From owner-dev-commits-src-all@freebsd.org Sun Jun 13 19:15:57 2021 Return-Path: Delivered-To: dev-commits-src-all@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 3544B643C7F; Sun, 13 Jun 2021 19:15:57 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G34705MqPz4bg0; Sun, 13 Jun 2021 19:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68032264DB; Sun, 13 Jun 2021 19:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15DJFu16047329; Sun, 13 Jun 2021 19:15:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15DJFuxW047328; Sun, 13 Jun 2021 19:15:56 GMT (envelope-from git) Date: Sun, 13 Jun 2021 19:15:56 GMT Message-Id: <202106131915.15DJFuxW047328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 2a8921c5d187 - stable/13 - pciconf: Use VM_MEMATTR_DEVICE on supported architectures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2a8921c5d187a2c3f1b709cc77c839568ede0b8d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 19:15:57 -0000 The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2a8921c5d187a2c3f1b709cc77c839568ede0b8d commit 2a8921c5d187a2c3f1b709cc77c839568ede0b8d Author: Marcin Wojtas AuthorDate: 2021-04-06 15:00:05 +0000 Commit: Andrew Turner CommitDate: 2021-06-13 15:49:36 +0000 pciconf: Use VM_MEMATTR_DEVICE on supported architectures Some architectures - armv7, armv8 and riscv use VM_MEMATTR_DEVICE when mapping device registers in kernel. Do the same in pciconf. On armada8k SoC all reads from BARs mapped with hitherto attribute (VM_MEMATTR_UNCACHEABLE) return 0xff's. Submitted by: Kornel Duleba Reviewed by: kib Obtained from: Semihalf Sponsored by: Marvell Differential revision: https://reviews.freebsd.org/D29603 (cherry picked from commit 1c1ead9b94a1a731646327ec3b09e8f3acd577b8) --- usr.sbin/pciconf/pciconf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c index 817de6ec09ed..6b54687d7c79 100644 --- a/usr.sbin/pciconf/pciconf.c +++ b/usr.sbin/pciconf/pciconf.c @@ -1126,7 +1126,11 @@ dump_bar(const char *name, const char *reg, const char *bar_start, if (*reg == '\0' || *el != '\0') errx(1, "Invalid bar specification %s", reg); pbm.pbm_flags = 0; - pbm.pbm_memattr = VM_MEMATTR_UNCACHEABLE; /* XXX */ +#ifdef VM_MEMATTR_DEVICE + pbm.pbm_memattr = VM_MEMATTR_DEVICE; +#else + pbm.pbm_memattr = VM_MEMATTR_UNCACHEABLE; +#endif fd = open(_PATH_DEVPCI, O_RDWR, 0); if (fd < 0)