From patchwork Wed Aug 21 08:18:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13770986 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 BC146C52D7C for ; Wed, 21 Aug 2024 08:19:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E5966B00C3; Wed, 21 Aug 2024 04:19:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 495066B00C4; Wed, 21 Aug 2024 04:19:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 335D66B00C5; Wed, 21 Aug 2024 04:19:49 -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 13A006B00C3 for ; Wed, 21 Aug 2024 04:19:49 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CA26E160AA3 for ; Wed, 21 Aug 2024 08:19:48 +0000 (UTC) X-FDA: 82475554056.04.570B7FE Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf24.hostedemail.com (Postfix) with ESMTP id EF6A818001A for ; Wed, 21 Aug 2024 08:19:46 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=kCU4OnJB; spf=pass (imf24.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724228308; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WkLNXpSDw35lj4Q8QTsPG+BhSNUK5Ar50Dqo0ISPkHo=; b=EAU4pGu3darsKOOU/0lYsgyQtiVT3ayYZL39yEVwUwglqWNcBihr6jf0/gg0Bj9ipJOzUr 4vBZAZKwN5a22gLMWJqzSVRGonPROFDQigzaivMmbdAmbAzRZ/Hss+w4piGCrL8u4fwF8i /jejtoCUICNqe50ub2cTsbmRi3yfcug= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724228308; a=rsa-sha256; cv=none; b=SdH5F+zmC5Fd2yNZoVq/HiMJGB4LdQp4Z0EonWkqiZtPNvehUzc/2wKG3yK2fjY78Pq14U emlMTeOU1oTedz4+6Xjxgi5MlXph0g1EmR1xQb4/lK++9HJWpo23NYa/+K1z4gSlPfM24K ugAY2gI4PJZtMPkM0IxgDYGZZSSOeJs= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=kCU4OnJB; spf=pass (imf24.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2d3bc043e81so4980462a91.2 for ; Wed, 21 Aug 2024 01:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1724228386; x=1724833186; darn=kvack.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=WkLNXpSDw35lj4Q8QTsPG+BhSNUK5Ar50Dqo0ISPkHo=; b=kCU4OnJB4HJOQitaVCa+dTBJSXLku1hrTscKDwbRzijSx/1g4SxA0rnrKqckF7OhW0 ouCjOPBQ8RGw5MkkI67FV4eWSRhO91QIIOw+U85nTSsslfbV1mJSB4l1+9NB88WQI/d0 tj6XP5P8SFQCttYTy/Brl7QTlG7iCMbA/TzM2QRgDg2xfZoIoYwvOfBO7QBj+2s53U8Q ockMK/5rgBUR8XircGpvPOCNPE+w2itMDMFc9YblWk3ghl4tP63XlpCjgET8CPSuSX11 cj3BPqFRhikOT7lgKhQBwu1Lp70kEcwxshKlKaLhriLtDrf7KLpqD+EVhvQGm2hfeWEz ZyGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724228386; x=1724833186; 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=WkLNXpSDw35lj4Q8QTsPG+BhSNUK5Ar50Dqo0ISPkHo=; b=tSRDqVrQJ0s2dJNQbczlsKRLfcipGN2+rgqjP+POSjyLD+voiS8o7jhq9BJeqMhsZJ aIB8OshSbbq8N2EI2PgOq3xlsQ1n1COZc6EnM4Rb2TZTCHFr9bSeq5fj0c0r7ebjsnyv jfrzXKyJazJuu4SCoHjd5afUBhquhpVx29la/6BNpOFDotmju7TRKWZAjytSt/ElD/n0 ZGFbpwOcxtE1v6+CHvgd4Qwxiy2SyankLQAFiuRuj/DOyeiVe2sCDtY/01kW0W9GIULP bkE7Vx9z/WekyO06l7H7QsMSheLlAj/NU7N6LVc0+dFq1g9diJ5uAXVr/31y67FCax79 Dbjg== X-Forwarded-Encrypted: i=1; AJvYcCXFHIRDaHkYeHeK9Uhk0zHTzMbftSsoSab80zkT7CWBqUKXK6W3iUE/owQ+vT929LCipQ/3Q1dtaA==@kvack.org X-Gm-Message-State: AOJu0Ywl0P0b63hI/WMdVTwx961LDwq4rakthOSamAyI7/ryQKGv7L2Y stAPRU4P6UJul53rosVGtZ3fkMHm9ZzacBbW2VFjVTaUfX0XiTpcekIwAEU660g= X-Google-Smtp-Source: AGHT+IFyY3NlNyztu6E70clqH4irJgHSXlPUHA4AtOW6RrWWSbwAKaoUYDBEK6KZMX7nlR++kviHPA== X-Received: by 2002:a17:90a:e7c6:b0:2cf:cc0d:96cc with SMTP id 98e67ed59e1d1-2d5e99c8b75mr1585510a91.9.1724228385781; Wed, 21 Aug 2024 01:19:45 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.150]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2d5eb9049b0sm1091453a91.17.2024.08.21.01.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 01:19:45 -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 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 03/14] powerpc: assert_pte_locked() use pte_offset_map_readonly_nolock() Date: Wed, 21 Aug 2024 16:18:46 +0800 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: EF6A818001A X-Stat-Signature: 5drd3t6ji4axr16pr96ot4h1wrsrf31n X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1724228386-766468 X-HE-Meta: U2FsdGVkX18pqZPkj/C9NZNBVmGgB2OBZHe3bxNxz+jXkhCjEBkcTO+jaIscD//qRs8RLafVuzI218eAuDGubWFJfQwxQ+vgbj7cM42dTiQ5qiCfIQXN29gFRCsnYikhhd7hRIIaz+OFeNeMMxHOLr10pGbUH/zTgckqwNvKhK1FqwVrLTWx2xjuL7uHhNtvAFeTI4qMAlVla3FFzHcd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/CBMgc/nCMYC7atN1R3UQeG8QPeGnmtc/RW+H3XJnKw5jt0Ezzo9vvOFhYX4iZ5lXA+RYAXNb2sZLwuusiEP/7zf85XgyMoP3IMF2Rd2Ov/n5KAFLq6jrIgijTBc6tagZHM3shpC5/KOKJWjr 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: In assert_pte_locked(), we just get the ptl and assert if it was already held, so convert it to using pte_offset_map_readonly_nolock(). Signed-off-by: Qi Zheng --- 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..ae4d236b5cef7 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_readonly_nolock(mm, pmd, addr, &ptl); BUG_ON(!pte); assert_spin_locked(ptl); pte_unmap(pte);