Re: [edk2-devel] GuestPhysAddrSize questions

2024-03-06 Thread Paolo Bonzini
On Mon, Mar 4, 2024 at 6:24 PM Tom Lendacky wrote: > > 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 > >>>

Re: [edk2-devel] GuestPhysAddrSize questions

2024-03-04 Thread Lendacky, Thomas via groups.io
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

Re: [edk2-devel] GuestPhysAddrSize questions

2024-03-04 Thread Gerd Hoffmann
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

Re: [edk2-devel] GuestPhysAddrSize questions

2024-02-22 Thread Paolo Bonzini
On Thu, Feb 22, 2024 at 5:13 PM Paolo Bonzini wrote: > Also, to clarify the hardware behavior, if hCR4.LA57=0 and host > PhysAddrSize==52, then will guest physical addresses above 2^48 > > 1) cause a reserved #PF in the guest, or > > 2) cause a non-present NPF exit in the hypervisor? > > I

Re: [edk2-devel] GuestPhysAddrSize questions

2024-02-22 Thread Paolo Bonzini
On 2/22/24 16:44, Tom Lendacky wrote: On 2/22/24 05:24, Gerd Hoffmann wrote:    Hi, +    if (Cr4.Bits.LA57) { +  if (PhysBits > 48) { +    /* + * Some Intel CPUs support 5-level paging, have more than 48 + * phys-bits but support only 4-level EPT, which effectively +   

Re: [edk2-devel] GuestPhysAddrSize questions

2024-02-22 Thread Lendacky, Thomas via groups.io
On 2/22/24 05:24, Gerd Hoffmann wrote: Hi, +if (Cr4.Bits.LA57) { + if (PhysBits > 48) { +/* + * Some Intel CPUs support 5-level paging, have more than 48 + * phys-bits but support only 4-level EPT, which effectively + * limits guest phys-bits to 48.

[edk2-devel] GuestPhysAddrSize questions (was: Re: [PATCH v4 3/3] OvmfPkg/PlatformInitLib: add 5-level paging) support

2024-02-22 Thread Gerd Hoffmann
Hi, > +if (Cr4.Bits.LA57) { > + if (PhysBits > 48) { > +/* > + * Some Intel CPUs support 5-level paging, have more than 48 > + * phys-bits but support only 4-level EPT, which effectively > + * limits guest phys-bits to 48. > + * > + * AMD