Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1136532rdb; Tue, 30 Jan 2024 08:54:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IG7Y3KmpTw102cGwVZ9luFRaK+FCJWPtPdJYDEZidHHWo/FeL3FYkhI2CAFdjTiIql04SFe X-Received: by 2002:a05:6358:4411:b0:176:92d1:568f with SMTP id z17-20020a056358441100b0017692d1568fmr6313190rwc.18.1706633679780; Tue, 30 Jan 2024 08:54:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706633679; cv=pass; d=google.com; s=arc-20160816; b=lyPAmrzQj3uAZcvtqCYO7t3Wsqjh+JjdCe1Z4qNJQpQKybrpzOgMZo4GVIImw6aiYU ZRMwNnCXY6Slju5VlV4L5nTxToMRwHNP2V0Em8fgvEar46Tgr66wa/uvZnSuryDuMp1A cLGvXTkNRn2xhatcZYOmJIytoclvfDvj7cW1WxBwt1jrwPSwgVUdUt3zzL3pQGR6Wa5S XuHDDoH/bMvIUcRWKTQSdXUMQKtqJS3+LEaSit5nC357VXHpICMednMYx/Pp+Nwhk47Y bd+jUD35Dibj8Bia8lssqB6+P1SfyAPucoBDC+QJRz+AweCvzDgeshUMWy/7p6jYXKwZ h/+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=NaBMNzr+cAg9HARQ76XDRr+NTvdKYaoOi19UN7075Pg=; fh=sLt5f47gqTtW9z8i7d24fxb95mmu25q3R5AWSUaUWlw=; b=sxyrGGrLnkzlR69Zf7iFXrCGlPvW65+tHVx2l/BDYX4kBnYZXVVkVEGn9dmWwV+18+ uAYEWF9PnOpT3rDq2D84st78fohVVFbpIdQ3BEu5hDqUFJS7gX5Xwyw+DfhQmkGNt9ML GB+am1+Ri1mKfMSbFxubivmTd+WS2tinduoz23fNR1Y5VvoBTtMoOJqD+oFI0T4Qns9n 6JEMDhQmt1R2v0SSljaMHuzsGcZcjR7wBw9Vq4EqY0CIa8JF+AUV6O2Pex7nshMFqDyS pQ9Gevkhdg9pVum0Tso/kIau6FsHQENy0s/2X9mOvFYiXFD6Olqw3aIQrHIrJR7oh2w6 Eqsw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=O3j0OrZH; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-44990-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r16-20020a638f50000000b005cd813c23c4si7872062pgn.579.2024.01.30.08.54.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 08:54:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44990-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=O3j0OrZH; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-44990-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 812A228CD15 for ; Tue, 30 Jan 2024 16:53:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A845129A9B; Tue, 30 Jan 2024 16:53:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="O3j0OrZH" Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E657086ADC; Tue, 30 Jan 2024 16:53:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=167.114.26.122 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706633591; cv=none; b=EKHxJ3fA+ILWUQd9x7CBnQDnY4R7bPScxhDL6I+NVJQXqH+h64t2OQKAiltORg/XPqs1jZvg299eazWGgfLzol133jwEcS4RDfWh6Je3KiLRxn3f4OkSWd0dZHmwIgq+NHlSIA+2pNMbtQPtg+xfISc++vmLVyXjqtr5KYoXvLQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706633591; c=relaxed/simple; bh=Y0wTQsFQxBGihii2XUTlKjm4PLqLm9Iv8iRpB5W6oiU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=bjKCaPid54xCcpoxWexp/m3dIN+c+tYNVDF/Y60Zcs6EL9zMAo2S67p01d5LOEx63YiwXL2CuBlHNaHM6Qt2GLtmcANThAvHwpJBnDWn8uAXEhghoanIVhSBSlJtaQQI4agxIEo+zIxIwyCoEdTmABgWdRGfiuJZExPGGwmXt1A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=O3j0OrZH; arc=none smtp.client-ip=167.114.26.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706633582; bh=Y0wTQsFQxBGihii2XUTlKjm4PLqLm9Iv8iRpB5W6oiU=; h=From:To:Cc:Subject:Date:From; b=O3j0OrZHAaPVHqKNJDlGd9sdFDBgJv7ZTPNfF/geXnNU8X+vdyJrGNeG7jc2PmFcT vHVBTx2cw/X2mEB4vo+xPPWOPtfj3AJKyF1VL4ekbW/3UeTl1bhrPL7GJsbsUA4Xjf QN5n1PkrJytSFnG4MMAUxz0Hshp1lnfrHlGiViw5dhz+dbt5tSbQFQdUYOVz5zEo+z dkhR8Eo1aBMX3GoMv7Wy6G2ZBwdyZyWjGByfMC4pdfKcGaepdNqVweTXxNJdIP/9Jx 3w/wriketsu8SXr0KY8sxsTXpUqpeoZdN4oQeD4+Ioed20ctoxadZGPgNX63/gVKyG 2ldjjViqgwmkA== Received: from thinkos.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4TPWSZ2LkgzVCQ; Tue, 30 Jan 2024 11:53:02 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Vishal Verma , Dave Jiang Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , linux-mm@kvack.org, linux-arch@vger.kernel.org, Matthew Wilcox , Arnd Bergmann , Russell King , linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [RFC PATCH v2 0/8] Introduce dcache_is_aliasing() to fix DAX regression Date: Tue, 30 Jan 2024 11:52:47 -0500 Message-Id: <20240130165255.212591-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This commit introduced in v5.13 prevents building FS_DAX on 32-bit ARM, even on ARMv7 which does not have virtually aliased dcaches: commit d92576f1167c ("dax: does not work correctly with virtual aliasing caches") It used to work fine before: I have customers using DAX over pmem on ARMv7, but this regression will likely prevent them from upgrading their kernel. The root of the issue here is the fact that DAX was never designed to handle virtually aliased dcache (VIVT and VIPT with aliased dcache). It touches the pages through their linear mapping, which is not consistent with the userspace mappings on virtually aliased dcaches. This patch series introduces dcache_is_aliasing() with the new Kconfig option ARCH_HAS_CACHE_ALIASING and implements it for all architectures. The implementation of dcache_is_aliasing() is either evaluated to a constant at compile-time or a runtime check, which is what is needed on ARM. With this we can basically narrow down the list of architectures which are unsupported by DAX to those which are really affected. Note that the order of the series was completely changed based on the feedback received on v1, cache_is_aliasing() is renamed to dcache_is_aliasing(), ARCH_HAS_CACHE_ALIASING_DYNAMIC is gone, dcache_is_aliasing() vs ARCH_HAS_CACHE_ALIASING relationship is simplified, and the dax_is_supported() check was moved to its rightful place in all filesystems. Feedback is welcome, Thanks, Mathieu Cc: Andrew Morton Cc: Linus Torvalds Cc: linux-mm@kvack.org Cc: linux-arch@vger.kernel.org Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King Cc: linux-cxl@vger.kernel.org Cc: nvdimm@lists.linux.dev Cc: linux-fsdevel@vger.kernel.org Mathieu Desnoyers (8): dax: Introduce dax_is_supported() erofs: Use dax_is_supported() ext2: Use dax_is_supported() ext4: Use dax_is_supported() fuse: Use dax_is_supported() xfs: Use dax_is_supported() Introduce dcache_is_aliasing() across all architectures dax: Fix incorrect list of dcache aliasing architectures arch/arc/Kconfig | 1 + arch/arc/include/asm/cachetype.h | 9 +++++++++ arch/arm/Kconfig | 1 + arch/arm/include/asm/cachetype.h | 2 ++ arch/csky/Kconfig | 1 + arch/csky/include/asm/cachetype.h | 9 +++++++++ arch/m68k/Kconfig | 1 + arch/m68k/include/asm/cachetype.h | 9 +++++++++ arch/mips/Kconfig | 1 + arch/mips/include/asm/cachetype.h | 9 +++++++++ arch/nios2/Kconfig | 1 + arch/nios2/include/asm/cachetype.h | 10 ++++++++++ arch/parisc/Kconfig | 1 + arch/parisc/include/asm/cachetype.h | 9 +++++++++ arch/sh/Kconfig | 1 + arch/sh/include/asm/cachetype.h | 9 +++++++++ arch/sparc/Kconfig | 1 + arch/sparc/include/asm/cachetype.h | 14 ++++++++++++++ arch/xtensa/Kconfig | 1 + arch/xtensa/include/asm/cachetype.h | 10 ++++++++++ fs/Kconfig | 1 - fs/erofs/super.c | 5 ++++- fs/ext2/super.c | 6 +++++- fs/ext4/super.c | 5 ++++- fs/fuse/dax.c | 7 +++++++ fs/xfs/xfs_iops.c | 2 +- include/linux/cacheinfo.h | 6 ++++++ include/linux/dax.h | 9 +++++++++ mm/Kconfig | 6 ++++++ 29 files changed, 142 insertions(+), 5 deletions(-) create mode 100644 arch/arc/include/asm/cachetype.h create mode 100644 arch/csky/include/asm/cachetype.h create mode 100644 arch/m68k/include/asm/cachetype.h create mode 100644 arch/mips/include/asm/cachetype.h create mode 100644 arch/nios2/include/asm/cachetype.h create mode 100644 arch/parisc/include/asm/cachetype.h create mode 100644 arch/sh/include/asm/cachetype.h create mode 100644 arch/sparc/include/asm/cachetype.h create mode 100644 arch/xtensa/include/asm/cachetype.h -- 2.39.2