kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Expose new features for intel processor
@ 2020-07-05 22:59 Cathy Zhang
  2020-07-05 22:59 ` [PATCH 1/2] x86: Expose SERIALIZE for supported cpuid Cathy Zhang
  2020-07-05 22:59 ` [PATCH 2/2] x86: Expose TSX Suspend Load Address Tracking Cathy Zhang
  0 siblings, 2 replies; 5+ messages in thread
From: Cathy Zhang @ 2020-07-05 22:59 UTC (permalink / raw)
  To: kvm, linux-kernel, x86
  Cc: pbonzini, sean.j.christopherson, vkuznets, wanpengli, jmattson,
	joro, tglx, mingo, bp, hpa, ricardo.neri-calderon,
	kyung.min.park, Cathy Zhang

This patchset is to expose two new features for intel
processors which support them, like Sapphire Rapids.
SERIALIZE is a faster serializing instruction which
does not modify registers, arithmetic flags or memory,
will not cause VM exit. TSX suspend load tracking
instruction aims to give a way to choose which memory
accesses do not need to be tracked in the TSX read set.

Cathy Zhang (2):
  x86: Expose SERIALIZE for supported cpuid
  x86: Expose TSX Suspend Load Address Tracking

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

-- 
1.8.3.1


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

* [PATCH 1/2] x86: Expose SERIALIZE for supported cpuid
  2020-07-05 22:59 [PATCH 0/2] Expose new features for intel processor Cathy Zhang
@ 2020-07-05 22:59 ` Cathy Zhang
  2020-07-06 18:06   ` kernel test robot
  2020-07-05 22:59 ` [PATCH 2/2] x86: Expose TSX Suspend Load Address Tracking Cathy Zhang
  1 sibling, 1 reply; 5+ messages in thread
From: Cathy Zhang @ 2020-07-05 22:59 UTC (permalink / raw)
  To: kvm, linux-kernel, x86
  Cc: pbonzini, sean.j.christopherson, vkuznets, wanpengli, jmattson,
	joro, tglx, mingo, bp, hpa, ricardo.neri-calderon,
	kyung.min.park, Cathy Zhang

SERIALIZE instruction is supported by intel processors,
like Sapphire Rapids. Expose it in KVM supported cpuid.

The SERIALIZE enumeration kernel patch link is as follows:
https://lore.kernel.org/patchwork/patch/1254757/

Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
---
 arch/x86/kvm/cpuid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 8a294f9..e603aeb 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -341,7 +341,8 @@ void kvm_set_cpu_caps(void)
 	kvm_cpu_cap_mask(CPUID_7_EDX,
 		F(AVX512_4VNNIW) | F(AVX512_4FMAPS) | F(SPEC_CTRL) |
 		F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(INTEL_STIBP) |
-		F(MD_CLEAR) | F(AVX512_VP2INTERSECT) | F(FSRM)
+		F(MD_CLEAR) | F(AVX512_VP2INTERSECT) | F(FSRM) |
+		F(SERIALIZE)
 	);
 
 	/* TSC_ADJUST and ARCH_CAPABILITIES are emulated in software. */
-- 
1.8.3.1


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

* [PATCH 2/2] x86: Expose TSX Suspend Load Address Tracking
  2020-07-05 22:59 [PATCH 0/2] Expose new features for intel processor Cathy Zhang
  2020-07-05 22:59 ` [PATCH 1/2] x86: Expose SERIALIZE for supported cpuid Cathy Zhang
@ 2020-07-05 22:59 ` Cathy Zhang
  2020-07-06 21:19   ` kernel test robot
  1 sibling, 1 reply; 5+ messages in thread
From: Cathy Zhang @ 2020-07-05 22:59 UTC (permalink / raw)
  To: kvm, linux-kernel, x86
  Cc: pbonzini, sean.j.christopherson, vkuznets, wanpengli, jmattson,
	joro, tglx, mingo, bp, hpa, ricardo.neri-calderon,
	kyung.min.park, Cathy Zhang

TSX Suspend Load Address Tracking is supported by intel processors,
like Sapphire Rapids. Expose it in KVM supported cpuid.

The associated kernel enumeration patches link is as follows:
https://lore.kernel.org/patchwork/patch/1254756/

Signed-off-by: Cathy Zhang <cathy.zhang@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 e603aeb..dcf48cc 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -342,7 +342,7 @@ void kvm_set_cpu_caps(void)
 		F(AVX512_4VNNIW) | F(AVX512_4FMAPS) | F(SPEC_CTRL) |
 		F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(INTEL_STIBP) |
 		F(MD_CLEAR) | F(AVX512_VP2INTERSECT) | F(FSRM) |
-		F(SERIALIZE)
+		F(SERIALIZE) | F(TSX_LDTRK)
 	);
 
 	/* TSC_ADJUST and ARCH_CAPABILITIES are emulated in software. */
-- 
1.8.3.1


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

* Re: [PATCH 1/2] x86: Expose SERIALIZE for supported cpuid
  2020-07-05 22:59 ` [PATCH 1/2] x86: Expose SERIALIZE for supported cpuid Cathy Zhang
@ 2020-07-06 18:06   ` kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2020-07-06 18:06 UTC (permalink / raw)
  To: Cathy Zhang, kvm, linux-kernel, x86
  Cc: kbuild-all, pbonzini, sean.j.christopherson, vkuznets, wanpengli,
	jmattson, joro, tglx

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

