Date: Sat, 6 Jun 2015 21:52:47 +0000 (UTC) From: Andrew Turner <andrew@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284103 - head/sys/arm64/arm64 Message-ID: <201506062152.t56LqlOl096733@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andrew Date: Sat Jun 6 21:52:46 2015 New Revision: 284103 URL: https://svnweb.freebsd.org/changeset/base/284103 Log: Rework exception entry to help with DTrace. We now store the stack pointer before adjusting it to store any registers. This is needed as DTrace may need to adjust the kernel stack pointer, and previously the new stack pointer would have needed to be checked incase it was changed. Modified: head/sys/arm64/arm64/exception.S Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Sat Jun 6 21:11:17 2015 (r284102) +++ head/sys/arm64/arm64/exception.S Sat Jun 6 21:52:46 2015 (r284103) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); .text .macro save_registers el +.if \el == 1 + mov x18, sp +.endif stp x28, x29, [sp, #-16]! stp x26, x27, [sp, #-16]! stp x24, x25, [sp, #-16]! @@ -51,22 +54,20 @@ __FBSDID("$FreeBSD$"); mrs x10, elr_el1 mrs x11, spsr_el1 .if \el == 0 - mrs x12, sp_el0 -.else - mov x12, sp + mrs x18, sp_el0 .endif stp x10, x11, [sp, #-16]! - stp x12, lr, [sp, #-16]! + stp x18, lr, [sp, #-16]! mrs x18, tpidr_el1 .endm .macro restore_registers el - ldp x12, lr, [sp], #16 + msr daifset, #2 /* Disable interrupts, x18 may change + * in the interrupt exception handler */ + ldp x18, lr, [sp], #16 ldp x10, x11, [sp], #16 .if \el == 0 - msr sp_el0, x12 -.else - mov sp, x12 + msr sp_el0, x18 .endif msr spsr_el1, x11 msr elr_el1, x10 @@ -89,6 +90,10 @@ __FBSDID("$FreeBSD$"); ldp x24, x25, [sp], #16 ldp x26, x27, [sp], #16 ldp x28, x29, [sp], #16 +.if \el == 1 + mov sp, x18 + mrs x18, tpidr_el1 +.endif .endm .macro do_ast
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506062152.t56LqlOl096733>