From nobody Sat May 11 15:38:33 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 4Vc8zZ10R2z5KKhK; Sat, 11 May 2024 15:38:34 +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 4Vc8zZ0Rp2z44cp; Sat, 11 May 2024 15:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715441914; 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=ywAliOX9aFinJrvJo3pTb9r0eTtQs1gyyjXncxXiUEs=; b=cPTJS7pI4wh92leBEvuX+o8dElesIpvZh4zkGIV/L4pv8dfQZV7RiLhrj70FHbhjaYKRiA fFAEmthHEi0PuWv0bnO86CF+8hdo6grPj/bEEUzUGB8qnM1brKrAC5dC6J7jHeXxxevsYY Esh9Wp29DMalYtAQq60xJ2Eas9icGVhnnlcFvhRduQT+DoeGw2xwhkHbu0oNGoJcxm0X+F +VgRFvsfhGu2ar0BnwxcCxhShHISvM+aVkfbV+W70jiyC7wjgCDAuLQZqj8GWtvb8XzDAz IIKekzCFT48EkUXXOZOHyirvhDWWI7hCVbToGDNVl/NGhY9bmYblGdugeC/lEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715441914; a=rsa-sha256; cv=none; b=T9GCc0L22POxAQ/SXAfyw84cja0mzSyOdiG58v0u5IrUvWIsrkPqH31JAgqCQkn+GHtIoC 6FJx1FTSXsx0p+USPT+RUX88EW8G2og1UqSWdnfKocQIuQx6heHJhW6pPxMPbpKhE1RuoH FK7QMJBVp5RxDU9SyjUBqv6rfc977QoDVHBM52x8lEAVDE/HBJ2cY6K6qiuBxc2y7NOuJh LwIqK//mGafblMXZwHtgmyumhLJ9PpT077Uha0pVhhBlIqiIAGT2ho1SO7dv934hQpsw1q Jd2ajuE4ADb0Y4hgbktzod+t7zjoW4kuD/7yxKeCYGaB4DbUECTekHAxjc1H4A== 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=1715441914; 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=ywAliOX9aFinJrvJo3pTb9r0eTtQs1gyyjXncxXiUEs=; b=O57P2E/LGbiOMzc/QyHHrTjRq2iu7roRFxqHiTWOBZ5hS4KVOI+DVCB71h5mr5KrOU0Ogn RjJIdsPUPOpreedwsYLD6J40Pxs3lqk/K48BeMEeVJSjWdMmujGHgfXSGtKkX6xzzEEKiP 2BieEcixKHekMpkXOETv2n2XqnyJY9fJBiSnPcwirUDM7gvz3UDnlYspRV88+chDgopEXT 7t2wmZKoR7dGmEXhtDgerWjjffupcBkY456cDJYzHvsXu34flivB/c/fSC8k/OY8hPmRDV FJ64xed4EXoaT88Xm0OvmaDQceANZWrgVYFN/s//l8AeGG7H80ocmeXHmPazzA== 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 4Vc8zZ031DzRDc; Sat, 11 May 2024 15:38:34 +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 44BFcXWI039587; Sat, 11 May 2024 15:38:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44BFcXA1039584; Sat, 11 May 2024 15:38:33 GMT (envelope-from git) Date: Sat, 11 May 2024 15:38:33 GMT Message-Id: <202405111538.44BFcXA1039584@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: 2d97bd0639cd - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 2d97bd0639cd0af43b7beb6f45ef15bcf110db57 Auto-Submitted: auto-generated The branch stable/14 has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=2d97bd0639cd0af43b7beb6f45ef15bcf110db57 commit 2d97bd0639cd0af43b7beb6f45ef15bcf110db57 Author: Tijl Coosemans AuthorDate: 2024-05-08 18:49:56 +0000 Commit: Tijl Coosemans CommitDate: 2024-05-11 15:32:51 +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 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45125 (cherry picked from commit 2ae0f5a4d0931067c672be9a791909f0e32d5a0e) --- 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_ */