x86/cpufeatures: Enumerate new AVX512 bfloat16 instructions
RFC PATCH 1/1 x86/cpufeatures: Enumerate new AVX512 bfloat16 instructions
AVX512 Vector Neural Network Instructions (VNNI) in Intel Deep Learning Boost support bfloat16 format (BF16). BF16 is a short version of FP32 and has several advantages over FP16. BF16 offers more than enough range for deep learning training tasks and doesn't need to handle hardware exception as this is a performance optimization. FP32 accumulation after the multiply is essential to achieve sufficient numerical behavior on an application level.
AVX512 bfloat16 instructions can be enumerated by:
CPUID.(EAX=7,ECX=1):EAX[bit 5] AVX512_BF16
Detailed information of the CPUID bit and AVX512 bfloat16 instructions can be found in the latest Intel Architecture Instruction Set Extensions and Future Features Programming Reference.
---
Since split lock feature (to-be-upstreamed) occupies the last bit of word 7, need to create a new word 19 to host AVX512_BF16 and other future features.
arch/x86/include/asm/cpufeature.h | 7 +++++-- arch/x86/include/asm/cpufeatures.h | 8 +++++++- arch/x86/include/asm/disabled-features.h | 3 ++- arch/x86/include/asm/required-features.h | 3 ++- arch/x86/kernel/cpu/cpuid-deps.c | 1 + arch/x86/kernel/cpu/scattered.c | 1 + 6 files changed, 18 insertions(+), 5 deletions(-)
arch/x86/include/asm/cpufeature.h +5 -2
@@ -30,6 +30,7 @@ enum cpuid_leafsCPUID_7_ECX ,CPUID_8000_0007_EBX ,CPUID_7_EDX , + CPUID_LNX_4, };#ifdef CONFIG_X86_FEATURE_NAMES
@@ -81,8 +82,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32]; CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 16, feature_bit) || \ CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 17, feature_bit) || \ CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 18, feature_bit) || \ + CHECK_BIT_IN_MASK_WORD(REQUIRED_MASK, 19, feature_bit) || \ REQUIRED_MASK_CHECK || \ - BUILD_BUG_ON_ZERO(NCAPINTS != 19)) + BUILD_BUG_ON_ZERO(NCAPINTS != 20))#define DISABLED_MASK_BIT_SET (feature_bit) \ ( CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 0, feature_bit) || \
@@ -104,8 +106,9 @@ extern const char * const x86_bug_flags[NBUGINTS*32]; CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 16, feature_bit) || \ CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 17, feature_bit) || \ CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 18, feature_bit) || \ + CHECK_BIT_IN_MASK_WORD(DISABLED_MASK, 19, feature_bit) || \ DISABLED_MASK_CHECK || \ - BUILD_BUG_ON_ZERO(NCAPINTS != 19)) + BUILD_BUG_ON_ZERO(NCAPINTS != 20))#define cpu_has (c, bit) \ (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \
arch/x86/include/asm/cpufeatures.h +7 -1
@@ -13,7 +13,7 @@/* * Defines x86 CPU feature bits */ -#define NCAPINTS 19/* N 32-bit words worth of info */ +#define NCAPINTS 20/* N 32-bit words worth of info */ #define NBUGINTS 1/* N 32-bit bug flags */ /*
@@ -352,6 +352,12 @@#define X86_FEATURE_ARCH_CAPABILITIES (18*32+29)/* IA32_ARCH_CAPABILITIES MSR (Intel) */ #define X86_FEATURE_SPEC_CTRL_SSBD (18*32+31)/* "" Speculative Store Bypass Disable */ +/* +* Extended auxiliary flags: Linux defined - For features scattered in various +* CPUID levels and sub-leaves like CPUID level 7 and sub-leaf 1, etc, word 19. +*/ +#define X86_FEATURE_AVX512_BF16 (19*32+ 0)/* BFLOAT16 instructions */ +/* * BUG word(s) */
arch/x86/include/asm/disabled-features.h +2 -1
@@ -84,6 +84,7 @@#define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP)#define DISABLED_MASK17 0#define DISABLED_MASK18 0 -#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19) +#define DISABLED_MASK19 0 +#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 20)#endif /* _ASM_X86_DISABLED_FEATURES_H */
arch/x86/include/asm/required-features.h +2 -1
@@ -101,6 +101,7 @@#define REQUIRED_MASK16 0#define REQUIRED_MASK17 0#define REQUIRED_MASK18 0 -#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19) +#define REQUIRED_MASK19 0 +#define REQUIRED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 20)#endif /* _ASM_X86_REQUIRED_FEATURES_H */
arch/x86/kernel/cpu/cpuid-deps.c +1 -0
@@ -59,6 +59,7 @@ static const struct cpuid_dep cpuid_deps[] = { { X86_FEATURE_AVX512_4VNNIW, X86_FEATURE_AVX512F }, { X86_FEATURE_AVX512_4FMAPS, X86_FEATURE_AVX512F }, { X86_FEATURE_AVX512_VPOPCNTDQ, X86_FEATURE_AVX512F }, + { X86_FEATURE_AVX512_BF16, X86_FEATURE_AVX512VL }, {} };
arch/x86/kernel/cpu/scattered.c +1 -0
@@ -26,6 +26,7 @@ struct cpuid_bit {static const struct cpuid_bit cpuid_bits[] = { {X86_FEATURE_APERFMPERF ,CPUID_ECX ,0 ,0x00000006 ,0 }, {X86_FEATURE_EPB ,CPUID_ECX ,3 ,0x00000006 ,0 }, + {X86_FEATURE_AVX512_BF16 ,CPUID_EAX ,5 ,0x00000007 ,1 }, {X86_FEATURE_CAT_L3 ,CPUID_EBX ,1 ,0x00000010 ,0 }, {X86_FEATURE_CAT_L2 ,CPUID_EBX ,2 ,0x00000010 ,0 }, {X86_FEATURE_CDP_L3 ,CPUID_ECX ,2 ,0x00000010 ,1 },
Signature · 1 line
2.19.1
Borislav Petkov
maintainerQuoted 15 lines · Fenghua Yu
AVX512 Vector Neural Network Instructions (VNNI) in Intel Deep Learning Boost support bfloat16 format (BF16). BF16 is a short version of FP32 and has several advantages over FP16. BF16 offers more than enough range for deep learning training tasks and doesn't need to handle hardware exception as this is a performance optimization. FP32 accumulation after the multiply is essential to achieve sufficient numerical behavior on an application level.
AVX512 bfloat16 instructions can be enumerated by:
CPUID.(EAX=7,ECX=1):EAX[bit 5] AVX512_BF16Detailed information of the CPUID bit and AVX512 bfloat16 instructions can be found in the latest Intel Architecture Instruction Set Extensions and Future Features Programming Reference.
Quoted 6 lines
Signed-off-by Fenghua Yu <[email protected]>---
Since split lock feature (to-be-upstreamed) occupies the last bit of word 7, need to create a new word 19 to host
AVX512_BF16and other future features.
Is CPUID.(EAX=7,ECX=1):EAX going to contain only feature bits? If so, just make it a proper feature word instead of a linux-specific one.
Also, while on the subject, you can recycle word 11
/* Intel-defined CPU QoS Sub-leaf, CPUID level 0x0000000F:0 (EDX), word 11 */
#define X86_FEATURE_CQM_LLC (11*32+ 1) /* LLC QoS if 1 */
and move it to scattered as it is a complete waste. Word 12 too, for that matter. But do that in separate patches.
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.Quoted 19 lines · Borislav Petkov
Quoted 18 lines · Fenghua Yu
AVX512 Vector Neural Network Instructions (VNNI) in Intel Deep Learning Boost support bfloat16 format (BF16). BF16 is a short version of FP32 and has several advantages over FP16. BF16 offers more than enough range for deep learning training tasks and doesn't need to handle hardware exception as this is a performance optimization. FP32 accumulation after the multiply is essential to achieve sufficient numerical behavior on an application level.
AVX512 bfloat16 instructions can be enumerated by:
CPUID.(EAX=7,ECX=1):EAX[bit 5] AVX512_BF16Detailed information of the CPUID bit and AVX512 bfloat16 instructions can be found in the latest Intel Architecture Instruction Set Extensions and Future Features Programming Reference.
Signed-off-by Fenghua Yu <[email protected]>---
Quoted 6 lines
Quoted 3 lines
Since split lock feature (to-be-upstreamed) occupies the last bit of word 7, need to create a new word 19 to host
AVX512_BF16and other future features.Is CPUID.(EAX=7,ECX=1):EAX going to contain only feature bits? If so, just make it a proper feature word instead of a linux-specific one.
AFAICT, there will be more features in the EAX register in the future. Ok. I will use a feature word for CPUID.(EAX=7,ECX=1):EAX.
Quoted 8 lines
Also, while on the subject, you can recycle word 11
/* Intel-defined CPU QoS Sub-leaf, CPUID level 0x0000000F:0 (EDX), word 11 */
#defineX86_FEATURE_CQM_LLC(11*32+ 1) /* LLC QoS if 1 */and move it to scattered as it is a complete waste. Word 12 too, for that matter. But do that in separate patches.
So can I re-organize word 11 and 12 as follows?
1. Change word 11 to host scattered features.
2. Move the previos features in word 11 and word 12 to word 11:
/*
* Extended auxiliary flags: Linux defined - For features scattered in various
* CPUID levels and sub-leaves like CPUID level 7 and sub-leaf 1, etc, word 19. */
#define X86_FEATURE_CQM_LLC (11*32+ 0) /* LLC QoS if 1 */ #define X86_FEATURE_CQM_OCCUP_LLC (11*32+ 1) /* LLC occupancy monitoring */ #define X86_FEATURE_CQM_MBM_TOTAL (11*32+ 2) /* LLC Total MBM monitoring */ #define X86_FEATURE_CQM_MBM_LOCAL (11*32+ 3) /* LLC Local MBM monitoring */
3. Change word 12 to host CPUID.(EAX=7,ECX=1):EAX:
/* Intel-defined CPU features, CPUID level 0x7:1 (EAX), word 12 */
#define X86_FEATURE_AVX512_BF16 (12*32+ 0) /* BFLOAT16 instructions */
4. Do other necessary changes to match the new word 11 and word 12.
Thanks.
-Fenghua
Borislav Petkov
maintainerQuoted 8 lines · Fenghua Yu
So can I re-organize word 11 and 12 as follows?
1. Change word 11 to host scattered features.
2. Move the previos features in word 11 and word 12 to word 11:
/*
* Extended auxiliary flags: Linux defined - For features scattered in various
* CPUID levels and sub-leaves like CPUID level 7 and sub-leaf 1, etc, word 19. */
Quoted 4 lines
#define X86_FEATURE_CQM_LLC (11*32+ 0) /* LLC QoS if 1 */ #define X86_FEATURE_CQM_OCCUP_LLC (11*32+ 1) /* LLC occupancy monitoring */ #define X86_FEATURE_CQM_MBM_TOTAL (11*32+ 2) /* LLC Total MBM monitoring */ #define X86_FEATURE_CQM_MBM_LOCAL (11*32+ 3) /* LLC Local MBM monitoring */
Yap.
Quoted 3 lines
3. Change word 12 to host CPUID.(EAX=7,ECX=1):EAX:
/* Intel-defined CPU features, CPUID level 0x7:1 (EAX), word 12 */
#defineX86_FEATURE_AVX512_BF16(12*32+ 0) /* BFLOAT16 instructions */
This needs to be (12*32+ 5) if word 12 is going to map leaf CPUID.(EAX=7,ECX=1):EAX.
At least judging from the arch extensions doc which lists EAX as:
Bits 04-00: Reserved.
Bit 05: AVX512_BF16. Vector Neural Network Instructions supporting BFLOAT16 inputs and conversion instructions from IEEE single precision. Bits 31-06: Reserved.
Quoted 1 line
4. Do other necessary changes to match the new word 11 and word 12.
But split in two patches: first does steps 1+2, second patch adds the new leaf to word 12.
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.Quoted 20 lines · Borislav Petkov
Quoted 8 lines · Fenghua Yu
So can I re-organize word 11 and 12 as follows?
1. Change word 11 to host scattered features.
2. Move the previos features in word 11 and word 12 to word 11:
/*
* Extended auxiliary flags: Linux defined - For features scattered in various
* CPUID levels and sub-leaves like CPUID level 7 and sub-leaf 1, etc, word 19. */Quoted 4 lines
#define X86_FEATURE_CQM_LLC (11*32+ 0) /* LLC QoS if 1 */ #define X86_FEATURE_CQM_OCCUP_LLC (11*32+ 1) /* LLC occupancy monitoring */ #define X86_FEATURE_CQM_MBM_TOTAL (11*32+ 2) /* LLC Total MBM monitoring */ #define X86_FEATURE_CQM_MBM_LOCAL (11*32+ 3) /* LLC Local MBM monitoring */Yap.
Quoted 3 lines
3. Change word 12 to host CPUID.(EAX=7,ECX=1):EAX:
/* Intel-defined CPU features, CPUID level 0x7:1 (EAX), word 12 */
#defineX86_FEATURE_AVX512_BF16(12*32+ 0) /* BFLOAT16 instructions */
Quoted 8 lines
This needs to be (12*32+ 5) if word 12 is going to map leaf CPUID.(EAX=7,ECX=1):EAX.
At least judging from the arch extensions doc which lists EAX as:
Bits 04-00: Reserved.
Bit 05:AVX512_BF16. Vector Neural Network Instructions supporting BFLOAT16 inputs and conversion instructions from IEEE single precision. Bits 31-06: Reserved.
Yes, you are absolutely right. I'll defint it as (12*32+ 5).
Quoted 5 lines
Quoted 2 lines
4. Do other necessary changes to match the new word 11 and word 12.
But split in two patches: first does steps 1+2, second patch adds the new leaf to word 12.
There are two varialbes defined in cpuinfo_x86: x86_cache_max_rmid and x86_cache_occ_scale. c->x86_cache_max_rmid is read from CPUID.0xf.1:ECX and c->x86_cache_occ_scale is read from CPUID.0xf.1:EBX.
After getting X86_FEATURE_CQM_* from scattered, the two variables need to be read from CPUID again. So the code of reading the two variables need to be moved from before init_scattered_cpuid_features(c) to after the function. This make the get_cpu_cap() code awkward.
And the two variables are ONLY used in resctrl monitoring configuration. There is no need to store them in cpuinfo_x86 on each CPU.
I'm thinking to simplify and clean this part of code:
1. In patch #1:
- remove the definitions of x86_cache_max_rmid and x86_cache_occ_scale from cpuinfo_x86
- remove assignment of c->x86_cache_max_rmid and c->x86_cache_occ_scale from get_cpu_cap(c)
- get r->mon_scale and r->num_rmid in rdt_get_mon_l3_config(r) directly from CPUID.0xf.1:EBX and CPUID.0xf.1:ECX.
2. In patch #2: do steps 1+2 to recycle word 11. After patch #1, I can totally remove the code to get c->x86_cache_max_rmd and c->x86_cache_occ_scale in get_cpu_cap(c). And patch #2 is cleaner.
3. In patch #3: add new word 12 to host CPUID.7.1:EAX
Do you think the patch #1 is necessary and this is a right patch set?
Thanks.
-Fenghua
Quoted 65 lines · Fenghua Yu
Quoted 9 lines · Borislav Petkov
Quoted 8 lines · Fenghua Yu
So can I re-organize word 11 and 12 as follows?
1. Change word 11 to host scattered features.
2. Move the previos features in word 11 and word 12 to word 11:
/*
* Extended auxiliary flags: Linux defined - For features scattered
in various
* CPUID levels and sub-leaves like CPUID level 7 and sub-leaf 1, etc,word 19.
Quoted 3 lines
Quoted 3 lines
*/
#defineX86_FEATURE_CQM_LLC(11*32+ 0) /* LLC QoS if 1 */
#defineX86_FEATURE_CQM_OCCUP_LLC(11*32+ 1) /* LLCoccupancy monitoring */
Quoted 1 line
Quoted 1 line
#define
X86_FEATURE_CQM_MBM_TOTAL(11*32+ 2) /* LLC TotalMBM monitoring */
Quoted 1 line
Quoted 1 line
#define
X86_FEATURE_CQM_MBM_LOCAL(11*32+ 3) /* LLC LocalMBM monitoring */
Quoted 6 lines
Yap.
Quoted 3 lines
3. Change word 12 to host CPUID.(EAX=7,ECX=1):EAX:
/* Intel-defined CPU features, CPUID level 0x7:1 (EAX), word 12 */
#defineX86_FEATURE_AVX512_BF16(12*32+ 0) /* BFLOAT16instructions */
Quoted 8 lines
This needs to be (12*32+ 5) if word 12 is going to map leaf CPUID.(EAX=7,ECX=1):EAX.
At least judging from the arch extensions doc which lists EAX as:
Bits 04-00: Reserved.
Bit 05:AVX512_BF16. Vector Neural Network Instructions supportingBFLOAT16 inputs and conversion instructions from IEEE single precision.
Quoted 1 line
Bits 31-06: Reserved.
Yes, you are absolutely right. I'll defint it as (12*32+ 5).
Quoted 5 lines
Quoted 2 lines
4. Do other necessary changes to match the new word 11 and word 12.
But split in two patches: first does steps 1+2, second patch adds the new leaf to word 12.
There are two varialbes defined in
cpuinfo_x86:x86_cache_max_rmidandx86_cache_occ_scale.c->x86_cache_max_rmidis read from CPUID.0xf.1:ECX andc->x86_cache_occ_scaleis read from CPUID.0xf.1:EBX.After getting X86_FEATURE_CQM_* from scattered, the two variables need to be read from CPUID again. So the code of reading the two variables need to be moved from before
init_scattered_cpuid_features(c)to after the function. This make theget_cpu_cap()code awkward.And the two variables are ONLY used in resctrl monitoring configuration. There is no need to store them in
cpuinfo_x86on each CPU.I'm thinking to simplify and clean this part of code:
1. In patch #1:
- remove the definitions ofx86_cache_max_rmidandx86_cache_occ_scalefromcpuinfo_x86
- remove assignment ofc->x86_cache_max_rmidand c-Quoted 1 line
x86_cache_occ_scalefromget_cpu_cap(c)
Quoted 8 lines
- get
r->mon_scaleandr->num_rmidinrdt_get_mon_l3_config(r)directly from CPUID.0xf.1:EBX and CPUID.0xf.1:ECX.
2. In patch #2: do steps 1+2 to recycle word 11. After patch #1, I can totally remove the code to getc->x86_cache_max_rmdandc->x86_cache_occ_scaleinget_cpu_cap(c). And patch #2 is cleaner.
3. In patch #3: add new word 12 to host CPUID.7.1:EAXDo you think the patch #1 is necessary and this is a right patch set?
My bad. I studied a bit more and found the patch #1 is not needed. Please ignore my last email.
Thanks.
-Fenghua
Borislav Petkov
maintainerQuoted 1 line · Fenghua
My bad. I studied a bit more and found the patch #1 is not needed.
Why, I think you were spot-on:
"And the two variables are ONLY used in resctrl monitoring configuration. There is no need to store them in cpuinfo_x86 on each CPU."
That was a real overkill to put them in cpuinfo_x86. The information needed should simply be read out in rdt_get_mon_l3_config() and that's it - no need to global values to store them.
Now removing them should be in a separate patch so that review is easy.
Or am I missing an aspect?
Signature · 4 lines
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.Quoted 9 lines · Borislav Petkov
Quoted 1 line · Fenghua
My bad. I studied a bit more and found the patch #1 is not needed.
Why, I think you were spot-on:
"And the two variables are ONLY used in resctrl monitoring configuration. There is no need to store them in
cpuinfo_x86on each CPU."
Quoted 7 lines
That was a real overkill to put them in
cpuinfo_x86. The information needed should simply be read out inrdt_get_mon_l3_config()and that's it - no need to global values to store them.Now removing them should be in a separate patch so that review is easy.
Or am I missing an aspect?
x86_init_cache_qos() fnds the minimum number of rmid on all CPUs and store it in boot_cpu_data.
If removing the two variables from cpuinfo_x86 and getting number of rmid and occupancy scale in rdt_get_mon_l3_config() directly from CPUID on the current CPU, we need to assume all CPUs have the same number of rmid.
Is this a right assumption?
After think again, it might be a right assumption after all. AFAICT, each Intel platform that supports resctrl has the same number of rmid on all CPUs and there is no plan to have a resctrl platform that has different numbers of rmid on CPUs.
So Ok, I will write the patch #1 that removes the two variables from cpuinfo_x86 and gets the info directly from CPUID in rdt_get_mon_l3_config().
Thanks.
-Fenghua
Quoted 25 lines · Borislav Petkov
Quoted 8 lines · Fenghua Yu
So can I re-organize word 11 and 12 as follows?
1. Change word 11 to host scattered features.
2. Move the previos features in word 11 and word 12 to word 11:
/*
* Extended auxiliary flags: Linux defined - For features scattered in various
* CPUID levels and sub-leaves like CPUID level 7 and sub-leaf 1, etc, word 19. */Quoted 4 lines
#define X86_FEATURE_CQM_LLC (11*32+ 0) /* LLC QoS if 1 */ #define X86_FEATURE_CQM_OCCUP_LLC (11*32+ 1) /* LLC occupancy monitoring */ #define X86_FEATURE_CQM_MBM_TOTAL (11*32+ 2) /* LLC Total MBM monitoring */ #define X86_FEATURE_CQM_MBM_LOCAL (11*32+ 3) /* LLC Local MBM monitoring */Yap.
Quoted 3 lines
3. Change word 12 to host CPUID.(EAX=7,ECX=1):EAX:
/* Intel-defined CPU features, CPUID level 0x7:1 (EAX), word 12 */
#defineX86_FEATURE_AVX512_BF16(12*32+ 0) /* BFLOAT16 instructions */This needs to be (12*32+ 5) if word 12 is going to map leaf CPUID.(EAX=7,ECX=1):EAX.
At least judging from the arch extensions doc which lists EAX as:
Quoted 8 lines
Bits 04-00: Reserved.
Bit 05:AVX512_BF16. Vector Neural Network Instructions supporting BFLOAT16 inputs and conversion instructions from IEEE single precision. Bits 31-06: Reserved.Quoted 1 line
4. Do other necessary changes to match the new word 11 and word 12.
But split in two patches: first does steps 1+2, second patch adds the new leaf to word 12.
Currently KVM doesn't simulate scattered features (the ones in CPUID_LNX_* in cpuid_leafs) as reverse_cpuid[] doesn't contain CPUID_LNX_*.
After the X86_FEATURES_CQM_* features are changed to scattered features, they will not be simulated by KVM any more as CPUID_F_0_EDX and CPUID_F_1_EDX are removed.
Should patch #1 simulate X86_FEATURE_CQM_* in KVM? Or let KVM guys handle the scattered features?
Thanks.
-Fenghua
Borislav Petkov
maintainerQuoted 2 lines · Fenghua Yu
Currently KVM doesn't simulate scattered features (the ones in CPUID_LNX_* in
cpuid_leafs) as reverse_cpuid[] doesn't contain CPUID_LNX_*.
43500e6f294d ("x86/cpufeatures: Remove get_scattered_cpuid_leaf()")
Quoted 3 lines
After the X86_FEATURES_CQM_* features are changed to scattered features, they will not be simulated by KVM any more as
CPUID_F_0_EDXandCPUID_F_1_EDXare removed.
Does KVM even support resctrl? I doubt only exporting a couple of CPUID bits into the guest is enough...
Quoted 2 lines
Should patch #1 simulate X86_FEATURE_CQM_* in KVM? Or let KVM guys handle the scattered features?
Right, the scattered thing was removed as KVM didn't need it, apparently, see above.
Signature · 4 lines
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.Quoted 4 lines · Borislav Petkov
Quoted 2 lines · Fenghua Yu
Currently KVM doesn't simulate scattered features (the ones in CPUID_LNX_* in
cpuid_leafs) as reverse_cpuid[] doesn't contain CPUID_LNX_*.
Quoted 8 lines
43500e6f294d("x86/cpufeatures: Removeget_scattered_cpuid_leaf()")Quoted 3 lines
After the X86_FEATURES_CQM_* features are changed to scattered features, they will not be simulated by KVM any more as
CPUID_F_0_EDXandCPUID_F_1_EDXare removed.Does KVM even support resctrl? I doubt only exporting a couple of CPUID bits into the guest is enough...
KVM doesn't support resctrl. Moving X86_FEATURES_CQM_* to a scattered leaf won't affect KVM.
Quoted 5 lines
Quoted 2 lines
Should patch #1 simulate X86_FEATURE_CQM_* in KVM? Or let KVM guys handle the scattered features?
Right, the scattered thing was removed as KVM didn't need it, apparently, see above.
Let KVM people deal with it, in the unlikely event someone adds resctrl support to KVM.
Quoted 17 lines · Sean Christopherson
Quoted 4 lines · Borislav Petkov
Quoted 2 lines · Fenghua Yu
Currently KVM doesn't simulate scattered features (the ones in CPUID_LNX_* in
cpuid_leafs) as reverse_cpuid[] doesn't contain CPUID_LNX_*.Quoted 8 lines
43500e6f294d("x86/cpufeatures: Removeget_scattered_cpuid_leaf()")Quoted 3 lines
After the X86_FEATURES_CQM_* features are changed to scattered features, they will not be simulated by KVM any more as
CPUID_F_0_EDXandCPUID_F_1_EDXare removed.Does KVM even support resctrl? I doubt only exporting a couple of CPUID bits into the guest is enough...
KVM doesn't support resctrl. Moving X86_FEATURES_CQM_* to a scattered leaf won't affect KVM.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Should patch #1 simulate X86_FEATURE_CQM_* in KVM? Or let KVM guys handle the scattered features?
Right, the scattered thing was removed as KVM didn't need it, apparently, see above.
Let KVM people deal with it, in the unlikely event someone adds resctrl support to KVM.
Thank you for your insight, Boris and Sean!
-Fenghua