From owner-svn-src-head@freebsd.org Wed Dec 19 17:52:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC645133E360; Wed, 19 Dec 2018 17:52:10 +0000 (UTC) (envelope-from markj@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) server-signature RSA-PSS (4096 bits) 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 8F1CB8BD56; Wed, 19 Dec 2018 17:52:10 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 820D7195E2; Wed, 19 Dec 2018 17:52:10 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJHqAKa091611; Wed, 19 Dec 2018 17:52:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJHq9nv091607; Wed, 19 Dec 2018 17:52:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812191752.wBJHq9nv091607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Dec 2018 17:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342223 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 342223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F1CB8BD56 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.936,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 17:52:11 -0000 Author: markj Date: Wed Dec 19 17:52:09 2018 New Revision: 342223 URL: https://svnweb.freebsd.org/changeset/base/342223 Log: Replace uses of sbadaddr with stval. The sbadaddr register was renamed in version 1.10 of the privileged architecture specification. No functional change intended. Submitted by: Mitchell Horne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18594 Modified: head/sys/riscv/include/frame.h head/sys/riscv/riscv/db_interface.c head/sys/riscv/riscv/exception.S head/sys/riscv/riscv/genassym.c head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/include/frame.h ============================================================================== --- head/sys/riscv/include/frame.h Wed Dec 19 17:48:37 2018 (r342222) +++ head/sys/riscv/include/frame.h Wed Dec 19 17:52:09 2018 (r342223) @@ -55,7 +55,7 @@ struct trapframe { uint64_t tf_a[8]; uint64_t tf_sepc; uint64_t tf_sstatus; - uint64_t tf_sbadaddr; + uint64_t tf_stval; uint64_t tf_scause; }; Modified: head/sys/riscv/riscv/db_interface.c ============================================================================== --- head/sys/riscv/riscv/db_interface.c Wed Dec 19 17:48:37 2018 (r342222) +++ head/sys/riscv/riscv/db_interface.c Wed Dec 19 17:52:09 2018 (r342223) @@ -98,7 +98,7 @@ struct db_variable db_regs[] = { { "a7", DB_OFFSET(tf_a[7]), db_frame }, { "sepc", DB_OFFSET(tf_sepc), db_frame }, { "sstatus", DB_OFFSET(tf_sstatus), db_frame }, - { "sbadaddr", DB_OFFSET(tf_sbadaddr), db_frame }, + { "stval", DB_OFFSET(tf_stval), db_frame }, { "scause", DB_OFFSET(tf_scause), db_frame }, }; Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Wed Dec 19 17:48:37 2018 (r342222) +++ head/sys/riscv/riscv/exception.S Wed Dec 19 17:52:09 2018 (r342223) @@ -107,8 +107,8 @@ __FBSDID("$FreeBSD$"); sd t0, (TF_SEPC)(sp) csrr t0, sstatus sd t0, (TF_SSTATUS)(sp) - csrr t0, sbadaddr - sd t0, (TF_SBADADDR)(sp) + csrr t0, stval + sd t0, (TF_STVAL)(sp) csrr t0, scause sd t0, (TF_SCAUSE)(sp) .endm Modified: head/sys/riscv/riscv/genassym.c ============================================================================== --- head/sys/riscv/riscv/genassym.c Wed Dec 19 17:48:37 2018 (r342222) +++ head/sys/riscv/riscv/genassym.c Wed Dec 19 17:52:09 2018 (r342223) @@ -96,6 +96,6 @@ ASSYM(TF_T, offsetof(struct trapframe, tf_t)); ASSYM(TF_S, offsetof(struct trapframe, tf_s)); ASSYM(TF_A, offsetof(struct trapframe, tf_a)); ASSYM(TF_SEPC, offsetof(struct trapframe, tf_sepc)); -ASSYM(TF_SBADADDR, offsetof(struct trapframe, tf_sbadaddr)); +ASSYM(TF_STVAL, offsetof(struct trapframe, tf_stval)); ASSYM(TF_SCAUSE, offsetof(struct trapframe, tf_scause)); ASSYM(TF_SSTATUS, offsetof(struct trapframe, tf_sstatus)); Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Wed Dec 19 17:48:37 2018 (r342222) +++ head/sys/riscv/riscv/trap.c Wed Dec 19 17:52:09 2018 (r342223) @@ -170,7 +170,7 @@ static void data_abort(struct trapframe *frame, int usermode) { struct vm_map *map; - uint64_t sbadaddr; + uint64_t stval; struct thread *td; struct pcb *pcb; vm_prot_t ftype; @@ -188,7 +188,7 @@ data_abort(struct trapframe *frame, int usermode) td = curthread; p = td->td_proc; pcb = td->td_pcb; - sbadaddr = frame->tf_sbadaddr; + stval = frame->tf_stval; if (td->td_critnest != 0 || td->td_intr_nesting_level != 0 || WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, @@ -197,7 +197,7 @@ data_abort(struct trapframe *frame, int usermode) if (usermode) map = &td->td_proc->p_vmspace->vm_map; - else if (sbadaddr >= VM_MAX_USER_ADDRESS) + else if (stval >= VM_MAX_USER_ADDRESS) map = kernel_map; else { if (pcb->pcb_onfault == 0) @@ -205,7 +205,7 @@ data_abort(struct trapframe *frame, int usermode) map = &td->td_proc->p_vmspace->vm_map; } - va = trunc_page(sbadaddr); + va = trunc_page(stval); if ((frame->tf_scause == EXCP_FAULT_STORE) || (frame->tf_scause == EXCP_STORE_PAGE_FAULT)) { @@ -249,7 +249,7 @@ data_abort(struct trapframe *frame, int usermode) ucode = SEGV_ACCERR; else ucode = SEGV_MAPERR; - call_trapsignal(td, sig, ucode, (void *)sbadaddr); + call_trapsignal(td, sig, ucode, (void *)stval); } else { if (pcb->pcb_onfault != 0) { frame->tf_a[0] = error; @@ -267,7 +267,7 @@ done: fatal: dump_regs(frame); - panic("Fatal page fault at %#lx: %#016lx", frame->tf_sepc, sbadaddr); + panic("Fatal page fault at %#lx: %#016lx", frame->tf_sepc, stval); } void @@ -324,8 +324,8 @@ do_trap_supervisor(struct trapframe *frame) break; default: dump_regs(frame); - panic("Unknown kernel exception %x badaddr %lx\n", - exception, frame->tf_sbadaddr); + panic("Unknown kernel exception %x trap value %lx\n", + exception, frame->tf_stval); } } @@ -392,7 +392,7 @@ do_trap_user(struct trapframe *frame) break; default: dump_regs(frame); - panic("Unknown userland exception %x, badaddr %lx\n", - exception, frame->tf_sbadaddr); + panic("Unknown userland exception %x, trap value %lx\n", + exception, frame->tf_stval); } }