Re: [PATCH] x86/AMD: Apply erratum 688 on machines without a BIOS fix

From: sonofagun
Date: Fri Oct 21 2016 - 17:51:54 EST



Thank you for your time! I have chosen reply to list and all recipients, it must work now.

My brother rejected the proposed patch because it does not provide equivalent functionality with the original.

Our initial patch would fix 3 broken models and 1 working model. Your patch will only work for 1 model. Only machines having our APU will be fixed. All B0 APUs will be unpatched. This is not right. Check the revision guide to verify that.

To avoid unneeded complexity we propose this patch as V2, do you agree?

+#define MSR_AMD64_IC_CFG 0xC0011021
+
+static void init_amd_on(struct cpuinfo_x86 *c)
+{
+ /*
+ * Apply erratum 688 fix so machines without a BIOS
+ * fix work.
+ */
+
+ u32 val = pci_read_config(0, 0x18, 0x4, 0x164);
+
+ if (!(val & BIT(2))) {
+ msr_set_bit(MSR_AMD64_IC_CFG, 3);
+ msr_set_bit(MSR_AMD64_IC_CFG, 14);
+}
static void init_amd_bd(struct cpuinfo_x86 *c)
{
u64 value;
@@ -738,6 +750,7 @@ static void init_amd(struct cpuinfo_x86
case 0xf: init_amd_k8(c); break;
case 0x10: init_amd_gh(c); break;
case 0x12: init_amd_ln(c); break;
+ case 0x14: init_amd_on(c); break;
case 0x15: init_amd_bd(c); break;
}

Please advice to proceed!


Why, what's wrong with that one? That one should be all fixed! :-)

I have such box too and it runs fine.
erratum 721 :-(