Re: [PATCH v3 2/3] kvm: add support for guest physical bits

2024-03-18 Thread Gerd Hoffmann
Hi, > > diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c > > index 9c791b7b0520..a2b7bfaeadf8 100644 > > --- a/target/i386/kvm/kvm-cpu.c > > +++ b/target/i386/kvm/kvm-cpu.c > > @@ -18,10 +18,36 @@ > > #include "kvm_i386.h" > > #include "hw/core/accel-cpu.h" > > +static void

Re: [PATCH v3 2/3] kvm: add support for guest physical bits

2024-03-18 Thread Gerd Hoffmann
Hi, > > +if (cpu->guest_phys_bits > cpu->host_phys_bits_limit) { > > +cpu->guest_phys_bits = cpu->host_phys_bits_limit; > > host_phys_bits_limit is zero by default, so I think it is better to be > like: > > if (cpu->host_phys_bits_limit && > cpu->guest_phys_bits

Re: [PATCH v3 2/3] kvm: add support for guest physical bits

2024-03-17 Thread Xiaoyao Li
On 3/13/2024 9:27 PM, Gerd Hoffmann wrote: Query kvm for supported guest physical address bits, in cpuid function 8008, eax[23:16]. Usually this is identical to host physical address bits. With NPT or EPT being used this might be restricted to 48 (max 4-level paging address space size) even

Re: [PATCH v3 2/3] kvm: add support for guest physical bits

2024-03-17 Thread Tao Su
On Wed, Mar 13, 2024 at 02:27:18PM +0100, Gerd Hoffmann wrote: > Query kvm for supported guest physical address bits, in cpuid > function 8008, eax[23:16]. Usually this is identical to host > physical address bits. With NPT or EPT being used this might be > restricted to 48 (max 4-level pagin

[PATCH v3 2/3] kvm: add support for guest physical bits

2024-03-13 Thread Gerd Hoffmann
Query kvm for supported guest physical address bits, in cpuid function 8008, eax[23:16]. Usually this is identical to host physical address bits. With NPT or EPT being used this might be restricted to 48 (max 4-level paging address space size) even if the host cpu supports more physical addre