From owner-svn-src-stable@freebsd.org Mon Jan 8 12:56:54 2018 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 77F7DE6AB6B; Mon, 8 Jan 2018 12:56:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52B3D79BD0; Mon, 8 Jan 2018 12:56:54 +0000 (UTC) (envelope-from kib@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 903532FE5E; Mon, 8 Jan 2018 12:56:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w08CurnS067551; Mon, 8 Jan 2018 12:56:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w08Cur5c067549; Mon, 8 Jan 2018 12:56:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201801081256.w08Cur5c067549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 8 Jan 2018 12:56:53 +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: r327694 - in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 327694 X-SVN-Commit-Repository: base 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.25 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: Mon, 08 Jan 2018 12:56:54 -0000 Author: kib Date: Mon Jan 8 12:56:53 2018 New Revision: 327694 URL: https://svnweb.freebsd.org/changeset/base/327694 Log: MFC r327472: Avoid re-check of usermode condition. Modified: stable/11/sys/amd64/amd64/trap.c stable/11/sys/i386/i386/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/trap.c ============================================================================== --- stable/11/sys/amd64/amd64/trap.c Mon Jan 8 11:45:56 2018 (r327693) +++ stable/11/sys/amd64/amd64/trap.c Mon Jan 8 12:56:53 2018 (r327694) @@ -606,7 +606,6 @@ trap_pfault(struct trapframe *frame, int usermode) td = curthread; p = td->td_proc; eva = frame->tf_addr; - rv = 0; if (__predict_false((td->td_pflags & TDP_NOFAULTING) != 0)) { /* @@ -658,7 +657,7 @@ trap_pfault(struct trapframe *frame, int usermode) * Don't allow user-mode faults in kernel address space. */ if (usermode) - goto nogo; + return (SIGSEGV); map = kernel_map; } else { @@ -713,7 +712,6 @@ trap_pfault(struct trapframe *frame, int usermode) #endif return (0); } -nogo: if (!usermode) { if (td->td_intr_nesting_level == 0 && curpcb->pcb_onfault != NULL) { Modified: stable/11/sys/i386/i386/trap.c ============================================================================== --- stable/11/sys/i386/i386/trap.c Mon Jan 8 11:45:56 2018 (r327693) +++ stable/11/sys/i386/i386/trap.c Mon Jan 8 12:56:53 2018 (r327694) @@ -742,7 +742,6 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ td = curthread; p = td->td_proc; - rv = 0; if (__predict_false((td->td_pflags & TDP_NOFAULTING) != 0)) { /* @@ -803,7 +802,7 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ return (-2); #endif if (usermode) - goto nogo; + return (SIGSEGV); map = kernel_map; } else { @@ -860,7 +859,6 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ #endif return (0); } -nogo: if (!usermode) { if (td->td_intr_nesting_level == 0 && curpcb->pcb_onfault != NULL) {