linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] KVM: x86: expose direct stores instructions into VM.
@ 2018-11-06  5:55 Liu Jingqi
  2018-11-06  5:55 ` [PATCH v2 1/2] KVM: x86: expose MOVDIRI CPU feature " Liu Jingqi
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Liu Jingqi @ 2018-11-06  5:55 UTC (permalink / raw)
  To: pbonzini, rkrcmar, tglx, mingo
  Cc: bp, hpa, x86, kvm, linux-kernel, tao3.xu, Liu Jingqi

Direct stores instructions MOVDIRI and MOVDIR64B will be available in
Tremont and other future x86 processors,
and need to be exposed to guest VM.

The release document ref below link:
https://software.intel.com/sites/default/files/managed/c5/15/\
architecture-instruction-set-extensions-programming-reference.pdf

This series expose movdiri and movdir64b features to guest VM.

Changelog:
v2:
	Separated from the series https://lkml.org/lkml/2018/7/10/160
	since umonitor/umwait/tpause instructions patches are not ready yet.
v1:
	Sent out with umonitor/umwait/tpause instructions patches.

Liu Jingqi (2):
  KVM: x86: expose MOVDIRI CPU feature into VM.
  KVM: x86: expose MOVDIR64B CPU feature into VM.

 arch/x86/kvm/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/2] KVM: x86: expose MOVDIRI CPU feature into VM.
  2018-11-06  5:55 [PATCH v2 0/2] KVM: x86: expose direct stores instructions into VM Liu Jingqi
@ 2018-11-06  5:55 ` Liu Jingqi
  2018-11-06  5:55 ` [PATCH v2 2/2] KVM: x86: expose MOVDIR64B " Liu Jingqi
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Liu Jingqi @ 2018-11-06  5:55 UTC (permalink / raw)
  To: pbonzini, rkrcmar, tglx, mingo
  Cc: bp, hpa, x86, kvm, linux-kernel, tao3.xu, Liu Jingqi

MOVDIRI moves doubleword or quadword from register to memory through
direct store which is implemented by using write combining (WC) for
writing data directly into memory without caching the data.

Availability of the MOVDIRI instruction is indicated by the presence of
the CPUID feature flag MOVDIRI(CPUID.0x07.0x0:ECX[bit 27]).

This patch exposes the movdiri feature to the guest.

The release document ref below link:
https://software.intel.com/sites/default/files/managed/c5/15/\
architecture-instruction-set-extensions-programming-reference.pdf

Signed-off-by: Liu Jingqi <jingqi.liu@intel.com>
Cc: Xu Tao <tao3.xu@intel.com>
---
 arch/x86/kvm/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 7bcfa61..cbfeaa7 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -406,7 +406,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 		F(AVX512VBMI) | F(LA57) | F(PKU) | 0 /*OSPKE*/ |
 		F(AVX512_VPOPCNTDQ) | F(UMIP) | F(AVX512_VBMI2) | F(GFNI) |
 		F(VAES) | F(VPCLMULQDQ) | F(AVX512_VNNI) | F(AVX512_BITALG) |
-		F(CLDEMOTE);
+		F(CLDEMOTE) | F(MOVDIRI);
 
 	/* cpuid 7.0.edx*/
 	const u32 kvm_cpuid_7_0_edx_x86_features =
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/2] KVM: x86: expose MOVDIR64B CPU feature into VM.
  2018-11-06  5:55 [PATCH v2 0/2] KVM: x86: expose direct stores instructions into VM Liu Jingqi
  2018-11-06  5:55 ` [PATCH v2 1/2] KVM: x86: expose MOVDIRI CPU feature " Liu Jingqi
@ 2018-11-06  5:55 ` Liu Jingqi
  2018-11-29 10:13 ` [PATCH v2 0/2] KVM: x86: expose direct stores instructions " David Hildenbrand
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Liu Jingqi @ 2018-11-06  5:55 UTC (permalink / raw)
  To: pbonzini, rkrcmar, tglx, mingo
  Cc: bp, hpa, x86, kvm, linux-kernel, tao3.xu, Liu Jingqi

MOVDIR64B moves 64-bytes as direct-store with 64-bytes write atomicity.
Direct store is implemented by using write combining (WC) for writing
data directly into memory without caching the data.

