[PATCH] target/i386/hvf: fix a compilation error

Wei Liu posted 1 patch 6 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/aBBws1ikCDfyC0RI@liuwe-devbox-ubuntu-v2.tail21d00.ts.net
Maintainers: Cameron Esfahani <dirty@apple.com>, Roman Bolshakov <rbolshakov@ddn.com>, Phil Dennis-Jordan <phil@philjordan.eu>
target/i386/hvf/hvf.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] target/i386/hvf: fix a compilation error
Posted by Wei Liu 6 months, 2 weeks ago
Include exec/target_page.h to fix the following build error.

x86_64-softmmu.a.p/target_i386_hvf_hvf.c.o -c ../target/i386/hvf/hvf.c
../target/i386/hvf/hvf.c:139:49: error: use of undeclared identifier 'TARGET_PAGE_SIZE'
  139 |             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'
  141 |             hv_vm_protect(dirty_page_start, TARGET_PAGE_SIZE,
      |                                             ^

Signed-off-by: Wei Liu <wei.liu@kernel.org>
---
I suspect 58d00538ceeef990 and its follow-up patches caused this issue but I
unfortunately don't have cycles to investigate further.
---
 target/i386/hvf/hvf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index 23ebf2550a..99e37a33e5 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -76,6 +76,7 @@
 #include "qemu/main-loop.h"
 #include "qemu/accel.h"
 #include "target/i386/cpu.h"
+#include "exec/target_page.h"
 
 static Error *invtsc_mig_blocker;
 
-- 
2.39.5 (Apple Git-154)
Re: [PATCH] target/i386/hvf: fix a compilation error
Posted by Paolo Bonzini 6 months, 2 weeks ago
Queued, thanks.

Paolo
Re: [PATCH] target/i386/hvf: fix a compilation error
Posted by Philippe Mathieu-Daudé 6 months, 2 weeks ago
On 29/4/25 08:24, Wei Liu wrote:
> Include exec/target_page.h to fix the following build error.
> 
> x86_64-softmmu.a.p/target_i386_hvf_hvf.c.o -c ../target/i386/hvf/hvf.c
> ../target/i386/hvf/hvf.c:139:49: error: use of undeclared identifier 'TARGET_PAGE_SIZE'
>    139 |             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'
>    141 |             hv_vm_protect(dirty_page_start, TARGET_PAGE_SIZE,
>        |                                             ^
> 
> Signed-off-by: Wei Liu <wei.liu@kernel.org>
> ---
> I suspect 58d00538ceeef990 and its follow-up patches caused this issue but I
> unfortunately don't have cycles to investigate further.

Yeah sorry we don't have HVF intel covered anymore in our CI so we
missed this. It is due to commit 9c2ff9cdc9b, see same fix:

https://lore.kernel.org/qemu-devel/20250425174310.70890-1-philmd@linaro.org/

> ---
>   target/i386/hvf/hvf.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
> index 23ebf2550a..99e37a33e5 100644
> --- a/target/i386/hvf/hvf.c
> +++ b/target/i386/hvf/hvf.c
> @@ -76,6 +76,7 @@
>   #include "qemu/main-loop.h"
>   #include "qemu/accel.h"
>   #include "target/i386/cpu.h"
> +#include "exec/target_page.h"
>   
>   static Error *invtsc_mig_blocker;
>