From patchwork Thu Aug 22 07:13:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13772869 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 D4592C3DA4A for ; Thu, 22 Aug 2024 07:18:58 +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=O1mpKMHwwZ1CFkcRRT4IxjhKZ5nh5A3TknIoqewquLI=; b=w2D3MFoJNHXF2FSPywc1bxYolS W5gmDQywPp37DQZo+fMir+KA4YcXQjwVEHZVEL6/xERcJrtatj7BrdGRNbeQ8jGvCfDxW439CN9fm 627WlpWOQd0Koj0s0YZNwT3krp84JeMV/QGi8MJ7wcM68AgOQ1zY54NU+RhlpO09PLGY/RxVxCUwr nAP+EAPqCbAcydhnSN7YyR0FM+j48WkTTAzOuT8YN3SOnfR9KclEJL9nFcmD+rKGcsbY+pCTkRJDO CUTB6hisXc1b6/rpXNiHQobo3PFS8sd6CWI5svtKCiuYgMx7Vysfk0RWzOUWCR2qGgXq6trAhTQ7X BpbtJXbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh25k-0000000Bp75-2A6d; Thu, 22 Aug 2024 07:18:44 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh21U-0000000Bn2E-3k4U for linux-arm-kernel@bombadil.infradead.org; Thu, 22 Aug 2024 07:14:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=O1mpKMHwwZ1CFkcRRT4IxjhKZ5nh5A3TknIoqewquLI=; b=CqA1wbD+NvsZeiJ0oJ4UzEdXxN ava60kGundJlGRqSrkE+gQlq2Nr26wL1hT4I++9LhmPL+Z08U5rrO/Ow0wVH331s/mjSYVUzDaC/1 Bm0BrXZrgDwdPLc4R1l0i/gIZvjZiVOfGxCKh8CcTzRLoHXPwSrY0UWfG1p57xlxkl36OTfPgKGeP 6WusRij7+wC9qNSgujFIsbnn73kbtGDTbPSFcNpG3HfWrUHpiIykeDqd3RYzhYxB8WNc7r3A8ZCje WbtvYK1MKn+b7+QUT5izmR51/QILWWXXQGezdWG5xQQ2yvxLI7Y6Kgnnz+t7RnhPkKcrFNWFtlV5Y l+Rwl7Qg==; Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh21Q-00000009sLX-1OCg for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 07:14:19 +0000 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3db16129143so245284b6e.0 for ; Thu, 22 Aug 2024 00:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1724310846; x=1724915646; 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=O1mpKMHwwZ1CFkcRRT4IxjhKZ5nh5A3TknIoqewquLI=; b=iPGiGvJRzP0COcxCeQnOAcJpioE2aIR+VLTaGZ1P9uLhW/4mBKwOvPOjJ3G9MuJM// 8XJoMNw3z0ZKAV9Ml7Rft4R4XJl/Y7t0Xk5x7s+s3MNEg5jamklpaDTuglDwJWZw7d79 PydBGdT5U3M9eD5p7Dhmy9OAfGUVxcN9e/MP8Q0XyApZAIdZCfq7WXiMpEd2NGP3RHLi UEKsLuLSI/HYw5Tb6F8QaF7iStmsOKKXxXWxyHx/BsMdQTujzxIYeTVPjnjfCiQaw8Xe E3+pI6XY2d4UfdjN5ggLLhJx/7l10tb4OyVTBCDAqqO1E3Xc+bXv34QYirAYoNS8cdts gY3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724310846; x=1724915646; 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=O1mpKMHwwZ1CFkcRRT4IxjhKZ5nh5A3TknIoqewquLI=; b=Wz7nc3MuLfY3tG4rEru5aKu62vxXgiGDpa9ncwfNSJRmoIwo9oVc3E5cgQ0JDZ8jQi lFshjd9M4YQbfS555nVWgdNQoy5GOzl1JW9iSr6Ip1+bZWWEDr4etb6V4w/rItNyZdWK wEYTNuarbWFiX9BYa+ZJ9vMnEhCKKQAuquxWklbjMw/4OnkXRJ2LMZlip9lvdUgT9DVV /inaGyrQQ9VR9B6aF7J6gF4kM+dSk5rdx7N53lNBFkWmWOVsjZo0R+klO2nIViY4Ijea U8TtlZ8aPjtySoxREcR6P1huqBKlEYccjSIfrYkSLuMkJ1o9OwlyFicRpq0BBYXhKLJI yEUw== X-Forwarded-Encrypted: i=1; AJvYcCWajeOZGk7AS9RdWeowFMyYQyFbtjHOqTOumnsy89NqO/A2xls0Zl58gsCqd6jhAwGRdueYA8q8RFSiHFiDMtq1@lists.infradead.org X-Gm-Message-State: AOJu0YwObHjjraIxPioy03lYtMBVSb3JcQquAI/GkiOBuwyPmz8vDZP8 xfeiBWyN9EJ8UzKNY+VKifdZ+MQKv7QeYKt8LBU8leSJgYMCmHI26lsFEtIUpMg= X-Google-Smtp-Source: AGHT+IFDX2PqWoIoI6wCA8pFxmw/BmBf/PDUvtd9hijDBvTgLhn0KCKCIBnod1yVuIa/+/M4c6qbig== X-Received: by 2002:a05:6808:1a08:b0:3da:a16e:1764 with SMTP id 5614622812f47-3de194e0e97mr6243309b6e.4.1724310845744; Thu, 22 Aug 2024 00:14:05 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([240e:473:c90:f96:d029:ea8a:4e6d:d272]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7cd9ac994a3sm695095a12.16.2024.08.22.00.14.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2024 00:14:05 -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 v2 03/14] powerpc: assert_pte_locked() use pte_offset_map_ro_nolock() Date: Thu, 22 Aug 2024 15:13:18 +0800 Message-Id: <89ae94f722996b4ee7ef20d44cd7f5e2f0495c47.1724310149.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-20240822_081417_655292_B053D983 X-CRM114-Status: GOOD ( 11.26 ) 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);