On 10/28/25 06:42, Philippe Mathieu-Daudé wrote:
> hv_vm_protect() arguments must be aligned to host page.
>
> Suggested-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> accel/hvf/hvf-all.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c
> index e13abddbd9c..2efecdc9f40 100644
> --- a/accel/hvf/hvf-all.c
> +++ b/accel/hvf/hvf-all.c
> @@ -11,6 +11,7 @@
> #include "qemu/osdep.h"
> #include "qemu/error-report.h"
> #include "accel/accel-ops.h"
> +#include "exec/cpu-common.h"
> #include "system/address-spaces.h"
> #include "system/memory.h"
> #include "system/hvf.h"
> @@ -67,6 +68,8 @@ static void do_hv_vm_protect(hwaddr start, size_t size,
> flags & HV_MEMORY_READ ? 'R' : '-',
> flags & HV_MEMORY_WRITE ? 'W' : '-',
> flags & HV_MEMORY_EXEC ? 'X' : '-');
> + g_assert(!((uintptr_t)start & ~qemu_real_host_page_mask()));
> + g_assert(!(size & ~qemu_real_host_page_mask()));
>
> ret = hv_vm_protect(start, size, flags);
> assert_hvf_ok(ret);
You should call qemu_real_host_page_mask only once.
Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~