Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp601155pxb; Tue, 5 Apr 2022 15:33:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL0UsjVQ5Z/ig8edv5uX8VNGmRzmElok0L4z/gRvUaTi5ji9ejMZD4qo+IZIIxhkn3c3/w X-Received: by 2002:a05:6a00:b87:b0:4fa:a79a:72e7 with SMTP id g7-20020a056a000b8700b004faa79a72e7mr5764727pfj.68.1649197998269; Tue, 05 Apr 2022 15:33:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649197998; cv=none; d=google.com; s=arc-20160816; b=0ZEluLkY8d68TrcEHCWdeyyzziANnjBnhWo461Ln3jeT6s9gMhvO3aO8PKdyFZsJf5 8OJphGBZxcGayATIBtABKAE1pu1aqvS60SoLHoKDG/5ZosJ2WRh67BDYboR2cMunkSBw XbauVd0CVFJnTXRgCiVtNoleE6wg71/GsyspSbQ+NR7Ba7Yl3wsL92gMrodrOy/u52hC T7ZrY3GgopN4WWfLZ4CmV22mD0bz+jXigyQqzOF5RT4/M9e2j6DXPJtAS/FkSA4OvjDo XA/IUn/FqqMGBMDiIka41jwD6d0KrjA7+dpwiDQismZQo9Lcv6STuztQ9zwcB+xzt7Fb t07g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EogSymabNiebuPLxWLgCu/kljfkeSjW33y/6CQsKU4A=; b=ZZvl7kLxP8u77Y+RcMnEGmP0vMU+JSoEIIpI//3Dc3McbGTE1XKMkQYCnTXcRr2mvK Ml4DSekz1D2Wi22sWgBJIUP5hJIurq84OPuuv2wBm3qB6xRz9D8SlRekMpVKamd6CUH1 sGT4KqCvmzZWb6tigK799ZQkULXktA+peR5rCc2Ofr/9EYQC/U2ANqzjNKtcRtA+rD3R iJ4saevmrPRJRqZ/GgM7t+Hl8zMfW3KJx2ebXl5DC3ite4oMR/AlyTcyr+u8hYzqvpsv M66zkkEHEOAEJJAwvLctMMuPVEptkcXa+JMrwYjtnCHkjLhRRm+LnLucbzYCFSp1khqx zdwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uyFVOjnE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m13-20020a170902f64d00b00153b2d165d2si13653317plg.474.2022.04.05.15.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 15:33:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uyFVOjnE; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5E48D20DB1C; Tue, 5 Apr 2022 15:15:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237426AbiDEMFY (ORCPT + 99 others); Tue, 5 Apr 2022 08:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244147AbiDEIvn (ORCPT ); Tue, 5 Apr 2022 04:51:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE6C3D3AC0; Tue, 5 Apr 2022 01:40:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D605F614E5; Tue, 5 Apr 2022 08:39:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3B60C385A1; Tue, 5 Apr 2022 08:39:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147977; bh=jdhV1ARZqjVBNBTFdsNBzGc69eetyP1wwgKMcVbjsh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uyFVOjnENXWNE4FZBoHN7vpI0NYmN8hc3e8lhgYXABrZPZIWVisFC+CBNG10Hf0pg ZBiaZlgRue0gZeUtQt9HVjAnZ4hNgkpBDAO6/QuH/LclGBS/P/0c8k/33kYOZWjkLa i69WsvaZqOgPxxRVr8CuKmqvgtLqmcX62eFMJJck= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Filippov Subject: [PATCH 5.16 0183/1017] xtensa: define update_mmu_tlb function Date: Tue, 5 Apr 2022 09:18:16 +0200 Message-Id: <20220405070359.671343382@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Max Filippov commit 1c4664faa38923330d478f046dc743a00c1e2dec upstream. Before the commit f9ce0be71d1f ("mm: Cleanup faultaround and finish_fault() codepaths") there was a call to update_mmu_cache in alloc_set_pte that used to invalidate TLB entry caching invalid PTE that caused a page fault. That commit removed that call so now invalid TLB entry survives causing repetitive page faults on the CPU that took the initial fault until that TLB entry is occasionally evicted. This issue is spotted by the xtensa TLB sanity checker. Fix this issue by defining update_mmu_tlb function that flushes TLB entry for the faulting address. Cc: stable@vger.kernel.org # 5.12+ Signed-off-by: Max Filippov Signed-off-by: Greg Kroah-Hartman --- arch/xtensa/include/asm/pgtable.h | 4 ++++ arch/xtensa/mm/tlb.c | 6 ++++++ 2 files changed, 10 insertions(+) --- a/arch/xtensa/include/asm/pgtable.h +++ b/arch/xtensa/include/asm/pgtable.h @@ -411,6 +411,10 @@ extern void update_mmu_cache(struct vm_ typedef pte_t *pte_addr_t; +void update_mmu_tlb(struct vm_area_struct *vma, + unsigned long address, pte_t *ptep); +#define __HAVE_ARCH_UPDATE_MMU_TLB + #endif /* !defined (__ASSEMBLY__) */ #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG --- a/arch/xtensa/mm/tlb.c +++ b/arch/xtensa/mm/tlb.c @@ -162,6 +162,12 @@ void local_flush_tlb_kernel_range(unsign } } +void update_mmu_tlb(struct vm_area_struct *vma, + unsigned long address, pte_t *ptep) +{ + local_flush_tlb_page(vma, address); +} + #ifdef CONFIG_DEBUG_TLB_SANITY static unsigned get_pte_for_vaddr(unsigned vaddr)