diff mbox series

[PULL,05/22] target/i386/hvf: Include missing 'exec/target_page.h' header

Message ID 20250506143512.4315-6-philmd@linaro.org
State New
Headers show
Series [PULL,01/22] bsd-user: add option to enable plugins | expand

Commit Message

Philippe Mathieu-Daudé May 6, 2025, 2:34 p.m. UTC
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")
Reported-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reported-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20250425174310.70890-1-philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
 target/i386/hvf/hvf.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Wei Liu May 7, 2025, 6:35 a.m. UTC | #1
On Tue, May 06, 2025 at 04:34:54PM +0200, Philippe Mathieu-Daudé wrote:
> 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")
> Reported-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> Reported-by: Wei Liu <wei.liu@kernel.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Message-Id: <20250425174310.70890-1-philmd@linaro.org>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>

FYI Paolo merged a patch from me that does the same thing. My patch is
already in the master branch.

Wei.

> ---
>  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 99e37a33e50..b16fb066758 100644
> --- a/target/i386/hvf/hvf.c
> +++ b/target/i386/hvf/hvf.c
> @@ -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"
> -- 
> 2.47.1
>
Philippe Mathieu-Daudé May 7, 2025, 11:20 a.m. UTC | #2
Hi Wei,

On 7/5/25 08:35, Wei Liu wrote:
> On Tue, May 06, 2025 at 04:34:54PM +0200, Philippe Mathieu-Daudé wrote:
>> 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")
>> Reported-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> Reported-by: Wei Liu <wei.liu@kernel.org>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Message-Id: <20250425174310.70890-1-philmd@linaro.org>
>> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> 
> FYI Paolo merged a patch from me that does the same thing. My patch is
> already in the master branch.

Paolo said he'd replace your patch by this older one which mentions
the problematic commit, which is why I didn't notice your patch,
I was expecting this one to disappear on rebase. I don't plan to
repost this PR except if there is a serious problem with it. In
this case, we can still revert if we are picky. Duplicated includes
aren't a problem, missing ones are.

BTW since you are testing / using HVF on x86, do you know if your
employer could help extending our CI infrastructure coverage for
your use cases?

Regards,

Phil.
Wei Liu May 8, 2025, 1:09 a.m. UTC | #3
On Wed, May 07, 2025 at 01:20:49PM +0200, Philippe Mathieu-Daudé wrote:
> Hi Wei,
> 
> On 7/5/25 08:35, Wei Liu wrote:
> > On Tue, May 06, 2025 at 04:34:54PM +0200, Philippe Mathieu-Daudé wrote:
> > > 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")
> > > Reported-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> > > Reported-by: Wei Liu <wei.liu@kernel.org>
> > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > > Message-Id: <20250425174310.70890-1-philmd@linaro.org>
> > > Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> > 
> > FYI Paolo merged a patch from me that does the same thing. My patch is
> > already in the master branch.
> 
> Paolo said he'd replace your patch by this older one which mentions
> the problematic commit, which is why I didn't notice your patch,
> I was expecting this one to disappear on rebase. I don't plan to
> repost this PR except if there is a serious problem with it. In
> this case, we can still revert if we are picky. Duplicated includes
> aren't a problem, missing ones are.
> 

Sure.

> BTW since you are testing / using HVF on x86, do you know if your
> employer could help extending our CI infrastructure coverage for
> your use cases?
> 

No, we don't have a use case for HVF. I only tested it because I wanted
to refactor the instruction emulator out of the HVF code base.

Thanks,
Wei.

> Regards,
> 
> Phil.
diff mbox series

Patch

diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index 99e37a33e50..b16fb066758 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -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"