Hi Cathy,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on kvm/linux-next]
[also build test ERROR on tip/auto-latest linux/master linus/master v5.8-rc4 next-20200706]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Cathy-Zhang/Expose-new-features-for-intel-processor/20200706-070640
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from arch/x86/kvm/cpuid.c:21:
   arch/x86/kvm/cpuid.c: In function 'kvm_set_cpu_caps':
>> arch/x86/kvm/cpuid.h:91:42: error: 'X86_FEATURE_SERIALIZE' undeclared (first use in this function); did you mean 'X86_FEATURE_RETPOLINE'?
      91 | #define feature_bit(name)  __feature_bit(X86_FEATURE_##name)
         |                                          ^~~~~~~~~~~~
   arch/x86/kvm/cpuid.c:55:11: note: in expansion of macro 'feature_bit'
      55 | #define F feature_bit
         |           ^~~~~~~~~~~
   arch/x86/kvm/cpuid.c:345:3: note: in expansion of macro 'F'
     345 |   F(SERIALIZE)
         |   ^
   arch/x86/kvm/cpuid.h:91:42: note: each undeclared identifier is reported only once for each function it appears in
      91 | #define feature_bit(name)  __feature_bit(X86_FEATURE_##name)
         |                                          ^~~~~~~~~~~~
   arch/x86/kvm/cpuid.c:55:11: note: in expansion of macro 'feature_bit'
      55 | #define F feature_bit
         |           ^~~~~~~~~~~
   arch/x86/kvm/cpuid.c:345:3: note: in expansion of macro 'F'
     345 |   F(SERIALIZE)
         |   ^

vim +91 arch/x86/kvm/cpuid.h

a0a2260c12d8658 Sean Christopherson 2019-12-17  90  
87382003e355592 Sean Christopherson 2019-12-17 @91  #define feature_bit(name)  __feature_bit(X86_FEATURE_##name)
87382003e355592 Sean Christopherson 2019-12-17  92  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

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

* Re: [PATCH 2/2] x86: Expose TSX Suspend Load Address Tracking
  2020-07-05 22:59 ` [PATCH 2/2] x86: Expose TSX Suspend Load Address Tracking Cathy Zhang
@ 2020-07-06 21:19   ` kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2020-07-06 21:19 UTC (permalink / raw)
  To: Cathy Zhang, kvm, linux-kernel, x86
  Cc: kbuild-all, pbonzini, sean.j.christopherson, vkuznets, wanpengli,
	jmattson, joro, tglx

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

Hi Cathy,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on kvm/linux-next]
[also build test ERROR on tip/auto-latest linux/master linus/master v5.8-rc4 next-20200706]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Cathy-Zhang/Expose-new-features-for-intel-processor/20200706-070640
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from arch/x86/kvm/cpuid.c:21:
   arch/x86/kvm/cpuid.c: In function 'kvm_set_cpu_caps':
   arch/x86/kvm/cpuid.h:91:42: error: 'X86_FEATURE_SERIALIZE' undeclared (first use in this function); did you mean 'X86_FEATURE_RETPOLINE'?
      91 | #define feature_bit(name)  __feature_bit(X86_FEATURE_##name)
         |                                          ^~~~~~~~~~~~
   arch/x86/kvm/cpuid.c:55:11: note: in expansion of macro 'feature_bit'
      55 | #define F feature_bit
         |           ^~~~~~~~~~~
   arch/x86/kvm/cpuid.c:345:3: note: in expansion of macro 'F'
     345 |   F(SERIALIZE) | F(TSX_LDTRK)
         |   ^
   arch/x86/kvm/cpuid.h:91:42: note: each undeclared identifier is reported only once for each function it appears in
      91 | #define feature_bit(name)  __feature_bit(X86_FEATURE_##name)
         |                                          ^~~~~~~~~~~~
   arch/x86/kvm/cpuid.c:55:11: note: in expansion of macro 'feature_bit'
      55 | #define F feature_bit
         |           ^~~~~~~~~~~
   arch/x86/kvm/cpuid.c:345:3: note: in expansion of macro 'F'
     345 |   F(SERIALIZE) | F(TSX_LDTRK)
         |   ^
>> arch/x86/kvm/cpuid.h:91:42: error: 'X86_FEATURE_TSX_LDTRK' undeclared (first use in this function); did you mean 'X86_FEATURE_TSC_ADJUST'?
      91 | #define feature_bit(name)  __feature_bit(X86_FEATURE_##name)
         |                                          ^~~~~~~~~~~~
   arch/x86/kvm/cpuid.c:55:11: note: in expansion of macro 'feature_bit'
      55 | #define F feature_bit
         |           ^~~~~~~~~~~
   arch/x86/kvm/cpuid.c:345:18: note: in expansion of macro 'F'
     345 |   F(SERIALIZE) | F(TSX_LDTRK)
         |                  ^

vim +91 arch/x86/kvm/cpuid.h

a0a2260c12d865 Sean Christopherson 2019-12-17  90  
87382003e35559 Sean Christopherson 2019-12-17 @91  #define feature_bit(name)  __feature_bit(X86_FEATURE_##name)
87382003e35559 Sean Christopherson 2019-12-17  92  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

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

end of thread, other threads:[~2020-07-06 21:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05 22:59 [PATCH 0/2] Expose new features for intel processor Cathy Zhang
2020-07-05 22:59 ` [PATCH 1/2] x86: Expose SERIALIZE for supported cpuid Cathy Zhang
2020-07-06 18:06   ` kernel test robot
2020-07-05 22:59 ` [PATCH 2/2] x86: Expose TSX Suspend Load Address Tracking Cathy Zhang
2020-07-06 21:19   ` kernel test robot

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