]> Gentwo Git Trees - linux/.git/commit
KVM: x86: Check XSS validity against guest CPUIDs
authorChao Gao <chao.gao@intel.com>
Fri, 19 Sep 2025 22:32:13 +0000 (15:32 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 23 Sep 2025 16:00:45 +0000 (09:00 -0700)
commit338543cbe033e56dcc8c13adcdf6c228953c0829
tree8a8acf31e98a8038de0aa3bd32a4e4e5745fd1f2
parentc0a5f298912222f3bb4e8f5dc67c6a1f0e93d83f
KVM: x86: Check XSS validity against guest CPUIDs

Maintain per-guest valid XSS bits and check XSS validity against them
rather than against KVM capabilities. This is to prevent bits that are
supported by KVM but not supported for a guest from being set.

Opportunistically return KVM_MSR_RET_UNSUPPORTED on IA32_XSS MSR accesses
if guest CPUID doesn't enumerate X86_FEATURE_XSAVES. Since
KVM_MSR_RET_UNSUPPORTED takes care of host_initiated cases, drop the
host_initiated check.

Signed-off-by: Chao Gao <chao.gao@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Link: https://lore.kernel.org/r/20250919223258.1604852-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/cpuid.c
arch/x86/kvm/x86.c