From owner-svn-src-head@freebsd.org Fri Jan 17 16:48:21 2020 Return-Path: Delivered-To: svn-src-head@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 DAB5F1F3EE5; Fri, 17 Jan 2020 16:48:21 +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.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 47zn7T4l6Pz3H5T; Fri, 17 Jan 2020 16:48:21 +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 9DF1FBE20; Fri, 17 Jan 2020 16:48:21 +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 00HGmLRQ043266; Fri, 17 Jan 2020 16:48:21 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00HGmLIO043264; Fri, 17 Jan 2020 16:48:21 GMT (envelope-from br@FreeBSD.org) Message-Id: <202001171648.00HGmLIO043264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 17 Jan 2020 16:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356834 - 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: 356834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Fri, 17 Jan 2020 16:48:21 -0000 Author: br Date: Fri Jan 17 16:48:20 2020 New Revision: 356834 URL: https://svnweb.freebsd.org/changeset/base/356834 Log: Use unsigned loads in fubyte, fuword16, generic_bs_r_1, generic_bs_r_2 as these functions should do zero-extend. Discovered by running pci_read_cap(), and by hint from James Clarke. Reviewed by: James Clarke Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D23236 Modified: head/sys/riscv/riscv/bus_space_asm.S head/sys/riscv/riscv/support.S Modified: head/sys/riscv/riscv/bus_space_asm.S ============================================================================== --- head/sys/riscv/riscv/bus_space_asm.S Fri Jan 17 15:55:14 2020 (r356833) +++ head/sys/riscv/riscv/bus_space_asm.S Fri Jan 17 16:48:20 2020 (r356834) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Ruslan Bukin + * Copyright (c) 2016-2020 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -38,13 +38,13 @@ __FBSDID("$FreeBSD$"); ENTRY(generic_bs_r_1) add a3, a1, a2 - lb a0, 0(a3) + lbu a0, 0(a3) ret END(generic_bs_r_1) ENTRY(generic_bs_r_2) add a3, a1, a2 - lh a0, 0(a3) + lhu a0, 0(a3) ret END(generic_bs_r_2) Modified: head/sys/riscv/riscv/support.S ============================================================================== --- head/sys/riscv/riscv/support.S Fri Jan 17 15:55:14 2020 (r356833) +++ head/sys/riscv/riscv/support.S Fri Jan 17 16:48:20 2020 (r356834) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015-2018 Ruslan Bukin + * Copyright (c) 2015-2020 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -102,7 +102,7 @@ ENTRY(fubyte) la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a1) /* And set it */ ENTER_USER_ACCESS(a1) - lb a0, 0(a0) /* Try loading the data */ + lbu a0, 0(a0) /* Try loading the data */ EXIT_USER_ACCESS(a1) SET_FAULT_HANDLER(x0, a1) /* Reset the fault handler */ ret /* Return */ @@ -117,7 +117,7 @@ ENTRY(fuword16) la a6, fsu_fault /* Load the fault handler */ SET_FAULT_HANDLER(a6, a1) /* And set it */ ENTER_USER_ACCESS(a1) - lh a0, 0(a0) /* Try loading the data */ + lhu a0, 0(a0) /* Try loading the data */ EXIT_USER_ACCESS(a1) SET_FAULT_HANDLER(x0, a1) /* Reset the fault handler */ ret /* Return */