[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 21/23] pc/q35: setup q35 for xen
From: |
Joel Upham |
Subject: |
[PATCH v1 21/23] pc/q35: setup q35 for xen |
Date: |
Tue, 20 Jun 2023 13:24:55 -0400 |
Mirrored the init done for piix devices when xen is being used.
This is needed for xen memory to be initialized and used with q35.
Signed-off-by: Joel Upham <jupham125@gmail.com>
---
hw/i386/pc_q35.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 789a23ce6b..0b53a86dd2 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -145,6 +145,7 @@ static void pc_q35_init(MachineState *machine)
MemoryRegion *system_io = get_system_io();
MemoryRegion *pci_memory;
MemoryRegion *rom_memory;
+ MemoryRegion *ram_memory;
GSIState *gsi_state;
ISABus *isa_bus;
int i;
@@ -196,8 +197,12 @@ static void pc_q35_init(MachineState *machine)
}
pc_machine_init_sgx_epc(pcms);
- x86_cpus_init(x86ms, pcmc->default_cpu_version);
+ x86_cpus_init(x86ms, pcmc->default_cpu_version);
+ if (xen_enabled()) {
+ xen_hvm_init_pc(pcms, &ram_memory);
+ machine->ram = ram_memory;
+ }
kvmclock_create(pcmc->kvmclock_create_always);
/* pci enabled */
@@ -230,7 +235,15 @@ static void pc_q35_init(MachineState *machine)
}
/* allocate ram and load rom/bios */
- pc_memory_init(pcms, system_memory, rom_memory, pci_hole64_size);
+ if (!xen_enabled())
+ pc_memory_init(pcms, system_memory, rom_memory, pci_hole64_size);
+ else {
+ pc_system_flash_cleanup_unused(pcms);
+ if (machine->kernel_filename != NULL) {
+ /* For xen HVM direct kernel boot, load linux here */
+ xen_load_linux(pcms);
+ }
+ }
object_property_add_child(OBJECT(machine), "q35", OBJECT(q35_host));
object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_RAM_MEM,
@@ -307,7 +320,7 @@ static void pc_q35_init(MachineState *machine)
assert(pcms->vmport != ON_OFF_AUTO__MAX);
if (pcms->vmport == ON_OFF_AUTO_AUTO) {
- pcms->vmport = ON_OFF_AUTO_ON;
+ pcms->vmport = xen_enabled() ? ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON;
}
/* init basic PC hardware */
--
2.34.1
- Re: [PATCH v1 03/23] q35/acpi/xen: Provide ACPI PCI hotplug interface for Xen on Q35, (continued)
- [PATCH v1 04/23] q35/xen: Add Xen platform device support for Q35, Joel Upham, 2023/06/20
- [PATCH v1 05/23] q35: Fix incorrect values for PCIEXBAR masks, Joel Upham, 2023/06/20
- [PATCH v1 11/23] xen/pt: handle PCIe Extended Capabilities Next register, Joel Upham, 2023/06/20
- [PATCH v1 14/23] xen/pt: add fixed-size PCIe Extended Capabilities descriptors, Joel Upham, 2023/06/20
- [PATCH v1 16/23] xen/pt: add descriptors and size calculation for RCLD/ACS/PMUX/DPA/MCAST/TPH/DPC PCIe Extended Capabilities, Joel Upham, 2023/06/20
- [PATCH v1 19/23] xen/pt: Fake capability id, Joel Upham, 2023/06/20
- [PATCH v1 22/23] qdev-monitor/pt: bypass root device check, Joel Upham, 2023/06/20
- [PATCH v1 09/23] xen/pt: Xen PCIe passthrough support for Q35: bypass PCIe topology check, Joel Upham, 2023/06/20
- [PATCH v1 08/23] xen/pt: determine the legacy/PCIe mode for a passed through device, Joel Upham, 2023/06/20
- [PATCH v1 21/23] pc/q35: setup q35 for xen,
Joel Upham <=
- [PATCH v1 23/23] s3 support: enabling s3 with q35, Joel Upham, 2023/06/20
- [PATCH v1 06/23] xen/pt: XenHostPCIDevice: provide functions for PCI Capabilities and PCIe Extended Capabilities enumeration, Joel Upham, 2023/06/20
- [PATCH v1 13/23] xen/pt: add Vendor-specific PCIe Extended Capability descriptor and sizing, Joel Upham, 2023/06/20
- Re: [PATCH v1 00/23] Q35 support for Xen, Bernhard Beschow, 2023/06/22