Commit bfd68594 authored by David Mosberger-Tang's avatar David Mosberger-Tang Committed by Tony Luck

[IA64] Avoid .spillpsp directive in handcoded assembly

Some time ago, GAS was fixed to bring the .spillpsp directive in line
with the Intel assembler manual (there was some disagreement as to
whether or not there is a built-in 16-byte offset).  Unfortunately,
there are two places in the kernel where this directive is used in
handwritten assembly files and those of course relied on the "buggy"
behavior.  As a result, when using a "fixed" assembler, the kernel
picks up the UNaT bits from the wrong place (off by 16) and randomly
sets NaT bits on the scratch registers.  This can be noticed easily by
looking at a coredump and finding various scratch registers with
unexpected NaT values.  The patch below fixes this by using the
.spillsp directive instead, which works correctly no matter what
assembler is in use.
Signed-off-by: default avatarDavid Mosberger-Tang <davidm@hpl.hp.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent a84f5770
...@@ -1182,7 +1182,7 @@ ENTRY(notify_resume_user) ...@@ -1182,7 +1182,7 @@ ENTRY(notify_resume_user)
;; ;;
(pNonSys) mov out2=0 // out2==0 => not a syscall (pNonSys) mov out2=0 // out2==0 => not a syscall
.fframe 16 .fframe 16
.spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!) .spillsp ar.unat, 16
st8 [sp]=r9,-16 // allocate space for ar.unat and save it st8 [sp]=r9,-16 // allocate space for ar.unat and save it
st8 [out1]=loc1,-8 // save ar.pfs, out1=&sigscratch st8 [out1]=loc1,-8 // save ar.pfs, out1=&sigscratch
.body .body
...@@ -1208,7 +1208,7 @@ GLOBAL_ENTRY(sys_rt_sigsuspend) ...@@ -1208,7 +1208,7 @@ GLOBAL_ENTRY(sys_rt_sigsuspend)
adds out2=8,sp // out2=&sigscratch->ar_pfs adds out2=8,sp // out2=&sigscratch->ar_pfs
;; ;;
.fframe 16 .fframe 16
.spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!) .spillsp ar.unat, 16
st8 [sp]=r9,-16 // allocate space for ar.unat and save it st8 [sp]=r9,-16 // allocate space for ar.unat and save it
st8 [out2]=loc1,-8 // save ar.pfs, out2=&sigscratch st8 [out2]=loc1,-8 // save ar.pfs, out2=&sigscratch
.body .body
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment