On 3/4/24 07:09, Gerd Hoffmann wrote:
   Hi,

    23:16 GuestPhysAddrSize Maximum guest physical address size in bits.
                            This number applies only to guests using nested
                            paging. When this field is zero, refer to the
                            PhysAddrSize field for the maximum guest
                            physical address size. See “Secure Virtual
                            Machine” in APM Volume 2.

I believe the main purpose of GuestPhysAddrSize was for software use (for
nested virtualization) and that the hardware itself has always returned zero
for that value. So you should be able to use that field. Adding @Paolo for
his thoughts.

Posted patches for kernel
https://lore.kernel.org/kvm/20240301101410.356007-1-kra...@redhat.com/
and qemu
https://lore.kernel.org/kvm/20240301101713.356759-1-kra...@redhat.com/
(sorry forgot to Cc you).

Reviewers mentioned this is meant for nested guests, i.e. (if I
understand this correctly) the l0 hypervisor can use that to tell
the l1 hypervisor what the l2 guest phys-bits should be.

Is this nested virtualization use documented somewhere?  Tried to
search for GuestPhysAddrSize or Fn8000_0008_EAX in APM Volume 2,
found nothing.

Right, and I don't think you'll see anything added to the APM that will state how it can be used by software. The APM is an architectural definition and won't talk about hypervisors and using nested paging, etc.


Is there any case where the phys-bits limits for an l1 guest and
l2 guest would be different?

I haven't really thought about this before and all the implications that may or may not be in play, so I don't think I can really answer that.

Thanks,
Tom


thanks & take care,
   Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116332): https://edk2.groups.io/g/devel/message/116332
Mute This Topic: https://groups.io/mt/104510523/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to