All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	qemu-devel@nongnu.org, Sander Eikelenboom <linux@eikelenboom.it>
Subject: Re: [Qemu-devel] [PATCH RFC] acpi: don't build acpi tables for xen hvm guests
Date: Thu, 27 Oct 2016 12:03:42 +0100	[thread overview]
Message-ID: <20161027110342.GY30231@citrix.com> (raw)
In-Reply-To: <20161027125402.63484b99@nial.brq.redhat.com>

Cc Sander

On Thu, Oct 27, 2016 at 12:54:02PM +0200, Igor Mammedov wrote:
> On Wed, 26 Oct 2016 16:22:34 +0100
> Wei Liu <wei.liu2@citrix.com> wrote:
> 
> > On Wed, Oct 26, 2016 at 05:09:52PM +0200, Igor Mammedov wrote:
> > > On Tue, 25 Oct 2016 18:28:04 +0100
> > > Wei Liu <wei.liu2@citrix.com> wrote:
> > >   
> > > > Xen's toolstack is in charge of building ACPI tables. Skip acpi table
> > > > building if running on Xen.
> > > > 
> > > > This issue is discovered due to direct kernel boot on Xen doesn't boot
> > > > anymore, because the new ACPI tables cause the guest to exceed its
> > > > memory allocation limit.
> > > > 
> > > > Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
> > > > Signed-off-by: Wei Liu <wei.liu2@citrix.com>  
> > > Question is:
> > > Why does xen guest get ACPI tables from QEMU instead of using
> > > Xen provided ones.
> > > Maybe it's firmware issue i.e. firmware side shouldn't load
> > > ACPI tables from QEMU provided fwcfg file and load Xen provided instead.
> > >   
> > 
> > It hasn't come to the point that the guest is booted. QEMU exits when
> > trying to populate some pages for the guest, at which point the guest
> > has not yet been started.  In a sense, Xen guest doesn't get ACPI from
> > QEMU because it never gets to that point.
> > 
> > Direct kernel boot causes fw_cfg to be filled in. pcms->has_acpi_build
> > defaults to true and acpi_enabled is also true. These make all checks in
> > acpi_setup pass. QEMU proceeds to build and load ACPI tables (which are
> > never going to be used by Xen guests), causing the guest to exceeds its
> > limit.
> > 
> > Wei.
> Would something like this fix issue for you?
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index a54a468..61b6026 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -1094,10 +1094,13 @@ DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa,
>  #ifdef CONFIG_XEN
>  static void xenfv_machine_options(MachineClass *m)
>  {
> +    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
> +
>      m->desc = "Xen Fully-virtualized PC";
>      m->max_cpus = HVM_MAX_VCPUS;
>      m->default_machine_opts = "accel=xen";
>      m->hot_add_cpu = pc_hot_add_cpu;
> +    pcmc->has_acpi_build = false;
>  }
>  
>  DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init,
> 

Yes, it does.

(I have a similar patch in my queue already)

Wei.

WARNING: multiple messages have this Message-ID (diff)
From: Wei Liu <wei.liu2@citrix.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	qemu-devel@nongnu.org, Sander Eikelenboom <linux@eikelenboom.it>,
	Anthony PERARD <anthony.perard@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [Qemu-devel] [PATCH RFC] acpi: don't build acpi tables for xen hvm guests
Date: Thu, 27 Oct 2016 12:03:42 +0100	[thread overview]
Message-ID: <20161027110342.GY30231@citrix.com> (raw)
In-Reply-To: <20161027125402.63484b99@nial.brq.redhat.com>

Cc Sander

