[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/16] hw/xen: add stubs for various functions
From: |
Pierrick Bouvier |
Subject: |
[PATCH 13/16] hw/xen: add stubs for various functions |
Date: |
Sun, 9 Mar 2025 21:58:39 -0700 |
Those functions are used by system/physmem.c, and are called only if
xen is enabled (which happens only if CONFIG_XEN is not set).
So we can crash in case those are called.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
hw/xen/xen_stubs.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++
hw/xen/meson.build | 3 +++
2 files changed, 59 insertions(+)
create mode 100644 hw/xen/xen_stubs.c
diff --git a/hw/xen/xen_stubs.c b/hw/xen/xen_stubs.c
new file mode 100644
index 00000000000..19cee84bbb4
--- /dev/null
+++ b/hw/xen/xen_stubs.c
@@ -0,0 +1,56 @@
+/*
+ * Various stubs for xen functions
+ *
+ * Those functions are used only if xen_enabled(). This file is linked only if
+ * CONFIG_XEN is not set, so they should never be called.
+ *
+ * Copyright (c) 2025 Linaro, Ltd.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "system/xen.h"
+#include "system/xen-mapcache.h"
+
+void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length)
+{
+ g_assert_not_reached();
+}
+
+void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
+ struct MemoryRegion *mr, Error **errp)
+{
+ g_assert_not_reached();
+}
+
+bool xen_mr_is_memory(MemoryRegion *mr)
+{
+ g_assert_not_reached();
+}
+
+void xen_invalidate_map_cache_entry(uint8_t *buffer)
+{
+ g_assert_not_reached();
+}
+
+void xen_invalidate_map_cache(void)
+{
+ g_assert_not_reached();
+}
+
+ram_addr_t xen_ram_addr_from_mapcache(void *ptr)
+{
+ g_assert_not_reached();
+}
+
+uint8_t *xen_map_cache(MemoryRegion *mr,
+ hwaddr phys_addr,
+ hwaddr size,
+ ram_addr_t ram_addr_offset,
+ uint8_t lock,
+ bool dma,
+ bool is_write)
+{
+ g_assert_not_reached();
+}
diff --git a/hw/xen/meson.build b/hw/xen/meson.build
index 4a486e36738..a1850e76988 100644
--- a/hw/xen/meson.build
+++ b/hw/xen/meson.build
@@ -9,6 +9,9 @@ system_ss.add(when: ['CONFIG_XEN_BUS'], if_true: files(
system_ss.add(when: ['CONFIG_XEN', xen], if_true: files(
'xen-operations.c',
+),
+if_false: files(
+ 'xen_stubs.c',
))
xen_specific_ss = ss.source_set()
--
2.39.5
- [PATCH 01/16] exec/memory_ldst: extract memory_ldst declarations from cpu-all.h, (continued)
- [PATCH 01/16] exec/memory_ldst: extract memory_ldst declarations from cpu-all.h, Pierrick Bouvier, 2025/03/10
- [PATCH 03/16] include: move target_words_bigendian() from tswap to bswap, Pierrick Bouvier, 2025/03/10
- [PATCH 04/16] exec/memory.h: make devend_memop target agnostic, Pierrick Bouvier, 2025/03/10
- [PATCH 05/16] qemu/bswap: implement {ld,st}.*_p as functions, Pierrick Bouvier, 2025/03/10
- [PATCH 08/16] exec/exec-all: remove dependency on cpu.h, Pierrick Bouvier, 2025/03/10
- [PATCH 06/16] exec/cpu-all.h: we can now remove ld/st macros, Pierrick Bouvier, 2025/03/10
- [PATCH 12/16] exec/ram_addr: call xen_hvm_modified_memory only if xen is enabled, Pierrick Bouvier, 2025/03/10
- [PATCH 07/16] codebase: prepare to remove cpu.h from exec/exec-all.h, Pierrick Bouvier, 2025/03/10
- [PATCH 10/16] exec/ram_addr: remove dependency on cpu.h, Pierrick Bouvier, 2025/03/10
- [PATCH 11/16] system/kvm: make kvm_flush_coalesced_mmio_buffer() accessible for common code, Pierrick Bouvier, 2025/03/10
- [PATCH 13/16] hw/xen: add stubs for various functions,
Pierrick Bouvier <=
- [PATCH 14/16] system/physmem: compilation unit is now common to all targets, Pierrick Bouvier, 2025/03/10
- [PATCH 16/16] system/ioport: make compilation unit common, Pierrick Bouvier, 2025/03/10
- [PATCH 09/16] exec/memory-internal: remove dependency on cpu.h, Pierrick Bouvier, 2025/03/10
- [PATCH 15/16] system/memory: make compilation unit common, Pierrick Bouvier, 2025/03/10
- Re: [PATCH 00/16] make system memory API available for common code, BALATON Zoltan, 2025/03/10