linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: hpa@zytor.com, torvalds@linux-foundation.org, tglx@linutronix.de,
	mingo@kernel.org, Yazen.Ghannam@amd.com, mirh@protonmail.ch,
	sherry.hurwitz@amd.com, bp@suse.de, stable@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/urgent] x86/cpu/AMD: Apply the Erratum 688 fix when the BIOS doesn't
Date: Sun, 22 Oct 2017 15:04:29 +0200	[thread overview]
Message-ID: <20171022130429.GA3165@worktop.lehotels.local> (raw)
In-Reply-To: <tip-bfc1168de949cd3e9ca18c3480b5085deff1ea7c@git.kernel.org>

On Sun, Oct 22, 2017 at 05:16:29AM -0700, tip-bot for Borislav Petkov wrote:
> +static void __fix_erratum_688(void *info)
> +{
> +#define MSR_AMD64_IC_CFG 0xC0011021
> +
> +	msr_set_bit(MSR_AMD64_IC_CFG, 3);
> +	msr_set_bit(MSR_AMD64_IC_CFG, 14);

I realize this is an erratum work around, but would it be too much to
ask for a small comment explaining the magic values?

> +}
> +
> +/* Apply erratum 688 fix so machines without a BIOS fix work. */
> +static __init void fix_erratum_688(void)
> +{
> +	struct pci_dev *F4;
> +	u32 val;
> +
> +	if (boot_cpu_data.x86 != 0x14)
> +		return;
> +
> +	if (!amd_northbridges.num)
> +		return;
> +
> +	F4 = node_to_amd_nb(0)->link;
> +	if (!F4)
> +		return;
> +
> +	if (pci_read_config_dword(F4, 0x164, &val))
> +		return;
> +
> +	if (val & BIT(2))
> +		return;
> +
> +	on_each_cpu(__fix_erratum_688, NULL, 0);
> +
> +	pr_info("x86/cpu/AMD: CPU erratum 688 worked around\n");

Except for all CPUs that were not online at this point in time... So
suppose I boot with a limited number of CPUs and then later bring up the
rest, bad things happen.

  reply	other threads:[~2017-10-22 13:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-22 10:47 [PATCH] x86/AMD: Apply Erratum 688 fix when BIOS doesn't Borislav Petkov
2017-10-22 11:04 ` Ingo Molnar
2017-10-22 11:12   ` Borislav Petkov
2017-10-22 12:14     ` Ingo Molnar
2017-10-22 12:16 ` [tip:x86/urgent] x86/cpu/AMD: Apply the Erratum 688 fix when the " tip-bot for Borislav Petkov
2017-10-22 13:04   ` Peter Zijlstra [this message]
2017-10-22 14:01     ` Boris Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171022130429.GA3165@worktop.lehotels.local \
    --to=peterz@infradead.org \
    --cc=Yazen.Ghannam@amd.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mirh@protonmail.ch \
    --cc=sherry.hurwitz@amd.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).