[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <75312407-36e9-b3da-f7a3-0aabe09ed1ae@linux.alibaba.com>
Date: Wed, 1 Sep 2021 08:23:06 +0800
From: Lai Jiangshan <laijs@...ux.alibaba.com>
To: Peter Zijlstra <peterz@...radead.org>,
Lai Jiangshan <jiangshanlai@...il.com>
Cc: linux-kernel@...r.kernel.org, Andy Lutomirski <luto@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH 05/24] x86/entry: Introduce __entry_text for entry code
written in C
On 2021/9/1 03:34, Peter Zijlstra wrote:
> On Wed, Sep 01, 2021 at 01:50:06AM +0800, Lai Jiangshan wrote:
>> From: Lai Jiangshan <laijs@...ux.alibaba.com>
>>
>> Some entry code will be implemented in traps.c. We need __entry_text
>> to set them in .entry.text section.
>>
>> Signed-off-by: Lai Jiangshan <laijs@...ux.alibaba.com>
>> ---
>> arch/x86/entry/traps.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/x86/entry/traps.c b/arch/x86/entry/traps.c
>> index f71db7934f90..ef07ae5fb3a0 100644
>> --- a/arch/x86/entry/traps.c
>> +++ b/arch/x86/entry/traps.c
>> @@ -69,6 +69,11 @@
>> extern unsigned char native_irq_return_iret[];
>> extern unsigned char asm_load_gs_index_gs_change[];
>>
>> +/* Entry code written in C. Must be only used in traps.c */
>> +#define __entry_text \
>> + noinline notrace __attribute((__section__(".entry.text"))) \
>> + __no_kcsan __no_sanitize_address __no_profile __no_sanitize_coverage
>
> Urgh, that's bound to get out of sync with noinstr.. How about you make
> noinstr something like:
>
> #define __noinstr_section(section) \
> noinline notrace __attribute((__section__(section))) \
> __no_kcsan __no_sanitize_address __no_profile __no_sanitize_coverage
>
> #define noinstr __noinstr_section(".noinstr.text")
>
> and then write the above like:
>
> #define __entry_text __noinstr_section(".entry.text")
It is a good idea. There was no "__no_profile __no_sanitize_coverage"
when I first made the patch several month ago. I added it after I recheck
the definition of "noinstr" yesterday which means we really need __noinstr_section()
to keep them sync.
>
Powered by blists - more mailing lists