[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 01/25] memory: Correctly return alias region type
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 01/25] memory: Correctly return alias region type |
Date: |
Mon, 16 Mar 2020 19:49:42 +0100 |
Since memory region aliases are neither rom nor ram, they are
described as i/o, which is often incorrect. Return instead the
type of the original region we are aliasing.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
memory.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/memory.c b/memory.c
index 09be40edd2..3ea0afada9 100644
--- a/memory.c
+++ b/memory.c
@@ -2830,6 +2830,9 @@ void address_space_destroy(AddressSpace *as)
static const char *memory_region_type(MemoryRegion *mr)
{
+ if (mr->alias) {
+ return memory_region_type(mr->alias);
+ }
if (memory_region_is_ram_device(mr)) {
return "ramd";
} else if (memory_region_is_romd(mr)) {
--
2.21.1
- [PATCH v3 00/25] hw: Sanitize various MemoryRegion calls, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 01/25] memory: Correctly return alias region type,
Philippe Mathieu-Daudé <=
- [PATCH v3 02/25] memory: Simplify memory_region_init_rom_nomigrate() to ease review, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 03/25] scripts/cocci: Rename memory-region-{init-ram -> housekeeping}, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 04/25] scripts/cocci: Patch to replace memory_region_init_{ram, readonly -> rom}, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 05/25] hw/arm: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 07/25] hw/m68k: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 08/25] hw/net: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 09/25] hw/pci-host: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 10/25] hw/ppc: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 11/25] hw/riscv: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16
- [PATCH v3 12/25] hw/sh4: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/03/16