From ac23dd2f293c59a5cd2fb385162277b4a6aef769 Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Fri, 23 Jun 2023 14:45:53 +0200 Subject: memory-device: Track used region size in DeviceMemoryState MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's avoid iterating over all devices and simply track it in the DeviceMemoryState. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Hildenbrand Message-Id: <20230623124553.400585-11-david@redhat.com> Signed-off-by: David Hildenbrand --- include/hw/boards.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/hw/boards.h b/include/hw/boards.h index 3b7c30e..ed83360 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -298,11 +298,13 @@ struct MachineClass { * address space for memory devices starts * @mr: address space container for memory devices * @dimm_size: the sum of plugged DIMMs' sizes + * @used_region_size: the part of @mr already used by memory devices */ typedef struct DeviceMemoryState { hwaddr base; MemoryRegion mr; uint64_t dimm_size; + uint64_t used_region_size; } DeviceMemoryState; /** -- cgit v1.1