Re: [PATCH v2] x86,mm: print likely CPU at segfault time

From: Borislav Petkov
Date: Fri Aug 05 2022 - 09:26:10 EST


On Fri, Aug 05, 2022 at 08:53:46AM -0400, Rik van Riel wrote:
> Having a small percentage of the segfaults show up on
> cores other than the broken one does not cause issues with
> detection or diagnosis.

I'm sorry but I'm not buying any of this: this should either be 100%
correct or it can stay on your kernels.

> We could, but then we would be reading the CPU number
> on every page fault, just in case it's a segfault.
>
> That does not seem like a worthwhile tradeoff, given
> how much of a hot path page faults are, and how rare
> segfaults are.

Oh wow, a whopping single instruction:

movl %gs:cpu_number(%rip), %eax # cpu_number, pfo_val__

What tradeoff?

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette