From owner-dev-commits-src-all@freebsd.org Fri Jan 8 18:53:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF1AE4D318C; Fri, 8 Jan 2021 18:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DCC1X6TLpz4pwY; Fri, 8 Jan 2021 18:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D12612A9; Fri, 8 Jan 2021 18:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 108IrqB3083399; Fri, 8 Jan 2021 18:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 108IrqeS083398; Fri, 8 Jan 2021 18:53:52 GMT (envelope-from git) Date: Fri, 8 Jan 2021 18:53:52 GMT Message-Id: <202101081853.108IrqeS083398@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: e9bb4ce3d0e7 - main - arm64: don't pass user trapframe to kdb_trap() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9bb4ce3d0e714d35b12ffdc7ecb56cade01f4a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2021 18:53:53 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e9bb4ce3d0e714d35b12ffdc7ecb56cade01f4a0 commit e9bb4ce3d0e714d35b12ffdc7ecb56cade01f4a0 Author: mhorne AuthorDate: 2020-12-18 18:43:52 +0000 Commit: Mitchell Horne CommitDate: 2021-01-08 18:53:20 +0000 arm64: don't pass user trapframe to kdb_trap() This effectively undoes the changes made in r321571. While useful, it is inconsistent with how other architectures pass trapframes to kdb. This change is also required to get a working gdb(4) stub on arm64, as otherwise the backtrace will begin too early. As of 088a7eef95b1, this information can still be obtained via "show registers/u". Reviewed by: jhb (slightly earlier version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Pull Request: https://reviews.freebsd.org/D27719 --- sys/arm64/arm64/trap.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 1330838148d2..12d10ff1d261 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -360,7 +360,6 @@ print_registers(struct trapframe *frame) void do_el1h_sync(struct thread *td, struct trapframe *frame) { - struct trapframe *oframe; uint32_t exception; uint64_t esr, far; int dfsc; @@ -378,18 +377,6 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) "do_el1_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", td, esr, frame->tf_elr, frame); - oframe = td->td_frame; - - switch (exception) { - case EXCP_BRK: - case EXCP_WATCHPT_EL1: - case EXCP_SOFTSTP_EL1: - break; - default: - td->td_frame = frame; - break; - } - switch (exception) { case EXCP_FP_SIMD: case EXCP_TRAP_FP: @@ -429,18 +416,15 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) } #endif #ifdef KDB - kdb_trap(exception, 0, - (td->td_frame != NULL) ? td->td_frame : frame); + kdb_trap(exception, 0, frame); #else panic("No debugger in kernel.\n"); #endif - frame->tf_elr += 4; break; case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: #ifdef KDB - kdb_trap(exception, 0, - (td->td_frame != NULL) ? td->td_frame : frame); + kdb_trap(exception, 0, frame); #else panic("No debugger in kernel.\n"); #endif @@ -455,8 +439,6 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) panic("Unknown kernel exception %x esr_el1 %lx\n", exception, esr); } - - td->td_frame = oframe; } void