Re: [PATCH v10 1/8] crash: introduce arch/*/asm/crash.h

Eric DeVolder
2022-08-12T21:25:11Z

On 8/12/22 04:46, Baoquan He wrote:
> On 08/08/22 at 10:18am, Eric DeVolder wrote:
>>
>>
>> On 8/7/22 22:25, Baoquan He wrote:
>>> Hi Eric,
>>>
>>> On 07/21/22 at 02:17pm, Eric DeVolder wrote:
>>>> The use of __weak is being eliminated within kexec sources.
>>>> The technique uses macros mapped onto inline functions in
>>>> order to replace __weak.
>>>>
>>>> This patchset was using __weak and so in order to replace
>>>> __weak, this patch introduces arch/*/asm/crash.h, patterned
>>>> after how kexec is moving away from __weak and to the macro
>>>> definitions.
>>>
>>> Are you going to replace __weak in kexec of arll ARCHes? I don't see
>>> your point why all these empty header files are introduced. Wondering
>>> what's impacted if not adding these empty files?
>>
>> Hi Baoquan,
>> In this patchset, to file include/linux/crash_core.h I added the line #include <asm/crash.h>.
>> I patterned this after how include/linux/kexec.h does #include <asm/kexec.h>.
>
> I am sorry, Eric, it looks not so good. I understand you want to pattern
> asm/kexe.h, but we need consider reality. Introducing a dozen of empty
> header file and not being able to tell when they will be filled doesn't
> make sense.
>
> Includig <asm/crash.h> where needed is much simpler. I doubt if your way
> can pass other reviewers' line. Can you reconsider?

If I include <asm/crash.h> where needed, which is kernel/crash_core.c, then the other archs will
fail build if that file doesn't exist. A couple of options, which do you think is better to pursue?

- use asm/kexec.h instead of asm/crash.h; it appears all the architectures already have this file in
place

- go ahead and put the appropriate crash macros/inline functions into each arch asm/crash.h so that
the files are not just empty, and leave the use of asm/crash.h

Or perhaps you see a better alternative?

Thanks!
eric

>
> diff --git a/kernel/crash_core.c b/kernel/crash_core.c
> index 77f5f3591760..b0577bdcc491 100644
> --- a/kernel/crash_core.c
> +++ b/kernel/crash_core.c
> @@ -15,6 +15,7 @@
>
> #include <asm/page.h>
> #include <asm/sections.h>
> +#include <asm/crash.h>
>
> #include <crypto/sha1.h>
>