From: Liam Merwick <liam.merwick@oracle.com>
To: Stefano Garzarella <sgarzare@redhat.com>, qemu-devel@nongnu.org
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Richard Henderson <rth@twiddle.net>,
"Michael S. Tsirkin" <mst@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] hw/i386/pc: enable PVH only for machine type >= 4.0
Date: Tue, 22 Jan 2019 12:19:57 +0000 [thread overview]
Message-ID: <0e6e97a2-c029-bbbe-7a9d-009e1f8f20cc@oracle.com> (raw)
In-Reply-To: <20190122121048.76469-1-sgarzare@redhat.com>
On 22/01/2019 12:10, Stefano Garzarella wrote:
> In order to avoid migration issues, we enable PVH only for
> machine type >= 4.0
>
> Suggested-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
> ---
> Based-on: <1548093980-43088-1-git-send-email-pbonzini@redhat.com>
>
> hw/i386/pc.c | 4 +++-
> hw/i386/pc_piix.c | 3 +++
> hw/i386/pc_q35.c | 3 +++
> include/hw/i386/pc.h | 3 +++
> 4 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 2833b130ba..3be4a06c4f 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -1211,7 +1211,8 @@ static void load_linux(PCMachineState *pcms,
> * saving the PVH entry point used by the x86/HVM direct boot ABI.
> * If load_elfboot() is successful, populate the fw_cfg info.
> */
> - if (load_elfboot(kernel_filename, kernel_size,
> + if (pcmc->pvh_enabled &&
> + load_elfboot(kernel_filename, kernel_size,
> header, pvh_start_addr, fw_cfg)) {
> fclose(f);
>
> @@ -2774,6 +2775,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
> pcmc->acpi_data_size = 0x20000 + 0x8000;
> pcmc->save_tsc_khz = true;
> pcmc->linuxboot_dma_enabled = true;
> + pcmc->pvh_enabled = true;
> assert(!mc->get_hotplug_handler);
> mc->get_hotplug_handler = pc_get_hotpug_handler;
> mc->cpu_index_to_instance_props = pc_cpu_index_to_props;
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 5088e2f492..a51b83e50e 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -440,9 +440,12 @@ DEFINE_I440FX_MACHINE(v4_0, "pc-i440fx-4.0", NULL,
>
> static void pc_i440fx_3_1_machine_options(MachineClass *m)
> {
> + PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
> +
> pc_i440fx_4_0_machine_options(m);
> m->is_default = 0;
> m->alias = NULL;
> + pcmc->pvh_enabled = false;
> compat_props_add(m->compat_props, hw_compat_3_1, hw_compat_3_1_len);
> compat_props_add(m->compat_props, pc_compat_3_1, pc_compat_3_1_len);
> }
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index b7b7959934..4a175ea50e 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -376,9 +376,12 @@ DEFINE_Q35_MACHINE(v4_0, "pc-q35-4.0", NULL,
>
> static void pc_q35_3_1_machine_options(MachineClass *m)
> {
> + PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
> +
> pc_q35_4_0_machine_options(m);
> m->default_kernel_irqchip_split = false;
> m->alias = NULL;
> + pcmc->pvh_enabled = false;
> compat_props_add(m->compat_props, hw_compat_3_1, hw_compat_3_1_len);
> compat_props_add(m->compat_props, pc_compat_3_1, pc_compat_3_1_len);
> }
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 0abbe45637..e4e2c1352d 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -133,6 +133,9 @@ struct PCMachineClass {
>
> /* use DMA capable linuxboot option rom */
> bool linuxboot_dma_enabled;
> +
> + /* use PVH to load kernels that support this feature */
> + bool pvh_enabled;
> };
>
> #define TYPE_PC_MACHINE "generic-pc-machine"
>
next prev parent reply other threads:[~2019-01-22 19:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 12:10 [Qemu-devel] [PATCH] hw/i386/pc: enable PVH only for machine type >= 4.0 Stefano Garzarella
2019-01-22 12:19 ` Liam Merwick [this message]
2019-01-22 15:23 ` Eduardo Habkost
2019-01-22 16:30 ` Stefan Hajnoczi
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=0e6e97a2-c029-bbbe-7a9d-009e1f8f20cc@oracle.com \
--to=liam.merwick@oracle.com \
--cc=ehabkost@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=sgarzare@redhat.com \
--cc=stefanha@redhat.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).