qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/7] Use TARGET_VIRT_ADDR_SPACE_BITS in h2g_vali


From: Paul Brook
Subject: Re: [Qemu-devel] [PATCH 2/7] Use TARGET_VIRT_ADDR_SPACE_BITS in h2g_valid.
Date: Sun, 28 Feb 2010 14:11:42 +0000
User-agent: KMail/1.12.4 (Linux/2.6.32-trunk-amd64; KDE/4.3.4; x86_64; ; )

>  /* 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

[Prev in Thread] Current Thread [Next in Thread]