]> git.proxmox.com Git - qemu.git/commitdiff
target-alpha: Remap PIO space for 43-bit KSEG for EV6.
authorRichard Henderson <rth@twiddle.net>
Wed, 27 Apr 2011 16:22:18 +0000 (09:22 -0700)
committerRichard Henderson <rth@anchor.twiddle.net>
Tue, 31 May 2011 17:18:06 +0000 (10:18 -0700)
Signed-off-by: Richard Henderson <rth@twiddle.net>
target-alpha/helper.c

index d0e4db26c282dcbd697f8a2af7459b3209df855f..32c2cf9db346dd96683356989c22c3b74b959c14 100644 (file)
@@ -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;