linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: x86: expose a few new features into VM.
@ 2018-07-10  8:54 Jingqi Liu
  2018-07-10  8:54 ` [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU " Jingqi Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Jingqi Liu @ 2018-07-10  8:54 UTC (permalink / raw)
  To: pbonzini, rkrcmar, tglx, mingo, hpa
  Cc: x86, kvm, linux-kernel, wei.w.wang, Jingqi Liu

A few new features including user wait (umwait, umonitor, tpause)
and direct stores (movdiri and movdir64b) will be available in
Intel Snow Ridge, 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 umonitor,umwait, tpause, movdiri and movdir64b
features to guest VM.

Jingqi Liu (3):
  KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU features into VM.
  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(-)

-- 
1.8.3.1


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

* [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU features into VM.
  2018-07-10  8:54 [PATCH 0/3] KVM: x86: expose a few new features into VM Jingqi Liu
@ 2018-07-10  8:54 ` Jingqi Liu
  2018-07-10 11:53   ` kbuild test robot
                     ` (2 more replies)
  2018-07-10  8:54 ` [PATCH 2/3] KVM: x86: expose MOVDIRI CPU feature " Jingqi Liu
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 12+ messages in thread
From: Jingqi Liu @ 2018-07-10  8:54 UTC (permalink / raw)
  To: pbonzini, rkrcmar, tglx, mingo, hpa
  Cc: x86, kvm, linux-kernel, wei.w.wang, Jingqi Liu

UMONITOR, UMWAIT, and TPAUSE are a set of user wait instructions.

UMONITOR arms address monitoring hardware using an address. A store
to an address within the specified address range triggers the
monitoring hardware to wake up the processor waiting in umwait.

UMWAIT instructs the processor to enter an implementation-dependent
optimized state while monitoring a range of addresses. The optimized
state may be either a light-weight power/performance optimized state
(c0.1 state) or an improved power/performance optimized state
(c0.2 state).

TPAUSE instructs the processor to enter an implementation-dependent
optimized state c0.1 or c0.2 state and wake up when time-stamp counter
reaches specified timeout.

Availability of the user wait instructions is indicated by the presence
of the CPUID feature flag WAITPKG CPUID.0x07.0x0:ECX[5].

This patch exposes the umonitor,umwait, and tpause features 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
This patch has a dependency on https://lkml.org/lkml/2018/6/15/657.

Signed-off-by: Jingqi Liu <jingqi.liu@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 7e042e3..e16c05e 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(WAITPKG);
 
 	/* cpuid 7.0.edx*/
 	const u32 kvm_cpuid_7_0_edx_x86_features =
-- 
1.8.3.1


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

* [PATCH 2/3] KVM: x86: expose MOVDIRI CPU feature into VM.
  2018-07-10  8:54 [PATCH 0/3] KVM: x86: expose a few new features into VM Jingqi Liu
  2018-07-10  8:54 ` [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU " Jingqi Liu
@ 2018-07-10  8:54 ` Jingqi Liu
  2018-07-10 12:25   ` kbuild test robot
  2018-07-10  8:54 ` [PATCH 3/3] KVM: x86: expose MOVDIR64B " Jingqi Liu
  2018-08-06  8:17 ` [PATCH 0/3] KVM: x86: expose a few new features " Liu, Jingqi
  3 siblings, 1 reply; 12+ messages in thread
From: Jingqi Liu @ 2018-07-10  8:54 UTC (permalink / raw)
  To: pbonzini, rkrcmar, tglx, mingo, hpa
  Cc: x86, kvm, linux-kernel, wei.w.wang, Jingqi Liu

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
This patch has a dependency on https://lkml.org/lkml/2018/6/15/654.

Signed-off-by: Jingqi Liu <jingqi.liu@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 e16c05e..456caf7 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(WAITPKG);
+		F(CLDEMOTE) | F(WAITPKG) | F(MOVDIRI);
 
 	/* cpuid 7.0.edx*/
 	const u32 kvm_cpuid_7_0_edx_x86_features =
-- 
1.8.3.1


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

* [PATCH 3/3] KVM: x86: expose MOVDIR64B CPU feature into VM.
  2018-07-10  8:54 [PATCH 0/3] KVM: x86: expose a few new features into VM Jingqi Liu
  2018-07-10  8:54 ` [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU " Jingqi Liu
  2018-07-10  8:54 ` [PATCH 2/3] KVM: x86: expose MOVDIRI CPU feature " Jingqi Liu
@ 2018-07-10  8:54 ` Jingqi Liu
  2018-07-10 10:04   ` kbuild test robot
  2018-08-06  8:17 ` [PATCH 0/3] KVM: x86: expose a few new features " Liu, Jingqi
  3 siblings, 1 reply; 12+ messages in thread
From: Jingqi Liu @ 2018-07-10  8:54 UTC (permalink / raw)
  To: pbonzini, rkrcmar, tglx, mingo, hpa
  Cc: x86, kvm, linux-kernel, wei.w.wang, Jingqi Liu

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
This patch has a dependency on https://lkml.org/lkml/2018/6/15/655.

Signed-off-by: Jingqi Liu <jingqi.liu@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 456caf7..deaad68 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(WAITPKG) | F(MOVDIRI);
+		F(CLDEMOTE) | F(WAITPKG) | F(MOVDIRI) | F(MOVDIR64B);
 
 	/* cpuid 7.0.edx*/
 	const u32 kvm_cpuid_7_0_edx_x86_features =
-- 
1.8.3.1


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

* Re: [PATCH 3/3] KVM: x86: expose MOVDIR64B CPU feature into VM.
  2018-07-10  8:54 ` [PATCH 3/3] KVM: x86: expose MOVDIR64B " Jingqi Liu
@ 2018-07-10 10:04   ` kbuild test robot
  0 siblings, 0 replies; 12+ messages in thread
From: kbuild test robot @ 2018-07-10 10:04 UTC (permalink / raw)
  To: Jingqi Liu
  Cc: kbuild-all, pbonzini, rkrcmar, tglx, mingo, hpa, x86, kvm,
	linux-kernel, wei.w.wang, Jingqi Liu

[-- Attachment #1: Type: text/plain, Size: 2721 bytes --]

Hi Jingqi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on kvm/linux-next]
[also build test ERROR on v4.18-rc4 next-20180709]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Jingqi-Liu/KVM-x86-expose-a-few-new-features-into-VM/20180710-171958
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: i386-randconfig-x075-201827 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   arch/x86//kvm/cpuid.c: In function '__do_cpuid_ent':
   arch/x86//kvm/cpuid.c:68:18: error: 'X86_FEATURE_WAITPKG' undeclared (first use in this function); did you mean 'X86_FEATURE_MWAITX'?
    #define F(x) bit(X86_FEATURE_##x)
                     ^
   arch/x86//kvm/cpuid.c:409:17: note: in expansion of macro 'F'
      F(CLDEMOTE) | F(WAITPKG) | F(MOVDIRI) | F(MOVDIR64B);
                    ^
   arch/x86//kvm/cpuid.c:68:18: note: each undeclared identifier is reported only once for each function it appears in
    #define F(x) bit(X86_FEATURE_##x)
                     ^
   arch/x86//kvm/cpuid.c:409:17: note: in expansion of macro 'F'
      F(CLDEMOTE) | F(WAITPKG) | F(MOVDIRI) | F(MOVDIR64B);
                    ^
   arch/x86//kvm/cpuid.c:68:18: error: 'X86_FEATURE_MOVDIRI' undeclared (first use in this function); did you mean 'X86_FEATURE_MOVBE'?
    #define F(x) bit(X86_FEATURE_##x)
                     ^
   arch/x86//kvm/cpuid.c:409:30: note: in expansion of macro 'F'
      F(CLDEMOTE) | F(WAITPKG) | F(MOVDIRI) | F(MOVDIR64B);
                                 ^
>> arch/x86//kvm/cpuid.c:68:18: error: 'X86_FEATURE_MOVDIR64B' undeclared (first use in this function); did you mean 'X86_FEATURE_MOVDIRI'?
    #define F(x) bit(X86_FEATURE_##x)
                     ^
   arch/x86//kvm/cpuid.c:409:43: note: in expansion of macro 'F'
      F(CLDEMOTE) | F(WAITPKG) | F(MOVDIRI) | F(MOVDIR64B);
                                              ^

vim +68 arch/x86//kvm/cpuid.c

4ff41732 Paolo Bonzini 2014-02-24  67  
5c404cab Paolo Bonzini 2014-12-03 @68  #define F(x) bit(X86_FEATURE_##x)
5c404cab Paolo Bonzini 2014-12-03  69  

:::::: The code at line 68 was first introduced by commit
:::::: 5c404cabd1b5c125653ac573cb9284bdf42b658a KVM: x86: use F() macro throughout cpuid.c

:::::: TO: Paolo Bonzini <pbonzini@redhat.com>
:::::: CC: Paolo Bonzini <pbonzini@redhat.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25444 bytes --]

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

* Re: [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU features into VM.
  2018-07-10  8:54 ` [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU " Jingqi Liu
@ 2018-07-10 11:53   ` kbuild test robot
  2018-07-10 12:12   ` kbuild test robot
  2018-08-20 10:16   ` Paolo Bonzini
  2 siblings, 0 replies; 12+ messages in thread
From: kbuild test robot @ 2018-07-10 11:53 UTC (permalink / raw)
  To: Jingqi Liu
  Cc: kbuild-all, pbonzini, rkrcmar, tglx, mingo, hpa, x86, kvm,
	linux-kernel, wei.w.wang, Jingqi Liu

[-- Attachment #1: Type: text/plain, Size: 1940 bytes --]

Hi Jingqi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on kvm/linux-next]
[also build test ERROR on v4.18-rc4 next-20180709]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Jingqi-Liu/KVM-x86-expose-a-few-new-features-into-VM/20180710-171958
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: x86_64-randconfig-x012-201827 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   arch/x86/kvm/cpuid.c: In function '__do_cpuid_ent':
>> arch/x86/kvm/cpuid.c:68:18: error: 'X86_FEATURE_WAITPKG' undeclared (first use in this function); did you mean 'X86_FEATURE_MWAITX'?
    #define F(x) bit(X86_FEATURE_##x)
                     ^
>> arch/x86/kvm/cpuid.c:409:17: note: in expansion of macro 'F'
      F(CLDEMOTE) | F(WAITPKG);
                    ^
   arch/x86/kvm/cpuid.c:68:18: note: each undeclared identifier is reported only once for each function it appears in
    #define F(x) bit(X86_FEATURE_##x)
                     ^
>> arch/x86/kvm/cpuid.c:409:17: note: in expansion of macro 'F'
      F(CLDEMOTE) | F(WAITPKG);
                    ^

vim +68 arch/x86/kvm/cpuid.c

4ff41732 Paolo Bonzini 2014-02-24  67  
5c404cab Paolo Bonzini 2014-12-03 @68  #define F(x) bit(X86_FEATURE_##x)
5c404cab Paolo Bonzini 2014-12-03  69  

:::::: The code at line 68 was first introduced by commit
:::::: 5c404cabd1b5c125653ac573cb9284bdf42b658a KVM: x86: use F() macro throughout cpuid.c

:::::: TO: Paolo Bonzini <pbonzini@redhat.com>
:::::: CC: Paolo Bonzini <pbonzini@redhat.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29037 bytes --]

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

* Re: [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU features into VM.
  2018-07-10  8:54 ` [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU " Jingqi Liu
  2018-07-10 11:53   ` kbuild test robot
@ 2018-07-10 12:12   ` kbuild test robot
  2018-08-20 10:16   ` Paolo Bonzini
  2 siblings, 0 replies; 12+ messages in thread
From: kbuild test robot @ 2018-07-10 12:12 UTC (permalink / raw)
  To: Jingqi Liu
  Cc: kbuild-all, pbonzini, rkrcmar, tglx, mingo, hpa, x86, kvm,
	linux-kernel, wei.w.wang, Jingqi Liu

[-- Attachment #1: Type: text/plain, Size: 1926 bytes --]

Hi Jingqi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on kvm/linux-next]
[also build test ERROR on v4.18-rc4 next-20180709]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Jingqi-Liu/KVM-x86-expose-a-few-new-features-into-VM/20180710-171958
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: x86_64-randconfig-s0-07101819 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   arch/x86/kvm/cpuid.c: In function '__do_cpuid_ent':
>> arch/x86/kvm/cpuid.c:68:18: error: 'X86_FEATURE_WAITPKG' undeclared (first use in this function)
    #define F(x) bit(X86_FEATURE_##x)
                     ^
   arch/x86/kvm/cpuid.c:409:17: note: in expansion of macro 'F'
      F(CLDEMOTE) | F(WAITPKG);
                    ^
   arch/x86/kvm/cpuid.c:68:18: note: each undeclared identifier is reported only once for each function it appears in
    #define F(x) bit(X86_FEATURE_##x)
                     ^
   arch/x86/kvm/cpuid.c:409:17: note: in expansion of macro 'F'
      F(CLDEMOTE) | F(WAITPKG);
                    ^

vim +/X86_FEATURE_WAITPKG +68 arch/x86/kvm/cpuid.c

4ff41732 Paolo Bonzini 2014-02-24  67  
5c404cab Paolo Bonzini 2014-12-03 @68  #define F(x) bit(X86_FEATURE_##x)
5c404cab Paolo Bonzini 2014-12-03  69  

:::::: The code at line 68 was first introduced by commit
:::::: 5c404cabd1b5c125653ac573cb9284bdf42b658a KVM: x86: use F() macro throughout cpuid.c

:::::: TO: Paolo Bonzini <pbonzini@redhat.com>
:::::: CC: Paolo Bonzini <pbonzini@redhat.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35138 bytes --]

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

* Re: [PATCH 2/3] KVM: x86: expose MOVDIRI CPU feature into VM.
  2018-07-10  8:54 ` [PATCH 2/3] KVM: x86: expose MOVDIRI CPU feature " Jingqi Liu
@ 2018-07-10 12:25   ` kbuild test robot
  0 siblings, 0 replies; 12+ messages in thread
From: kbuild test robot @ 2018-07-10 12:25 UTC (permalink / raw)
  To: Jingqi Liu
  Cc: kbuild-all, pbonzini, rkrcmar, tglx, mingo, hpa, x86, kvm,
	linux-kernel, wei.w.wang, Jingqi Liu

[-- Attachment #1: Type: text/plain, Size: 2298 bytes --]

Hi Jingqi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on kvm/linux-next]
[also build test ERROR on v4.18-rc4 next-20180709]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Jingqi-Liu/KVM-x86-expose-a-few-new-features-into-VM/20180710-171958
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: x86_64-randconfig-x012-201827 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   arch/x86/kvm/cpuid.c: In function '__do_cpuid_ent':
   arch/x86/kvm/cpuid.c:68:18: error: 'X86_FEATURE_WAITPKG' undeclared (first use in this function); did you mean 'X86_FEATURE_MWAITX'?
    #define F(x) bit(X86_FEATURE_##x)
                     ^
   arch/x86/kvm/cpuid.c:409:17: note: in expansion of macro 'F'
      F(CLDEMOTE) | F(WAITPKG) | F(MOVDIRI);
                    ^
   arch/x86/kvm/cpuid.c:68:18: note: each undeclared identifier is reported only once for each function it appears in
    #define F(x) bit(X86_FEATURE_##x)
                     ^
   arch/x86/kvm/cpuid.c:409:17: note: in expansion of macro 'F'
      F(CLDEMOTE) | F(WAITPKG) | F(MOVDIRI);
                    ^
>> arch/x86/kvm/cpuid.c:68:18: error: 'X86_FEATURE_MOVDIRI' undeclared (first use in this function); did you mean 'X86_FEATURE_MOVBE'?
    #define F(x) bit(X86_FEATURE_##x)
                     ^
   arch/x86/kvm/cpuid.c:409:30: note: in expansion of macro 'F'
      F(CLDEMOTE) | F(WAITPKG) | F(MOVDIRI);
                                 ^

vim +68 arch/x86/kvm/cpuid.c

4ff41732 Paolo Bonzini 2014-02-24  67  
5c404cab Paolo Bonzini 2014-12-03 @68  #define F(x) bit(X86_FEATURE_##x)
5c404cab Paolo Bonzini 2014-12-03  69  

:::::: The code at line 68 was first introduced by commit
:::::: 5c404cabd1b5c125653ac573cb9284bdf42b658a KVM: x86: use F() macro throughout cpuid.c

:::::: TO: Paolo Bonzini <pbonzini@redhat.com>
:::::: CC: Paolo Bonzini <pbonzini@redhat.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29037 bytes --]

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

* Re: [PATCH 0/3] KVM: x86: expose a few new features into VM.
  2018-07-10  8:54 [PATCH 0/3] KVM: x86: expose a few new features into VM Jingqi Liu
                   ` (2 preceding siblings ...)
  2018-07-10  8:54 ` [PATCH 3/3] KVM: x86: expose MOVDIR64B " Jingqi Liu
@ 2018-08-06  8:17 ` Liu, Jingqi
  2018-08-06 16:58   ` Paolo Bonzini
  3 siblings, 1 reply; 12+ messages in thread
From: Liu, Jingqi @ 2018-08-06  8:17 UTC (permalink / raw)
  To: pbonzini, rkrcmar, tglx, mingo, hpa; +Cc: x86, kvm, linux-kernel, wei.w.wang

Hi Paolo,

Do you have any comments for the series ?
Thanks
Jingqi

On 7/10/2018 4:54 PM, Jingqi Liu wrote:
> A few new features including user wait (umwait, umonitor, tpause)
> and direct stores (movdiri and movdir64b) will be available in
> Intel Snow Ridge, 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 umonitor,umwait, tpause, movdiri and movdir64b
> features to guest VM.
>
> Jingqi Liu (3):
>    KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU features into VM.
>    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(-)
>


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

* Re: [PATCH 0/3] KVM: x86: expose a few new features into VM.
  2018-08-06  8:17 ` [PATCH 0/3] KVM: x86: expose a few new features " Liu, Jingqi
@ 2018-08-06 16:58   ` Paolo Bonzini
  0 siblings, 0 replies; 12+ messages in thread
From: Paolo Bonzini @ 2018-08-06 16:58 UTC (permalink / raw)
  To: Liu, Jingqi, rkrcmar, tglx, mingo, hpa; +Cc: x86, kvm, linux-kernel, wei.w.wang

On 06/08/2018 10:17, Liu, Jingqi wrote:
> Hi Paolo,
> 
> Do you have any comments for the series ?
> Thanks
> Jingqi

Hi,

the features are not yet available in Linus's tree, so I have to wait
before including this series.

Paolo

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

* Re: [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU features into VM.
  2018-07-10  8:54 ` [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU " Jingqi Liu
  2018-07-10 11:53   ` kbuild test robot
  2018-07-10 12:12   ` kbuild test robot
@ 2018-08-20 10:16   ` Paolo Bonzini
  2018-08-20 12:36     ` Liu, Jingqi
  2 siblings, 1 reply; 12+ messages in thread
From: Paolo Bonzini @ 2018-08-20 10:16 UTC (permalink / raw)
  To: Jingqi Liu, rkrcmar, tglx, mingo, hpa; +Cc: x86, kvm, linux-kernel, wei.w.wang

On 10/07/2018 10:54, Jingqi Liu wrote:
> UMONITOR, UMWAIT, and TPAUSE are a set of user wait instructions.
> 
> UMONITOR arms address monitoring hardware using an address. A store
> to an address within the specified address range triggers the
> monitoring hardware to wake up the processor waiting in umwait.
> 
> UMWAIT instructs the processor to enter an implementation-dependent
> optimized state while monitoring a range of addresses. The optimized
> state may be either a light-weight power/performance optimized state
> (c0.1 state) or an improved power/performance optimized state
> (c0.2 state).
> 
> TPAUSE instructs the processor to enter an implementation-dependent
> optimized state c0.1 or c0.2 state and wake up when time-stamp counter
> reaches specified timeout.
> 
> Availability of the user wait instructions is indicated by the presence
> of the CPUID feature flag WAITPKG CPUID.0x07.0x0:ECX[5].
> 
> This patch exposes the umonitor,umwait, and tpause features 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
> This patch has a dependency on https://lkml.org/lkml/2018/6/15/657.
> 
> Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>

Hi Jingqi, you also need to track and save/restore IA32_UMWAIT_CONTROL.

Thanks,

Paolo

> ---
>  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 7e042e3..e16c05e 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(WAITPKG);
>  
>  	/* cpuid 7.0.edx*/
>  	const u32 kvm_cpuid_7_0_edx_x86_features =
> 


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

* RE: [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU features into VM.
  2018-08-20 10:16   ` Paolo Bonzini
@ 2018-08-20 12:36     ` Liu, Jingqi
  0 siblings, 0 replies; 12+ messages in thread
From: Liu, Jingqi @ 2018-08-20 12:36 UTC (permalink / raw)
  To: Paolo Bonzini, rkrcmar, tglx, mingo, hpa
  Cc: x86, kvm, linux-kernel, Wang, Wei W

> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> Sent: Monday, August 20, 2018 6:16 PM
> To: Liu, Jingqi <jingqi.liu@intel.com>; rkrcmar@redhat.com; tglx@linutronix.de;
> mingo@redhat.com; hpa@zytor.com
> Cc: x86@kernel.org; kvm@vger.kernel.org; linux-kernel@vger.kernel.org; Wang,
> Wei W <wei.w.wang@intel.com>
> Subject: Re: [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU
> features into VM.
> 
> On 10/07/2018 10:54, Jingqi Liu wrote:
> > UMONITOR, UMWAIT, and TPAUSE are a set of user wait instructions.
> >
> > UMONITOR arms address monitoring hardware using an address. A store to
> > an address within the specified address range triggers the monitoring
> > hardware to wake up the processor waiting in umwait.
> >
> > UMWAIT instructs the processor to enter an implementation-dependent
> > optimized state while monitoring a range of addresses. The optimized
> > state may be either a light-weight power/performance optimized state
> > (c0.1 state) or an improved power/performance optimized state
> > (c0.2 state).
> >
> > TPAUSE instructs the processor to enter an implementation-dependent
> > optimized state c0.1 or c0.2 state and wake up when time-stamp counter
> > reaches specified timeout.
> >
> > Availability of the user wait instructions is indicated by the
> > presence of the CPUID feature flag WAITPKG CPUID.0x07.0x0:ECX[5].
> >
> > This patch exposes the umonitor,umwait, and tpause features 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
> > This patch has a dependency on https://lkml.org/lkml/2018/6/15/657.
> >
> > Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
> 
> Hi Jingqi, you also need to track and save/restore IA32_UMWAIT_CONTROL.

Yes, I'll handle IA32_UMWAIT_CONTROL in the second version.
Thanks for your review.

> 
> Thanks,
> 
> Paolo
> 
> > ---
> >  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
> > 7e042e3..e16c05e 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(WAITPKG);
> >
> >  	/* cpuid 7.0.edx*/
> >  	const u32 kvm_cpuid_7_0_edx_x86_features =
> >


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

end of thread, other threads:[~2018-08-20 12:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-10  8:54 [PATCH 0/3] KVM: x86: expose a few new features into VM Jingqi Liu
2018-07-10  8:54 ` [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU " Jingqi Liu
2018-07-10 11:53   ` kbuild test robot
2018-07-10 12:12   ` kbuild test robot
2018-08-20 10:16   ` Paolo Bonzini
2018-08-20 12:36     ` Liu, Jingqi
2018-07-10  8:54 ` [PATCH 2/3] KVM: x86: expose MOVDIRI CPU feature " Jingqi Liu
2018-07-10 12:25   ` kbuild test robot
2018-07-10  8:54 ` [PATCH 3/3] KVM: x86: expose MOVDIR64B " Jingqi Liu
2018-07-10 10:04   ` kbuild test robot
2018-08-06  8:17 ` [PATCH 0/3] KVM: x86: expose a few new features " Liu, Jingqi
2018-08-06 16:58   ` 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).