[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZcD8k2UTs3wyk9Dx@e133380.arm.com>
Date: Mon, 5 Feb 2024 15:19:47 +0000
From: Dave Martin <Dave.Martin@....com>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Fangrui Song <maskray@...gle.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, linux-arm-kernel@...ts.infradead.org,
Jisheng Zhang <jszhang@...nel.org>,
Peter Smith <peter.smith@....com>, llvm@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64: jump_label: use constraints "Si" instead of "i"
On Sat, Feb 03, 2024 at 10:50:44AM +0100, Ard Biesheuvel wrote:
> On Fri, 2 Feb 2024 at 23:51, Fangrui Song <maskray@...gle.com> wrote:
[...]
> > "Si" is fine for GCC and Clang.
> > "i" is fine for Clang but not for GCC PIC.
> >
> > https://maskray.me/blog/2024-01-30-raw-symbol-names-in-inline-assembly#aarch64
> >
> > In gcc/config/aarch64, LEGITIMATE_PIC_OPERAND_P(X) disallows any symbol
> > reference, which means that "i" and "s" cannot be used for PIC. Instead,
> > the constraint "S" has been supported since the initial port (2012) to
> > reference a symbol or label.
> >
> > I am also not familiar with
> > https://gcc.gnu.org/onlinedocs/gcc/Multi-Alternative.html (comma in a
> > constraint string). Thankfully we don't need this powerful construct:)
Ack, I had thought that this was relevant, but it is not,
and "Si" seems right.
[...]
> > I am convinced by Ard' argument that two inputs (key, branch) deserve
> > two operands.
> > The existing "i"(&((char *)key)[branch]) is kinda ugly and also longer:)
>
> If it helps clarify things, we might do something like
>
> ".quad (%[key] - .) + %[bit0]"
>
> : : [key]"Si"(key), [bit0]"i"(branch) : : l_yes);
I don't have a strong opinion on the naming, but something like this
seems fine.
Cheers
---Dave
Powered by blists - more mailing lists