From 871f1ddd46625c2f485f7f5737b1c237ebb943a4 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Mon, 16 Jul 2007 16:47:35 +0000 Subject: [PATCH] Restore the value of ar.rnat after the assignment to ar.bspstore. The SDM states that writing to ar.bspstore invalidates the ar.rnat register as a side-effect. This was interpreted as "bits in the ar.rnat register that correspond to registers whose value is on the stack are undefined'. Since we keep the kernel stack NaT- aligned with the user stack (i.e. the lower 9 bits of the backing store pointer remain unchanged when we switch to the kernel stack) bits that need preserving would be preserved. That interpretation is questionable. So, now, the interpretation is more absolute: ar.rnat is undefined after writing to ar.bspstore. As such, we write the saved value of ar.rnat back to ar.rnat after writing to ar.bspstore. Discussed with: christian.kandeler@hob.de Approved by: re (kensmith) --- sys/ia64/ia64/syscall.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/ia64/ia64/syscall.S b/sys/ia64/ia64/syscall.S index 7b279078883d..73f8da67b830 100644 --- a/sys/ia64/ia64/syscall.S +++ b/sys/ia64/ia64/syscall.S @@ -251,10 +251,10 @@ ENTRY_NOPROFILE(epc_syscall, 8) add sp=-16,r30 ;; } -{ .mib +{ .mmi + mov ar.rnat=r19 mov r21=ar.unat add r31=8,r30 - nop 0 ;; } { .mib @@ -561,7 +561,7 @@ epc_syscall_setup_ia32: srlz.d add r2=gw_ret_ia32-ia64_gateway_page,r2 ;; - mov ar.rsc=0x0 + mov ar.rsc=0 mov b7=r2 br.ret.sptk b7 ;;