From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932314AbbEHQ2d (ORCPT ); Fri, 8 May 2015 12:28:33 -0400 Received: from terminus.zytor.com ([198.137.202.10]:51001 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932288AbbEHQ21 (ORCPT ); Fri, 8 May 2015 12:28:27 -0400 User-Agent: K-9 Mail for Android In-Reply-To: <87mw1fkpgn.fsf@rasmusvillemoes.dk> References: <1431092553-12914-1-git-send-email-linux@rasmusvillemoes.dk> <20150508142453.GC4137@pd.tnic> <87mw1fkpgn.fsf@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH] x86: tell the world boot_params is 16-byte aligned From: "H. Peter Anvin" Date: Fri, 08 May 2015 09:26:49 -0700 To: Rasmus Villemoes , Borislav Petkov CC: Thomas Gleixner , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org Message-ID: <853B4FF2-FAC4-4FE3-90F5-D1CFD18B10F7@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NAK. This could break in the case of careless bootloaders... On May 8, 2015 9:23:52 AM PDT, Rasmus Villemoes wrote: >On Fri, May 08 2015, Borislav Petkov 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 : >>> 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.