Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3006191ioo; Tue, 24 May 2022 10:44:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQl3HuEh/ZJsFdXEhRYy0Sr6/wkSS4JF4BevIN1MZQQ/mzydD2yI4tR2FyzgdE/eRLGEKO X-Received: by 2002:aa7:da8d:0:b0:42a:aa60:8af3 with SMTP id q13-20020aa7da8d000000b0042aaa608af3mr29965135eds.94.1653414262787; Tue, 24 May 2022 10:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653414262; cv=none; d=google.com; s=arc-20160816; b=UE98xtIQ3i6+r11ovzYY4Y42y+0k6Sis7Bm8phQO8GL/eFj6VWxTrxuXy0DqRe+G1a ZvtPW+fgDZsNLgbS56GIEaktYIkFTkhiMhzUiFETW5+Ay1ZQ1cMQWH/JyZzP1VZ39ybq SBMcow+TJuXrdmNBoJ4KdBP0tvg+e7UwKLdPa7rPs/V8QUgyDXzs7+MFiAb1x6TZQ6B2 3uS/vSsBic9FlH8HFMZIUo+7M9Y4J/JfCzeE/4jQPiFFEKvLr0ARPWDCYC6MU7DQrN1c whaMe3yQykMdMvzs57lAuxRwRgN7cSdBfp4lVJaL9DSqTmgEcVVZj59es80p+2Qnlhkd dDVw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2/QYUMW6dk87ZdHaZItfN4MfDAbU8lloQ8bQ909fg8U=; b=XLSaW3hA6NI6Xmv3R2fT4CSoOVwUdCTj3axOSY3Re1B4opLpt/UKmMbcGb+66Y+QQC xTck7r64hFL3T2yQQc5BwZYloy8QeL8RJJSE0pKkKFv0gxgM/f5yjMQgzdQ6fTwn3ltW YmAfd2dtrMpQC6LBNV9zx608HhB+Jg/ThqXhJROY1DQIWG6qKWIh3+kOkJEqa/MTgbH2 Q3jAdk0+7QT3c0Zkku0LzkeF1DCX6/5ZrbdeXr6i/luG+NlQB7skrQeuwYq0japDvyRD I0PIa3FRLj0Oe10LOaLVyfAZyaO3qkwyOOqJraZMqmssSnPZhZ4zmVHsYLmheRX5A5RQ XvFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="NJT/7W5z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c14-20020a05640227ce00b00425f7f0fba4si16035356ede.51.2022.05.24.10.43.48; Tue, 24 May 2022 10:44:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="NJT/7W5z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239541AbiEXQCl (ORCPT + 99 others); Tue, 24 May 2022 12:02:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239349AbiEXQBh (ORCPT ); Tue, 24 May 2022 12:01:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C9E5A0D24; Tue, 24 May 2022 09:00:44 -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 ams.source.kernel.org (Postfix) with ESMTPS id 9D9B2B817F2; Tue, 24 May 2022 16:00:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27AECC3411A; Tue, 24 May 2022 16:00:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653408042; bh=uNYcJ4Cr7Q5JHM1D51Lx3IAU4uaYLwTacB3qIeJzItk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NJT/7W5zuf8GQg8VeRKfviCplSiM/BQ440CvBns3DITo2tL3SNeWn+ygwyUq68TXT J9FfQUPhDLZKMOHBuYN26x2158ZfXJtCjCrU3jm5KAXzJTmMiKHBmcKmKmz8lnY2eb LjZnMeyMWCbHDYy3xiywnoSkX6FQIIIcwxHNmdZKF7TVDFOZVtK2PCJpeOybzlvZuS yzGzH+BMLp5SPAPSdWlCSpL6e+AGOfp15nYjNdxx0mKxF6f+O4r2VFTXSOGUJtMD2l eNPwlnmLOu4F8Q/zpnrgeDDYN3ZEIOSp29Esuxm7FmFTO3YB0xM+btoYUazjeaV8Xu 4IfpJomM8j6vA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: John David Anglin , Helge Deller , Sasha Levin , James.Bottomley@HansenPartnership.com, akpm@linux-foundation.org, zhengqi.arch@bytedance.com, linux-parisc@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 2/8] parisc: Disable debug code regarding cache flushes in handle_nadtlb_fault() Date: Tue, 24 May 2022 12:00:29 -0400 Message-Id: <20220524160035.827109-2-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220524160035.827109-1-sashal@kernel.org> References: <20220524160035.827109-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: John David Anglin [ Upstream commit 67c35a3b646cc68598ff0bb28de5f8bd7b2e81b3 ] Change the "BUG" to "WARNING" and disable the message because it triggers occasionally in spite of the check in flush_cache_page_if_present. The pte value extracted for the "from" page in copy_user_highpage is racy and occasionally the pte is cleared before the flush is complete. I assume that the page is simultaneously flushed by flush_cache_mm before the pte is cleared as nullifying the fdc doesn't seem to cause problems. I investigated various locking scenarios but I wasn't able to find a way to sequence the flushes. This code is called for every COW break and locks impact performance. This patch is related to the bigger cache flush patch because we need the pte on PA8800/PA8900 to flush using the vma context. I have also seen this from copy_to_user_page and copy_from_user_page. The messages appear infrequently when enabled. Signed-off-by: John David Anglin Signed-off-by: Helge Deller Signed-off-by: Sasha Levin --- arch/parisc/mm/fault.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index 5faa3cff4738..2472780d4039 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c @@ -22,6 +22,8 @@ #include +#define DEBUG_NATLB 0 + /* Various important other fields */ #define bit22set(x) (x & 0x00000200) #define bits23_25set(x) (x & 0x000001c0) @@ -449,8 +451,8 @@ handle_nadtlb_fault(struct pt_regs *regs) fallthrough; case 0x380: /* PDC and FIC instructions */ - if (printk_ratelimit()) { - pr_warn("BUG: nullifying cache flush/purge instruction\n"); + if (DEBUG_NATLB && printk_ratelimit()) { + pr_warn("WARNING: nullifying cache flush/purge instruction\n"); show_regs(regs); } if (insn & 0x20) { -- 2.35.1