summaryrefslogtreecommitdiff
path: root/arch/parisc/mm
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2021-12-23 21:46:35 +0100
committerHelge Deller <deller@gmx.de>2022-01-07 01:29:21 +0100
commit4b9d2a731c3d22a05c1bccdb11b6e00054ff5fda (patch)
tree5eef0589eef5ddb7f78c6deb8d12109ae6d14b01 /arch/parisc/mm
parent9e9d4b460f23bab61672eae397417d03917d116c (diff)
downloadlwn-4b9d2a731c3d22a05c1bccdb11b6e00054ff5fda.tar.gz
lwn-4b9d2a731c3d22a05c1bccdb11b6e00054ff5fda.zip
parisc: Switch user access functions to signal errors in r29 instead of r8
Use register r29 instead of register r8 to signal faults when accessing user memory. In case of faults, the fixup routine will store -EFAULT in this register. This change saves up to 752 bytes on a 32bit kernel, partly because the compiler doesn't need to save and restore the old r8 value on the stack. bloat-o-meter results for usage with r29 register: add/remove: 0/0 grow/shrink: 23/86 up/down: 228/-980 (-752) bloat-o-meter results for usage with r28 register: add/remove: 0/0 grow/shrink: 28/83 up/down: 296/-956 (-660) Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/mm')
-rw-r--r--arch/parisc/mm/fault.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index 4a6221b869fd..01fd2a32acc6 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -148,11 +148,11 @@ int fixup_exception(struct pt_regs *regs)
* Fix up get_user() and put_user().
* ASM_EXCEPTIONTABLE_ENTRY_EFAULT() sets the least-significant
* bit in the relative address of the fixup routine to indicate
- * that %r8 should be loaded with -EFAULT to report a userspace
- * access error.
+ * that gr[ASM_EXCEPTIONTABLE_REG] should be loaded with
+ * -EFAULT to report a userspace access error.
*/
if (fix->fixup & 1) {
- regs->gr[8] = -EFAULT;
+ regs->gr[ASM_EXCEPTIONTABLE_REG] = -EFAULT;
/* zero target register for get_user() */
if (parisc_acctyp(0, regs->iir) == VM_READ) {