From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751474AbcDPLYU (ORCPT ); Sat, 16 Apr 2016 07:24:20 -0400 Received: from terminus.zytor.com ([198.137.202.10]:42952 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751269AbcDPLYS (ORCPT ); Sat, 16 Apr 2016 07:24:18 -0400 Date: Sat, 16 Apr 2016 04:21:35 -0700 From: tip-bot for Vitaly Kuznetsov Message-ID: Cc: vkuznets@redhat.com, tglx@linutronix.de, hpa@zytor.com, cavery@redhat.com, acme@redhat.com, kys@microsoft.com, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, alexander.shishkin@linux.intel.com, mingo@kernel.org, jolsa@redhat.com, peterz@infradead.org, haiyangz@microsoft.com Reply-To: jolsa@redhat.com, haiyangz@microsoft.com, peterz@infradead.org, torvalds@linux-foundation.org, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, mingo@kernel.org, acme@redhat.com, cavery@redhat.com, kys@microsoft.com, tglx@linutronix.de, vkuznets@redhat.com, hpa@zytor.com In-Reply-To: <1460728232-31433-1-git-send-email-vkuznets@redhat.com> References: <1460728232-31433-1-git-send-email-vkuznets@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/hyperv: Avoid reporting bogus NMI status for Gen2 instances Git-Commit-ID: 1e2ae9ec072f3b7887f456426bc2cf23b80f661a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 1e2ae9ec072f3b7887f456426bc2cf23b80f661a Gitweb: http://git.kernel.org/tip/1e2ae9ec072f3b7887f456426bc2cf23b80f661a Author: Vitaly Kuznetsov AuthorDate: Fri, 15 Apr 2016 15:50:32 +0200 Committer: Ingo Molnar CommitDate: Sat, 16 Apr 2016 11:18:21 +0200 x86/hyperv: Avoid reporting bogus NMI status for Gen2 instances Generation2 instances don't support reporting the NMI status on port 0x61, read from there returns 'ff' and we end up reporting nonsensical PCI error (as there is no PCI bus in these instances) on all NMIs: NMI: PCI system error (SERR) for reason ff on CPU 0. Dazed and confused, but trying to continue Fix the issue by overriding x86_platform.get_nmi_reason. Use 'booted on EFI' flag to detect Gen2 instances. Signed-off-by: Vitaly Kuznetsov Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Cathy Avery Cc: Haiyang Zhang Cc: Jiri Olsa Cc: K. Y. Srinivasan Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: devel@linuxdriverproject.org Link: http://lkml.kernel.org/r/1460728232-31433-1-git-send-email-vkuznets@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/cpu/mshyperv.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 4e7c693..10c11b4 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -152,6 +152,11 @@ static struct clocksource hyperv_cs = { .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; +static unsigned char hv_get_nmi_reason(void) +{ + return 0; +} + static void __init ms_hyperv_init_platform(void) { /* @@ -191,6 +196,13 @@ static void __init ms_hyperv_init_platform(void) machine_ops.crash_shutdown = hv_machine_crash_shutdown; #endif mark_tsc_unstable("running on Hyper-V"); + + /* + * Generation 2 instances don't support reading the NMI status from + * 0x61 port. + */ + if (efi_enabled(EFI_BOOT)) + x86_platform.get_nmi_reason = hv_get_nmi_reason; } const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {