From owner-svn-src-all@freebsd.org Wed Sep 5 09:53:56 2018 Return-Path: Delivered-To: svn-src-all@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 267BBFEAB2B; Wed, 5 Sep 2018 09:53:56 +0000 (UTC) (envelope-from br@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 CFD747A3AD; Wed, 5 Sep 2018 09:53:55 +0000 (UTC) (envelope-from br@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 CA7CA244D2; Wed, 5 Sep 2018 09:53:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w859rteF024870; Wed, 5 Sep 2018 09:53:55 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w859rtne024869; Wed, 5 Sep 2018 09:53:55 GMT (envelope-from br@FreeBSD.org) Message-Id: <201809050953.w859rtne024869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 5 Sep 2018 09:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338466 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 338466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2018 09:53:56 -0000 Author: br Date: Wed Sep 5 09:53:55 2018 New Revision: 338466 URL: https://svnweb.freebsd.org/changeset/base/338466 Log: Fix bug: compare uaddr to VM_MAXUSER_ADDRESS, not to a tmp value left by SET_FAULT_HANDLER(). Approved by: re (kib) Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/copyinout.S Modified: head/sys/riscv/riscv/copyinout.S ============================================================================== --- head/sys/riscv/riscv/copyinout.S Wed Sep 5 01:46:27 2018 (r338465) +++ head/sys/riscv/riscv/copyinout.S Wed Sep 5 09:53:55 2018 (r338466) @@ -111,12 +111,12 @@ END(copyin) ENTRY(copyinstr) mv a5, x0 /* count = 0 */ beqz a2, 3f /* If len == 0 then skip loop */ - li a7, VM_MAXUSER_ADDRESS la a6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(a6, a7) /* Set the handler */ -1: bgt a7, a0, copyio_fault + li a7, VM_MAXUSER_ADDRESS +1: bgt a0, a7, copyio_fault lb a4, 0(a0) /* Load from uaddr */ addi a0, a0, 1 sb a4, 0(a1) /* Store in kaddr */