From patchwork Fri Jun 9 08:08:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13273389 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 0D49FC7EE25 for ; Fri, 9 Jun 2023 08:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:Message-ID: In-Reply-To:Subject:cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AypGyOkUSTcyHncU3VKXgmDu1C1sJcSObQGDb21UTuI=; b=wvMwPV+pfGZUJE Y1Rw278NgAA/qja8703EvLtuuE49LQallGD4sADBZ99cCN7okr87w9L8YYRGyjrwlQG5uHZtDIJfa u79OaB/B53npPd3DAbBNbnDhoAnTdDjl+GZAFOlQiN+rQ4137BQsBBUz8M10Hyuy3U3bUN4wJb1HK N0neEXtm/Fr2njzVMWCnktuP4ne7qZBCiqhSiIygKFKIT6AAkSVX/FrWZKh9sbnAOqGP6bKfzKyHE 0/mVKoSrBMYqS+6XvfBlGaWFjd8JsyOZekvdu3AUlh/i7VWAZw52KnhWhQvyEiAFrYC/NfR1Pzd71 zoCTBk+T3MtB39crNDLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7XBF-00CBAW-00; Fri, 09 Jun 2023 08:09:09 +0000 Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7XBC-00CB9K-2d for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2023 08:09:08 +0000 Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-565eb83efe4so13743667b3.0 for ; Fri, 09 Jun 2023 01:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686298146; x=1688890146; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=D+JG9ScbeIgWCoIoD1lrBSynxF7pZ7ZmtCOtSuAlDGQ=; b=RfeoHUBLwqk9vTTBDLCpOuzNXpllWDEkPYc6yjXtxGCPNmX/rvie991AU10lJs4XbF 9RzbOtcSEpi5Rh8KstlxITQN3Ffo4ROyfYENBHFqs9HkcG3CFgO7j5lBQrxeeGMGBjp2 NZdxOQon49qNf9HZ1Qgrz3xC18+gnVg36Hvk5SsHYUm7h4j5tszvUdFL2KV4ehwHCBOk gyj3AdqSIMMtQdGmRCxc7HYtfEU+n7ezPeWYkyEIY3KjdS94V8qvWswp+jF2hFiGMFim NoPZGExtzKBOx7SOm5zC/zUvIhzRSqstVSVI3uYZkXeW9ex9SLXGk6aLeA5PY5ojGjGB epOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686298146; x=1688890146; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=D+JG9ScbeIgWCoIoD1lrBSynxF7pZ7ZmtCOtSuAlDGQ=; b=MWO+dHhp1akDfDX2ILI0LA+NRXopFoJ6QYRte+symq/AZ2SKQ+1qm+qB5J5JICf+LC V449cNkqr/HYnIm5Ib1Vr2HwbBqQ4mgMAMWgPigbT6Fdj0pc3AFIGgFgrR1yX97s/EgU +3phZJUAn7G9LAFgvMsMVElUp02vPgk48K34gQcPuJcDxG5WqPtl2vLGota63rZdFYbG zyqx1e+YqZ7Oi2YqLrTYGPFANeJEfw3shZv3bTKQejNdpIQHfCs2g58VX+Gu1k0oP9HK OpuhpPLiGmNc1vpsyFZkcPykbEy+T30+FPGQja9jCbOW476oj0J4AKw4MoZC9M95Oupg 30WQ== X-Gm-Message-State: AC+VfDyozr+z9B+1SkhJJsZjGr9+uQdvJnZ6eQ+rZpgUZhBP045L6mw6 paH0ZWkx32tzTJRaw4WBtHtM9A== X-Google-Smtp-Source: ACHHUZ5DQYcZ9JTl8EUp4l7QLImYygbjncdx8ql55YYe3IsFqc7F1XNEab87Po2zAxMo3TGE3P0BfA== X-Received: by 2002:a0d:e684:0:b0:565:e87f:a78f with SMTP id p126-20020a0de684000000b00565e87fa78fmr500342ywe.25.1686298145738; Fri, 09 Jun 2023 01:09:05 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id n19-20020a819c53000000b005688f7596ccsm453200ywa.78.2023.06.09.01.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 01:09:04 -0700 (PDT) Date: Fri, 9 Jun 2023 01:08:52 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Peter Zijlstra , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Greg Ungerer , Michal Simek , Thomas Bogendoerfer , Helge Deller , John David Anglin , "Aneesh Kumar K.V" , Michael Ellerman , Alexandre Ghiti , Palmer Dabbelt , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda , Alexander Gordeev , John Paul Adrian Glaubitz , "David S. Miller" , Chris Zankel , Max Filippov , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 07/23 fix] mips: update_mmu_cache() can replace __update_tlb(): fix In-Reply-To: <178970b0-1539-8aac-76fd-972c6c46ec17@google.com> Message-ID: <6852be98-64e6-6092-d1c-13124b97bc75@google.com> References: <178970b0-1539-8aac-76fd-972c6c46ec17@google.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230609_010906_879427_D4B5B5EE X-CRM114-Status: GOOD ( 15.61 ) 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 I expect this to fix the arch/mips/mm/tlb-r4k.c:300:16: warning: variable 'pmdp' set but not used reported by the kernel test robot; but I am uncomfortable rearranging lines in this tlb_probe_hazard() area, and would be glad for review and testing by someone familiar with mips - thanks in advance! Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306091304.cNVIspK0-lkp@intel.com/ Signed-off-by: Hugh Dickins --- arch/mips/mm/tlb-r4k.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c index c96725d17cab..80fc90d8d2f1 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c @@ -293,11 +293,13 @@ void local_flush_tlb_one(unsigned long page) void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) { - unsigned long flags; +#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT pgd_t *pgdp; p4d_t *p4dp; pud_t *pudp; pmd_t *pmdp; +#endif + unsigned long flags; int idx, pid; /* @@ -316,15 +318,15 @@ void update_mmu_cache(struct vm_area_struct *vma, pid = read_c0_entryhi() & cpu_asid_mask(¤t_cpu_data); write_c0_entryhi(address | pid); } - pgdp = pgd_offset(vma->vm_mm, address); mtc0_tlbw_hazard(); tlb_probe(); tlb_probe_hazard(); + idx = read_c0_index(); +#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT + pgdp = pgd_offset(vma->vm_mm, address); p4dp = p4d_offset(pgdp, address); pudp = pud_offset(p4dp, address); pmdp = pmd_offset(pudp, address); - idx = read_c0_index(); -#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT /* this could be a huge page */ if (ptep == (pte_t *)pmdp) { unsigned long lo;