Re: [PATCH 0/4] Better memcpy_mcsafe()

From: Ingo Molnar
Date: Sat Aug 27 2016 - 03:29:04 EST



* Tony Luck <tony.luck@xxxxxxxxx> wrote:

> The original version of this used a check of the x86_model_id string
> for the magic "Intel(R) Xeon(R) CPU E7-" to determine whether we are
> running on a cpu that supports machine check recovery.
>
> Boris tried to talk me out of that, but at the time I didn't think
> there was a viable alternate option, and somehow he fell for that line.
>
> It turns out there is a better way, that isn't as painful as I thought
> it might be. It does help guarantee future employment, as I'll
> have to add a new quirk for each CPU generation. But the check for "E7"
> would have eventually failed and required a patch too.
>
> The downside of a quirk is that it runs after the X86_FEATURE patching
> code. So instead of "static_cpu_has()" we use "static_branch_unlikely(&mcsafe_key)"

So why not move it to the early PCI quirk code in arch/x86/ and get rid of this
quirk within a quirk?

Thanks,

Ingo