From nobody Sun May 12 15:58:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VcnMZ5jHnz5KGM9; Sun, 12 May 2024 15:58:02 +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 4VcnMZ3hbZz4PDV; Sun, 12 May 2024 15:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715529482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Ydb9HOsWPhGtcGKh7WY+1wGBL5LpUUhU4ODBEmi1Og=; b=CuGmxE4bVMsn/ngdXu0NLgF6nBWdiOTANnccH15Ra3l9E8pgTKWsR8amOIll01Rh0x6ShG FW/MKk18gfiil6ZR2R+IQcfGJQAgovKF/nHMkoh6naTWGOqJmkfBrbsfCie/7aBK+hOZYE TEk+4ktmIQ/yqV6gMfZ6gX3s9B2vBivYjgQca7oXywSvIbQikJyP60Eos1WSRNDH3MoGVP E2l8eDclwPmIHrSLimo9TxvM7Ui4d1kOpXNqQlhwl/avVsE8YNVgE3EVBf8kmCkSJSchV3 ZmnK0VEQbyI3jw58mfVWBnTwsMwmz6v854hFwbJ6oGXlWiFMvP8Yolxjc6ElLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715529482; a=rsa-sha256; cv=none; b=v/zx0mRzXADZYLaDzt/nKheUdLMW9VMkSZYa/Mx7P5jbG/A1yySlox7I83ASbioXvulOUY 9W/Npm/wqKjtfQT+vdqIuIH2wwQ7GG57GtmqN77EzEWx337qZ24xz0nmdO7o7Vm8i8FQOX kkRSItyg+JTNJoNZRj+Bpn0wTXUDxsxSNrCk9XxVszkwPtKjBuPnRQqv2V7fl0EEYCUKeR 0vfOOHZb09o6R7a5rt52biT07Hvnt7jic2Mi63LkC1y7CrGYqdh+lTLKHGnAmr5eqoahMC eu+m73P22WNB/WFEhZshsyQ9mFRKVf10GwdIHPSZjQCpCyeRAA9Ei/+vBmGMOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715529482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Ydb9HOsWPhGtcGKh7WY+1wGBL5LpUUhU4ODBEmi1Og=; b=rsAWMHsS1IzGGzclneYXVi0NufS3W+XVrDFdaM9LqMoRF+YKtccU2ciaW7Lx5ldMBJ2T4q h3Fajyx+JMHUKfHLYfldHvYwxEksTL6GmDU/IzhDXMFqGo6Xb1D8Z53R1JDc4+a4quC4sY KCg0gIUz1t1Yu4hYSrW0KujVpx6NweBUp5seLCX6+Vb0i7g4YMzz42g/1ByEmrsqA8yKvX LKJFKst6U6E3tsKGJykMjOyHXwBeRjfJ6VuTLB1Uv8PvCruuv0o+ym132q52s5wRIj4sL9 jmtyN8isAK8GJC0al7BBhP+X4sd751N6/Ht7tW12Z4ublPCwaF1dV2XMX6rkxg== 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 4VcnMZ30w5z18g8; Sun, 12 May 2024 15:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44CFw2g1007894; Sun, 12 May 2024 15:58:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44CFw2PE007891; Sun, 12 May 2024 15:58:02 GMT (envelope-from git) Date: Sun, 12 May 2024 15:58:02 GMT Message-Id: <202405121558.44CFw2PE007891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Tijl Coosemans Subject: git: fe13793bb442 - releng/14.1 - linuxkpi: Make arch_io_*_memtype_wc amd64-only List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: fe13793bb44212607c231a9c793de05aea74dc7b Auto-Submitted: auto-generated The branch releng/14.1 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=fe13793bb44212607c231a9c793de05aea74dc7b commit fe13793bb44212607c231a9c793de05aea74dc7b Author: Tijl Coosemans AuthorDate: 2024-05-08 18:49:56 +0000 Commit: Tijl Coosemans CommitDate: 2024-05-12 15:56:55 +0000 linuxkpi: Make arch_io_*_memtype_wc amd64-only Linux only implements these functions on x86. They return 0 on other architectures. The FreeBSD implementation calls PHYS_TO_DMAP but this panics on i386 because it does not have a direct map so return 0 on i386 as well for now. These functions are only used by graphics/drm-*-kmod to mark the VRAM aperture write-combining but this is also accomplished by a call to vm_phys_fictitious_reg_range so this change is sufficient to fix drm-*-kmod on i386 for FreeBSD 14.1. Reviewed by: kib Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D45125 (cherry picked from commit 2ae0f5a4d0931067c672be9a791909f0e32d5a0e) (cherry picked from commit 2d97bd0639cd0af43b7beb6f45ef15bcf110db57) --- sys/compat/linuxkpi/common/include/linux/io.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index bce70ed0cb8d..164347dbc4e7 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -541,30 +541,29 @@ void lkpi_arch_phys_wc_del(int); #define arch_phys_wc_index(x) \ (((x) < __MTRR_ID_BASE) ? -1 : ((x) - __MTRR_ID_BASE)) -#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__) || defined(__powerpc__) || defined(__riscv) static inline int arch_io_reserve_memtype_wc(resource_size_t start, resource_size_t size) { +#if defined(__amd64__) vm_offset_t va; va = PHYS_TO_DMAP(start); - -#ifdef VM_MEMATTR_WRITE_COMBINING return (-pmap_change_attr(va, size, VM_MEMATTR_WRITE_COMBINING)); #else - return (-pmap_change_attr(va, size, VM_MEMATTR_UNCACHEABLE)); + return (0); #endif } static inline void arch_io_free_memtype_wc(resource_size_t start, resource_size_t size) { +#if defined(__amd64__) vm_offset_t va; va = PHYS_TO_DMAP(start); pmap_change_attr(va, size, VM_MEMATTR_WRITE_BACK); -} #endif +} #endif /* _LINUXKPI_LINUX_IO_H_ */