From owner-svn-src-head@freebsd.org Wed Sep 12 08:05:35 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 0932B108AD24; Wed, 12 Sep 2018 08:05:35 +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 A3F5B770ED; Wed, 12 Sep 2018 08:05:34 +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 98D0D23CD9; Wed, 12 Sep 2018 08:05:34 +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 w8C85Yjv012405; Wed, 12 Sep 2018 08:05:34 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8C85YcP012403; Wed, 12 Sep 2018 08:05:34 GMT (envelope-from br@FreeBSD.org) Message-Id: <201809120805.w8C85YcP012403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 12 Sep 2018 08:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338608 - in head/sys: net sys X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: net sys X-SVN-Commit-Revision: 338608 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.27 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, 12 Sep 2018 08:05:35 -0000 Author: br Date: Wed Sep 12 08:05:33 2018 New Revision: 338608 URL: https://svnweb.freebsd.org/changeset/base/338608 Log: Don't mark module data as static on RISC-V. Similar to arm64, riscv compiler uses PC-relative loads/stores, and with static data compiler does not emit relocations. In result, kernel module linker has nothing to fix and data accessed from the wrong location. Approved by: re (gjb) Sponsored by: DARPA, AFRL Modified: head/sys/net/vnet.h head/sys/sys/pcpu.h Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Wed Sep 12 05:08:49 2018 (r338607) +++ head/sys/net/vnet.h Wed Sep 12 08:05:33 2018 (r338608) @@ -273,7 +273,7 @@ extern struct sx vnet_sxlock; /* struct _hack is to stop this from being used with static data */ #define VNET_DEFINE(t, n) \ struct _hack; t VNET_NAME(n) __section(VNET_SETNAME) __used -#if defined(KLD_MODULE) && defined(__aarch64__) +#if defined(KLD_MODULE) && (defined(__aarch64__) || defined(__riscv)) /* * As with DPCPU_DEFINE_STATIC we are unable to mark this data as static * in modules on some architectures. Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Wed Sep 12 05:08:49 2018 (r338607) +++ head/sys/sys/pcpu.h Wed Sep 12 08:05:33 2018 (r338608) @@ -84,7 +84,7 @@ extern uintptr_t dpcpu_off[]; /* struct _hack is to stop this from being used with the static keyword. */ #define DPCPU_DEFINE(t, n) \ struct _hack; t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used -#if defined(KLD_MODULE) && defined(__aarch64__) +#if defined(KLD_MODULE) && (defined(__aarch64__) || defined(__riscv)) /* * On some architectures the compiler will use PC-relative load to * find the address of DPCPU data with the static keyword. We then