mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: tell the world boot_params is 16-byte aligned
Date: Fri, 08 May 2015 09:26:49 -0700	[thread overview]
Message-ID: <853B4FF2-FAC4-4FE3-90F5-D1CFD18B10F7@zytor.com> (raw)
In-Reply-To: <87mw1fkpgn.fsf@rasmusvillemoes.dk>

NAK.  This could break in the case of careless bootloaders...

On May 8, 2015 9:23:52 AM PDT, Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:
>On Fri, May 08 2015, Borislav Petkov <bp@alien8.de> wrote:
>
>> On Fri, May 08, 2015 at 03:42:33PM +0200, Rasmus Villemoes wrote:
>>> It doesn't matter much, but this disassembly makes me cry a little
>bit:
>>> 
>>> ffffffff81f21223 <copy_bootdata>:
>>> ffffffff81f21223:       55                      push   %rbp
>>> ffffffff81f21224:       48 c7 c0 40 c2 02 82    mov   
>$0xffffffff8202c240,%rax
>>> ffffffff81f2122b:       48 89 fe                mov    %rdi,%rsi
>>> ffffffff81f2122e:       a8 01                   test   $0x1,%al
>>> 
>>> The reason is that boot_params is defined with
>>> __attribute__((aligned(16))) in boot/main.c, but other translation
>>> units only see the packed attribute on the definition of struct
>>> boot_params, so assume the worst. Making the de facto alignment
>public
>>
>> Wouldn't it be better if we put both attributes together, i.e.:
>
>Sure, putting it on the type works as well. Either way is fine with me.
>
>Rasmus

-- 
Sent from my mobile phone.  Please pardon brevity and lack of formatting.

  reply	other threads:[~2015-05-08 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 13:42 Rasmus Villemoes
2015-05-08 14:24 ` Borislav Petkov
2015-05-08 16:23   ` Rasmus Villemoes
2015-05-08 16:26     ` H. Peter Anvin [this message]
2015-05-08 17:40       ` Borislav Petkov
2015-05-08 18:36         ` H. Peter Anvin

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=853B4FF2-FAC4-4FE3-90F5-D1CFD18B10F7@zytor.com \
    --to=hpa@zytor.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mingo@redhat.com \
    --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®