[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 05/22] xen-platform-pci: allow its creation with XEN_EMULA
From: |
David Woodhouse |
Subject: |
[RFC PATCH v2 05/22] xen-platform-pci: allow its creation with XEN_EMULATE mode |
Date: |
Fri, 9 Dec 2022 09:55:55 +0000 |
From: Joao Martins <joao.m.martins@oracle.com>
The only thing we need to handle on KVM side is to change the
pfn from R/W to R/O.
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
hw/i386/xen/xen_platform.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index a64265cca0..914619d140 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -271,7 +271,10 @@ static void platform_fixed_ioport_writeb(void *opaque,
uint32_t addr, uint32_t v
case 0: /* Platform flags */ {
hvmmem_type_t mem_type = (val & PFFLAG_ROM_LOCK) ?
HVMMEM_ram_ro : HVMMEM_ram_rw;
- if (xen_set_mem_type(xen_domid, mem_type, 0xc0, 0x40)) {
+ if (xen_mode == XEN_EMULATE) {
+ /* XXX */
+ s->flags = val & PFFLAG_ROM_LOCK;
+ } else if (xen_set_mem_type(xen_domid, mem_type, 0xc0, 0x40)) {
DPRINTF("unable to change ro/rw state of ROM memory area!\n");
} else {
s->flags = val & PFFLAG_ROM_LOCK;
@@ -496,12 +499,6 @@ static void xen_platform_realize(PCIDevice *dev, Error
**errp)
PCIXenPlatformState *d = XEN_PLATFORM(dev);
uint8_t *pci_conf;
- /* Device will crash on reset if xen is not initialized */
- if (!xen_enabled()) {
- error_setg(errp, "xen-platform device requires the Xen accelerator");
- return;
- }
-
pci_conf = dev->config;
pci_set_word(pci_conf + PCI_COMMAND, PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
--
2.35.3
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, (continued)
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, Paul Durrant, 2022/12/20
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/20
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, Paul Durrant, 2022/12/20
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/20
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/28
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/20
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, Paul Durrant, 2022/12/21
- Re: [RFC PATCH v2 20/22] i386/xen: HVMOP_set_param / HVM_PARAM_CALLBACK_IRQ, David Woodhouse, 2022/12/21
[RFC PATCH v2 09/22] pc_piix: allow xenfv machine with XEN_EMULATE, David Woodhouse, 2022/12/09
[RFC PATCH v2 05/22] xen-platform-pci: allow its creation with XEN_EMULATE mode,
David Woodhouse <=
[RFC PATCH v2 11/22] i386/xen: implement HYPERCALL_xen_version, David Woodhouse, 2022/12/09
[RFC PATCH v2 18/22] i386/xen: handle VCPUOP_register_runstate_memory_area, David Woodhouse, 2022/12/09
[RFC PATCH v2 17/22] i386/xen: handle VCPUOP_register_vcpu_time_info, David Woodhouse, 2022/12/09
[RFC PATCH v2 01/22] include: import xen public headers, David Woodhouse, 2022/12/09