From owner-svn-src-stable@freebsd.org Tue May 30 13:02:11 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C882CB7C7D5; Tue, 30 May 2017 13:02:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C69189; Tue, 30 May 2017 13:02:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4UD2Ajv003757; Tue, 30 May 2017 13:02:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4UD2AOv003348; Tue, 30 May 2017 13:02:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201705301302.v4UD2AOv003348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 30 May 2017 13:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r319204 - in stable/11/sys/arm64: arm64 include X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2017 13:02:11 -0000 Author: andrew Date: Tue May 30 13:02:10 2017 New Revision: 319204 URL: https://svnweb.freebsd.org/changeset/base/319204 Log: MFC r313396: Push reading of ESR_EL1 to assembly. Among other uses this will allow us to expose this to signal handlers, e.g. for the clang sanitizers. Modified: stable/11/sys/arm64/arm64/exception.S stable/11/sys/arm64/arm64/genassym.c stable/11/sys/arm64/arm64/trap.c stable/11/sys/arm64/include/frame.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/exception.S ============================================================================== --- stable/11/sys/arm64/arm64/exception.S Tue May 30 12:44:01 2017 (r319203) +++ stable/11/sys/arm64/arm64/exception.S Tue May 30 13:02:10 2017 (r319204) @@ -56,10 +56,12 @@ __FBSDID("$FreeBSD$"); stp x0, x1, [sp, #(TF_X + 0 * 8)] mrs x10, elr_el1 mrs x11, spsr_el1 + mrs x12, esr_el1 .if \el == 0 mrs x18, sp_el0 .endif - stp x10, x11, [sp, #(TF_ELR)] + str x10, [sp, #(TF_ELR)] + stp w11, w12, [sp, #(TF_SPSR)] stp x18, lr, [sp, #(TF_SP)] mrs x18, tpidr_el1 add x29, sp, #(TF_SIZE) Modified: stable/11/sys/arm64/arm64/genassym.c ============================================================================== --- stable/11/sys/arm64/arm64/genassym.c Tue May 30 12:44:01 2017 (r319203) +++ stable/11/sys/arm64/arm64/genassym.c Tue May 30 13:02:10 2017 (r319204) @@ -62,4 +62,5 @@ ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(TF_SIZE, sizeof(struct trapframe)); ASSYM(TF_SP, offsetof(struct trapframe, tf_sp)); ASSYM(TF_ELR, offsetof(struct trapframe, tf_elr)); +ASSYM(TF_SPSR, offsetof(struct trapframe, tf_spsr)); ASSYM(TF_X, offsetof(struct trapframe, tf_x)); Modified: stable/11/sys/arm64/arm64/trap.c ============================================================================== --- stable/11/sys/arm64/arm64/trap.c Tue May 30 12:44:01 2017 (r319203) +++ stable/11/sys/arm64/arm64/trap.c Tue May 30 13:02:10 2017 (r319204) @@ -254,7 +254,7 @@ print_registers(struct trapframe *frame) 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); + printf("spsr: %8x\n", frame->tf_spsr); } void @@ -264,7 +264,7 @@ do_el1h_sync(struct trapframe *frame) uint64_t esr, far; /* Read the esr register to get the exception details */ - esr = READ_SPECIALREG(esr_el1); + esr = frame->tf_esr; exception = ESR_ELx_EXCEPTION(esr); #ifdef KDTRACE_HOOKS @@ -341,7 +341,7 @@ do_el0_sync(struct trapframe *frame) td = curthread; td->td_frame = frame; - esr = READ_SPECIALREG(esr_el1); + esr = frame->tf_esr; exception = ESR_ELx_EXCEPTION(esr); switch (exception) { case EXCP_UNKNOWN: Modified: stable/11/sys/arm64/include/frame.h ============================================================================== --- stable/11/sys/arm64/include/frame.h Tue May 30 12:44:01 2017 (r319203) +++ stable/11/sys/arm64/include/frame.h Tue May 30 13:02:10 2017 (r319204) @@ -45,7 +45,8 @@ struct trapframe { uint64_t tf_sp; uint64_t tf_lr; uint64_t tf_elr; - uint64_t tf_spsr; + uint32_t tf_spsr; + uint32_t tf_esr; uint64_t tf_x[30]; };