On Mon, 2021-04-05 at 15:32 +0000, Sean Christopherson wrote: > > diff --git a/arch/x86/include/asm/cpufeatures.h > > b/arch/x86/include/asm/cpufeatures.h > > index 8f2f050..d4a883a 100644 > > --- a/arch/x86/include/asm/cpufeatures.h > > +++ b/arch/x86/include/asm/cpufeatures.h > > @@ -13,7 +13,7 @@ > > /* > > * Defines x86 CPU feature bits > > */ > > -#define NCAPINTS 19 /* N 32-bit words worth > > of info */ > > +#define NCAPINTS 21 /* N 32-bit words worth > > of info */ > > #define NBUGINTS 1 /* N 32-bit bug flags */ > > > > /* > > @@ -382,6 +382,15 @@ > > #define X86_FEATURE_CORE_CAPABILITIES (18*32+30) /* "" > > IA32_CORE_CAPABILITIES MSR */ > > #define X86_FEATURE_SPEC_CTRL_SSBD (18*32+31) /* "" Speculative > > Store Bypass Disable */ > > > > +/* Intel-defined KeyLocker feature CPUID level 0x00000019 (EBX), > > word 20*/ > > +#define X86_FEATURE_KL_INS_ENABLED (19*32 + 0) /* "" Key Locker > > instructions */ > > +#define X86_FEATURE_KL_WIDE (19*32 + 2) /* "" Wide Key Locker > > instructions */ > > +#define X86_FEATURE_IWKEY_BACKUP (19*32 + 4) /* "" IWKey backup > > */ > > + > > +/* Intel-defined KeyLocker feature CPUID level 0x00000019 (ECX), > > word 21*/ > > +#define X86_FEATURE_IWKEY_NOBACKUP (20*32 + 0) /* "" NoBackup > > parameter to LOADIWKEY */ > > +#define X86_FEATURE_IWKEY_RAND (20*32 + 1) /* IWKey Randomization > > */ > > These should probably go into a Linux-defined leaf, I'm guessing > neither leaf > will be anywhere near full, at least in Linux. KVM's reverse-CPUID > code will > likely/hopefully be gaining support for scattered leafs in the near > future[*], > that side of things should be a non-issue if/when this lands. > > https://lkml.kernel.org/r/02455fc7521e9f1dc621b57c02c52cd04ce07797.1616136308.git.kai.huang@xxxxxxxxx Yes, in my internal private tree, I have refactored code based on your patch. BTW, I'm thinking, what if when those new HW-defined leaves got more occupied? will then they be moved from the Linux-defined leaves to new truely-map-to-HW-definition leaves?