Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3146884pxk; Tue, 15 Sep 2020 11:12:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYdf3kXRXSol0Mdds8yapygO3wstep6Hze33uXoJI80tdZwyMpwly9GHp2wsYOv92HkOBj X-Received: by 2002:a05:6402:3c8:: with SMTP id t8mr23011529edw.266.1600193549653; Tue, 15 Sep 2020 11:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600193549; cv=none; d=google.com; s=arc-20160816; b=JiGG+XBncy5Ti3Ab3/puADq0a5+VTOQdyrirv1dCDJ5hO2UO2HDno1To1a0bdb7dCZ 9NonqDrSeb4qqXj3nbBjATQpEQOKUHKP4SZGuSKx5A5juV4Wr+Dvk7J80Ua+lqrENRFW W2LeZsfDWxPpX1KXK2qMUvmliQgl+CJO1BwGqq7JbQ2fDxB3fbeneajKLGgQ4WrjywC1 9x1cHlTK7FMDvW0zdwvUBQ4fMiKVYRNxfVRCtNnfabCkGFroqm+W+fD6VtlJuuq48DT4 CA40KkB3ZyLMqTZW3ICXRkZ4qgDCQ01HgU1JRL0S50V4Qg23JemrQgctv3BI6xU4tbyb U/rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=cQyOo5PCLoM2Y8hFh8xufEQK85tMtyIXyOPGtwJu2pw=; b=FDHvvsNuWEu9HA+odNIYZG7OnKuZB8iSUmQ7Wx5JWA3ye6itg0oSAe9wzufu+PwwiT XFlVZmt0rtM8OzfLMa6g/1+mgPlaXUwKKm2mXbnyXtxXJqN5+a2Dt638A0YD27UIyNWF Gxm8NAOoLwzSywJzEfLTMgsEeEKavs1eMaLKbRaf3Ot3tfxMDK7rWFnDdwNdYEjw1i9c /j5knuLm5pcMVvUBCSDtb4lNsMIq881dQ7qv651aXiQCO8Q8Txp7P0zMxsA9b+NID6bK /4Nx5h05S0gC+MHl1sVlYhc9u1GQ61XWT/kWoAUArMZ54i4xHuJctMxGmEhao+SUXMBL yQcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si10132964edw.450.2020.09.15.11.12.06; Tue, 15 Sep 2020 11:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727846AbgIOSJ6 (ORCPT + 99 others); Tue, 15 Sep 2020 14:09:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:60824 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727954AbgIOSIS (ORCPT ); Tue, 15 Sep 2020 14:08:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5B5B8B302; Tue, 15 Sep 2020 18:07:30 +0000 (UTC) From: Michal Suchanek To: linuxppc-dev@lists.ozlabs.org Cc: Michal Suchanek , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Nicholas Piggin , Santosh Sivaraj , Christophe Leroy , Ganesh Goudar , Mahesh Salgaonkar , Alistair Popple , Jordan Niethe , Mike Rapoport , Peter Zijlstra , "Aneesh Kumar K.V" , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] Revert "powerpc/64s: machine check interrupt update NMI accounting" Date: Tue, 15 Sep 2020 20:06:59 +0200 Message-Id: <20200915180659.12503-1-msuchanek@suse.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915084302.GG29778@kitsune.suse.cz> References: <20200915084302.GG29778@kitsune.suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 116ac378bb3ff844df333e7609e7604651a0db9d. This commit causes the kernel to oops and reboot when injecting a SLB multihit which causes a MCE. Before this commit a SLB multihit was corrected by the kernel and the system continued to operate normally. cc: stable@vger.kernel.org Fixes: 116ac378bb3f ("powerpc/64s: machine check interrupt update NMI accounting") Signed-off-by: Michal Suchanek --- arch/powerpc/kernel/mce.c | 7 ------- arch/powerpc/kernel/traps.c | 18 +++--------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c index ada59f6c4298..2e13528dcc92 100644 --- a/arch/powerpc/kernel/mce.c +++ b/arch/powerpc/kernel/mce.c @@ -591,14 +591,10 @@ EXPORT_SYMBOL_GPL(machine_check_print_event_info); long notrace machine_check_early(struct pt_regs *regs) { long handled = 0; - bool nested = in_nmi(); u8 ftrace_enabled = this_cpu_get_ftrace_enabled(); this_cpu_set_ftrace_enabled(0); - if (!nested) - nmi_enter(); - hv_nmi_check_nonrecoverable(regs); /* @@ -607,9 +603,6 @@ long notrace machine_check_early(struct pt_regs *regs) if (ppc_md.machine_check_early) handled = ppc_md.machine_check_early(regs); - if (!nested) - nmi_exit(); - this_cpu_set_ftrace_enabled(ftrace_enabled); return handled; diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index d1ebe152f210..7853b770918d 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -827,19 +827,7 @@ void machine_check_exception(struct pt_regs *regs) { int recover = 0; - /* - * BOOK3S_64 does not call this handler as a non-maskable interrupt - * (it uses its own early real-mode handler to handle the MCE proper - * and then raises irq_work to call this handler when interrupts are - * enabled). - * - * This is silly. The BOOK3S_64 should just call a different function - * rather than expecting semantics to magically change. Something - * like 'non_nmi_machine_check_exception()', perhaps? - */ - const bool nmi = !IS_ENABLED(CONFIG_PPC_BOOK3S_64); - - if (nmi) nmi_enter(); + nmi_enter(); __this_cpu_inc(irq_stat.mce_exceptions); @@ -865,7 +853,7 @@ void machine_check_exception(struct pt_regs *regs) if (check_io_access(regs)) goto bail; - if (nmi) nmi_exit(); + nmi_exit(); die("Machine check", regs, SIGBUS); @@ -876,7 +864,7 @@ void machine_check_exception(struct pt_regs *regs) return; bail: - if (nmi) nmi_exit(); + nmi_exit(); } void SMIException(struct pt_regs *regs) -- 2.28.0