From patchwork Tue Jan 30 16:52:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13537739 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 C2951C46CD2 for ; Tue, 30 Jan 2024 16:53:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3F1D56B009E; Tue, 30 Jan 2024 11:53:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A1796B009F; Tue, 30 Jan 2024 11:53:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26C616B00A0; Tue, 30 Jan 2024 11:53:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 160D96B009E for ; Tue, 30 Jan 2024 11:53:06 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 99F55120874 for ; Tue, 30 Jan 2024 16:53:05 +0000 (UTC) X-FDA: 81736572330.12.404B10F Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf15.hostedemail.com (Postfix) with ESMTP id 01D64A0019 for ; Tue, 30 Jan 2024 16:53:03 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=vgbjUBoC; spf=pass (imf15.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706633584; a=rsa-sha256; cv=none; b=5aIH11VkS8ocKNN+HFQo1rzCtT88Ih5Nu//vi+LXAoSWDf+g3wt3fK9N2IFxUh6kDczWLy IuEwI7iiUIB1cAhIHrVGy3oi0T96GDdM+0FYLBThwGYw2zaHX8BwCqhJvAldXRKz8+HcrG HbVYg1aCHJiHEvdf13X+abTCHefQ1w0= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=vgbjUBoC; spf=pass (imf15.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706633584; 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=XsGwYVoIL2p17hZN8IAvz/FHhHmi8wuXgYvwpNE3TAw=; b=z2koEOZgkG5xZvubY6yZro/uOqDSZVsgX3WJ6L47hgB6JF4Tw8tX1jJ561g/7z0ULXaqyv eEp8zLKSD1AiuPO64M6xIoK+K+xFtnc8MoszNZ63TblHgO4S9XIshEjky/Wx/cQbR1bWyA wujxSUFKqeMdtEvW/wLQPfavU6w3yNw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706633582; bh=kONcCPsuyI5WQYSGBCSYy4QvFvi3USH7Uw/j5x6yQS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vgbjUBoCsBWslMcltBfdpWSeMuBJh9vagVsOzVBCsYPflmZF21l/oXX1Ba/PO3mLt IAo6tDBPixabdyL82vFyeZRM4K5gXSlF3AcHSkts4ATD0jK0r54h3KWd9BfSuB2vq3 5ncl3QmDBgaRucDB6G9aoZY9wcKTZ8lNMpVD2BB6c/pWaO6TWZJpNAP6qpjr4lp/QH Xrf1q2e9OeLafet9cmHN9zLTm4hViwA6TMJFVknG1455my5qsCaRlgKhoJB5AHSqBX z7oR+SBvEguwEdLQu5X8pytv05SsqgN3NUYNRzNrZcjomR6+XC1ZyjdraSUi/geEb6 in89aPEvh0XWw== 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 4TPWSZ4m37zVCR; 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 , nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [RFC PATCH v2 1/8] dax: Introduce dax_is_supported() Date: Tue, 30 Jan 2024 11:52:48 -0500 Message-Id: <20240130165255.212591-2-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-Server: rspam08 X-Rspamd-Queue-Id: 01D64A0019 X-Stat-Signature: 8nspb5ri7aaehugcdpk65cjy41yigo3b X-Rspam-User: X-HE-Tag: 1706633583-144198 X-HE-Meta: U2FsdGVkX19ZgUb0uBZWSVMbxJGZ/RCxwbrD+ebgaBZA7obKc6PIKlorA8J/icKfbi2AWsUgJ8g39yNphzz6ip5h0C+FfXNmcagKEXc+DHr7a0eiXsxbovgwxCv7l+3nYpTcqe2pxHRjxM2WBAy/qmHinz/konXklOMC366Peukb9NS29E68XRYoAcXuuSVh6VltR3n3cgj5wuS5+yrTCu4O+qMost6qjhuryE245aQXZ+LHBuYrRhHicTnYumptzi2qprjiWcO8x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8xg7FT9Boqw0T6q9MYoSYcil6R7Qt5BcECeecim1XtB/WMeVs0pLqQV/kMt7uNWuFL4ISkcFaMgJ05FOco/SZ16gkU9+B0D1LPZJWBNZYUPajWgsuEFq83wRhwC0+onyuZe33UtXXrj1A4LXSDcKnxk4oUqMRgVg7V9g7o9yEsY1Xt2dKs5R5CASnEklaVLH19cqmIDZYMa1SBVKGcmVtIVF8Pv8+HYZ9Bycf4X1QTQC1NWgxy3uyEcm2k5ywiZorG9yo8jbfaIRVZk4WQ== 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: Introduce a new dax_is_supported() static inline to check whether the architecture supports DAX. This replaces the following fs/Kconfig:FS_DAX dependency: depends on !(ARM || MIPS || SPARC) This is done in preparation for its use by each filesystem supporting the dax mount option to validate whether dax is indeed supported. This is done in preparation for using dcache_is_aliasing() in a following change which will properly support architectures which detect dcache aliasing at runtime. 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 --- fs/Kconfig | 1 - include/linux/dax.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/Kconfig b/fs/Kconfig index 42837617a55b..e5efdb3b276b 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -56,7 +56,6 @@ endif # BLOCK config FS_DAX bool "File system based Direct Access (DAX) support" depends on MMU - depends on !(ARM || MIPS || SPARC) depends on ZONE_DEVICE || FS_DAX_LIMITED select FS_IOMAP select DAX diff --git a/include/linux/dax.h b/include/linux/dax.h index b463502b16e1..cfc8cd4a3eae 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -78,6 +78,12 @@ static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, return false; return dax_synchronous(dax_dev); } +static inline bool dax_is_supported(void) +{ + return !IS_ENABLED(CONFIG_ARM) && + !IS_ENABLED(CONFIG_MIPS) && + !IS_ENABLED(CONFIG_SPARC); +} #else static inline void *dax_holder(struct dax_device *dax_dev) { @@ -122,6 +128,10 @@ static inline size_t dax_recovery_write(struct dax_device *dax_dev, { return 0; } +static inline bool dax_is_supported(void) +{ + return false; +} #endif void set_dax_nocache(struct dax_device *dax_dev);