Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265301AbUF1X6O (ORCPT ); Mon, 28 Jun 2004 19:58:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265305AbUF1X6O (ORCPT ); Mon, 28 Jun 2004 19:58:14 -0400 Received: from fw.osdl.org ([65.172.181.6]:11403 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S265301AbUF1X6M (ORCPT ); Mon, 28 Jun 2004 19:58:12 -0400 Date: Mon, 28 Jun 2004 16:57:07 -0700 From: Andrew Morton To: Ricky Beam Cc: linux-kernel@vger.kernel.org, Andi Kleen , Rusty Russell Subject: Re: __setup()'s not processed in bk-current Message-Id: <20040628165707.328cce15.akpm@osdl.org> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1658 Lines: 48 Ricky Beam wrote: > > Do I smell some bad pointer math? Yeap: > DEBUG: sizeof(obs_kernel_param): 24 (0x18) > > obsolete_checksetup(): line: ro > obsolete_checksetup(): checking: nosmp(5) @ ffffffff80593510 > obsolete_checksetup(): checking: (1) @ ffffffff80593528 > > p++ moved the pointer sizeof(obs_kernel_param) ahead, but that's 8 bytes > short. Thanks for working that out. It's been handing around for ages. We're now putting 24-byte structures into .init.setup via __setup. But x86_64's compiler is emitting a `.align 16' in there, so they end up on 32-byte boundaries and do_early_param()'s pointer arithmetic goes wrong. Fix that up by forcing the compiler to align these structures to sizeof(long). --- 25-akpm/include/linux/init.h | 1 + 1 files changed, 1 insertion(+) diff -puN include/linux/init.h~x86_64-setup-section-alignment-fix include/linux/init.h --- 25/include/linux/init.h~x86_64-setup-section-alignment-fix 2004-06-28 16:47:41.000000000 -0700 +++ 25-akpm/include/linux/init.h 2004-06-28 16:47:41.000000000 -0700 @@ -119,6 +119,7 @@ struct obs_kernel_param { static struct obs_kernel_param __setup_##unique_id \ __attribute_used__ \ __attribute__((__section__(".init.setup"))) \ + __attribute__((aligned((sizeof(long))))) \ = { __setup_str_##unique_id, fn, early } #define __setup_null_param(str, unique_id) \ _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/