[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdk3YG5TFD71E-9vPqssFZW1U3umCR+AWLLp8RZK2zHGsw@mail.gmail.com>
Date: Mon, 13 Apr 2020 11:29:00 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Jian Cai <caij2003@...il.com>
Cc: Manoj Gupta <manojgupta@...gle.com>,
Stefan Agner <stefan@...er.ch>,
Russell King <linux@...linux.org.uk>,
Enrico Weigelt <info@...ux.net>,
Kate Stewart <kstewart@...uxfoundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
LKML <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH] ARM: replace the sole use of a symbol with its definition
On Tue, Apr 7, 2020 at 12:09 PM Jian Cai <caij2003@...il.com> wrote:
>
> ALT_UP_B macro sets symbol up_b_offset via .equ to an expression
> involving another symbol. The macro gets expanded twice when
> arch/arm/kernel/sleep.S is assembled, creating a scenario where
> up_b_offset is set to another expression involving symbols while its
> current value is based on symbols. LLVM integrated assembler does not
> allow such cases, and based on the documentation of binutils, "Values
> that are based on expressions involving other symbols are allowed, but
> some targets may restrict this to only being done once per assembly", so
> it may be better to avoid such cases as it is not clearly stated which
> targets should support or disallow them. The fix in this case is simple,
> as up_b_offset has only one use, so we can replace the use with the
> definition and get rid of up_b_offset.
>
> Signed-off-by: Jian Cai <caij2003@...il.com>
Probably didn't need the extra parens, but it's fine (unless another
reviewer would like a v2). Maybe Stefan has some thoughts?
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
Please add Link tags if these correspond to issues in our link
tracker, they help us track when and where patches land.
Link: https://github.com/ClangBuiltLinux/linux/issues/920
> ---
> arch/arm/include/asm/assembler.h | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
> index 99929122dad7..adee13126c62 100644
> --- a/arch/arm/include/asm/assembler.h
> +++ b/arch/arm/include/asm/assembler.h
> @@ -269,10 +269,9 @@
> .endif ;\
> .popsection
> #define ALT_UP_B(label) \
> - .equ up_b_offset, label - 9998b ;\
> .pushsection ".alt.smp.init", "a" ;\
> .long 9998b ;\
> - W(b) . + up_b_offset ;\
> + W(b) . + (label - 9998b) ;\
> .popsection
> #else
> #define ALT_SMP(instr...)
> --
> 2.26.0.292.g33ef6b2f38-goog
>
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists