From patchwork Tue Sep 24 06:09:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13810141 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 AF1CCCF9C71 for ; Tue, 24 Sep 2024 06:14:19 +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=eTCRoeg0isJN3FsWjY36jjsXQE i2MsvsyZ31KmLghLIzuJziVdebQRlfH+nVtFdrbVxV/ew0Bp9gHF+Wkj/GQ2Jk+dKURpvpl1cyryP E+VJKFKIdwoRROtexLP2OktI/IhLqM+x8AVODOHJnsELAhd/+r5dk/mvXv4mDPPedncUDmrYnZzZV 7wd810Q059/SAnDjdQQ7Ey3C7zN8djKj9/Ww/8NDbCBUMboL6ZSWfpYTNKqkamNpXdGuLT0jxI+ER AywI8PdbbKLqYAEy6/UM8MIX46urPmewG2UdX9+XMgyh9eBigRq06pd+VEORDoNNDKv0TxYg6f9IJ Myit6dtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1ssyoM-00000001CwK-1TkN; Tue, 24 Sep 2024 06:14:10 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1ssykz-00000001Bgo-2HO1 for linux-arm-kernel@lists.infradead.org; Tue, 24 Sep 2024 06:10:43 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2068acc8a4fso47159365ad.1 for ; Mon, 23 Sep 2024 23:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1727158240; x=1727763040; 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=FIV/BvAb3RB4rw118q1HmPIDQ38nF5WGiZa8DqMDE6EfaHWOpPuboM5FEPlrFqC9iX jZv4MqsPLlcBi4gwHPhWeElZk4GElXxgACn4BolM1xq4UvF2E/dwVChyxD5wQEP62LNA 6hVyrw7VvbGJg54G3tVfeCTuuNfX+4Ihq4MsBHNwGebiVZ8RXnsNx0lI7VrcLVwShlPt jXbcz5obUahsfcR9EmBaVwwlnBeTJmqfHi/LDd6Lkb0vyAi6g7KuDcsm2W6TSagdczq4 JABiK6Bwu6Mj2UiIpO+MiOiMP0UE+9PaA9KMZoEBRXi2H8PPPCPUskhgEcHxNjQVTs/p HDXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727158240; x=1727763040; 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=d5OY/nQmGXT1hNbKTJX9Ql3irROTgja/CZQJOikT4TC8ELwvWYPkNCtwxHpoeeOMmK C2nl1SwKq2OJ/4Yz1z9kU6I6xalYbxAO6QxxyXocy2C1gxpc3mY5ozGTVP2THdm7j+8n Rrf5QFKcB4bA8fvxJHA1t1eZB9/DvrcVmrnf7LkEyDn9Jx9qHJNVLNu89ZtwapSKMbq3 s5t3MEIO04y2PzuxN1AVrxJaU9GmTpjQIbebmcpV1Tzq001KStTvBLD+OYc3KT+1Nc9c PeCdXD/MV0bsGGnP5mipRRgfLPPTkRPOacjcn9MjHw/uozH4o9+0wAzr6/rUFMNmrgvx mKfA== X-Forwarded-Encrypted: i=1; AJvYcCVZ2xioafy/RAVxaeXsCADVam5RBVxkq2k7moXyK8GgjLqf8zM+lca07iw3y7IE9LPp277rb/psxVBovd1IoqF9@lists.infradead.org X-Gm-Message-State: AOJu0YzMyVvVjgxXkmXl4za18xFqRMukVxPK4g4oMVaj8HnNMEnKYA3S dEbOSfZOdQDo5wUaTCUdLXMcqckyEFqE6z+JaxLrjd+AX8rS3dC+9kY+i+MdNoA= X-Google-Smtp-Source: AGHT+IElcy6/dcdtPcpdDMoiIIDu5/E2AQfQDwpdj/dfRLSSVL2tlA+KvKWV7BmaFFYnOD/6ZCb7Sg== X-Received: by 2002:a17:903:2311:b0:206:a935:2f8 with SMTP id d9443c01a7336-208d832a910mr203885105ad.2.1727158240521; Mon, 23 Sep 2024 23:10:40 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([63.216.146.178]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af17229c9sm4344885ad.85.2024.09.23.23.10.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 23:10:40 -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 v4 02/13] powerpc: assert_pte_locked() use pte_offset_map_ro_nolock() Date: Tue, 24 Sep 2024 14:09:54 +0800 Message-Id: <597a93841525dbd58fbebcfdc547f2080694835b.1727148662.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-20240923_231041_606898_0E6638BA X-CRM114-Status: GOOD ( 11.34 ) 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);