>  /* All direct uses of g2h and h2g need to go away for usermode softmmu. 
>  */ #define g2h(x) ((void *)((unsigned long)(x) + GUEST_BASE))
> +
> +#if HOST_LONG_BITS == TARGET_VIRT_ADDR_SPACE_BITS

Shouldn't this be <= ? 
1ul << T_V_A_S_B is undefined for 64-bit guests on 32-bit hosts.

> +#define h2g_valid(x) 1
> +#else
> +#define h2g_valid(x) ({ \
> +    unsigned long __guest = (unsigned long)(x) - GUEST_BASE; \
> +    __guest < (1ul << TARGET_VIRT_ADDR_SPACE_BITS); \


Paul


Reply via email to