2020-07-05 23:05:49

by Zhang, Cathy

[permalink] [raw]
Subject: [PATCH 0/2] Expose new features for intel processor

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


2020-07-05 23:06:04

by Zhang, Cathy

[permalink] [raw]
Subject: [PATCH 1/2] x86: Expose SERIALIZE for supported cpuid

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 <[email protected]>
---
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

2020-07-05 23:09:56

by Zhang, Cathy

[permalink] [raw]
Subject: [PATCH 2/2] x86: Expose TSX Suspend Load Address Tracking

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 <[email protected]>
---
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

2020-07-06 18:08:34

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 1/2] x86: Expose SERIALIZE for supported cpuid

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 <[email protected]>

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/[email protected]


Attachments:
(No filename) (2.40 kB)
.config.gz (48.09 kB)
Download all attachments

2020-07-06 21:39:05

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 2/2] x86: Expose TSX Suspend Load Address Tracking

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 <[email protected]>

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/[email protected]


Attachments:
(No filename) (2.98 kB)
.config.gz (48.09 kB)
Download all attachments