* [PATCH] hw/i386/isapc: Remove dead Xen code
@ 2025-11-23 18:58 Philippe Mathieu-Daudé
2025-11-24 10:14 ` Daniel P. Berrangé
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-11-23 18:58 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, David Woodhouse, Paul Durrant, Eduardo Habkost,
xen-devel, Anthony PERARD, Stefano Stabellini, Richard Henderson,
Michael S. Tsirkin, Mark Cave-Ayland, Marcel Apfelbaum,
Philippe Mathieu-Daudé
We don't use Xen on the isapc machine: let's remove
pointless code.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i386/isapc.c | 27 ++++-----------------------
1 file changed, 4 insertions(+), 23 deletions(-)
diff --git a/hw/i386/isapc.c b/hw/i386/isapc.c
index 1ba9ae22cc3..1e13a30c505 100644
--- a/hw/i386/isapc.c
+++ b/hw/i386/isapc.c
@@ -17,8 +17,6 @@
#include "hw/ide/ide-bus.h"
#include "system/kvm.h"
#include "hw/i386/kvm/clock.h"
-#include "hw/xen/xen-x86.h"
-#include "system/xen.h"
#include "hw/rtc/mc146818rtc.h"
#include "target/i386/cpu.h"
@@ -37,7 +35,6 @@ static void pc_init_isa(MachineState *machine)
ISABus *isa_bus;
uint32_t irq;
GSIState *gsi_state;
- MemoryRegion *ram_memory;
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
int i;
@@ -77,15 +74,9 @@ static void pc_init_isa(MachineState *machine)
/*
* There is no RAM split for the isapc machine
*/
- if (xen_enabled()) {
- xen_hvm_init_pc(pcms, &ram_memory);
- } else {
- ram_memory = machine->ram;
-
- pcms->max_ram_below_4g = 3.5 * GiB;
- x86ms->above_4g_mem_size = 0;
- x86ms->below_4g_mem_size = machine->ram_size;
- }
+ pcms->max_ram_below_4g = 3.5 * GiB;
+ x86ms->above_4g_mem_size = 0;
+ x86ms->below_4g_mem_size = machine->ram_size;
x86_cpus_init(x86ms, pcmc->default_cpu_version);
@@ -94,17 +85,7 @@ static void pc_init_isa(MachineState *machine)
}
/* allocate ram and load rom/bios */
- if (!xen_enabled()) {
- pc_memory_init(pcms, system_memory, system_memory, 0);
- } else {
- assert(machine->ram_size == x86ms->below_4g_mem_size +
- x86ms->above_4g_mem_size);
-
- if (machine->kernel_filename != NULL) {
- /* For xen HVM direct kernel boot, load linux here */
- xen_load_linux(pcms);
- }
- }
+ pc_memory_init(pcms, system_memory, system_memory, 0);
gsi_state = pc_gsi_create(&x86ms->gsi, false);
--
2.51.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] hw/i386/isapc: Remove dead Xen code
2025-11-23 18:58 [PATCH] hw/i386/isapc: Remove dead Xen code Philippe Mathieu-Daudé
@ 2025-11-24 10:14 ` Daniel P. Berrangé
2025-11-24 10:27 ` Mark Cave-Ayland
2025-11-24 10:52 ` Alex Bennée
2 siblings, 0 replies; 6+ messages in thread
From: Daniel P. Berrangé @ 2025-11-24 10:14 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Paolo Bonzini, David Woodhouse, Paul Durrant,
Eduardo Habkost, xen-devel, Anthony PERARD, Stefano Stabellini,
Richard Henderson, Michael S. Tsirkin, Mark Cave-Ayland,
Marcel Apfelbaum
On Sun, Nov 23, 2025 at 07:58:32PM +0100, Philippe Mathieu-Daudé wrote:
> We don't use Xen on the isapc machine: let's remove
> pointless code.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/i386/isapc.c | 27 ++++-----------------------
> 1 file changed, 4 insertions(+), 23 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] hw/i386/isapc: Remove dead Xen code
2025-11-23 18:58 [PATCH] hw/i386/isapc: Remove dead Xen code Philippe Mathieu-Daudé
2025-11-24 10:14 ` Daniel P. Berrangé
@ 2025-11-24 10:27 ` Mark Cave-Ayland
2025-11-24 11:07 ` Philippe Mathieu-Daudé
2025-11-24 10:52 ` Alex Bennée
2 siblings, 1 reply; 6+ messages in thread
From: Mark Cave-Ayland @ 2025-11-24 10:27 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Paolo Bonzini, David Woodhouse, Paul Durrant, Eduardo Habkost,
xen-devel, Anthony PERARD, Stefano Stabellini, Richard Henderson,
Michael S. Tsirkin, Marcel Apfelbaum
On 23/11/2025 18:58, Philippe Mathieu-Daudé wrote:
> We don't use Xen on the isapc machine: let's remove
> pointless code.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/i386/isapc.c | 27 ++++-----------------------
> 1 file changed, 4 insertions(+), 23 deletions(-)
>
> diff --git a/hw/i386/isapc.c b/hw/i386/isapc.c
> index 1ba9ae22cc3..1e13a30c505 100644
> --- a/hw/i386/isapc.c
> +++ b/hw/i386/isapc.c
> @@ -17,8 +17,6 @@
> #include "hw/ide/ide-bus.h"
> #include "system/kvm.h"
> #include "hw/i386/kvm/clock.h"
> -#include "hw/xen/xen-x86.h"
> -#include "system/xen.h"
> #include "hw/rtc/mc146818rtc.h"
> #include "target/i386/cpu.h"
>
> @@ -37,7 +35,6 @@ static void pc_init_isa(MachineState *machine)
> ISABus *isa_bus;
> uint32_t irq;
> GSIState *gsi_state;
> - MemoryRegion *ram_memory;
> DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
> int i;
>
> @@ -77,15 +74,9 @@ static void pc_init_isa(MachineState *machine)
> /*
> * There is no RAM split for the isapc machine
> */
> - if (xen_enabled()) {
> - xen_hvm_init_pc(pcms, &ram_memory);
> - } else {
> - ram_memory = machine->ram;
> -
> - pcms->max_ram_below_4g = 3.5 * GiB;
> - x86ms->above_4g_mem_size = 0;
> - x86ms->below_4g_mem_size = machine->ram_size;
> - }
> + pcms->max_ram_below_4g = 3.5 * GiB;
> + x86ms->above_4g_mem_size = 0;
> + x86ms->below_4g_mem_size = machine->ram_size;
>
> x86_cpus_init(x86ms, pcmc->default_cpu_version);
>
> @@ -94,17 +85,7 @@ static void pc_init_isa(MachineState *machine)
> }
>
> /* allocate ram and load rom/bios */
> - if (!xen_enabled()) {
> - pc_memory_init(pcms, system_memory, system_memory, 0);
> - } else {
> - assert(machine->ram_size == x86ms->below_4g_mem_size +
> - x86ms->above_4g_mem_size);
> -
> - if (machine->kernel_filename != NULL) {
> - /* For xen HVM direct kernel boot, load linux here */
> - xen_load_linux(pcms);
> - }
> - }
> + pc_memory_init(pcms, system_memory, system_memory, 0);
>
> gsi_state = pc_gsi_create(&x86ms->gsi, false);
FWIW I did contact upstream about this (see
https://patchew.org/QEMU/20250618112828.235087-1-mark.caveayland@nutanix.com/20250618112828.235087-13-mark.caveayland@nutanix.com/#91b96b24-af60-4a89-91ec-d0e660a76a0a@nutanix.com)
and they mentioned that it should work, which is why I left it in.
Unfortunately I don't currently have any way to test it here :/
ATB,
Mark.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] hw/i386/isapc: Remove dead Xen code
2025-11-23 18:58 [PATCH] hw/i386/isapc: Remove dead Xen code Philippe Mathieu-Daudé
2025-11-24 10:14 ` Daniel P. Berrangé
2025-11-24 10:27 ` Mark Cave-Ayland
@ 2025-11-24 10:52 ` Alex Bennée
2 siblings, 0 replies; 6+ messages in thread
From: Alex Bennée @ 2025-11-24 10:52 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Paolo Bonzini, David Woodhouse, Paul Durrant,
Eduardo Habkost, xen-devel, Anthony PERARD, Stefano Stabellini,
Richard Henderson, Michael S. Tsirkin, Mark Cave-Ayland,
Marcel Apfelbaum
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> We don't use Xen on the isapc machine: let's remove
> pointless code.
Are you sure about this? The older Xen config did support:
isa
Simulate an ISA only system
isa (Default=0; Value='no|yes')
I don't know why anyone would want a ISA capable HVM machine these days
but I would at least want to know when Xen dropped this as an option in
the commit message.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/i386/isapc.c | 27 ++++-----------------------
> 1 file changed, 4 insertions(+), 23 deletions(-)
>
> diff --git a/hw/i386/isapc.c b/hw/i386/isapc.c
> index 1ba9ae22cc3..1e13a30c505 100644
> --- a/hw/i386/isapc.c
> +++ b/hw/i386/isapc.c
> @@ -17,8 +17,6 @@
> #include "hw/ide/ide-bus.h"
> #include "system/kvm.h"
> #include "hw/i386/kvm/clock.h"
> -#include "hw/xen/xen-x86.h"
> -#include "system/xen.h"
> #include "hw/rtc/mc146818rtc.h"
> #include "target/i386/cpu.h"
>
> @@ -37,7 +35,6 @@ static void pc_init_isa(MachineState *machine)
> ISABus *isa_bus;
> uint32_t irq;
> GSIState *gsi_state;
> - MemoryRegion *ram_memory;
> DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
> int i;
>
> @@ -77,15 +74,9 @@ static void pc_init_isa(MachineState *machine)
> /*
> * There is no RAM split for the isapc machine
> */
> - if (xen_enabled()) {
> - xen_hvm_init_pc(pcms, &ram_memory);
> - } else {
> - ram_memory = machine->ram;
> -
> - pcms->max_ram_below_4g = 3.5 * GiB;
> - x86ms->above_4g_mem_size = 0;
> - x86ms->below_4g_mem_size = machine->ram_size;
> - }
> + pcms->max_ram_below_4g = 3.5 * GiB;
> + x86ms->above_4g_mem_size = 0;
> + x86ms->below_4g_mem_size = machine->ram_size;
>
> x86_cpus_init(x86ms, pcmc->default_cpu_version);
>
> @@ -94,17 +85,7 @@ static void pc_init_isa(MachineState *machine)
> }
>
> /* allocate ram and load rom/bios */
> - if (!xen_enabled()) {
> - pc_memory_init(pcms, system_memory, system_memory, 0);
> - } else {
> - assert(machine->ram_size == x86ms->below_4g_mem_size +
> - x86ms->above_4g_mem_size);
> -
> - if (machine->kernel_filename != NULL) {
> - /* For xen HVM direct kernel boot, load linux here */
> - xen_load_linux(pcms);
> - }
> - }
> + pc_memory_init(pcms, system_memory, system_memory, 0);
>
> gsi_state = pc_gsi_create(&x86ms->gsi, false);
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] hw/i386/isapc: Remove dead Xen code
2025-11-24 10:27 ` Mark Cave-Ayland
@ 2025-11-24 11:07 ` Philippe Mathieu-Daudé
2025-11-24 13:36 ` Alex Bennée
0 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-11-24 11:07 UTC (permalink / raw)
To: Mark Cave-Ayland, qemu-devel
Cc: Paolo Bonzini, David Woodhouse, Paul Durrant, Eduardo Habkost,
xen-devel, Anthony PERARD, Stefano Stabellini, Richard Henderson,
Michael S. Tsirkin, Marcel Apfelbaum
On 24/11/25 11:27, Mark Cave-Ayland wrote:
> On 23/11/2025 18:58, Philippe Mathieu-Daudé wrote:
>
>> We don't use Xen on the isapc machine: let's remove
>> pointless code.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> hw/i386/isapc.c | 27 ++++-----------------------
>> 1 file changed, 4 insertions(+), 23 deletions(-)
>>
>> diff --git a/hw/i386/isapc.c b/hw/i386/isapc.c
>> index 1ba9ae22cc3..1e13a30c505 100644
>> --- a/hw/i386/isapc.c
>> +++ b/hw/i386/isapc.c
>> @@ -17,8 +17,6 @@
>> #include "hw/ide/ide-bus.h"
>> #include "system/kvm.h"
>> #include "hw/i386/kvm/clock.h"
>> -#include "hw/xen/xen-x86.h"
>> -#include "system/xen.h"
>> #include "hw/rtc/mc146818rtc.h"
>> #include "target/i386/cpu.h"
>> @@ -37,7 +35,6 @@ static void pc_init_isa(MachineState *machine)
>> ISABus *isa_bus;
>> uint32_t irq;
>> GSIState *gsi_state;
>> - MemoryRegion *ram_memory;
>> DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
>> int i;
>> @@ -77,15 +74,9 @@ static void pc_init_isa(MachineState *machine)
>> /*
>> * There is no RAM split for the isapc machine
>> */
>> - if (xen_enabled()) {
>> - xen_hvm_init_pc(pcms, &ram_memory);
>> - } else {
>> - ram_memory = machine->ram;
>> -
>> - pcms->max_ram_below_4g = 3.5 * GiB;
>> - x86ms->above_4g_mem_size = 0;
>> - x86ms->below_4g_mem_size = machine->ram_size;
>> - }
>> + pcms->max_ram_below_4g = 3.5 * GiB;
>> + x86ms->above_4g_mem_size = 0;
>> + x86ms->below_4g_mem_size = machine->ram_size;
>> x86_cpus_init(x86ms, pcmc->default_cpu_version);
>> @@ -94,17 +85,7 @@ static void pc_init_isa(MachineState *machine)
>> }
>> /* allocate ram and load rom/bios */
>> - if (!xen_enabled()) {
>> - pc_memory_init(pcms, system_memory, system_memory, 0);
>> - } else {
>> - assert(machine->ram_size == x86ms->below_4g_mem_size +
>> - x86ms->above_4g_mem_size);
>> -
>> - if (machine->kernel_filename != NULL) {
>> - /* For xen HVM direct kernel boot, load linux here */
>> - xen_load_linux(pcms);
>> - }
>> - }
>> + pc_memory_init(pcms, system_memory, system_memory, 0);
>> gsi_state = pc_gsi_create(&x86ms->gsi, false);
>
> FWIW I did contact upstream about this (see https://patchew.org/
> QEMU/20250618112828.235087-1-
> mark.caveayland@nutanix.com/20250618112828.235087-13-
> mark.caveayland@nutanix.com/#91b96b24-af60-4a89-91ec-
> d0e660a76a0a@nutanix.com) and they mentioned that it should work, which
> is why I left it in.
>
> Unfortunately I don't currently have any way to test it here :/
OK :| IMHO upstream Xen maintainers should provide us a test, otherwise
we can not make our code base evolve.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] hw/i386/isapc: Remove dead Xen code
2025-11-24 11:07 ` Philippe Mathieu-Daudé
@ 2025-11-24 13:36 ` Alex Bennée
0 siblings, 0 replies; 6+ messages in thread
From: Alex Bennée @ 2025-11-24 13:36 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Mark Cave-Ayland, qemu-devel, Paolo Bonzini, David Woodhouse,
Paul Durrant, Eduardo Habkost, xen-devel, Anthony PERARD,
Stefano Stabellini, Richard Henderson, Michael S. Tsirkin,
Marcel Apfelbaum
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> On 24/11/25 11:27, Mark Cave-Ayland wrote:
>> On 23/11/2025 18:58, Philippe Mathieu-Daudé wrote:
>>
>>> We don't use Xen on the isapc machine: let's remove
>>> pointless code.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> ---
>>> hw/i386/isapc.c | 27 ++++-----------------------
>>> 1 file changed, 4 insertions(+), 23 deletions(-)
>>>
>>> diff --git a/hw/i386/isapc.c b/hw/i386/isapc.c
>>> index 1ba9ae22cc3..1e13a30c505 100644
>>> --- a/hw/i386/isapc.c
>>> +++ b/hw/i386/isapc.c
>>> @@ -17,8 +17,6 @@
>>> #include "hw/ide/ide-bus.h"
>>> #include "system/kvm.h"
>>> #include "hw/i386/kvm/clock.h"
>>> -#include "hw/xen/xen-x86.h"
>>> -#include "system/xen.h"
>>> #include "hw/rtc/mc146818rtc.h"
>>> #include "target/i386/cpu.h"
>>> @@ -37,7 +35,6 @@ static void pc_init_isa(MachineState *machine)
>>> ISABus *isa_bus;
>>> uint32_t irq;
>>> GSIState *gsi_state;
>>> - MemoryRegion *ram_memory;
>>> DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
>>> int i;
>>> @@ -77,15 +74,9 @@ static void pc_init_isa(MachineState *machine)
>>> /*
>>> * There is no RAM split for the isapc machine
>>> */
>>> - if (xen_enabled()) {
>>> - xen_hvm_init_pc(pcms, &ram_memory);
>>> - } else {
>>> - ram_memory = machine->ram;
>>> -
>>> - pcms->max_ram_below_4g = 3.5 * GiB;
>>> - x86ms->above_4g_mem_size = 0;
>>> - x86ms->below_4g_mem_size = machine->ram_size;
>>> - }
>>> + pcms->max_ram_below_4g = 3.5 * GiB;
>>> + x86ms->above_4g_mem_size = 0;
>>> + x86ms->below_4g_mem_size = machine->ram_size;
>>> x86_cpus_init(x86ms, pcmc->default_cpu_version);
>>> @@ -94,17 +85,7 @@ static void pc_init_isa(MachineState *machine)
>>> }
>>> /* allocate ram and load rom/bios */
>>> - if (!xen_enabled()) {
>>> - pc_memory_init(pcms, system_memory, system_memory, 0);
>>> - } else {
>>> - assert(machine->ram_size == x86ms->below_4g_mem_size +
>>> - x86ms->above_4g_mem_size);
>>> -
>>> - if (machine->kernel_filename != NULL) {
>>> - /* For xen HVM direct kernel boot, load linux here */
>>> - xen_load_linux(pcms);
>>> - }
>>> - }
>>> + pc_memory_init(pcms, system_memory, system_memory, 0);
>>> gsi_state = pc_gsi_create(&x86ms->gsi, false);
>> FWIW I did contact upstream about this (see https://patchew.org/
>> QEMU/20250618112828.235087-1-
>> mark.caveayland@nutanix.com/20250618112828.235087-13-
>> mark.caveayland@nutanix.com/#91b96b24-af60-4a89-91ec-
>> d0e660a76a0a@nutanix.com) and they mentioned that it should work,
>> which is why I left it in.
>> Unfortunately I don't currently have any way to test it here :/
>
> OK :| IMHO upstream Xen maintainers should provide us a test, otherwise
> we can not make our code base evolve.
Ok how about this:
As of the xen commit 9e8672f1c36 (tools: remove xend and associated
python modules) there is no longer the ability to emulate an ISA only
system. As a result we can drop the code in isapc. We still need to
support the ISA bus for the -m pc type as Xen doesn't support the q35
machine model for HVM.
I think the actual support got removed earlier but this was when the
last bits of "Simulate an ISA only system" where removed in 2013.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-11-24 13:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-23 18:58 [PATCH] hw/i386/isapc: Remove dead Xen code Philippe Mathieu-Daudé
2025-11-24 10:14 ` Daniel P. Berrangé
2025-11-24 10:27 ` Mark Cave-Ayland
2025-11-24 11:07 ` Philippe Mathieu-Daudé
2025-11-24 13:36 ` Alex Bennée
2025-11-24 10:52 ` Alex Bennée
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).