[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210831193430.GL4353@worktop.programming.kicks-ass.net>
Date: Tue, 31 Aug 2021 21:34:30 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Lai Jiangshan <jiangshanlai@...il.com>
Cc: linux-kernel@...r.kernel.org,
Lai Jiangshan <laijs@...ux.alibaba.com>,
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 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")
Powered by blists - more mailing lists