Skip to contentSkip to conversation

target/i386/hvf: Include missing 'exec/target_page.h' header

PATCH In review Philippe Mathieu-Daudé 2 participants 2 messages Apr 25, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/i386/hvf: Include missing 'exec/target_page.h' header

Include "exec/target_page.h" to be able to compile HVF on x86_64:

../target/i386/hvf/hvf.c:139:49: error: use of undeclared identifier 'TARGET_PAGE_SIZE'

              uint64_t dirty_page_start = gpa & ~(TARGET_PAGE_SIZE - 1u);
                                                ^

../target/i386/hvf/hvf.c:141:45: error: use of undeclared identifier 'TARGET_PAGE_SIZE'
hv_vm_protect(dirty_page_start, TARGET_PAGE_SIZE,

Fixes 9c2ff9cdc9b ("exec/cpu-all: remove exec/target_page include")
---
 target/i386/hvf/hvf.c | 1 +
 1 file changed, 1 insertion(+)
target/i386/hvf/hvf.c +1 -0
index 23ebf2550ac..da1dc66da07 100644
@@ -50,6 +50,7 @@
 #include "qemu/error-report.h"
 #include "qemu/memalign.h"
 #include "qapi/error.h"
+#include "exec/target_page.h"
 #include "migration/blocker.h"
 
 #include "system/hvf.h"
Signature · 1 line
2.47.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 20 lines · Philippe Mathieu-Daudé

Include "exec/target_page.h" to be able to compile HVF on x86_64:

../target/i386/hvf/hvf.c:139:49: error: use of undeclared identifier 'TARGET_PAGE_SIZE'

               uint64_t dirty_page_start = gpa & ~(TARGET_PAGE_SIZE - 1u);
                                                 ^

../target/i386/hvf/hvf.c:141:45: error: use of undeclared identifier 'TARGET_PAGE_SIZE'
hv_vm_protect(dirty_page_start, TARGET_PAGE_SIZE,

Fixes 9c2ff9cdc9b ("exec/cpu-all: remove exec/target_page include")
---
  target/i386/hvf/hvf.c | 1 +
  1 file changed, 1 insertion(+)
target/i386/hvf/hvf.c +0 -0
index 23ebf2550ac..da1dc66da07 100644

target/i386/hvf/hvf.c line 56

Quoted 7 lines
target/i386/hvf/hvf.c +1 -0
@@ -50,6 +50,7 @@
  #include "qemu/error-report.h"
  #include "qemu/memalign.h"
  #include "qapi/error.h"
+#include "exec/target_page.h"
  #include "migration/blocker.h"
 
  #include "system/hvf.h"

Thanks for the patch Philippe,