[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 22/77] hw/i386/pc: enable PVH only for machine type >
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 22/77] hw/i386/pc: enable PVH only for machine type >= 4.0 |
Date: |
Mon, 4 Feb 2019 19:35:24 +0100 |
From: Stefano Garzarella <address@hidden>
In order to avoid migration issues, we enable PVH only for
machine type >= 4.0
Suggested-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Stefano Garzarella <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
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 9efbd16..00166d1 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1220,7 +1220,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);
@@ -2783,6 +2784,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_hotplug_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 63c84e3..fd0f2c2 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 b7b7959..4a175ea 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 882fd8d..3ff127e 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -133,6 +133,9 @@ typedef struct PCMachineClass {
/* use DMA capable linuxboot option rom */
bool linuxboot_dma_enabled;
+
+ /* use PVH to load kernels that support this feature */
+ bool pvh_enabled;
} PCMachineClass;
#define TYPE_PC_MACHINE "generic-pc-machine"
--
1.8.3.1
- [Qemu-devel] [PULL 01/77] vhost-user-test: use g_cond_broadcast, (continued)
- [Qemu-devel] [PULL 01/77] vhost-user-test: use g_cond_broadcast, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 29/77] contrib/elf2dmp: use GLib in PDB processing, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 16/77] pvh: load initrd and expose it through fw_cfg, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 18/77] linuxboot_dma: move common functions in a new header, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 23/77] i386: remove the new CPUID 'PCONFIG' from Icelake-Server CPU model, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 30/77] contrib/elf2dmp: fix structures definitions, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 32/77] configure: enable elf2dmp build for Windows hosts, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 12/77] elf: Add optional function ptr to load_elf() to parse ELF notes, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 24/77] i386: remove the 'INTEL_PT' CPUID bit from named CPU models, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 26/77] target-i386: hvf: remove MPX support, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 22/77] hw/i386/pc: enable PVH only for machine type >= 4.0,
Paolo Bonzini <=
- [Qemu-devel] [PULL 28/77] contrib/elf2dmp: use GLib in ELF processing, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 19/77] optionrom: add new PVH option rom, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 21/77] optionrom/pvh: load initrd from fw_cfg, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 25/77] Revert "i386: Add CPUID bit for PCONFIG", Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 27/77] contrib/elf2dmp: fix elf.h including, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 15/77] pvh: Boot uncompressed kernel using direct boot ABI, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 37/77] hw/core/loader.c: Read as long as possible in load_image_size(), Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 40/77] docker: adjust Xen repository for CentOS 7, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 33/77] monitor: do not use QTAILQ_FOREACH_SAFE across critical sections, Paolo Bonzini, 2019/02/04
- [Qemu-devel] [PULL 38/77] i386: import & use bootparam.h, Paolo Bonzini, 2019/02/04