From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936015AbcJUXBu (ORCPT ); Fri, 21 Oct 2016 19:01:50 -0400 Received: from mail.skyhub.de ([78.46.96.112]:36318 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932774AbcJUXBr (ORCPT ); Fri, 21 Oct 2016 19:01:47 -0400 Date: Sat, 22 Oct 2016 01:01:43 +0200 From: Borislav Petkov To: sonofagun@openmailbox.org Cc: linux-kernel@vger.kernel.org, Nikos Barkas Subject: Re: [PATCH] x86/AMD: Apply erratum 688 on machines without a BIOS fix Message-ID: <20161021230143.4wwop3giwwuzbkpr@pd.tnic> References: <20161021164723.c5rh7kgulba2aq6i@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/ (1.7.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 22, 2016 at 12:51:32AM +0300, sonofagun@openmailbox.org wrote: > Thank you for your time! I have chosen reply to list and all recipients, it > must work now. Yes, exactly what I had in mind. > 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. Right you are: I read too much into the description of bit 2 of D18F4x164. Of course we want to apply that fix to to ON-Bs too. > 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); Yes, that should work fine. Btw, there's missing a closing } for the if-test here. > +} > 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! Right, please send a tested version of the above with the explanation text from your initial submission. Thanks. > erratum 721 :-( Hmm, interesting. Do you have a way to trigger that one? -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.