On Thu, Oct 27, 2016 at 12:54:02PM +0200, Igor Mammedov wrote:
> On Wed, 26 Oct 2016 16:22:34 +0100
> Wei Liu <wei.liu2@citrix.com> wrote:
> 
> > On Wed, Oct 26, 2016 at 05:09:52PM +0200, Igor Mammedov wrote:
> > > On Tue, 25 Oct 2016 18:28:04 +0100
> > > Wei Liu <wei.liu2@citrix.com> wrote:
> > >   
> > > > Xen's toolstack is in charge of building ACPI tables. Skip acpi table
> > > > building if running on Xen.
> > > > 
> > > > This issue is discovered due to direct kernel boot on Xen doesn't boot
> > > > anymore, because the new ACPI tables cause the guest to exceed its
> > > > memory allocation limit.
> > > > 
> > > > Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
> > > > Signed-off-by: Wei Liu <wei.liu2@citrix.com>  
> > > Question is:
> > > Why does xen guest get ACPI tables from QEMU instead of using
> > > Xen provided ones.
> > > Maybe it's firmware issue i.e. firmware side shouldn't load
> > > ACPI tables from QEMU provided fwcfg file and load Xen provided instead.
> > >   
> > 
> > It hasn't come to the point that the guest is booted. QEMU exits when
> > trying to populate some pages for the guest, at which point the guest
> > has not yet been started.  In a sense, Xen guest doesn't get ACPI from
> > QEMU because it never gets to that point.
> > 
> > Direct kernel boot causes fw_cfg to be filled in. pcms->has_acpi_build
> > defaults to true and acpi_enabled is also true. These make all checks in
> > acpi_setup pass. QEMU proceeds to build and load ACPI tables (which are
> > never going to be used by Xen guests), causing the guest to exceeds its
> > limit.
> > 
> > Wei.
> Would something like this fix issue for you?
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index a54a468..61b6026 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -1094,10 +1094,13 @@ DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa,
>  #ifdef CONFIG_XEN
>  static void xenfv_machine_options(MachineClass *m)
>  {
> +    PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
> +
>      m->desc = "Xen Fully-virtualized PC";
>      m->max_cpus = HVM_MAX_VCPUS;
>      m->default_machine_opts = "accel=xen";
>      m->hot_add_cpu = pc_hot_add_cpu;
> +    pcmc->has_acpi_build = false;
>  }
>  
>  DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init,
> 

Yes, it does.

(I have a similar patch in my queue already)

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-10-27 11:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 17:28 [Qemu-devel] [PATCH RFC] acpi: don't build acpi tables for xen hvm guests Wei Liu
2016-10-25 23:33 ` Stefano Stabellini
2016-10-25 23:33 ` [Qemu-devel] " Stefano Stabellini
2016-10-26 10:32   ` Wei Liu
2016-10-26 10:32     ` Wei Liu
2016-10-26 14:26     ` Eduardo Habkost
2016-10-26 14:26     ` [Qemu-devel] " Eduardo Habkost
2016-10-26 15:09 ` Igor Mammedov
2016-10-26 15:09   ` Igor Mammedov
2016-10-26 15:22   ` Wei Liu
2016-10-26 15:22     ` Wei Liu
2016-10-26 21:27     ` Stefano Stabellini
2016-10-26 21:30       ` Stefano Stabellini
2016-10-26 21:30         ` Stefano Stabellini
2016-10-26 21:27     ` Stefano Stabellini
2016-10-27 10:54     ` Igor Mammedov
2016-10-27 10:54       ` Igor Mammedov
2016-10-27 11:03       ` Wei Liu [this message]
2016-10-27 11:03         ` Wei Liu
2016-10-27 11:10         ` Wei Liu
2016-10-27 11:10           ` Wei Liu
2016-10-27 11:26           ` [Qemu-devel] [Xen-devel] " Igor Mammedov
2016-10-27 11:29             ` Wei Liu
2016-10-27 13:02               ` Igor Mammedov
2016-10-27 13:02                 ` [Qemu-devel] " Igor Mammedov
2016-10-27 11:29             ` Wei Liu
2016-10-27 11:26           ` Igor Mammedov
2016-10-27 10:57     ` Igor Mammedov
2016-10-27 10:57       ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161027110342.GY30231@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=imammedo@redhat.com \
    --cc=linux@eikelenboom.it \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.