Skip to contentSkip to conversation

hw/arm/virt: Use TAG_GRANULE when creating tag memory

PATCH Applied Gustavo Romero 3 participants 3 messages Oct 9 – Oct 12

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm/virt: Use TAG_GRANULE when creating tag memory

Use TAG_GRANULE definition when creating the memory region where the FEAT_MTE tags are stored.

---
 hw/arm/virt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
hw/arm/virt.c +4 -2
index 9d192515d8..0d56197dac 100644
@@ -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,
Signature · 1 line
2.47.3