Commit 88ea1a44 authored by Paul Mundt's avatar Paul Mundt

sh64: Fix up PC casting in unaligned fixup notifier with 32bit ABI.

Presently the build bails with the following:

  CC      arch/sh/mm/alignment.o
cc1: warnings being treated as errors
arch/sh/mm/alignment.c: In function 'unaligned_fixups_notify':
arch/sh/mm/alignment.c:69: warning: cast to pointer from integer of different size
arch/sh/mm/alignment.c:74: warning: cast to pointer from integer of different size
make[2]: *** [arch/sh/mm/alignment.o] Error 1

This is due to the fact that regs->pc is always 64-bit, while the pointer size
depends on the ABI. Wrapping through instruction_pointer() takes care of the
appropriate casting for both configurations.
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 3ef2932b
...@@ -69,12 +69,12 @@ void unaligned_fixups_notify(struct task_struct *tsk, insn_size_t insn, ...@@ -69,12 +69,12 @@ void unaligned_fixups_notify(struct task_struct *tsk, insn_size_t insn,
pr_notice("Fixing up unaligned userspace access " pr_notice("Fixing up unaligned userspace access "
"in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
tsk->comm, task_pid_nr(tsk), tsk->comm, task_pid_nr(tsk),
(void *)regs->pc, insn); (void *)instruction_pointer(regs), insn);
else if (se_kernmode_warn && printk_ratelimit()) else if (se_kernmode_warn && printk_ratelimit())
pr_notice("Fixing up unaligned kernel access " pr_notice("Fixing up unaligned kernel access "
"in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
tsk->comm, task_pid_nr(tsk), tsk->comm, task_pid_nr(tsk),
(void *)regs->pc, insn); (void *)instruction_pointer(regs), insn);
} }
static const char *se_usermode_action[] = { static const char *se_usermode_action[] = {
......
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