Re: [PATCH] KVM: vmx: Fix the broken usage of vmx_xsaves_supported

From: Paolo Bonzini
Date: Thu Jun 20 2019 - 04:42:06 EST


On 20/06/19 10:27, Wanpeng Li wrote:
> Agreed, in addition, guest can enable/disable cpuid bits by grub
> parameter

Through what path? Guest can disable X86_FEATURE_* but that's purely a
Linux feature, the few CPUID bits that can change at runtime already
call kvm_x86_ops->cpuid_update().

Paolo

> , should we call kvm_x86_ops->cpuid_update() in
> kvm_vcpu_reset() path to reflect the new guest cpuid influence to
> exec_control? e.g. the first boot guest disable xsaves in grub, kvm
> disables xsaves in exec_control; then guest reboot w/ xsaves enabled,
> it still get an #UD when executing.