lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 19 Apr 2022 16:58:47 -0500
From:   Eric DeVolder <eric.devolder@...cle.com>
To:     Borislav Petkov <bp@...en8.de>
Cc:     linux-kernel@...r.kernel.org, x86@...nel.org,
        kexec@...ts.infradead.org, ebiederm@...ssion.com,
        dyoung@...hat.com, bhe@...hat.com, vgoyal@...hat.com,
        tglx@...utronix.de, mingo@...hat.com, dave.hansen@...ux.intel.com,
        hpa@...or.com, nramas@...ux.microsoft.com, thomas.lendacky@....com,
        robh@...nel.org, efault@....de, rppt@...nel.org, david@...hat.com,
        konrad.wilk@...cle.com, boris.ostrovsky@...cle.com
Subject: Re: [PATCH v7 2/8] x86/crash: Introduce new options to support cpu
 and memory hotplug



On 4/19/22 05:32, Borislav Petkov wrote:
> On Mon, Apr 18, 2022 at 05:03:39PM -0500, Eric DeVolder wrote:
>> I've examined the code with this thought in mind, and I'm not exactly sure how
>> this code should be restructured for !HOTPLUG stubs. I'd very much appreciate
>> an example in order to facilitate accommodating the request!
> 
> For example, see init_intel_microcode() in arch/x86/include/asm/microcode.h:
> 
> #ifdef CONFIG_MICROCODE_INTEL
> extern struct microcode_ops * __init init_intel_microcode(void);
> #else
> static inline struct microcode_ops * __init init_intel_microcode(void)
> {
>          return NULL;
> }
> #endif /* CONFIG_MICROCODE_INTEL */
> 
> The actual definition then is in:
> 
>     arch/x86/kernel/cpu/microcode/intel.c:
>     struct microcode_ops * __init init_intel_microcode(void)
> 
> and it gets enabled when CONFIG_MICROCODE_INTEL is enabled in the
> .config. When CONFIG_MICROCODE_INTEL=n, the static inline stub gets used
> and optimized away by the compiler.
> 
> HTH.
> 

Thanks Boris. So in taking this concept and looking at, in particular, patch 4/8
"crash: add generic infrastructure for crash hotplug support", I'm not exactly
sure how to apply this technique.

For example, if the suggestion is to change crash_hotplug_init() to be the function
or a stub, then what is an appropriate place to the __init callout?

If instead the suggestion is to create !HOTPLUG stubs() for the registration
functions within crash_hotplug_init(), then that entails taking what are currently
static scope symbols in the callbacks and notifier_block and exposing (ie make non-
static) those, which doesn't seem beneficial.

Or if the suggestion is to create !HOTPLUG stubs() for the callbacks, then I thin that
is implying that crash_hotplug_init() is not #ifdef'd and always runs and always
sets-up these event handlers, regardless if we need them?

Perhaps said differently, I'm not seeing, yet, how this technique applies to this code.
Is there a specific function that you know you want this way?

Thanks,
eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