Re: [PATCH] KVM: x86: Fix the condition of #PF interception caused by MKTME

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

 



On 4/9/2024 10:01 AM, Sean Christopherson wrote:
On Tue, 19 Mar 2024 11:11:11 +0800, Tao Su wrote:
Intel MKTME repurposes several high bits of physical address as 'keyID',
so boot_cpu_data.x86_phys_bits doesn't hold physical address bits reported
by CPUID anymore.

If guest.MAXPHYADDR < host.MAXPHYADDR, the bit field of ‘keyID’ belongs
to reserved bits in guest’s view, so intercepting #PF to fix error code
is necessary, just replace boot_cpu_data.x86_phys_bits with
kvm_get_shadow_phys_bits() to fix.

[...]

Applied to kvm-x86 fixes, with a massaged shortlog/changelog.

Note, I don't love using kvm_get_shadow_phys_bits(),

cannot agree more.

but only because doing
CPUID every time is so pointlessly suboptimal.  I have a series to clean up all
of the related code, which I'll hopefully post later this week.

Look forward to it.

But I didn't see any reason to hold up this fix, as I really hope no one is
using allow_smaller_maxphyaddr in a nested VM with EPT enabled, which is the
only case where CPUID is likely to have a meaningful impact (due to causing a
VM-Exit).

[1/1] KVM: x86: Fix the condition of #PF interception caused by MKTME
       https://github.com/kvm-x86/linux/commit/7f2817ef52a1

--
https://github.com/kvm-x86/linux/tree/next





[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