Re: [RFC PATCH 5/5] x86/entry: Store CPU info on exception entry

From: Ingo Molnar
Date: Sun Aug 07 2022 - 06:29:53 EST



* Borislav Petkov <bp@xxxxxxxxx> wrote:

> On Sat, Aug 06, 2022 at 11:01:06AM +0200, Ingo Molnar wrote:
> > It's still 2 instructions more than what we had before, while the
> > fault-time CPU number is only needed infrequently AFAICS.
>
> With the amount of logical cores ever increasing and how CPU packages
> (nodes, L3 sharing, you name it) get more and more complex topology,
> I'd say the 2 insns to show the CPU number in every exception is a good
> thing to do.

We can show it - I'm arguing against extracting it too early, which costs
us 2 instructions in the exception fast path - while in 99.999999999% of
the cases we don't use that field at all ...

> Arguably, we probably should've even done it already...

Yeah, so I'm not against Rik's patch that prints the CPU number - that's
indeed useful and I'd like to see it merged.

I'm arguing against extracting the CPU so early as to impact the exception
fast path.

Thanks,

Ingo