qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	xen-devel@lists.xensource.com,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Ian.Jackson@eu.citrix.com, qemu-devel@nongnu.org,
	Chunyan Liu <cyliu@suse.com>, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH V4 2/2] qemu: support xen hvm direct kernel boot
Date: Wed, 2 Jul 2014 18:15:00 +0300	[thread overview]
Message-ID: <20140702151500.GA6649@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1407021517210.8923@kaball.uk.xensource.com>

On Wed, Jul 02, 2014 at 03:18:56PM +0100, Stefano Stabellini wrote:
> On Tue, 1 Jul 2014, Chunyan Liu wrote:
> > qemu side patch to support xen HVM direct kernel boot:
> > if -kernel exists, calls xen_load_linux(), which will read kernel/initrd
> > and add a linuxboot.bin or multiboot.bin option rom. The
> > linuxboot.bin/multiboot.bin will load kernel/initrd and jump to execute
> > kernel directly. It's working when xen uses seabios.
> > 
> > During this work, found the 'kvmvapic' is in option_rom list, it should
> > not be there in xen case. Set s->vapic_control = 0 in xen_apic_realize()
> > to handle that.

I would make this one a separate patch, it's mixing
bugfixes with features.
But up to you.


> > Signed-off-by: Chunyan Liu <cyliu@suse.com>
> 
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> Michael, Paolo, are you happy with this patch?
> If so, I am going to add it to my queue, unless you want to take it?

Pls go ahead.

Acked-by: Michael S. Tsirkin <mst@redhat.com>



