Re: [PATCH v2 23/23] kvm: x86: Disable RDMSR interception of IA32_XFD_ERR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/21/21 07:29, Liu, Jing2 wrote:

Thanks for reviewing the patches.

If disable unconditionally in vmx_create_vcpu, it means even guest has
no cpuid, the msr read is passthrough to guest and it can read a value, which
seems strange, though spec doesn't mention the read behaviour w/o cpuid.

How about disabling read interception at vmx_vcpu_after_set_cpuid?

if (boot_cpu_has(X86_FEATURE_XFD) && guest_cpuid_has(vcpu, X86_FEATURE_XFD))
         vmx_set_intercept_for_msr(vcpu, MSR_IA32_XFD_ERR, MSR_TYPE_R, false);

Even better:

	if (boot_cpu_has(X86_FEATURE_XFD))
		vmx_set_intercept_for_msr(vcpu, MSR_IA32_XFD_ERR, MSR_TYPE_R,
					  !guest_cpuid_has(vcpu, X86_FEATURE_XFD));

Thanks,

Paolo




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux