On 18.03.2025 10:19, Roger Pau Monne wrote:
> --- a/xen/arch/x86/include/asm/x86_64/uaccess.h
> +++ b/xen/arch/x86/include/asm/x86_64/uaccess.h
> @@ -9,9 +9,9 @@
>   * a secondary mapping installed, which needs to be used for such accesses in
>   * the PV case, and will also be used for HVM to avoid extra conditionals.
>   */
> -#define COMPAT_ARG_XLAT_VIRT_BASE ((void *)ARG_XLAT_START(current) + \
> -                                   (PERDOMAIN_ALT_VIRT_START - \
> -                                    PERDOMAIN_VIRT_START))
> +#define COMPAT_ARG_XLAT_VIRT_BASE ((void *)ARG_XLAT_START(current) - \
> +                                   (PERDOMAIN_VIRT_START - \
> +                                    PERDOMAIN_ALT_VIRT_START))

Aren't we then (still) dependent on ordering between PERDOMAIN_VIRT_START
and PERDOMAIN_ALT_VIRT_START? Would

#define COMPAT_ARG_XLAT_VIRT_BASE ((void *)ARG_XLAT_START(current) - \
                                   PERDOMAIN_VIRT_START + \
                                   PERDOMAIN_ALT_VIRT_START)

perhaps be less fragile?

Jan

Reply via email to