> 
> > Changes to v3:
> >   - add assertion before adding option rom as Stefan suggests
> > 
> >  hw/i386/pc.c           | 25 +++++++++++++++++++++++++
> >  hw/i386/pc_piix.c      |  7 +++++++
> >  hw/i386/xen/xen_apic.c |  1 +
> >  include/hw/i386/pc.h   |  5 +++++
> >  4 files changed, 38 insertions(+)
> > 
> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > index 2cf22b1..9e58982 100644
> > --- a/hw/i386/pc.c
> > +++ b/hw/i386/pc.c
> > @@ -1190,6 +1190,31 @@ void pc_acpi_init(const char *default_dsdt)
> >      }
> >  }
> >  
> > +FWCfgState *xen_load_linux(const char *kernel_filename,
> > +                           const char *kernel_cmdline,
> > +                           const char *initrd_filename,
> > +                           ram_addr_t below_4g_mem_size,
> > +                           PcGuestInfo *guest_info)
> > +{
> > +    int i;
> > +    FWCfgState *fw_cfg;
> > +
> > +    assert(kernel_filename != NULL);
> > +
> > +    fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
> > +    rom_set_fw(fw_cfg);
> > +
> > +    load_linux(fw_cfg, kernel_filename, initrd_filename,
> > +               kernel_cmdline, below_4g_mem_size);
> > +    for (i = 0; i < nb_option_roms; i++) {
> > +        assert(!strcmp(option_rom[i].name, "linuxboot.bin") ||
> > +               !strcmp(option_rom[i].name, "multiboot.bin"));
> > +        rom_add_option(option_rom[i].name, option_rom[i].bootindex);
> > +    }
> > +    guest_info->fw_cfg = fw_cfg;
> > +    return fw_cfg;
> > +}
> > +
> >  FWCfgState *pc_memory_init(MachineState *machine,
> >                             MemoryRegion *system_memory,
> >                             ram_addr_t below_4g_mem_size,
> > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> > index 2dccb34..63e2198 100644
> > --- a/hw/i386/pc_piix.c
> > +++ b/hw/i386/pc_piix.c
> > @@ -180,6 +180,13 @@ static void pc_init1(MachineState *machine,
> >          fw_cfg = pc_memory_init(machine, system_memory,
> >                                  below_4g_mem_size, above_4g_mem_size,
> >                                  rom_memory, &ram_memory, guest_info);
> > +    } else if (machine->kernel_filename != NULL) {
> > +        /* For xen HVM direct kernel boot, load linux here */
> > +        fw_cfg = xen_load_linux(machine->kernel_filename,
> > +                                machine->kernel_cmdline,
> > +                                machine->initrd_filename,
> > +                                below_4g_mem_size,
> > +                                guest_info);
> >      }
> >  
> >      gsi_state = g_malloc0(sizeof(*gsi_state));
> > diff --git a/hw/i386/xen/xen_apic.c b/hw/i386/xen/xen_apic.c
> > index 63bb7f7..f5acd6a 100644
> > --- a/hw/i386/xen/xen_apic.c
> > +++ b/hw/i386/xen/xen_apic.c
> > @@ -40,6 +40,7 @@ static void xen_apic_realize(DeviceState *dev, Error **errp)
> >  {
> >      APICCommonState *s = APIC_COMMON(dev);
> >  
> > +    s->vapic_control = 0;
> >      memory_region_init_io(&s->io_memory, OBJECT(s), &xen_apic_io_ops, s,
> >                            "xen-apic-msi", APIC_SPACE_SIZE);
> >  
> > diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> > index 1c0c382..b47aaa9 100644
> > --- a/include/hw/i386/pc.h
> > +++ b/include/hw/i386/pc.h
> > @@ -187,6 +187,11 @@ PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size,
> >  void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
> >                              MemoryRegion *pci_address_space);
> >  
> > +FWCfgState *xen_load_linux(const char *kernel_filename,
> > +                           const char *kernel_cmdline,
> > +                           const char *initrd_filename,
> > +                           ram_addr_t below_4g_mem_size,
> > +                           PcGuestInfo *guest_info);
> >  FWCfgState *pc_memory_init(MachineState *machine,
> >                             MemoryRegion *system_memory,
> >                             ram_addr_t below_4g_mem_size,
> > -- 
> > 1.8.4.5
> > 

      reply	other threads:[~2014-07-02 15:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01  7:05 [Qemu-devel] [RFC PATCH V4 0/2] Support xen HVM direct kernel boot Chunyan Liu
2014-07-01  7:06 ` [Qemu-devel] [RFC PATCH V4 1/2] xen: pass kernel initrd to qemu Chunyan Liu
2014-07-02 14:47   ` Ian Campbell
2014-06-20  6:03     ` [Qemu-devel] [RFC PATCH V3 0/2] support xen HVM direct kernel boot Chunyan Liu
2014-06-20  6:03       ` [Qemu-devel] [RFC PATCH V3 1/2] xen: pass kernel initrd to qemu Chunyan Liu
2014-06-23 14:22         ` Ian Jackson
2014-06-24  3:24           ` [Qemu-devel] [Xen-devel] " Chun Yan Liu
2014-07-02 14:40           ` [Qemu-devel] " Ian Campbell
2014-07-02 15:17             ` [Qemu-devel] [RFC PATCH V3 1/2] xen: pass kernel initrd to qemu [and 1 more messages] Ian Jackson
2014-07-03  5:56               ` [Qemu-devel] [Xen-devel] " Chun Yan Liu
2014-07-03  9:08                 ` Ian Campbell
2014-06-20  6:03       ` [Qemu-devel] [RFC PATCH V3 2/2] qemu: support xen hvm direct kernel boot Chunyan Liu
2014-06-20 12:08         ` Stefano Stabellini
2014-06-23  3:36           ` [Qemu-devel] [Xen-devel] " Chun Yan Liu
2014-06-23 10:14             ` Stefano Stabellini
2014-06-24  2:27               ` Chun Yan Liu
2014-07-02 15:16   ` [Qemu-devel] [RFC PATCH V4 1/2] xen: pass kernel initrd to qemu Ian Campbell
2014-07-03  2:34     ` [Qemu-devel] [Xen-devel] " Chun Yan Liu
2014-07-03  8:57       ` Ian Campbell
2014-07-01  7:06 ` [Qemu-devel] [RFC PATCH V4 2/2] qemu: support xen hvm direct kernel boot Chunyan Liu
2014-07-02 14:18   ` Stefano Stabellini
2014-07-02 15:15     ` Michael S. Tsirkin [this message]

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=20140702151500.GA6649@redhat.com \
    --to=mst@redhat.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=cyliu@suse.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).