linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Greg Hackmann <ghackmann@google.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: Sat, 29 Apr 2017 14:23:22 -0700	[thread overview]
Message-ID: <6b9fcaae-044d-5f71-6064-f0df88d5f8b4@zytor.com> (raw)
In-Reply-To: <d7bd4002-41dd-d0b1-f69e-30546b0ea41d@google.com>

On 04/26/17 14:29, Greg Hackmann wrote:
> 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".

OK, that's a genuine bug.  Please explain that in the comment; it has
nothing to do with clang.

	-hpa

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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-26 20:55 [PATCH v2] x86/mm/kaslr: Use _ASM_MUL macro for multiplication 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
2017-04-29 21:23         ` H. Peter Anvin [this message]
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=6b9fcaae-044d-5f71-6064-f0df88d5f8b4@zytor.com \
    --to=hpa@zytor.com \
    --cc=ghackmann@google.com \
    --cc=grundler@chromium.org \
    --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;
as well as URLs for NNTP newsgroup(s).