Availability of the MOVDIR64B instruction is indicated by the presence
of the CPUID feature flag MOVDIR64B (CPUID.0x07.0x0:ECX[bit 28]).

This patch exposes the movdir64b feature to the guest.

The release document ref below link:
https://software.intel.com/sites/default/files/managed/c5/15/\
architecture-instruction-set-extensions-programming-reference.pdf

Signed-off-by: Liu Jingqi <jingqi.liu@intel.com>
Cc: Xu Tao <tao3.xu@intel.com>
---
 arch/x86/kvm/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index cbfeaa7..721893a 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -406,7 +406,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 		F(AVX512VBMI) | F(LA57) | F(PKU) | 0 /*OSPKE*/ |
 		F(AVX512_VPOPCNTDQ) | F(UMIP) | F(AVX512_VBMI2) | F(GFNI) |
 		F(VAES) | F(VPCLMULQDQ) | F(AVX512_VNNI) | F(AVX512_BITALG) |
-		F(CLDEMOTE) | F(MOVDIRI);
+		F(CLDEMOTE) | F(MOVDIRI) | F(MOVDIR64B);
 
 	/* cpuid 7.0.edx*/
 	const u32 kvm_cpuid_7_0_edx_x86_features =
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] KVM: x86: expose direct stores instructions into VM.
  2018-11-06  5:55 [PATCH v2 0/2] KVM: x86: expose direct stores instructions into VM Liu Jingqi
  2018-11-06  5:55 ` [PATCH v2 1/2] KVM: x86: expose MOVDIRI CPU feature " Liu Jingqi
  2018-11-06  5:55 ` [PATCH v2 2/2] KVM: x86: expose MOVDIR64B " Liu Jingqi
@ 2018-11-29 10:13 ` David Hildenbrand
  2018-11-30 20:41 ` Eric Northup
  2019-01-30 17:16 ` Paolo Bonzini
  4 siblings, 0 replies; 7+ messages in thread
From: David Hildenbrand @ 2018-11-29 10:13 UTC (permalink / raw)
  To: Liu Jingqi, pbonzini, rkrcmar, tglx, mingo
  Cc: bp, hpa, x86, kvm, linux-kernel, tao3.xu

On 06.11.18 06:55, Liu Jingqi wrote:
> Direct stores instructions MOVDIRI and MOVDIR64B will be available in
> Tremont and other future x86 processors,
> and need to be exposed to guest VM.
> 
> The release document ref below link:
> https://software.intel.com/sites/default/files/managed/c5/15/\
> architecture-instruction-set-extensions-programming-reference.pdf
> 
> This series expose movdiri and movdir64b features to guest VM.
> 
> Changelog:
> v2:
> 	Separated from the series https://lkml.org/lkml/2018/7/10/160
> 	since umonitor/umwait/tpause instructions patches are not ready yet.
> v1:
> 	Sent out with umonitor/umwait/tpause instructions patches.
> 
> Liu Jingqi (2):
>   KVM: x86: expose MOVDIRI CPU feature into VM.
>   KVM: x86: expose MOVDIR64B CPU feature into VM.
> 
>  arch/x86/kvm/cpuid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Does it make sense to squash both patches? (into a patch named just like
this cover letter? :) )

-- 

Thanks,

David / dhildenb

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] KVM: x86: expose direct stores instructions into VM.
  2018-11-06  5:55 [PATCH v2 0/2] KVM: x86: expose direct stores instructions into VM Liu Jingqi
                   ` (2 preceding siblings ...)
  2018-11-29 10:13 ` [PATCH v2 0/2] KVM: x86: expose direct stores instructions " David Hildenbrand
@ 2018-11-30 20:41 ` Eric Northup
  2019-01-30 17:15   ` Paolo Bonzini
  2019-01-30 17:16 ` Paolo Bonzini
  4 siblings, 1 reply; 7+ messages in thread
From: Eric Northup @ 2018-11-30 20:41 UTC (permalink / raw)
  To: jingqi.liu
  Cc: Paolo Bonzini, rkrcmar, Thomas Gleixner, Ingo Molnar, bp,
	H. Peter Anvin, the arch/x86 maintainers, KVM,
	Linux Kernel Mailing List, tao3.xu

