qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel][PATCH] x86/cpu: Use max host physical address if -cpu m


From: Yang Weijiang
Subject: Re: [Qemu-devel][PATCH] x86/cpu: Use max host physical address if -cpu max option is applied
Date: Mon, 25 Jan 2021 13:41:50 +0800
User-agent: Mutt/1.11.3 (2019-02-01)

On Sun, Jan 24, 2021 at 02:08:29PM -0700, Nathan Chancellor wrote:
> On Wed, Jan 13, 2021 at 05:04:30PM +0800, Yang Weijiang wrote:
> > QEMU option -cpu max(max_features) means "Enables all features supported by
> > the accelerator in the current host", this looks true for all the features
> > except guest max physical address width, so add this patch to enable it.
> > 
> > Signed-off-by: Yang Weijiang <weijiang.yang@intel.com>
> > ---
> >  target/i386/cpu.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> > index 35459a38bb..b5943406f7 100644
> > --- a/target/i386/cpu.c
> > +++ b/target/i386/cpu.c
> > @@ -6673,7 +6673,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error 
> > **errp)
> >                  warned = true;
> >              }
> >  
> > -            if (cpu->host_phys_bits) {
> > +            if (cpu->host_phys_bits || cpu->max_features) {
> >                  /* The user asked for us to use the host physical bits */
> >                  cpu->phys_bits = host_phys_bits;
> >                  if (cpu->host_phys_bits_limit &&
> > -- 
> > 2.17.2
> > 
> > 
> 
> Hi,
> 
> This patch as commit 5a140b255d ("x86/cpu: Use max host physical address
> if -cpu max option is applied") prevents me from using '-cpu host' while
> booting an i386_defconfig kernel.
> 
> $ qemu-system-i386 \
> -append console=ttyS0 \
> -cpu host \
> -display none \
> -enable-kvm \
> -initrd rootfs.cpio \
> -kernel bzImage \
> -serial mon:stdio
> qemu-system-i386: phys-bits should be between 32 and 36  (but is 48)
> 
> Am I expected to pass "-cpu host,host-phys-bits=false" now or did this
> do something unexpected?
>
Hi, Nathan,
Could you try Paolo's latest patch?

[PULL 03/31] x86/cpu: Use max host physical address if -cpu max option is 
applied

diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 35459a38bb..72a79e6019 
100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -4319,6 +4319,7 @@ static void max_x86_cpu_initfn(Object *obj)
         if (lmce_supported()) {
             object_property_set_bool(OBJECT(cpu), "lmce", true, &error_abort);
         }
+        object_property_set_bool(OBJECT(cpu), "host-phys-bits", true,
+ &error_abort);
     } else {
         object_property_set_str(OBJECT(cpu), "vendor", CPUID_VENDOR_AMD,
                                 &error_abort);
> Cheers,
> Nathan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]