x86/cpufeatures: Add SGX1 and SGX2 sub-features
authorSean Christopherson <seanjc@google.com>
Fri, 19 Mar 2021 07:22:18 +0000 (20:22 +1300)
committerBorislav Petkov <bp@suse.de>
Thu, 25 Mar 2021 16:33:11 +0000 (17:33 +0100)
commitb8921dccf3b25798409d35155b5d127085de72c2
tree4e617f66ed6f58c18449f07278ee63176f57beae
parente9a15a40e857fc6ccfbb05fec7b184e9003057df
x86/cpufeatures: Add SGX1 and SGX2 sub-features

Add SGX1 and SGX2 feature flags, via CPUID.0x12.0x0.EAX, as scattered
features, since adding a new leaf for only two bits would be wasteful.
As part of virtualizing SGX, KVM will expose the SGX CPUID leafs to its
guest, and to do so correctly needs to query hardware and kernel support
for SGX1 and SGX2.

Suppress both SGX1 and SGX2 from /proc/cpuinfo. SGX1 basically means
SGX, and for SGX2 there is no concrete use case of using it in
/proc/cpuinfo.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Dave Hansen <dave.hansen@intel.com>
Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lkml.kernel.org/r/d787827dbfca6b3210ac3e432e3ac1202727e786.1616136308.git.kai.huang@intel.com
arch/x86/include/asm/cpufeatures.h
arch/x86/kernel/cpu/cpuid-deps.c
arch/x86/kernel/cpu/scattered.c