From 2f26e86da27f7fe59e16abb5535f64bdad29e688 Mon Sep 17 00:00:00 2001 From: Richard Henderson <rth@twiddle.net> Date: Wed, 13 Apr 2011 16:57:22 -0700 Subject: PCBB.PTBR contains a page frame number, not a physical address. --- init.c | 2 +- pal.S | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/init.c b/init.c index 25ca743..cb900c5 100644 --- a/init.c +++ b/init.c @@ -209,7 +209,7 @@ static void init_pcb (void) { pcb.ksp = (unsigned long)stack + sizeof(stack); - pcb.ptbr = PA(page_dir); + pcb.ptbr = PA(page_dir) >> PAGE_SHIFT; pcb.flags = 1; /* FEN */ } diff --git a/pal.S b/pal.S index 913b8f8..bea194f 100644 --- a/pal.S +++ b/pal.S @@ -565,12 +565,15 @@ CallPal_SwpPal_Cont: ldq_p t4, PCB_Q_FEN(a2) mtpr t0, ptUsp + + sll t1, VA_S_OFF, t1 mtpr t1, qemu_ptbr - mtpr t3, qemu_unique subl t2, p0, t2 mtpr t2, qemu_pcc_ofs + mtpr t3, qemu_unique + and t4, 1, t4 mtpr t4, qemu_fen @@ -908,6 +911,7 @@ CallPal_SwpCtx_Cont: // QEMU does not implement an ASN; skip that. ldq_p t10, PCB_Q_PTBR(a0) // Install new page tables + sll t10, VA_S_OFF, t10 mtpr t10, qemu_ptbr mtpr $31, qemu_tbia // Flush TLB, since we don't do ASNs -- cgit v1.1