From: Matthias Kaehlcke <mka@chromium.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Grant Grundler <grundler@chromium.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Greg Hackmann <ghackmann@google.com>,
Michael Davidson <md@google.com>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
"David S . Miller" <davem@davemloft.net>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] crypto: arm64/sha: use %c constraint code in ASM_EXPORT
Date: Wed, 5 Apr 2017 10:43:23 -0700 [thread overview]
Message-ID: <20170405174323.GC145051@google.com> (raw)
In-Reply-To: <CAKv+Gu-7tX6THETVA+M0UrC6rJ4id2AsHi2XfhDEmxCJ_tdwKw@mail.gmail.com>
Hoi Ard!
El Wed, Apr 05, 2017 at 06:08:37PM +0100 Ard Biesheuvel ha dit:
> On 5 April 2017 at 17:56, Matthias Kaehlcke <mka@chromium.org> wrote:
> > From: Greg Hackmann <ghackmann@google.com>
> >
> > The current definition of ASM_EXPORT doesn't work properly with clang,
> > according to https://bugs.llvm.org//show_bug.cgi?id=27250#c3 it relies on
> > gcc specific behavior. Change the constraint from an intermediate to an
> > output expression which works with both gcc and clang.
> >
> > From: Greg Hackmann <ghackmann@google.com>
> > Commit-message-by: Matthias Kaehlcke <mka@chromium.org>
> > Signed-off-by: Greg Hackmann <ghackmann@google.com>
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > ---
> > arch/arm64/crypto/sha1-ce-glue.c | 2 +-
> > arch/arm64/crypto/sha2-ce-glue.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm64/crypto/sha1-ce-glue.c b/arch/arm64/crypto/sha1-ce-glue.c
> > index aefda9868627..c71e94ba0e43 100644
> > --- a/arch/arm64/crypto/sha1-ce-glue.c
> > +++ b/arch/arm64/crypto/sha1-ce-glue.c
> > @@ -18,7 +18,7 @@
> > #include <linux/module.h>
> >
> > #define ASM_EXPORT(sym, val) \
> > - asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val));
> > + asm(".globl " #sym "; .set " #sym ", %c0" :: "I"(val));
> >
> > MODULE_DESCRIPTION("SHA1 secure hash using ARMv8 Crypto Extensions");
> > MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
> > diff --git a/arch/arm64/crypto/sha2-ce-glue.c b/arch/arm64/crypto/sha2-ce-glue.c
> > index 7cd587564a41..381b5fb2dcb2 100644
> > --- a/arch/arm64/crypto/sha2-ce-glue.c
> > +++ b/arch/arm64/crypto/sha2-ce-glue.c
> > @@ -18,7 +18,7 @@
> > #include <linux/module.h>
> >
> > #define ASM_EXPORT(sym, val) \
> > - asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val));
> > + asm(".globl " #sym "; .set " #sym ", %c0" :: "I"(val));
> >
> > MODULE_DESCRIPTION("SHA-224/SHA-256 secure hash using ARMv8 Crypto Extensions");
> > MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
>
> I am fine with this change, although I would really like to add a
> better reference to the commit log. It is *very* difficult to find any
> documentation regarding non-trivial uses of inline asm constraints,
> and if %c0 is the correct syntax, surely we can quote something better
> than a LLVM bugzilla entry? Also, where does the distinction between
> 'intermediate' vs 'output' expression come from?
To be honest assembly is not really my area of expertise and I relayed
the information from the LLVM bug. The link to the gcc doc on
x86(!) operand modifiers posted by Robin Murphy (thanks!) should be
helpful to provide a more accurate commit message.
Thanks
Matthias
WARNING: multiple messages have this Message-ID (diff)
From: mka@chromium.org (Matthias Kaehlcke)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] crypto: arm64/sha: use %c constraint code in ASM_EXPORT
Date: Wed, 5 Apr 2017 10:43:23 -0700 [thread overview]
Message-ID: <20170405174323.GC145051@google.com> (raw)
In-Reply-To: <CAKv+Gu-7tX6THETVA+M0UrC6rJ4id2AsHi2XfhDEmxCJ_tdwKw@mail.gmail.com>
Hoi Ard!
El Wed, Apr 05, 2017 at 06:08:37PM +0100 Ard Biesheuvel ha dit:
> On 5 April 2017 at 17:56, Matthias Kaehlcke <mka@chromium.org> wrote:
> > From: Greg Hackmann <ghackmann@google.com>
> >
> > The current definition of ASM_EXPORT doesn't work properly with clang,
> > according to https://bugs.llvm.org//show_bug.cgi?id=27250#c3 it relies on
> > gcc specific behavior. Change the constraint from an intermediate to an
> > output expression which works with both gcc and clang.
> >
> > From: Greg Hackmann <ghackmann@google.com>
> > Commit-message-by: Matthias Kaehlcke <mka@chromium.org>
> > Signed-off-by: Greg Hackmann <ghackmann@google.com>
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > ---
> > arch/arm64/crypto/sha1-ce-glue.c | 2 +-
> > arch/arm64/crypto/sha2-ce-glue.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm64/crypto/sha1-ce-glue.c b/arch/arm64/crypto/sha1-ce-glue.c
> > index aefda9868627..c71e94ba0e43 100644
> > --- a/arch/arm64/crypto/sha1-ce-glue.c
> > +++ b/arch/arm64/crypto/sha1-ce-glue.c
> > @@ -18,7 +18,7 @@
> > #include <linux/module.h>
> >
> > #define ASM_EXPORT(sym, val) \
> > - asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val));
> > + asm(".globl " #sym "; .set " #sym ", %c0" :: "I"(val));
> >
> > MODULE_DESCRIPTION("SHA1 secure hash using ARMv8 Crypto Extensions");
> > MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
> > diff --git a/arch/arm64/crypto/sha2-ce-glue.c b/arch/arm64/crypto/sha2-ce-glue.c
> > index 7cd587564a41..381b5fb2dcb2 100644
> > --- a/arch/arm64/crypto/sha2-ce-glue.c
> > +++ b/arch/arm64/crypto/sha2-ce-glue.c
> > @@ -18,7 +18,7 @@
> > #include <linux/module.h>
> >
> > #define ASM_EXPORT(sym, val) \
> > - asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val));
> > + asm(".globl " #sym "; .set " #sym ", %c0" :: "I"(val));
> >
> > MODULE_DESCRIPTION("SHA-224/SHA-256 secure hash using ARMv8 Crypto Extensions");
> > MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
>
> I am fine with this change, although I would really like to add a
> better reference to the commit log. It is *very* difficult to find any
> documentation regarding non-trivial uses of inline asm constraints,
> and if %c0 is the correct syntax, surely we can quote something better
> than a LLVM bugzilla entry? Also, where does the distinction between
> 'intermediate' vs 'output' expression come from?
To be honest assembly is not really my area of expertise and I relayed
the information from the LLVM bug. The link to the gcc doc on
x86(!) operand modifiers posted by Robin Murphy (thanks!) should be
helpful to provide a more accurate commit message.
Thanks
Matthias
WARNING: multiple messages have this Message-ID (diff)
From: Matthias Kaehlcke <mka@chromium.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Greg Hackmann <ghackmann@google.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S . Miller" <davem@davemloft.net>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Grant Grundler <grundler@chromium.org>,
Michael Davidson <md@google.com>,
Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH] crypto: arm64/sha: use %c constraint code in ASM_EXPORT
Date: Wed, 5 Apr 2017 10:43:23 -0700 [thread overview]
Message-ID: <20170405174323.GC145051@google.com> (raw)
In-Reply-To: <CAKv+Gu-7tX6THETVA+M0UrC6rJ4id2AsHi2XfhDEmxCJ_tdwKw@mail.gmail.com>
Hoi Ard!
El Wed, Apr 05, 2017 at 06:08:37PM +0100 Ard Biesheuvel ha dit:
> On 5 April 2017 at 17:56, Matthias Kaehlcke <mka@chromium.org> wrote:
> > From: Greg Hackmann <ghackmann@google.com>
> >
> > The current definition of ASM_EXPORT doesn't work properly with clang,
> > according to https://bugs.llvm.org//show_bug.cgi?id=27250#c3 it relies on
> > gcc specific behavior. Change the constraint from an intermediate to an
> > output expression which works with both gcc and clang.
> >
> > From: Greg Hackmann <ghackmann@google.com>
> > Commit-message-by: Matthias Kaehlcke <mka@chromium.org>
> > Signed-off-by: Greg Hackmann <ghackmann@google.com>
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > ---
> > arch/arm64/crypto/sha1-ce-glue.c | 2 +-
> > arch/arm64/crypto/sha2-ce-glue.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm64/crypto/sha1-ce-glue.c b/arch/arm64/crypto/sha1-ce-glue.c
> > index aefda9868627..c71e94ba0e43 100644
> > --- a/arch/arm64/crypto/sha1-ce-glue.c
> > +++ b/arch/arm64/crypto/sha1-ce-glue.c
> > @@ -18,7 +18,7 @@
> > #include <linux/module.h>
> >
> > #define ASM_EXPORT(sym, val) \
> > - asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val));
> > + asm(".globl " #sym "; .set " #sym ", %c0" :: "I"(val));
> >
> > MODULE_DESCRIPTION("SHA1 secure hash using ARMv8 Crypto Extensions");
> > MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
> > diff --git a/arch/arm64/crypto/sha2-ce-glue.c b/arch/arm64/crypto/sha2-ce-glue.c
> > index 7cd587564a41..381b5fb2dcb2 100644
> > --- a/arch/arm64/crypto/sha2-ce-glue.c
> > +++ b/arch/arm64/crypto/sha2-ce-glue.c
> > @@ -18,7 +18,7 @@
> > #include <linux/module.h>
> >
> > #define ASM_EXPORT(sym, val) \
> > - asm(".globl " #sym "; .set " #sym ", %0" :: "I"(val));
> > + asm(".globl " #sym "; .set " #sym ", %c0" :: "I"(val));
> >
> > MODULE_DESCRIPTION("SHA-224/SHA-256 secure hash using ARMv8 Crypto Extensions");
> > MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
>
> I am fine with this change, although I would really like to add a
> better reference to the commit log. It is *very* difficult to find any
> documentation regarding non-trivial uses of inline asm constraints,
> and if %c0 is the correct syntax, surely we can quote something better
> than a LLVM bugzilla entry? Also, where does the distinction between
> 'intermediate' vs 'output' expression come from?
To be honest assembly is not really my area of expertise and I relayed
the information from the LLVM bug. The link to the gcc doc on
x86(!) operand modifiers posted by Robin Murphy (thanks!) should be
helpful to provide a more accurate commit message.
Thanks
Matthias
next prev parent reply other threads:[~2017-04-05 17:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-05 16:56 [PATCH] crypto: arm64/sha: use %c constraint code in ASM_EXPORT Matthias Kaehlcke
2017-04-05 16:56 ` Matthias Kaehlcke
2017-04-05 16:56 ` Matthias Kaehlcke
2017-04-05 17:08 ` Ard Biesheuvel
2017-04-05 17:08 ` Ard Biesheuvel
2017-04-05 17:08 ` Ard Biesheuvel
2017-04-05 17:21 ` Robin Murphy
2017-04-05 17:21 ` Robin Murphy
2017-04-05 17:38 ` Ard Biesheuvel
2017-04-05 17:38 ` Ard Biesheuvel
2017-04-05 17:38 ` Ard Biesheuvel
2017-04-05 17:43 ` Matthias Kaehlcke [this message]
2017-04-05 17:43 ` Matthias Kaehlcke
2017-04-05 17:43 ` Matthias Kaehlcke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170405174323.GC145051@google.com \
--to=mka@chromium.org \
--cc=ard.biesheuvel@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=davem@davemloft.net \
--cc=ghackmann@google.com \
--cc=grundler@chromium.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=md@google.com \
--cc=robin.murphy@arm.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.