Re: [PATCH v2 02/10] hw/i386/pc: Remove PCMachineClass::pvh_enabled field

2026-03-10 Thread Zhao Liu
On Mon, Mar 09, 2026 at 03:50:04PM +0100, Philippe Mathieu-Daudé wrote:
> Date: Mon,  9 Mar 2026 15:50:04 +0100
> From: Philippe Mathieu-Daudé 
> Subject: [PATCH v2 02/10] hw/i386/pc: Remove PCMachineClass::pvh_enabled
>  field
> X-Mailer: git-send-email 2.53.0
> 
> The PCMachineClass::pvh_enabled boolean was only used by
> the pc-q35-3.1 and pc-i440fx-3.1 machines, which got removed.
> Remove it.
> 
> Signed-off-by: Philippe Mathieu-Daudé 
> Reviewed-by: Thomas Huth 
> Message-Id: <[email protected]>
> ---
>  include/hw/i386/pc.h | 3 ---
>  hw/i386/pc.c | 6 ++
>  hw/i386/x86-common.c | 3 +--
>  3 files changed, 3 insertions(+), 9 deletions(-)

Reviewed-by: Zhao Liu 




[PATCH v2 02/10] hw/i386/pc: Remove PCMachineClass::pvh_enabled field

2026-03-09 Thread Philippe Mathieu-Daudé
The PCMachineClass::pvh_enabled boolean was only used by
the pc-q35-3.1 and pc-i440fx-3.1 machines, which got removed.
Remove it.

Signed-off-by: Philippe Mathieu-Daudé 
Reviewed-by: Thomas Huth 
Message-Id: <[email protected]>
---
 include/hw/i386/pc.h | 3 ---
 hw/i386/pc.c | 6 ++
 hw/i386/x86-common.c | 3 +--
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 5623660f5dd..908de5e1eab 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -110,9 +110,6 @@ struct PCMachineClass {
 bool enforce_amd_1tb_hole;
 bool isa_bios_alias;
 
-/* use PVH to load kernels that support this feature */
-bool pvh_enabled;
-
 /* create kvmclock device even when KVM PV features are not exposed */
 bool kvmclock_create_always;
 
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 052226baa57..3fc2f0a057e 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -588,7 +588,6 @@ void xen_load_linux(PCMachineState *pcms)
 {
 int i;
 FWCfgState *fw_cfg;
-PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
 X86MachineState *x86ms = X86_MACHINE(pcms);
 
 assert(MACHINE(pcms)->kernel_filename != NULL);
@@ -598,7 +597,7 @@ void xen_load_linux(PCMachineState *pcms)
 fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus);
 rom_set_fw(fw_cfg);
 
-x86_load_linux(x86ms, fw_cfg, PC_FW_DATA, pcmc->pvh_enabled);
+x86_load_linux(x86ms, fw_cfg, PC_FW_DATA, true);
 for (i = 0; i < nb_option_roms; i++) {
 assert(!strcmp(option_rom[i].name, "linuxboot_dma.bin") ||
!strcmp(option_rom[i].name, "pvh.bin") ||
@@ -932,7 +931,7 @@ void pc_memory_init(PCMachineState *pcms,
 }
 
 if (linux_boot) {
-x86_load_linux(x86ms, fw_cfg, PC_FW_DATA, pcmc->pvh_enabled);
+x86_load_linux(x86ms, fw_cfg, PC_FW_DATA, true);
 }
 
 for (i = 0; i < nb_option_roms; i++) {
@@ -1673,7 +1672,6 @@ static void pc_machine_class_init(ObjectClass *oc, const 
void *data)
 pcmc->has_reserved_memory = true;
 pcmc->enforce_amd_1tb_hole = true;
 pcmc->isa_bios_alias = true;
-pcmc->pvh_enabled = true;
 pcmc->kvmclock_create_always = true;
 x86mc->apic_xrupt_override = true;
 assert(!mc->get_hotplug_handler);
diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
index a420112666a..db8d4e855f4 100644
--- a/hw/i386/x86-common.c
+++ b/hw/i386/x86-common.c
@@ -704,8 +704,7 @@ void x86_load_linux(X86MachineState *x86ms,
  * saving the PVH entry point used by the x86/HVM direct boot ABI.
  * If load_elfboot() is successful, populate the fw_cfg info.
  */
-if (pvh_enabled &&
-load_elfboot(kernel_filename, kernel_size,
+if (load_elfboot(kernel_filename, kernel_size,
  header, pvh_start_addr, fw_cfg)) {
 fclose(f);
 
-- 
2.53.0