On 4/10/2024 8:19 AM, Sean Christopherson wrote:
On Wed, 13 Mar 2024 13:58:41 +0100, Gerd Hoffmann wrote:
Use the GuestPhysBits field (EAX[23:16]) to communicate the max
addressable GPA to the guest. Typically this is identical to the max
effective GPA, except in case the CPU supports MAXPHYADDR > 48 but does
not support 5-level TDP.
See commit messages and source code comments for details.
[...]
Applied to kvm-x86 misc, with massaged changelogs to be more verbose when
describing the impact of each change, e.g. to call out that patch 2 isn't an
urgent fix because guest firmware can simply limit itself to using GPAs that
can be addressed with 4-level paging.
I also tagged patch 1 for stable@, as KVM-on-KVM will do the wrong thing when
patch 2 lands, i.e. KVM will incorrectly advertise the addressable MAXPHYADDR
as the raw/real MAXPHYADDR.
you mean old KVM on new KVM?
As far as I see, it seems no harm. e.g., if the userspace and L0 KVM
have the new implementation. On Intel SRF platform, L1 KVM sees
EAX[23:16]=48, EAX[7:0]=52. And when L1 KVM is old, it reports EAX[7:0]
= 48 to L1 userspace.
right, 48 is not the raw/real MAXPHYADDR. But I think there is not
statement on KVM that CPUID.0x8000_0008.EAX[7:0] of
KVM_GET_SUPPORTED_CPUID reports the raw/real MAXPHYADDR.
Please holler if you (or anyone) disagrees with the changes or my analysis on
the KVM-on-KVM issue.
Thanks!
[1/2] KVM: x86: Don't advertise guest.MAXPHYADDR as host.MAXPHYADDR in CPUID
https://github.com/kvm-x86/linux/commit/6f5c9600621b
[2/2] KVM: x86: Advertise max mappable GPA in CPUID.0x80000008.GuestPhysBits
https://github.com/kvm-x86/linux/commit/b628cb523c65
--
https://github.com/kvm-x86/linux/tree/next