From mboxrd@z Thu Jan 1 00:00:00 1970 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 1341AC3ABC3 for ; Mon, 12 May 2025 11:03:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9C76D6B00E0; Mon, 12 May 2025 07:03:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 974E66B00EA; Mon, 12 May 2025 07:03:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 867406B00EB; Mon, 12 May 2025 07:03:35 -0400 (EDT) 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 629916B00E0 for ; Mon, 12 May 2025 07:03:35 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C043AE234D for ; Mon, 12 May 2025 11:03:35 +0000 (UTC) X-FDA: 83433969990.30.F2249C3 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf04.hostedemail.com (Postfix) with ESMTP id F290440008 for ; Mon, 12 May 2025 11:03:33 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1747047814; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LvvVgG8sFYyCKKWqflx/P6eBZ3R2UIey0m6zvQUGr2I=; b=TtVNXEWIyhep4TszydTNEf5OPKir1CSQib31gc4iO+K2TorQcCe2mlELGxmvcmIIsfYA+T VHjim07YLPv3hhoOhwPgiqXP8yb+sJMBolbkg6oBGDKOvdrJC0bASb4aFxhKBJwr1W8C40 xNztH0UJ94DSAsc1q4YcpjxzqWneAcQ= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1747047814; a=rsa-sha256; cv=none; b=pzTt46VEARw4zxHOtq7eatNmxLZ7QxGUgqboqwIH4PIJGvbu3gWvMEh1omXeJh/dr69kLW Zrf15xSepQKQEb+jfPB37wPlf/RZ9uopLFbfkJ4hRcrEX/0S5rw0IE9t/3a4HDsAfB2yC9 Jsmjg3mMTr5ekYdnB6kcv++ql/07H2U= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4F06D150C; Mon, 12 May 2025 04:03:22 -0700 (PDT) Received: from [10.57.90.222] (unknown [10.57.90.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C87013F5A1; Mon, 12 May 2025 04:03:30 -0700 (PDT) Message-ID: <0ca27453-7fa8-47df-ac11-8992319da578@arm.com> Date: Mon, 12 May 2025 12:03:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] arm64/mm: Disable barrier batching in interrupt contexts Content-Language: en-GB To: Catalin Marinas Cc: Will Deacon , Pasha Tatashin , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , David Hildenbrand , "Matthew Wilcox (Oracle)" , Mark Rutland , Anshuman Khandual , Alexandre Ghiti , Kevin Brodsky , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, syzbot+5c0d9392e042f41d45c5@syzkaller.appspotmail.com References: <20250512102242.4156463-1-ryan.roberts@arm.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: m4d886dtwug9ioydjsykdf5wwfu9b4x5 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: F290440008 X-HE-Tag: 1747047813-841204 X-HE-Meta: U2FsdGVkX197YF0urns5txMHAmaiMbrlODUHsGVdqOpgs1ZnOFKMnL2h6uxqGhX9jxUJ6b19oF3o+ov/f9qVYnaT3svkad1cU7vGwnVHK9+y/IqTgO1vNRnPE2s6WV4CP3WLlqKGPwBH2ROXU1ZvEWC5mrdrbQd/nG4bKoavPLqEbfoHmMIyZaqotfw/kTOHlyEQ+3I6USHRXcm+qyTj/glbIUYel/Yactszza1lnV/6SDLItJFu0/kncWJMkBQYMACen8dLgQW/E7qejvl39m1D/0prY+Nn4sQamdDnc6IF3bGA1nQ646x9EonjDD8fKm/XkycihTfScxl8qMCAOfJorEo19E/7u0LAzRkmq6idZr3vz/Un1RRQwuFNdCy/Y6PqN0UOGxwm210j3RKQEXaYrtkGl+kwqSAzMKZs2WKqSSQYx/rLyldeU3orF06MFzeLSUH4yFM0czLD3nssW1xWYCdIiCbd9hTCvv5BJE73lEvnX1SYrYpRN6tU/V8FrFhDgB+Vu5rR9Q2UOEDsNVPG5wTJ3PtTuEWqiewhHShtZiFCay7UJzFDEA6x/3sF5aQJf9Oj1p3gMPg3CAbofwnnXoa4U5xh1of6SzX749SgMMjq05VuQcS/cD3v1GocTAjHyNl3I7rNX9qllvvZRMrLuPj4yq9X0ADS6uD5IfIoWh6pBxZWT3mbPWhKTKmRDMQBh/UPnwKqc3mH0j+PFY9UU0y41nvgRyGn/G1r2VhcpjAlc49UnlOz80oTXKS+X9oQu3vD4xORyhYiGw8vYFeIZBOHTzCAeWRNIzlgPsf8Ej0XifEI8MwW1G9ce59owHfc+ta+6uz+NC105J6mkEUbMbU3PFNTyj+ZCWP80+HUeRyTDy3ep+6bQ7JpQ4q6SQFkS2tPMUMB6KHOFBStCehwG45Zewc7ehFMKI2EYpWbX4LUGEIq4WjvhhzPJyoJxiTV+LzGD67UisYpn1F 7NwNmjWr sTXVJ9MAOfzXMnsEpvd/LgaZPzYbVEbIcdfa8A69WiRirtbCPspcnjYZxkloVUIz0U5gXF5Knb3dUIiMtrtAWPsntnM2X3bq20poAGj9cSOkSfxmJZ+QGiUxGJaj/AtfUYPe3L6JB5AiGxW+pjQJjmngz8FH4erxdL9z66rmcg1XRKM+MLAKeqHbGyiuZSnyNE3JH2KtrcqSTV2kR0zj+ZlYnMnIkmKz1MqoHhkoOVjrV5pHiExZpAM9N5B6TuQgblAgV8XzpS+dvTG1kZZVtoIMu5+upcILeHR5k5SD0FbcbOfx73Z5VwlSRqU2xdrsHKXpOeRH8KeFf/92s3LKu0n85RqIOgN69tmiEZgOjHzafki2nnwG6I6dXWG+BTyfrtrLfMEcwklPXXNbZk6kHWQ/jPA== 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: On 12/05/2025 12:00, Catalin Marinas wrote: > On Mon, May 12, 2025 at 11:22:40AM +0100, Ryan Roberts wrote: >> Commit 5fdd05efa1cd ("arm64/mm: Batch barriers when updating kernel >> mappings") enabled arm64 kernels to track "lazy mmu mode" using TIF >> flags in order to defer barriers until exiting the mode. At the same >> time, it added warnings to check that pte manipulations were never >> performed in interrupt context, because the tracking implementation >> could not deal with nesting. >> >> But it turns out that some debug features (e.g. KFENCE, DEBUG_PAGEALLOC) >> do manipulate ptes in softirq context, which triggered the warnings. >> >> So let's take the simplest and safest route and disable the batching >> optimization in interrupt contexts. This makes these users no worse off >> than prior to the optimization. Additionally the known offenders are >> debug features that only manipulate a single PTE, so there is no >> performance gain anyway. >> >> There may be some obscure case of encrypted/decrypted DMA with the >> dma_free_coherent called from an interrupt context, but again, this is >> no worse off than prior to the commit. >> >> Some options for supporting nesting were considered, but there is a >> difficult to solve problem if any code manipulates ptes within interrupt >> context but *outside of* a lazy mmu region. If this case exists, the >> code would expect the updates to be immediate, but because the task >> context may have already been in lazy mmu mode, the updates would be >> deferred, which could cause incorrect behaviour. This problem is avoided >> by always ensuring updates within interrupt context are immediate. >> >> Fixes: 5fdd05efa1cd ("arm64/mm: Batch barriers when updating kernel mappings") >> Reported-by: syzbot+5c0d9392e042f41d45c5@syzkaller.appspotmail.com >> Closes: https://lore.kernel.org/linux-arm-kernel/681f2a09.050a0220.f2294.0006.GAE@google.com/ >> Signed-off-by: Ryan Roberts > > As per the request in the original report, please also add: > > Reported-by: syzbot+5c0d9392e042f41d45c5@syzkaller.appspotmail.com I've already added it, 2 lines above your comment... > > I'll give it a try as well with my configurations and let you know if > there are any problems. In the meantime: > > Reviewed-by: Catalin Marinas Thanks!