Re: [PATCH v1 04/12] x86/mce: Remove noinstr annotation from mce_setup()
From: Borislav Petkov
Date: Fri Dec 10 2021 - 09:18:38 EST
On Thu, Dec 09, 2021 at 01:16:56PM +0100, Peter Zijlstra wrote:
> Yeah, that's what it does; but *why* is that correct?
Correct, shmorect - it is the #MC handler nasty.
> I'm thinking we're well past the exception entry code and are only
> using noinstr as a means to limit the amount of code in the MCE
> handler?
Well, one of the calls to mce_gather_info() happen in #MC context. That
one calls mce_setup() and that thing calls out to
# ./arch/x86/include/asm/paravirt.h:116: PVOP_VCALL4(cpu.cpuid, eax, ebx, ecx, edx);
cmpq $0, pv_ops+176(%rip) #, pv_ops.cpu.cpuid
and you get this:
vmlinux.o: warning: objtool: pv_ops[22]: xen_cpuid
vmlinux.o: warning: objtool: pv_ops[22]: native_cpuid
vmlinux.o: warning: objtool: mce_setup()+0xa0: call to pv_ops[22]() leaves .noinstr.text section
I think this is too much and too specific text to stick in the code as a
comment.
I can stick it in the commit message if you prefer that but frankly,
seeing those instrumentation_begin/_end() sandwiches are already hints
enough in my head to read "TODO" there...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette