From 1660e72d4fbbd87e34eb4017d7e7c0ff4e29ca84 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Sun, 23 Oct 2011 16:01:19 +0200 Subject: memory: Introduce memory_region_init_reservation Introduce a memory region type that can reserve I/O space. Such regions are useful for modeling I/O that is only handled outside of QEMU, i.e. in the context of an accelerator like KVM. Any access to such a region from QEMU is a bug, but could theoretically be triggered by guest code (DMA to reserved region). So only warning about such events once, then ignore them. Signed-off-by: Jan Kiszka --- memory.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'memory.h') diff --git a/memory.h b/memory.h index d48b08b..34c69cf 100644 --- a/memory.h +++ b/memory.h @@ -126,6 +126,7 @@ struct MemoryRegion { bool readonly; /* For RAM regions */ bool enabled; bool rom_device; + bool warning_printed; /* For reservations */ MemoryRegion *alias; target_phys_addr_t alias_offset; unsigned priority; @@ -280,6 +281,21 @@ void memory_region_init_rom_device(MemoryRegion *mr, uint64_t size); /** + * memory_region_init_reservation: Initialize a memory region that reserves + * I/O space. + * + * A reservation region primariy serves debugging purposes. It claims I/O + * space that is not supposed to be handled by QEMU itself. Any access via + * the memory API will cause an abort(). + * + * @mr: the #MemoryRegion to be initialized + * @name: used for debugging; not visible to the user or ABI + * @size: size of the region. + */ +void memory_region_init_reservation(MemoryRegion *mr, + const char *name, + uint64_t size); +/** * memory_region_destroy: Destroy a memory region and reclaim all resources. * * @mr: the region to be destroyed. May not currently be a subregion -- cgit v1.1