Re: [PATCH v4 1/2] kvm: add support for guest physical bits

2024-03-27 Thread Paolo Bonzini
On Wed, Mar 20, 2024 at 3:45 AM Xiaoyao Li wrote: > If users pass configuration like "-cpu > qemu64,phys-bits=52,host-phys-bits-limit=45", the cpu->guest_phys_bits > will be set to 45. I think this is not what we want, though the usage > seems insane. > > We can guard it as > > if (cpu->host_phy

Re: [PATCH v4 1/2] kvm: add support for guest physical bits

2024-03-22 Thread Gerd Hoffmann
> > +if (cpu->host_phys_bits_limit && > > +cpu->guest_phys_bits > cpu->host_phys_bits_limit) { > > +cpu->guest_phys_bits = cpu->host_phys_bits_limit; > > host_phys_bits_limit takes effect only when cpu->host_phys_bits is set. > > If users pass configuration like "-cpu > qemu64

Re: [PATCH v4 1/2] kvm: add support for guest physical bits

2024-03-19 Thread Xiaoyao Li
On 3/18/2024 11:53 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) eve