svn commit: r363618 - head/sys/powerpc/powerpc
John Baldwin
jhb at FreeBSD.org
Mon Jul 27 16:34:32 UTC 2020
Author: jhb
Date: Mon Jul 27 16:34:31 2020
New Revision: 363618
URL: https://svnweb.freebsd.org/changeset/base/363618
Log:
Set si_addr to dar for MMU and alignment faults.
Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25776
Modified:
head/sys/powerpc/powerpc/trap.c
Modified: head/sys/powerpc/powerpc/trap.c
==============================================================================
--- head/sys/powerpc/powerpc/trap.c Mon Jul 27 16:32:21 2020 (r363617)
+++ head/sys/powerpc/powerpc/trap.c Mon Jul 27 16:34:31 2020 (r363618)
@@ -207,7 +207,7 @@ trap(struct trapframe *frame)
int sig, type, user;
u_int ucode;
ksiginfo_t ksi;
- register_t fscr;
+ register_t addr, fscr;
VM_CNT_INC(v_trap);
@@ -224,6 +224,7 @@ trap(struct trapframe *frame)
type = ucode = frame->exc;
sig = 0;
user = frame->srr1 & PSL_PR;
+ addr = 0;
CTR3(KTR_TRAP, "trap: %s type=%s (%s)", td->td_name,
trapname(type), user ? "user" : "kernel");
@@ -248,6 +249,7 @@ trap(struct trapframe *frame)
if (user) {
td->td_pticks = 0;
td->td_frame = frame;
+ addr = frame->srr0;
if (td->td_cowgen != p->p_cowgen)
thread_cow_update(td);
@@ -261,18 +263,22 @@ trap(struct trapframe *frame)
break;
#if defined(__powerpc64__) && defined(AIM)
- case EXC_ISE:
case EXC_DSE:
+ addr = frame->dar;
+ /* FALLTHROUGH */
+ case EXC_ISE:
/* DSE/ISE are automatically fatal with radix pmap. */
if (radix_mmu ||
handle_user_slb_spill(&p->p_vmspace->vm_pmap,
- (type == EXC_ISE) ? frame->srr0 : frame->dar) != 0){
+ addr) != 0){
sig = SIGSEGV;
ucode = SEGV_MAPERR;
}
break;
#endif
case EXC_DSI:
+ addr = frame->dar;
+ /* FALLTHROUGH */
case EXC_ISI:
if (trap_pfault(frame, true, &sig, &ucode))
sig = 0;
@@ -368,6 +374,7 @@ trap(struct trapframe *frame)
if (fix_unaligned(td, frame) != 0) {
sig = SIGBUS;
ucode = BUS_ADRALN;
+ addr = frame->dar;
}
else
frame->srr0 += 4;
@@ -481,7 +488,7 @@ trap(struct trapframe *frame)
ksiginfo_init_trap(&ksi);
ksi.ksi_signo = sig;
ksi.ksi_code = (int) ucode; /* XXX, not POSIX */
- ksi.ksi_addr = (void *)frame->srr0;
+ ksi.ksi_addr = (void *)addr;
ksi.ksi_trapno = type;
trapsignal(td, &ksi);
}
More information about the svn-src-head
mailing list