From nobody Wed May 08 18:52:44 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 4VZPR05VYkz5JypF; Wed, 08 May 2024 18:52:44 +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 4VZPR04w7xz49CN; Wed, 8 May 2024 18:52:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715194364; 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=zTqDyl5HUJafC0UO0pom/nfPVB9H5JOjCsnfjNzZHWo=; b=Gou3nqAR2yeH/8or8vnJTOSkG4ZHWp+llKvaif/kZ53YTBdYBTqCuLJeHGtq5h9Fz+BKlH jyEeA90690LVUt/KEQn8eM/tEh3SROnQgiLdVQAEc/qYapy+quicYtlh3d8WzGxN4t4Pex yz2A3mL+EjIKTFCK6NjseihXfWf+KU27cTdY3s9cdAw8B0iBuZ53AXQ6Kju4y6oU/HISlo Y41a7s/Zo++tJYIVMG/+R9nzsLUNiYTM70W/TlMIHqFg2Llkm0Wr7sAIdgND2UN2edKj6C j+EXIfVdft24HU0l94SHmE3gUo11pljma3cPA3ftXk7bWRx0wzq3J7g87xgZcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715194364; a=rsa-sha256; cv=none; b=u6GnEqpwfs9Sjrt8WmD0imEs1kHUnj7oy/ah7rGEwnDL5t0aHabRDvoGKGewroAGx4PtNG /9/2/0lLIs0pbgtaD1wB0/qxWe//I+uaW9b1Jwr4JC+bwmq9Aw4z8woUcJiJvWgXn9BP4y Da0aPxp3p3YZHlsOoAeKOU8kkl7tPE5/+QRCPTAGm1iV1AIYZlXMT3bD2Ox9TfqIOpqorf S4BAbHk97g+3pTeXRpM5UVC0qIVtl0UlJJcyebbWRgNPZCNNTKFhExOIuuLlyMtMH3bxbO uZhd7p7xx0sYdDrSVDCvso0N32XdEWCUWNtieQwQvJs80zQlGUsan1b5mHnLVg== 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=1715194364; 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=zTqDyl5HUJafC0UO0pom/nfPVB9H5JOjCsnfjNzZHWo=; b=EtP/fHMBHADEVrN6GJehP2tSCmXYnAnw3hLLNhpbAjP5U3KNL41PruVodbH/tchK37pBrq EBw/MXU1lSxxCnQlOZUuS1+WDLroOYGWZO/XAwING33+5bi+JXA/CSFl8qSbudZLc3Cx1+ Y4EPGG3q1ojAULo9fnhSe3A8lNhqvDHFTbPbhgUrmfDTVAJCDIEnR+EICh27B2mY1git2h pxIrPqTq4igq+EU2EiUf7h8fbV7aLXsc1kDiYIVsbhSVqE6cvc84mFxqVtrmSdu63Pc4FM K5jWn9uIR5zqKqdug67YHUr5+2NoANAocQSY2nZrKVwRHAKJjGu8ccD+cgEcOw== 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 4VZPR04WMszcP5; Wed, 8 May 2024 18:52:44 +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 448Iqiu4070548; Wed, 8 May 2024 18:52:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448Iqi18070545; Wed, 8 May 2024 18:52:44 GMT (envelope-from git) Date: Wed, 8 May 2024 18:52:44 GMT Message-Id: <202405081852.448Iqi18070545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tijl Coosemans Subject: git: 2ae0f5a4d093 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 2ae0f5a4d0931067c672be9a791909f0e32d5a0e Auto-Submitted: auto-generated The branch main has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=2ae0f5a4d0931067c672be9a791909f0e32d5a0e commit 2ae0f5a4d0931067c672be9a791909f0e32d5a0e Author: Tijl Coosemans AuthorDate: 2024-05-08 18:49:56 +0000 Commit: Tijl Coosemans CommitDate: 2024-05-08 18:52:37 +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 --- 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_ */