Skip to contentSkip to conversation

target/i386: HAX: Enable ROM/ROM device memory region support

PATCH Superseded [email protected] 1 participant 1 message Jul 1, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 target/i386: HAX: Enable ROM/ROM device memory region support

From: Hang Yuan <[email protected]>

Add ROM and ROM device memory region support in HAX. Their memory region is read only and write access will generate EPT violation. The violation will be handled in the HAX kernel with the following patch.

https://github.com/intel/haxm/commit/33ceea09a1655fca12c47f1e112b1d269357ff28

v2: fix coding style problems

---
 target/i386/hax-mem.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
target/i386/hax-mem.c +4 -7
index 6bb5a24917..a8bfd37977 100644
@@ -175,13 +175,10 @@ static void hax_process_section(MemoryRegionSection *section, uint8_t flags)
     uint64_t host_va;
     uint32_t max_mapping_size;
 
-    /* We only care about RAM and ROM regions */
-    if (!memory_region_is_ram(mr)) {
-        if (memory_region_is_romd(mr)) {
-            /* HAXM kernel module does not support ROMD yet  */
-            warn_report("Ignoring ROMD region 0x%016" PRIx64 "->0x%016" PRIx64,
-                        start_pa, start_pa + size);
-        }
+    /* We only care about RAM/ROM regions and ROM device */
+    if (memory_region_is_rom(mr) || (memory_region_is_romd(mr))) {
+        flags |= HAX_RAM_INFO_ROM;
+    } else if (!memory_region_is_ram(mr)) {
         return;
     }
 
Signature · 1 line
2.21.0