From patchwork Thu Sep 26 06:46:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13812876 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32E10CCFA07 for ; Thu, 26 Sep 2024 06:51:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7WBwKEY9MWquOlo01BPdpzLz4TZdRIsQgPATlcDwMyk=; b=T4mKgUXXYBowibFxHMs4Thtkpj zEZx+gE8weUz+XB6RQkbhHNc6xRhVYJivz6HmYtaKYpXaAQfa4XZIz4+SEgcDgZAaunEQaqTyWpNy NY5+Ua0zqPx/awGhUiSYtzmYagQFFPO69DvOXPcOE88I+d8j9WI1ry1Ix+oEGCT3Gb4sL09L3jNvc 1fLIzNTUunWl9h8EDmcPhc2W1da69ZId3gq85JJ3b/Ct8yrDWsIPmRwiksWajeu7EJwyoy7hR6c/K d5aLSkNdjsImCS27uJxyRWV1YlP/mk1hCPObCssqvUzmP9t5Bixdqhv6U15TlMzhDNAB6OEMkYMno hcX094Cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stiLp-00000007Oh6-2ZaH; Thu, 26 Sep 2024 06:51:45 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stiHI-00000007NDM-39zF for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2024 06:47:05 +0000 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-4581ee65b46so4697041cf.3 for ; Wed, 25 Sep 2024 23:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1727333223; x=1727938023; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7WBwKEY9MWquOlo01BPdpzLz4TZdRIsQgPATlcDwMyk=; b=hfRYRoXekCR7hLDVQNGSFhqJqZknhdX2EXeqTGepmFpxnmnhh+zsJSy7DA9F24d79J oqz04dLLrA7FOo4+F7OHylVRFFErHbMk3DNS7WEQVGmXARGrsyOq+o/FIQqjEFVCDjei KIHvLiGZhbSkVEHAZK0ZbwEQm0Ma534XKHu3/x84zfMWydW9SCTtKcwBGdVuAV+AOBiC ReHHM/om53SgY5D34uOtSSQ32/d9yL+O2tr2rSYQk3UEqZzQBJsxZ8YzZOhIStn/Pr27 BJBCyl4YFJSU9triqEG4ueRe2XdohpRmPLrsJSGOMDWr+0cNFJZ/Teg5gyScPBxC+S6F QIiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727333223; x=1727938023; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7WBwKEY9MWquOlo01BPdpzLz4TZdRIsQgPATlcDwMyk=; b=raOY0RWky5zhFzgGfj++3w/MYLWYu+kTmOfYbUc+5pDOPABePhQvteJoPLpSczKiBd rnY0vRLoc0XRqsf8q3TCGAwxZ9TGGLlBCKSupYvkf7574qwY9T8eaIGfdMwYMnS+V9KK 6T0rkuYb+RZcsHvWAyh+y5wHCfG/PhRkoVKQBNYmYax1xUVhf/QSFLKefXlKXTCy1Sow tQxwvBgvZteWRuJ3MWm3ERexHprTQPPKf+SBUxyUB68uciowuBLUfXg7zac6/GdGfQKA eNgfo0oOajAe3NGg3nEK8VMolIEs/DklkjGk8NANQ+mtnTcCoHuXPJPnXmMsk5hv5nVB ldtg== X-Forwarded-Encrypted: i=1; AJvYcCUXRQpKZyqfaD3TKo7cDDwN2rlbrb4hhB8toZE9xQSRITKtUAaxLudM7mVAexYSLRBU033KVkY3R96cXkXv2djO@lists.infradead.org X-Gm-Message-State: AOJu0YwU8JUxtvhKn/vMZ7fh08KzKBeYE7NHtglO2dOZhvXpkfXStSml pHSW/zg4hUZlNjU2ywBnmstdaM3oYXBG6pMy85oGVMGjuJtIqZh+MsV3wkpelss= X-Google-Smtp-Source: AGHT+IHKcdRFC9q2GD6595fUPe4NgxH7f7bGHM/1jVFUOYjtanMZU2hJPsIx01XdKDMweQg9NQ43+w== X-Received: by 2002:a05:622a:105:b0:458:4c86:4564 with SMTP id d75a77b69052e-45b5e0952b0mr82475131cf.37.1727333223424; Wed, 25 Sep 2024 23:47:03 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.150]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45b5257ff1esm23024611cf.38.2024.09.25.23.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 23:47:03 -0700 (PDT) From: Qi Zheng To: david@redhat.com, hughd@google.com, willy@infradead.org, muchun.song@linux.dev, vbabka@kernel.org, akpm@linux-foundation.org, rppt@kernel.org, vishal.moola@gmail.com, peterx@redhat.com, ryan.roberts@arm.com, christophe.leroy2@cs-soprasteria.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Qi Zheng Subject: [PATCH v5 02/13] powerpc: assert_pte_locked() use pte_offset_map_ro_nolock() Date: Thu, 26 Sep 2024 14:46:15 +0800 Message-Id: <42559e042eb6fc3129a40f710d671712030646b4.1727332572.git.zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240925_234704_808796_F335E50E X-CRM114-Status: GOOD ( 10.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In assert_pte_locked(), we just get the ptl and assert if it was already held, so convert it to using pte_offset_map_ro_nolock(). Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Reviewed-by: Muchun Song --- arch/powerpc/mm/pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c index 7316396e452d8..61df5aed79894 100644 --- a/arch/powerpc/mm/pgtable.c +++ b/arch/powerpc/mm/pgtable.c @@ -398,7 +398,7 @@ void assert_pte_locked(struct mm_struct *mm, unsigned long addr) */ if (pmd_none(*pmd)) return; - pte = pte_offset_map_nolock(mm, pmd, addr, &ptl); + pte = pte_offset_map_ro_nolock(mm, pmd, addr, &ptl); BUG_ON(!pte); assert_spin_locked(ptl); pte_unmap(pte);