qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 07/21] xen-platform-pci: register xen-mmio as RAM for XEN_EMU


From: David Woodhouse
Subject: [RFC PATCH 07/21] xen-platform-pci: register xen-mmio as RAM for XEN_EMULATE
Date: Mon, 5 Dec 2022 17:31:23 +0000

From: Joao Martins <joao.m.martins@oracle.com>

This is a workaround while we find the most elegant solution
in grant table frames mapping.

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 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index 914619d140..710039851a 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -469,8 +469,12 @@ static const MemoryRegionOps platform_mmio_handler = {
 
 static void platform_mmio_setup(PCIXenPlatformState *d)
 {
-    memory_region_init_io(&d->mmio_bar, OBJECT(d), &platform_mmio_handler, d,
-                          "xen-mmio", 0x1000000);
+    if (xen_mode == XEN_EMULATE)
+        memory_region_init_ram(&d->mmio_bar, OBJECT(d), "xen-mmio", 0x1000000,
+                               &error_fatal);
+    else
+        memory_region_init_io(&d->mmio_bar, OBJECT(d), &platform_mmio_handler, 
d,
+                              "xen-mmio", 0x1000000);
 }
 
 static int xen_platform_post_load(void *opaque, int version_id)
-- 
2.35.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]