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

From: Rik van Riel
Date: Fri Aug 05 2022 - 10:41:26 EST


On Fri, 5 Aug 2022 16:27:40 +0200
Borislav Petkov <bp@xxxxxxxxx> wrote:

> On Fri, Aug 05, 2022 at 10:16:44AM -0400, Rik van Riel wrote:
> > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> > index fad8faa29d04..c7a5bbf40367 100644
> > --- a/arch/x86/mm/fault.c
> > +++ b/arch/x86/mm/fault.c
> > @@ -769,6 +769,8 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code,
> > unsigned long address, struct task_struct *tsk)
> > {
> > const char *loglvl = task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG;
> > + /* This is a racy snapshot, but it's better than nothing. */
> > + int cpu = raw_smp_processor_id();
>
> Please read this in exc_page_fault() and hand it down to helpers.

Below is the change that implements your suggestion.

If there is consensus among the x86 maintainers that this is
desirable, I am more than happy to merge that change into my
patch and resubmit v4.

I don't have a strong opinion either way.

---8<---