From patchwork Mon Jan 29 21:06:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13536400 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 5A14BC47DA9 for ; Mon, 29 Jan 2024 21:07:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D2326B009C; Mon, 29 Jan 2024 16:06:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 206FB6B00A2; Mon, 29 Jan 2024 16:06:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D95816B009C; Mon, 29 Jan 2024 16:06:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id ADB986B009E for ; Mon, 29 Jan 2024 16:06:54 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 89785C02D5 for ; Mon, 29 Jan 2024 21:06:54 +0000 (UTC) X-FDA: 81733583148.26.70D81E6 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf10.hostedemail.com (Postfix) with ESMTP id 007F9C001E for ; Mon, 29 Jan 2024 21:06:52 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=CcOYTXBC; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf10.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=1706562413; 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=h7fxtm6Dz7MxzniRp8UbYNumQbLRlmJV1CMVtnUarkc=; b=67B1Ko5+jdwUm4JyqxRon9YkCQmGLnWZpJ9AbF2sgXx7F+VzaH+L1FQJn8oZk9IWTJ5GGt MGCMg8vgu1/xrh+JRSAuxET8qt9e1qqb15pEtblrXrvKgYWN1GB5Rr0UM62rxvu3rXYCHt ddtU2ba6MX4NjmP8UZxZGrg6Yn/9OpQ= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=CcOYTXBC; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf10.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=1706562413; a=rsa-sha256; cv=none; b=T5K5YAJpsdwKlJwxTPihSxpBMrmDCdnxwAOxvXemYzWpNx+MBskXkYxPwc6Z/dSoRLpJZa oWacJVXyDRtL9pdvQk96NK9Og1ePlXleKwQPsIdHK7pdA7CtT7DF19a1E7weJii6vvjHww lhbFM2PzEidQwz7Owf9Mjbimc3oobqY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706562411; bh=+9KVNYBLuRYpTotbk2zGsoJXymuo5SYIdtEsNtMMAo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CcOYTXBC+giecQFAnLXwCTdIA57noQj2OFLZSCDKOIqpDr07dTVy1a8yJ3JryQJFV 2W5WB4QDkxTlNWbKpDcCfDCV1Yk9/dIKfFXxGJuTQcgowNhMsO3Yukg02bjPIMQFRv /baVDZYZtLVEz5A+3KUgQ0PgbI8sFNR5jmvB/7Vj1O8CCBTsO3bSZG9kBumQzDZiac Bm8evVOKtcBoj9wUdK5Wg/PiFVXjpfyrc41vpv1g5ItzalsHpw3MmQJYQPi57b1jWs DvIBjtghpS+h8EJifX32P3NqBz5VyeY9kNGlqU4+zvabpczDg6wWwsmvAwIDe9N3Eq k/288u39p8m6w== 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 4TP17v2W6RzVfr; Mon, 29 Jan 2024 16:06:51 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Vishal Verma , Dave Jiang Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Chandan Babu R , "Darrick J . Wong" , linux-xfs@vger.kernel.org, Andrew Morton , Linus Torvalds , linux-mm@kvack.org, linux-arch@vger.kernel.org, Matthew Wilcox , nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org Subject: [RFC PATCH 7/7] xfs: Use dax_is_supported() Date: Mon, 29 Jan 2024 16:06:31 -0500 Message-Id: <20240129210631.193493-8-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240129210631.193493-1-mathieu.desnoyers@efficios.com> References: <20240129210631.193493-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: h739tgum4g1zgpi1y4ifdxisz4gmz1ed X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 007F9C001E X-HE-Tag: 1706562412-418494 X-HE-Meta: U2FsdGVkX1+bBrpoyOYTdO5urg4XSJc9WDAoGiVWk/arP3EmMn3Oq2wGRQlJ+XuE+JXRPrE31J1xMA62kSVD9RcUnxx9s4ItCZsHoTUP7Hl8Q+YGiEiPrqnB2GzzvEZ5YvzD3R9lcyxV6ReCL5RMzemiLPfo2rQ4qA+AmKwXjsmu5rifghbX8cS45+i0iuzOX6vAz6elhaWzYfRGOFDGvE+AwhTVTemub66Z2QHxmXXBcUk3A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pfM3tOGUMq+B4lODuC2Q8uPE9Ha69WQ2dD+BcG+CuZEk7NKuEYSVX/SOicL657nesr1rgwdNqJmR8+KQOt1LhePUCMkPKlvJXAcNAxsjlw/nZdhfYXsK6ILU8iJEIWco9rs3kuWtJu0EwHPk43cjM7r5SqrtLUAIeUdjUncYNh6Wk04Vx30IqMIKi2NQl7kxR053NgzpxEWjOMNKtlljnSwVUCUSnID6tYaTjqZsTQlPdMKeyTY+X3dahI+nXji2zQK8= 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: Use dax_is_supported() to validate whether the architecture has virtually aliased caches at mount time. This is relevant for architectures which require a dynamic check to validate whether they have virtually aliased data caches (ARCH_HAS_CACHE_ALIASING_DYNAMIC=y). Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Chandan Babu R Cc: Darrick J. Wong Cc: linux-xfs@vger.kernel.org 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: nvdimm@lists.linux.dev Cc: linux-cxl@vger.kernel.org --- fs/xfs/xfs_super.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 764304595e8b..b27ecb11db66 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1376,14 +1376,22 @@ xfs_fs_parse_param( case Opt_nodiscard: parsing_mp->m_features &= ~XFS_FEAT_DISCARD; return 0; -#ifdef CONFIG_FS_DAX case Opt_dax: - xfs_mount_set_dax_mode(parsing_mp, XFS_DAX_ALWAYS); - return 0; + if (dax_is_supported()) { + xfs_mount_set_dax_mode(parsing_mp, XFS_DAX_ALWAYS); + return 0; + } else { + xfs_warn(parsing_mp, "dax option not supported."); + return -EINVAL; + } case Opt_dax_enum: - xfs_mount_set_dax_mode(parsing_mp, result.uint_32); - return 0; -#endif + if (dax_is_supported()) { + xfs_mount_set_dax_mode(parsing_mp, result.uint_32); + return 0; + } else { + xfs_warn(parsing_mp, "dax option not supported."); + return -EINVAL; + } /* Following mount options will be removed in September 2025 */ case Opt_ikeep: xfs_fs_warn_deprecated(fc, param, XFS_FEAT_IKEEP, true);