Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757479AbdIINHn (ORCPT ); Sat, 9 Sep 2017 09:07:43 -0400 Received: from mail.skyhub.de ([5.9.137.197]:56418 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753519AbdIINHm (ORCPT ); Sat, 9 Sep 2017 09:07:42 -0400 Date: Sat, 9 Sep 2017 15:07:27 +0200 From: Borislav Petkov To: Markus Trippelsdorf Cc: Andy Lutomirski , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , LKML , Ingo Molnar , Tom Lendacky Subject: Re: Current mainline git (24e700e291d52bd2) hangs when building e.g. perf Message-ID: <20170909130727.3jjnc6p5g45dihmy@pd.tnic> References: <20170908103513.npjmb2kcjt2zljb2@gmail.com> <20170908103906.GB278@x4> <20170908113039.GA285@x4> <20170908171633.GA279@x4> <20170908215656.qw66lgfsfgpoqrdm@pd.tnic> <20170909063908.GA277@x4> <20170909101810.a757cja7vslofyrj@pd.tnic> <20170909110749.GA277@x4> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170909110749.GA277@x4> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2105 Lines: 71 On Sat, Sep 09, 2017 at 01:07:49PM +0200, Markus Trippelsdorf wrote: > It doesn't work. Compiling in a text console just freezes the machine > before any MCE gets printed. Ok, let's turn off all syncflood bits. Hunk below. Do a $ dmesg | grep syncflood to check it worked. It says [ 1.557017] quirk_syncflood: 0x44: 0xa900044 [ 1.561431] quirk_syncflood: 0x44: wrote 0xa800040 [ 1.566361] quirk_syncflood: 0x180: 0x700022 [ 1.570775] quirk_syncflood: 0x180: wrote 0x20 here. Also, make sure you boot with "pci=check_enable_amd_mmconf" on the kernel cmdline because someone broke extended PCI cfg space again on those machines. At least on my test box here... But that's something I'll deal with later. :-\ Thanks. --- diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index eaa591cfd98b..c6a4430d2222 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c @@ -626,6 +626,32 @@ static void amd_disable_seq_and_redirect_scrub(struct pci_dev *dev) DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F3, amd_disable_seq_and_redirect_scrub); +static void quirk_syncflood(struct pci_dev *misc) +{ + u32 val; + + pci_read_config_dword(misc, 0x44, &val); + pr_info("%s: 0x44: 0x%x\n", __func__, val); + + val &= ~(BIT(30) | BIT(21) | BIT(20) | BIT(2)); + + pci_write_config_dword(misc, 0x44, val); + pci_read_config_dword(misc, 0x44, &val); + pr_info("%s: 0x44: wrote 0x%x\n", __func__, val); + + pci_read_config_dword(misc, 0x180, &val); + pr_info("%s: 0x180: 0x%x\n", __func__, val); + + val &= ~(BIT(22) | BIT(21) | BIT(20) | BIT(9) | BIT(8) | BIT(7) | BIT(6) | BIT(1)); + + pci_write_config_dword(misc, 0x180, val); + pci_read_config_dword(misc, 0x180, &val); + pr_info("%s: 0x180: wrote 0x%x\n", __func__, val); +} + +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC, + quirk_syncflood); + #if defined(CONFIG_X86_64) && defined(CONFIG_X86_MCE) #include #include -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.