From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFYBj-0005a0-Tm for qemu-devel@nongnu.org; Thu, 28 Apr 2011 16:51:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFYBj-0005fl-5F for qemu-devel@nongnu.org; Thu, 28 Apr 2011 16:51:51 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:41034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFYBi-0005Xk-VC for qemu-devel@nongnu.org; Thu, 28 Apr 2011 16:51:51 -0400 Received: by mail-pz0-f45.google.com with SMTP id 30so2296231pzk.4 for ; Thu, 28 Apr 2011 13:51:50 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Thu, 28 Apr 2011 13:51:06 -0700 Message-Id: <1304023875-25040-25-git-send-email-rth@twiddle.net> In-Reply-To: <1304023875-25040-1-git-send-email-rth@twiddle.net> References: <1304023875-25040-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 24/33] target-alpha: Remap PIO space for 43-bit KSEG for EV6. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Richard Henderson --- target-alpha/helper.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/target-alpha/helper.c b/target-alpha/helper.c index 96b407b..bd3af38 100644 --- a/target-alpha/helper.c +++ b/target-alpha/helper.c @@ -220,14 +220,18 @@ static int get_physical_address(CPUState *env, target_ulong addr, /* Translate the superpage. */ /* ??? When we do more than emulate Unix PALcode, we'll need to - determine which superpage is actually active. */ - if (saddr < 0 && (saddr >> (TARGET_VIRT_ADDR_SPACE_BITS - 2) & 3) == 2) { - /* User-space cannot access kseg addresses. */ + determine which KSEG is actually active. */ + if (saddr < 0 && ((saddr >> 41) & 3) == 2) { + /* User-space cannot access KSEG addresses. */ if (mmu_idx != MMU_KERNEL_IDX) { goto exit; } + /* For the benefit of the Typhoon chipset, move bit 40 to bit 43. + We would not do this if the 48-bit KSEG is enabled. */ phys = saddr & ((1ull << 40) - 1); + phys |= (saddr & (1ull << 40)) << 3; + prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; ret = -1; goto exit; -- 1.7.4.4