Received: from eggs.gnu.org ([2001:4830:134:3::10]:38517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b10kr-0000z0-6f for qemu-devel@nongnu.org; Thu, 12 May 2016 20:14:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b10kq-0002q9-0M for qemu-devel@nongnu.org; Thu, 12 May 2016 20:14:57 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:33569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b10kp-0002q4-Qk for qemu-devel@nongnu.org; Thu, 12 May 2016 20:14:55 -0400 Received: by mail-qk0-x241.google.com with SMTP id q184so7152971qkf.0 for ; Thu, 12 May 2016 17:14:55 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Thu, 12 May 2016 14:13:16 -1000 Message-Id: <1463098420-29113-16-git-send-email-rth@twiddle.net> In-Reply-To: <1463098420-29113-1-git-send-email-rth@twiddle.net> References: <1463098420-29113-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PULL 15/39] translate-all: Adjust 256mb testing for mips64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Make sure we preserve the high 32-bits when masking for mips64. Signed-off-by: Richard Henderson --- translate-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translate-all.c b/translate-all.c index 93b91ba..79a515d 100644 --- a/translate-all.c +++ b/translate-all.c @@ -515,7 +515,7 @@ static inline size_t size_code_gen_buffer(size_t tb_size) that the buffer not cross a 256MB boundary. */ static inline bool cross_256mb(void *addr, size_t size) { - return ((uintptr_t)addr ^ ((uintptr_t)addr + size)) & 0xf0000000; + return ((uintptr_t)addr ^ ((uintptr_t)addr + size)) & ~0x0ffffffful; } /* We weren't able to allocate a buffer without crossing that boundary, @@ -523,7 +523,7 @@ static inline bool cross_256mb(void *addr, size_t size) Returns the new base of the buffer, and adjusts code_gen_buffer_size. */ static inline void *split_cross_256mb(void *buf1, size_t size1) { - void *buf2 = (void *)(((uintptr_t)buf1 + size1) & 0xf0000000); + void *buf2 = (void *)(((uintptr_t)buf1 + size1) & ~0x0ffffffful); size_t size2 = buf1 + size1 - buf2; size1 = buf2 - buf1; -- 2.5.5