From: Gustavo Romero <[email protected]> Use TAG_GRANULE definition when creating the memory region where the FEAT_MTE tags are stored.
Signed-off-by: Gustavo Romero <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Message-id: [email protected] Signed-off-by: Peter Maydell <[email protected]> --- hw/arm/virt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 9d192515d85..0d56197dace 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2308,8 +2308,10 @@ static void create_tag_ram(MemoryRegion *tag_sysmem, { MemoryRegion *tagram = g_new(MemoryRegion, 1); - memory_region_init_ram(tagram, NULL, name, size / 32, &error_fatal); - memory_region_add_subregion(tag_sysmem, base / 32, tagram); + /* We store 2 granules in 1 byte. */ + memory_region_init_ram(tagram, NULL, name, size / (2 * TAG_GRANULE), + &error_fatal); + memory_region_add_subregion(tag_sysmem, base / (2 * TAG_GRANULE), tagram); } static void create_secure_ram(VirtMachineState *vms, -- 2.43.0
