From: Gautam Menghani <gautam@linux.ibm.com>
To: maddy@linux.ibm.com, vaibhav@gmail.com, npiggin@gmail.com,
mpe@ellerman.id.au, christophe.leroy@csgroup.eu
Cc: Gautam Menghani <gautam@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] KVM: PPC: Add the missing character/behaviour bits for KVM_PPC_GET_CPU_CHAR ioctl
Date: Wed, 3 Dec 2025 18:58:03 +0530 [thread overview]
Message-ID: <20251203132804.16692-1-gautam@linux.ibm.com> (raw)
Add the missing bits for the character and behaviour masks used to
indicate the valid bits in the result of KVM_PPC_GET_CPU_CHAR ioctl
used by KVM guests to know the host mitigation status.
Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
---
arch/powerpc/include/uapi/asm/kvm.h | 6 ++++++
arch/powerpc/kvm/powerpc.c | 10 ++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h
index 077c5437f521..19ad60fb9147 100644
--- a/arch/powerpc/include/uapi/asm/kvm.h
+++ b/arch/powerpc/include/uapi/asm/kvm.h
@@ -450,11 +450,17 @@ struct kvm_ppc_cpu_char {
#define KVM_PPC_CPU_CHAR_MTTRIG_THR_RECONF (1ULL << 57)
#define KVM_PPC_CPU_CHAR_COUNT_CACHE_DIS (1ULL << 56)
#define KVM_PPC_CPU_CHAR_BCCTR_FLUSH_ASSIST (1ull << 54)
+#define KVM_PPC_CPU_CHAR_BCCTR_LINK_FLUSH_ASSIST (1ull << 52)
#define KVM_PPC_CPU_BEHAV_FAVOUR_SECURITY (1ULL << 63)
#define KVM_PPC_CPU_BEHAV_L1D_FLUSH_PR (1ULL << 62)
#define KVM_PPC_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ULL << 61)
+#define KVM_PPC_CPU_BEHAV_FAVOUR_SECURITY_H (1ull << 60)
#define KVM_PPC_CPU_BEHAV_FLUSH_COUNT_CACHE (1ull << 58)
+#define KVM_PPC_CPU_BEHAV_FLUSH_LINK_STACK (1ull << 57)
+#define KVM_PPC_CPU_BEHAV_NO_L1D_FLUSH_ENTRY (1ull << 56)
+#define KVM_PPC_CPU_BEHAV_NO_L1D_FLUSH_UACCESS (1ull << 55)
+#define KVM_PPC_CPU_BEHAV_NO_STF_BARRIER (1ull << 54)
/* Per-vcpu XICS interrupt controller state */
#define KVM_REG_PPC_ICP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c)
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 2ba057171ebe..642740c86272 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -2261,11 +2261,17 @@ static int pseries_get_cpu_char(struct kvm_ppc_cpu_char *cp)
KVM_PPC_CPU_CHAR_BR_HINT_HONOURED |
KVM_PPC_CPU_CHAR_MTTRIG_THR_RECONF |
KVM_PPC_CPU_CHAR_COUNT_CACHE_DIS |
- KVM_PPC_CPU_CHAR_BCCTR_FLUSH_ASSIST;
+ KVM_PPC_CPU_CHAR_BCCTR_FLUSH_ASSIST |
+ KVM_PPC_CPU_CHAR_BCCTR_LINK_FLUSH_ASSIST;
cp->behaviour_mask = KVM_PPC_CPU_BEHAV_FAVOUR_SECURITY |
KVM_PPC_CPU_BEHAV_L1D_FLUSH_PR |
KVM_PPC_CPU_BEHAV_BNDS_CHK_SPEC_BAR |
- KVM_PPC_CPU_BEHAV_FLUSH_COUNT_CACHE;
+ KVM_PPC_CPU_BEHAV_FAVOUR_SECURITY_H |
+ KVM_PPC_CPU_BEHAV_FLUSH_COUNT_CACHE |
+ KVM_PPC_CPU_BEHAV_FLUSH_LINK_STACK |
+ KVM_PPC_CPU_BEHAV_NO_L1D_FLUSH_ENTRY |
+ KVM_PPC_CPU_BEHAV_NO_L1D_FLUSH_UACCESS |
+ KVM_PPC_CPU_BEHAV_NO_STF_BARRIER;
}
return 0;
}
--
2.50.1 (Apple Git-155)
reply other threads:[~2025-12-03 13:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251203132804.16692-1-gautam@linux.ibm.com \
--to=gautam@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=vaibhav@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).