From patchwork Tue Jan 30 16:52:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13537746 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1992C46CD2 for ; Tue, 30 Jan 2024 16:53:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 099FC6B00A7; Tue, 30 Jan 2024 11:53:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 026896B00A9; Tue, 30 Jan 2024 11:53:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D40EA6B00A8; Tue, 30 Jan 2024 11:53:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B85936B00A5 for ; Tue, 30 Jan 2024 11:53:08 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9D5D3A2116 for ; Tue, 30 Jan 2024 16:53:08 +0000 (UTC) X-FDA: 81736572456.13.B9F3FFD Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf19.hostedemail.com (Postfix) with ESMTP id 0F91F1A0002 for ; Tue, 30 Jan 2024 16:53:06 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=BUhe710j; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf19.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706633587; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jZU2ZbbgI/b/87AeHhjaYiSd5/oOGG+UvSS00fh9aPo=; b=rsvy5ocy7Gaf6+BkE3ui7iFGjBFhz14wF72vj9uK8gFToGW/+cJXCiw1hg3MHFJjZ8CM5H rLHCabKTU9sYcrpH/ScM8iLQNvL60/7hEts4Zf3w8WnLOWnRYRYhBQFC4NMlJ7J0Vbv0ik NGRgNlXI7IbZx/KPYP8BqEJUaHK65rA= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=BUhe710j; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf19.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706633587; a=rsa-sha256; cv=none; b=b6BJk+589B00nNbUfnO+t0wKuzQuzWzXCYlPgySz1w+sbBv50ho+BCMRuSExMmnh0OsqiQ Kfkhs+ZduiE9qdyJjTY7KW5CtQyuU9b/uBKZwkux2nxEVmZkxtOBYyDlFCoU7afI1+iWkE k62BTg67Dn2b07Ddg8d0/VWc8XBJMQo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706633585; bh=39364yK8Vve2TZEwvAasv/nldxj5QFqZMMVmBMwwiu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BUhe710jU2/derdpsA0dmrgdapNQmX0LXTEssfQdWcX2L97NEiIfvqlxiNskzlCQ+ uFBF2yIOIW7lLhGlgmLYL2QC0ZeqL0RkTwoEYx20D9bs890S3wdBKzVJdaeYrnozqP r4rIEq4WyYWNEKxGADF+jEmZYQH3YyuJEpH3/tIUj4UOrrV1coGgapkbjslqVS0p7F g8VCDbYKUyXI00zoYgdo6nbeTVRFmEiOfxFc5YMj8+QBGAhQlPTdTKLswnRa7tKr2a n8HrygNAcyh6r6ttOBpYmgmUin69L64Gw64u0Grq9Que0glHbaZLrtM5V+rY3Uav/H Pv8DFsI0xlUoA== 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 4TPWSd16qfzVlV; Tue, 30 Jan 2024 11:53:05 -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 , nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [RFC PATCH v2 8/8] dax: Fix incorrect list of dcache aliasing architectures Date: Tue, 30 Jan 2024 11:52:55 -0500 Message-Id: <20240130165255.212591-9-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240130165255.212591-1-mathieu.desnoyers@efficios.com> References: <20240130165255.212591-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 0F91F1A0002 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 5kx5osid94iorp1faq8agha3r9wwcm95 X-HE-Tag: 1706633586-391634 X-HE-Meta: U2FsdGVkX19tJ9j3WiDPrSpA+o2/grYM9HINZsb51Q4EObxk1ueNgmixUVs6tbkF+eXwu6tpdhI7hKU7fQ2FJOlK+wBRSW//iyJqoqYrmO1eS29+Hzq27vib7euIMhVftZhVb2JSZMczt10+LNLUz1/lrSoExxqAlPBF5rYZHhoggJfquUngLoM1+JCuQXqIRSP6Rr1OoFwK5EwIul4/8BoQEtearPKVfhs3F46oJA0yVKZrv95ewuw597F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Qi52BhCvtbaKXUrcSIoPJha6ZpQ/b2g7tma4fFWs9hwp4Fax91+0YaUES0ROYp2KLPjp/d4qU7jn2kJ/pUGYRjWQNLAezzl6Wm1E1isDCvuPGhTfsTGTpNd1haX4Hi/TQr8CJ3/6BzES7cy9HbWhnAJrVb8AElgQcqCr3E9lcGexdM2WcdTEtLgUoGdRJVR5LTkXKJJTzAopuJ8/hTm4t4SfsWH6guYl9qA6e4+ADa8edp0jnyZ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: commit d92576f1167c ("dax: does not work correctly with virtual aliasing caches") prevents DAX from building on architectures with virtually aliased dcache with: depends on !(ARM || MIPS || SPARC) This check is too broad (e.g. recent ARMv7 don't have virtually aliased dcaches), and also misses many other architectures with virtually aliased dcache. This is a regression introduced in the v5.13 Linux kernel where the dax mount option is removed for 32-bit ARMv7 boards which have no dcache aliasing, and therefore should work fine with FS_DAX. This was turned into the following implementation of dax_is_supported() by a preparatory change: return !IS_ENABLED(CONFIG_ARM) && !IS_ENABLED(CONFIG_MIPS) && !IS_ENABLED(CONFIG_SPARC); Use dcache_is_aliasing() instead to figure out whether the environment has aliasing dcaches. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers 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: nvdimm@lists.linux.dev Cc: linux-cxl@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org --- include/linux/dax.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linux/dax.h b/include/linux/dax.h index cfc8cd4a3eae..f59e604662e4 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -5,6 +5,7 @@ #include #include #include +#include typedef unsigned long dax_entry_t; @@ -80,9 +81,7 @@ static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, } static inline bool dax_is_supported(void) { - return !IS_ENABLED(CONFIG_ARM) && - !IS_ENABLED(CONFIG_MIPS) && - !IS_ENABLED(CONFIG_SPARC); + return !dcache_is_aliasing(); } #else static inline void *dax_holder(struct dax_device *dax_dev)