Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp818069rdb; Fri, 26 Jan 2024 11:34:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3xZ4ffGa1pO6J6HeTLssFqQPZ0zM4uxTXhOBNaSrZ4yBaMvNLxjXsotsLCedGXEZ9Qwlp X-Received: by 2002:a2e:3305:0:b0:2cf:121:3ccb with SMTP id d5-20020a2e3305000000b002cf01213ccbmr178867ljc.55.1706297658611; Fri, 26 Jan 2024 11:34:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706297658; cv=pass; d=google.com; s=arc-20160816; b=lhh80YgAi/y0ghuyfTW43/olhPqm45B9zsoXxFjuudZBWnRho7AiJv/setpUgnekGO sMLm91tkwQA7NaZM43hppdcJgXRadJZQAJeZWsgKOvObAZL2X/M3kFxWQjbyOJKvuFgy Qyx11GQjZ61AxmvcR1OU7BLwIJBGc+yyJVz50WBMgfV3KHHoiwgAfziAXDXYT1cNFaCG mjSX7l2G5j+2MsRjX/nDm/imHsyEpVEzjedW9qeiuZYgETa//HCGhV8Bj9xcqxNyrWeB b0CEXkgYJ1/7N/lDwjoEj5Jsgvx4FHNlf8lR/+DFqjQieoBenx9e8PqhPwtSRnxGs3Jk XGXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:to:from:content-language :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=h8pmL9jLWvvPTG0B7Jp8sr7EMU0Kb5koC3fZOQWO2zY=; fh=HYGuySxX1hXKIYDOuoEVPopqZAVZKfjWzJT8aamFAeQ=; b=V/p8ltb5EJy0cIIiCSs33gaLZrB5O9HcuT2412qJNbRF58PgN6Cl5krX5F+X9XWZyB ilqdkp/BovL5csHkaYDPsyyzVteIyhhZe786i3jzCAIsxsEDgMJGD6vkc5CtUtq8GKqi HhFzzOurOhZFgiLt7URqdk4TRjaCAkuxd4U7woETd3mMlbfrjlGt6tgdziGsBj3KDigS 0QMx9zgpCdejzo91c2kN9hityvPbQ5nNO7sXwFe/DmOK1ljDqBDdfRdKPNg5Vv/7rPfW nwuqCN1+i37nRZGsvjmqm6zbv6AEtEw3DLSLY+0ibxzR5iDLPVeX7Dc5RG+Od7sZ3b38 pfRw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=CYryvNhP; 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-40576-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40576-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id fd24-20020a056402389800b0055c208eadadsi908460edb.223.2024.01.26.11.34.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 11:34:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40576-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=CYryvNhP; 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-40576-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40576-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5BE011F233A2 for ; Fri, 26 Jan 2024 19:34:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5F26225CD; Fri, 26 Jan 2024 19:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="CYryvNhP" 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 ECA0E225CE; Fri, 26 Jan 2024 19:34:00 +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=1706297643; cv=none; b=JngSd0klYSeBmaOxuB3lLpJ8a+S8wDuuksF23krnds09Z+cEOTwD9Ztb7Iomj3iId2AdFnbpcoVt6cr4sB/COnDi+oJYcB7yaK2ilzMPzmbSzSSnLa5CiFv12xq9vr6daFuYlEcIVBDYdFyggDnG+4GaHeO4p89vIXDmESWq/Uc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706297643; c=relaxed/simple; bh=X2tv7YC7rvxoUUooCnssnmB276xID1n7i+KGcjgXyaY=; h=Message-ID:Date:MIME-Version:From:To:Subject:Content-Type; b=gCl4el3NiA+Pecvm/NWYSFxFxHuBbPcvn5MPZ30MpzEGYh3RPzZxup4vvJ4ywUPj2GkjFZE+H3vD8wJJbwfZS5uNhduzFdz0ESnLpKN0k76XNTtsF4gE3eUUsGqb2eQNy4Q44UXShqCB4Qw7FvQNNcVJOp6hzBxqlweJ/Sn6eYI= 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=CYryvNhP; 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=1706297639; bh=X2tv7YC7rvxoUUooCnssnmB276xID1n7i+KGcjgXyaY=; h=Date:From:To:Subject:From; b=CYryvNhPZbC7x2vM29ob6YlU9y7XqdYN1eE+S0JMTNZyFT6FwPl1FFNqD+a7/3OUg 363JrNqGqicCxn1V0gzmJktc5SGfN5Q8hC5GwNmbXcb319GcfZRSAdMDf2LQIX6oC+ lSxIcSLX3c/Ymagubv0PVRA6dDJJAjaAz/H1FkwBC/ixYQx0tXlnzCzCx5cOvEkold HkWWXgW0zcyim0acOvi0AoVPw1CIgk4mbGbJYNaEAr8+JhoLp0wx9vgkrPYTNu79IF KbWX5iKoCx6k/HjFrH1cjNfKeof6FDhCfoj/1KDcMcAr8o0JhZK5J+EMm/O1D8m9xo XOnbGShcIXNUQ== Received: from [172.16.0.134] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4TM7D72M8NzVDZ; Fri, 26 Jan 2024 14:33:59 -0500 (EST) Message-ID: Date: Fri, 26 Jan 2024 14:33:57 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Mathieu Desnoyers To: Dan Williams , Vishal Verma , Dave Jiang , Matthew Wilcox , Andrew Morton , Linus Torvalds , linux-mm , linux-arch@vger.kernel.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-kernel , Russell King , Arnd Bergmann Subject: [REGRESSION] v5.13: FS_DAX unavailable on 32-bit ARM Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, 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. I can see a few ways forward to address this: A) I have prepared a patch series introducing cache_is_aliasing() with new Kconfig options: * ARCH_HAS_CACHE_ALIASING * ARCH_HAS_CACHE_ALIASING_DYNAMIC and implemented it for all architectures. The "DYNAMIC" implementation implements cache_is_aliasing() as a runtime check, which is what is needed on architectures like 32-bit ARM. With this we can basically narrow down the list of architectures which are unsupported by DAX to those which are really affected, without actually solving the issue for architectures with virtually aliased dcaches. B) Another approach would be to dig into what exactly DAX is doing with the linear mapping, and try to fix this. I see two options there: B.1) Either we extend vmap to allow vmap'd pages to be aligned on specific multiples, and use a coloring trick based on SHMLBA like userspace mappings do for all DAX internal pages accesses, or B.2) We introduce flush_dcache_folio() at relevant spots (perhaps dax_flush() ?) to synchronize the linear mapping wrt userspace mappings. (would this work ?) Any thoughts on how to best move forward with this issue are welcome. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com