Set kvm_caps.supported_xcr0[APX] when the host has enabled the APX state along with CONFIG_KVM_APX=y. Tested-by: Zhao Liu Signed-off-by: Chang S. Bae --- arch/x86/kvm/x86.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 76f70d2631f6..8c6365122efb 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -7132,6 +7132,8 @@ int kvm_x86_vendor_init(struct kvm_x86_init_ops *ops) if (boot_cpu_has(X86_FEATURE_XSAVE)) { kvm_host.xcr0 = xgetbv(XCR_XFEATURE_ENABLED_MASK); kvm_caps.supported_xcr0 = kvm_host.xcr0 & KVM_SUPPORTED_XCR0; + if (IS_ENABLED(CONFIG_KVM_APX)) + kvm_caps.supported_xcr0 |= kvm_host.xcr0 & XFEATURE_MASK_APX; } if (boot_cpu_has(X86_FEATURE_XSAVES)) { -- 2.53.0