mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhao Liu <zhao1.liu@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Chao Gao <chao.gao@intel.com>, Zhao Liu <zhao1.liu@intel.com>,
	Xudong Hao <xudong.hao@intel.com>
Subject: [PATCH 1/4] KVM: x86: Advertise MOVRS CPUID to userspace
Date: Thu, 20 Nov 2025 13:07:17 +0800	[thread overview]
Message-ID: <20251120050720.931449-2-zhao1.liu@intel.com> (raw)
In-Reply-To: <20251120050720.931449-1-zhao1.liu@intel.com>

Define and pass MOVRS CPUID through to userspace.

MOVRS is a new set of instructions introduced in the Intel platform
Diamond Rapids, to provide load instructions that carry a read-shared
hint.

Functionally, MOVRS family is equivalent to existing load instructions,
but its read-shared hint indicates that the source memory location is
likely to become read-shared by multiple processors, i.e., read in the
future by at least one other processor before it is written (assuming it
is ever written in the future). This hint could optimize the behavior of
the caches, especially shared caches, for this data for future reads by
multiple processors. Additionally, MOVRS family also includes a software
prefetch instruction, PREFETCHRST2, that carries the same read-shared
hint. [*]

MOVRS family is enumerated by CPUID single-bit (0x7.0x1.EAX[bit 31]).
Since it's on a densely-populated CPUID leaf and some other bits on
this leaf have kernel usages, define this new feature in cpufeatures.h,
but hide it in /proc/cpuinfo due to lack of current kernel usage.

Advertise MOVRS bit to userspace directly. It's safe, since there's no
new VMX controls or additional host enabling required for guests to use
this feature.

[*]: Intel Architecture Instruction Set Extensions and Future Features
     (rev.059).

Tested-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
Reference link: https://cdrdv2.intel.com/v1/dl/getContent/865891
---
 arch/x86/include/asm/cpufeatures.h | 1 +
 arch/x86/kvm/cpuid.c               | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index 4091a776e37a..2d57bfe9c4c4 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -325,6 +325,7 @@
 #define X86_FEATURE_AMX_FP16		(12*32+21) /* AMX fp16 Support */
 #define X86_FEATURE_AVX_IFMA            (12*32+23) /* Support for VPMADD52[H,L]UQ */
 #define X86_FEATURE_LAM			(12*32+26) /* "lam" Linear Address Masking */
+#define X86_FEATURE_MOVRS		(12*32+31) /* MOVRS instructions */
 
 /* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */
 #define X86_FEATURE_CLZERO		(13*32+ 0) /* "clzero" CLZERO instruction */
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 52524e0ca97f..372d82bae272 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -1018,6 +1018,7 @@ void kvm_set_cpu_caps(void)
 		F(AMX_FP16),
 		F(AVX_IFMA),
 		F(LAM),
+		F(MOVRS),
 	);
 
 	kvm_cpu_cap_init(CPUID_7_1_ECX,
-- 
2.34.1


  reply	other threads:[~2025-11-20  4:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20  5:07 [PATCH 0/4] KVM: x86: Advertise new instruction CPUIDs for Intel Diamond Rapids Zhao Liu
2025-11-20  5:07 ` Zhao Liu [this message]
2026-01-23 18:03   ` [PATCH 1/4] KVM: x86: Advertise MOVRS CPUID to userspace Sean Christopherson
2025-11-20  5:07 ` [PATCH 2/4] KVM: x86: Advertise AMX CPUIDs in subleaf 0x1E.0x1 " Zhao Liu
2026-01-23  6:02   ` Xiaoyao Li
2026-01-23 17:53     ` Sean Christopherson
2026-01-23 17:55   ` Sean Christopherson
2026-01-25  7:51     ` Zhao Liu
2026-07-15 23:08       ` Jim Mattson
2026-07-21 18:52         ` Sean Christopherson
2026-01-23 18:06   ` Sean Christopherson
2026-01-25  7:54     ` Zhao Liu
2025-11-20  5:07 ` [PATCH 3/4] KVM: x86: Advertise AVX10.2 CPUID " Zhao Liu
2025-11-20  5:07 ` [PATCH 4/4] KVM: x86: Advertise AVX10_VNNI_INT " Zhao Liu
2025-12-18 17:54 ` [PATCH 0/4] KVM: x86: Advertise new instruction CPUIDs for Intel Diamond Rapids Paolo Bonzini
2026-01-21  1:40   ` Zhao Liu
2026-01-23  6:03 ` Xiaoyao Li
2026-02-04  0:10 ` Sean Christopherson

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=20251120050720.931449-2-zhao1.liu@intel.com \
    --to=zhao1.liu@intel.com \
    --cc=bp@alien8.de \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xudong.hao@intel.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

all inboxes | Powered by JetHome®