Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144322372
D3370.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3370.diff
View Options
Index: head/sys/arm64/arm64/trap.c
===================================================================
--- head/sys/arm64/arm64/trap.c
+++ head/sys/arm64/arm64/trap.c
@@ -229,6 +229,21 @@
userret(td, frame);
}
+static void
+print_registers(struct trapframe *frame)
+{
+ u_int reg;
+
+ for (reg = 0; reg < 31; reg++) {
+ printf(" %sx%d: %16lx\n", (reg < 10) ? " " : "", reg,
+ frame->tf_x[reg]);
+ }
+ printf(" sp: %16lx\n", frame->tf_sp);
+ printf(" lr: %16lx\n", frame->tf_lr);
+ printf(" elr: %16lx\n", frame->tf_elr);
+ printf("spsr: %16lx\n", frame->tf_spsr);
+}
+
void
do_el1h_sync(struct trapframe *frame)
{
@@ -265,6 +280,7 @@
switch(exception) {
case EXCP_FP_SIMD:
case EXCP_TRAP_FP:
+ print_registers(frame);
panic("VFP exception in the kernel");
case EXCP_DATA_ABORT:
data_abort(frame, esr, 0);
@@ -286,11 +302,30 @@
#endif
break;
default:
+ print_registers(frame);
panic("Unknown kernel exception %x esr_el1 %lx\n", exception,
esr);
}
}
+/*
+ * We get EXCP_UNKNOWN from QEMU when executing zeroed memory. For now turn
+ * this into a SIGILL.
+ */
+static void
+el0_excp_unknown(struct trapframe *frame)
+{
+ struct thread *td;
+ uint64_t far;
+
+ td = curthread;
+ far = READ_SPECIALREG(far_el1);
+ printf("el0 EXCP_UNKNOWN exception\n");
+ print_registers(frame);
+ call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)far);
+ userret(td, frame);
+}
+
void
do_el0_sync(struct trapframe *frame)
{
@@ -332,7 +367,11 @@
case EXCP_DATA_ABORT:
data_abort(frame, esr, 1);
break;
+ case EXCP_UNKNOWN:
+ el0_excp_unknown(frame);
+ break;
default:
+ print_registers(frame);
panic("Unknown userland exception %x esr_el1 %lx\n", exception,
esr);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 8, 8:27 PM (14 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28494500
Default Alt Text
D3370.diff (1 KB)
Attached To
Mode
D3370: arm64: turn el0 EXCP_UNKNOWN into a SIGILL
Attached
Detach File
Event Timeline
Log In to Comment