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 D8B92C7115B for ; Mon, 23 Jun 2025 14:30:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C80E8D0009; Mon, 23 Jun 2025 10:30:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7792E8D0005; Mon, 23 Jun 2025 10:30:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B5998D0009; Mon, 23 Jun 2025 10:30: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 591968D0005 for ; Mon, 23 Jun 2025 10:30:35 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id F23075A092 for ; Mon, 23 Jun 2025 14:30:34 +0000 (UTC) X-FDA: 83586901188.27.2563DD8 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf12.hostedemail.com (Postfix) with ESMTP id 79FE640016 for ; Mon, 23 Jun 2025 14:30:31 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf12.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750689033; a=rsa-sha256; cv=none; b=wFHawZ+kw7FsRf2HHWLLGtDprpOKiZuiXE+58IMtF285pUse7F0Z015HW5bPMpIWlpLA3o QJDLIFfNdhY3WntTBgOWCGQoeb4+fHLCbhgV3/zMVvxdJ/PsgA+rfRSxp2a+Rahh3Oli4s oaANjyluHAO+Ynwx5Aat4O7TTPDd3wY= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf12.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1750689033; 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=2OKC4NXgmcOKuROwXzqGWAhNvkbhl8IJtF/7BfBiZVw=; b=TYys9vOoCrPopRn5gfvuMQ3/LPHqM4zf29t3+BvEA71FVeIPL9qtgG0MCGHoFyo7aS5WOB b14PJKwz0c8QuZ//GQKZ1N+7HdO5NphYJh0jv1J5eD9x4VGMrO96oK7bdYfdzoHg6B8Son BQoVuOazFy+afZjZ5Bh6oF36u+Ag8zU= 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 770D7113E; Mon, 23 Jun 2025 07:30:12 -0700 (PDT) Received: from [10.1.29.169] (XHFQ2J9959.cambridge.arm.com [10.1.29.169]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BB3D43F66E; Mon, 23 Jun 2025 07:30:29 -0700 (PDT) Message-ID: Date: Mon, 23 Jun 2025 15:30:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm/vmalloc: leave lazy MMU mode on PTE mapping error Content-Language: en-GB To: Dan Carpenter Cc: Alexander Gordeev , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20250623075721.2817094-1-agordeev@linux.ibm.com> <107bfdb7-c8f5-45fa-872e-3e6928dc8025@arm.com> <9214718e-97d0-4e8f-b223-59351e664707@suswa.mountain> From: Ryan Roberts In-Reply-To: <9214718e-97d0-4e8f-b223-59351e664707@suswa.mountain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 79FE640016 X-Stat-Signature: ytbrgmhgm7adck6dk8af618m4jhrn95p X-HE-Tag: 1750689031-894460 X-HE-Meta: U2FsdGVkX18+bwCbl4KSIZfER8g/iSECXVwL/UtkiMsZIoZSY3fwKg4UhotX4oLJ7RYUW8iFH+DTvKf8nFYqqubzzuecmaBW2lY/PBgBIMNi6X5XvRUUNax1UsPk0bEz//tm+7BFkKPJeVpNXLEDu2OCzWMJvMPj6h1hyDMgnkZOCYK4W1kq+m5Mtl3Gng88rI2owxXzvtUf7adTX8K/Gx/kXJtGZaPp0Hr6CwsQ64bMC9iBszhj4HhZyx5ww/FfkZJ4K2mRTYbKs1QWqeEi3gkhbo2nGvA2VUYl7sH8rMQfg/05cMesXNiyYtMLU4SSOA3pIF3M26Z2OdS/Jzq0QjzErVTYRj8aRWXqA/kJPIUMkZCErQ0Ok1izH8R3sW02QrK5dmkwARhjd7VpsXVg/puG2yUIE9EKFhks3tDJ8ZAY5kkNOE6/2BN1JQywddSkWG1cyvnWl4nkhnq7T9AqttZQtT33PMPFci8b3ya9yoLwlPbwC0Ud8smN0nu+7ulOlK9+ufAXNslwXUWp3u4lXGAMpOqk1PW+PNPXuI/QrPfF4ZM9eE5Q3mb1z7w9uZyvN4lt1y5MlQTgPyY2s4oZD2uQ+VazG1KtHXtgRNgu3ZIbEbGKpaqt1gU/R2oqOdVnc8CqopVgLCV9yaBW7OBnht8caa/BaK7DTJuBTjAWjS3Y59OKTjtJr5xCoieysQn4Npvc7b2Sac/ZilMH0MrxA3UBufRsTsZthKU2yPn3uKsSy3PPDDpSo5qhL32kBnBmy39BJIiSVGX9pfLDatT/UeLQnGGVQWuHr4e8tOh85CQUU9gDF1khsLmcDFksVENXqxh0+xbevck0++jvZ0pFzGA/TyVW+ZvYsbVmVEn+f5agBm7VJr605Yav8LiRIIJGbi98FU75/3duU0cA6pYE+d2rg4k6gW7hWcrnXTtxoFt3eq6fxtAT9ybw7RFf+Kkcjk9eGJmKdi6ZPRYIsS4 u3MXkyUZ WkWDgANbUu28gTWQa/671o0NIqZSbzy6olT/vHIUKqckLQajcUDoG0l9bS3gMpzwcIeqKHdbFg5XeWE1Eb93iXh198kkPqk3xUDTRPVcVwvcb7y/g+Isymo1TBm7MDZU/i0MWpv36ew8eLbxact58+OnW6LhR6cXpx0OQIL19WIzOItlL23mWqoH8xIDb5WoLj1v6rxgM0uj1eAhLrPFymn8u/Ra/t19bFo65dM7i2to9hjxgZbUoVDmhMwyBRdfYmXqGTH9G29xgT26tPkQNS8jBurdZCv5GJyO6v/RoIT3YjNE+5MA4lW50Z5hH3glZwq8m0MpVNzsxZNw= 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 23/06/2025 14:53, Dan Carpenter wrote: > On Mon, Jun 23, 2025 at 02:31:48PM +0100, Ryan Roberts wrote: >> On 23/06/2025 14:03, Alexander Gordeev wrote: >>> On Mon, Jun 23, 2025 at 01:37:11PM +0100, Ryan Roberts wrote: >>>> On 23/06/2025 08:57, Alexander Gordeev wrote: >>>>> Function vmap_pages_pte_range() enters the lazy MMU mode, >>>>> but fails to leave it in case an error is encountered. >>>>> >>>>> Reported-by: kernel test robot >>>>> Reported-by: Dan Carpenter >>>>> Closes: https://lore.kernel.org/r/202506132017.T1l1l6ME-lkp@intel.com/ >>>>> Fixes: 44562c71e2cf ("mm/vmalloc: Enter lazy mmu mode while manipulating vmalloc ptes") >>>>> Signed-off-by: Alexander Gordeev >>>> >>>> Ouch, sorry about that! The patch looks good to me so: >>>> >>>> Reviewed-by: Ryan Roberts >>>> >>>> I wonder an aditional Fixes: should be added for Commit 2ba3e6947aed >>>> ("mm/vmalloc: track which page-table levels were modified") though? That's the >>>> one that added the "*mask |= PGTBL_PTE_MODIFIED;" which would have also been >>>> skipped if an error occured before this patch. >>> >>> Good catch! I think it certainly needs to be reported with Fixes >>> and I even doubt whether your commit should be mentioned at all? >> >> Well I would certainly argue that my patch is broken as is. So happy to have 2 >> Fixes: tags. But I'm not really sure what the rules are here... > > I would only list the older commit 2ba3e6947aed ("mm/vmalloc: track > which page-table levels were modified"). The static checker warning > came later, but it's not really the important bit. It's just one bug. Given smatch caught the locking bug, I wonder if it could be taught to look for lazy_mmu issues? i.e. unbalanced enter/leave, nesting and read hazards. I think Alexander previously found a read hazard so I wouldn't be surprised if there are more. > > We'll have to hand edit the commit if we want to backport it so that's > a separate issue. > > regards, > dan carpenter >