mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Hackmann <ghackmann@google.com>
To: hpa@zytor.com, Kees Cook <keescook@chromium.org>
Cc: Matthias Kaehlcke <mka@chromium.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "x86@kernel.org" <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Grant Grundler <grundler@chromium.org>,
	Michael Davidson <md@google.com>
Subject: Re: [PATCH v2] x86/mm/kaslr: Use _ASM_MUL macro for multiplication
Date: Wed, 26 Apr 2017 14:29:13 -0700	[thread overview]
Message-ID: <d7bd4002-41dd-d0b1-f69e-30546b0ea41d@google.com> (raw)
In-Reply-To: <3FE94529-1D0B-4B23-8D3A-0543E08B12F2@zytor.com>

On 04/26/2017 02:24 PM, hpa@zytor.com wrote:
>>> This really feels like a "fix your compiler" issue.
>>
>> We already use the other forms, what's so bad about adding mul too?
>> And if this lets us build under clang, all the better.
>>
>> -Kees
>
> It's not bad per se, but if this doesn't eventually gets fixed in clang we'll have no end of this crap.
>

AIUI the "problem" is that clang is spilling mix_const into memory 
rather than assigning it to a register.  This is perfectly legal since 
mix_const has a constraint of "rm".  But mul needs a suffix when the 
input is a memory location, since it can't infer the multiplication 
width from the input operand anymore.

You get the same error message with gcc if you force it to use a memory 
location, by narrowing the constraint from "rm" to "m".

  reply	other threads:[~2017-04-26 21:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-26 20:55 Matthias Kaehlcke
2017-04-26 21:00 ` hpa
2017-04-26 21:21   ` Kees Cook
2017-04-26 21:24     ` hpa
2017-04-26 21:29       ` Greg Hackmann [this message]
2017-04-29 21:23         ` H. Peter Anvin
2017-04-26 22:06 ` Kees Cook
2017-05-01 22:47 Matthias Kaehlcke
2017-05-02  2:08 ` Kees Cook

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=d7bd4002-41dd-d0b1-f69e-30546b0ea41d@google.com \
    --to=ghackmann@google.com \
    --cc=grundler@chromium.org \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=md@google.com \
    --cc=mingo@redhat.com \
    --cc=mka@chromium.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®