On Mon, Nov 5, 2018 at 10:01 PM Liu Jingqi <jingqi.liu@intel.com> wrote:
>
> Direct stores instructions MOVDIRI and MOVDIR64B will be available in
> Tremont and other future x86 processors,
> and need to be exposed to guest VM.

It seems like KVM's emulator should be able to complete these
instructions to emulated MMIO before exposing CPUID to guests in any
default or supported configurations.

It'll be much simpler for usermode to implement that property if the
KVM-reported supported CPUID table doesn't get updated before the KVM
emulator does.

-Eric

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] KVM: x86: expose direct stores instructions into VM.
  2018-11-30 20:41 ` Eric Northup
@ 2019-01-30 17:15   ` Paolo Bonzini
  0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2019-01-30 17:15 UTC (permalink / raw)
  To: Eric Northup, jingqi.liu
  Cc: rkrcmar, Thomas Gleixner, Ingo Molnar, bp, H. Peter Anvin,
	the arch/x86 maintainers, KVM, Linux Kernel Mailing List,
	tao3.xu

On 30/11/18 21:41, Eric Northup wrote:
> On Mon, Nov 5, 2018 at 10:01 PM Liu Jingqi <jingqi.liu@intel.com> wrote:
>>
>> Direct stores instructions MOVDIRI and MOVDIR64B will be available in
>> Tremont and other future x86 processors,
>> and need to be exposed to guest VM.
> 
> It seems like KVM's emulator should be able to complete these
> instructions to emulated MMIO before exposing CPUID to guests in any
> default or supported configurations.
> 
> It'll be much simpler for usermode to implement that property if the
> KVM-reported supported CPUID table doesn't get updated before the KVM
> emulator does.

We already do not support emulation for many CPUID bits we expose (AVX
and AVX512 above all), so that's not a huge problem.

I suppose these instructions are unlikely to be used on MMIO areas such
as legacy VGA VRAM.

Paolo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] KVM: x86: expose direct stores instructions into VM.
  2018-11-06  5:55 [PATCH v2 0/2] KVM: x86: expose direct stores instructions into VM Liu Jingqi
                   ` (3 preceding siblings ...)
  2018-11-30 20:41 ` Eric Northup
@ 2019-01-30 17:16 ` Paolo Bonzini
  4 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2019-01-30 17:16 UTC (permalink / raw)
  To: Liu Jingqi, rkrcmar, tglx, mingo; +Cc: bp, hpa, x86, kvm, linux-kernel, tao3.xu

On 06/11/18 06:55, Liu Jingqi wrote:
> Direct stores instructions MOVDIRI and MOVDIR64B will be available in
> Tremont and other future x86 processors,
> and need to be exposed to guest VM.
> 
> The release document ref below link:
> https://software.intel.com/sites/default/files/managed/c5/15/\
> architecture-instruction-set-extensions-programming-reference.pdf
> 
> This series expose movdiri and movdir64b features to guest VM.
> 
> Changelog:
> v2:
> 	Separated from the series https://lkml.org/lkml/2018/7/10/160
> 	since umonitor/umwait/tpause instructions patches are not ready yet.
> v1:
> 	Sent out with umonitor/umwait/tpause instructions patches.
> 
> Liu Jingqi (2):
>   KVM: x86: expose MOVDIRI CPU feature into VM.
>   KVM: x86: expose MOVDIR64B CPU feature into VM.
> 
>  arch/x86/kvm/cpuid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Queued, thanks.

Paolo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-30 17:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-06  5:55 [PATCH v2 0/2] KVM: x86: expose direct stores instructions into VM Liu Jingqi
2018-11-06  5:55 ` [PATCH v2 1/2] KVM: x86: expose MOVDIRI CPU feature " Liu Jingqi
2018-11-06  5:55 ` [PATCH v2 2/2] KVM: x86: expose MOVDIR64B " Liu Jingqi
2018-11-29 10:13 ` [PATCH v2 0/2] KVM: x86: expose direct stores instructions " David Hildenbrand
2018-11-30 20:41 ` Eric Northup
2019-01-30 17:15   ` Paolo Bonzini
2019-01-30 17:16 ` Paolo Bonzini

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).