Re: [PATCH v2 2/2] [RfC] expose host-phys-bits to guest

2022-09-08 Thread Michael S. Tsirkin
On Fri, Sep 09, 2022 at 08:06:53AM +0200, Gerd Hoffmann wrote: > Hi, > > > > > I think we still want to key this one off host_phys_bits > > > > so it works for e.g. hyperv emulation too. > > > > > > I think that should be the case. The chunks above change the > > > host-phys-bits option from s

Re: [PATCH v2 2/2] [RfC] expose host-phys-bits to guest

2022-09-08 Thread Gerd Hoffmann
Hi, > > > I think we still want to key this one off host_phys_bits > > > so it works for e.g. hyperv emulation too. > > > > I think that should be the case. The chunks above change the > > host-phys-bits option from setting cpu->host_phys_bits to setting > > the FEAT_KVM_HINTS bit. That shoul

Re: [PATCH v2 2/2] [RfC] expose host-phys-bits to guest

2022-09-08 Thread Michael S. Tsirkin
On Fri, Sep 09, 2022 at 07:18:17AM +0200, Gerd Hoffmann wrote: > Hi, > > > > @@ -424,7 +426,10 @@ static void > > > microvm_device_pre_plug_cb(HotplugHandler *hotplug_dev, > > > { > > > X86CPU *cpu = X86_CPU(dev); > > > > > > -cpu->host_phys_bits = true; /* need reliable phys-bits *

Re: [PATCH v2 2/2] [RfC] expose host-phys-bits to guest

2022-09-08 Thread Gerd Hoffmann
Hi, > > @@ -424,7 +426,10 @@ static void microvm_device_pre_plug_cb(HotplugHandler > > *hotplug_dev, > > { > > X86CPU *cpu = X86_CPU(dev); > > > > -cpu->host_phys_bits = true; /* need reliable phys-bits */ > > +/* need reliable phys-bits */ > > +cpu->env.features[FEAT_KVM_HI

Re: [PATCH v2 2/2] [RfC] expose host-phys-bits to guest

2022-09-08 Thread Michael S. Tsirkin
On Thu, Sep 08, 2022 at 01:31:09PM +0200, Gerd Hoffmann wrote: > Move "host-phys-bits" property from cpu->host_phys_bits to > cpu->env.features[FEAT_KVM_HINTS] (KVM_HINTS_PHYS_ADDRESS_SIZE_DATA_VALID > bit). > > This has the effect that the guest can see whenever host-phys-bits > is turned on or

[PATCH v2 2/2] [RfC] expose host-phys-bits to guest

2022-09-08 Thread Gerd Hoffmann
Move "host-phys-bits" property from cpu->host_phys_bits to cpu->env.features[FEAT_KVM_HINTS] (KVM_HINTS_PHYS_ADDRESS_SIZE_DATA_VALID bit). This has the effect that the guest can see whenever host-phys-bits is turned on or not and act accordingly. Signed-off-by: Gerd Hoffmann --- target/i386/cpu