lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 9 Sep 2017 15:07:27 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Markus Trippelsdorf <markus@...ppelsdorf.de>
Cc:     Andy Lutomirski <luto@...nel.org>, Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...hat.com>,
        Tom Lendacky <thomas.lendacky@....com>
Subject: Re: Current mainline git (24e700e291d52bd2) hangs when building e.g.
 perf

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 <linux/jump_label.h>
 #include <asm/string_64.h>




-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