From patchwork Mon Feb 15 07:36:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 8310731 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1767B9F2F0 for ; Mon, 15 Feb 2016 07:39:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AF1E204EB for ; Mon, 15 Feb 2016 07:39:16 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 439BB204AD for ; Mon, 15 Feb 2016 07:39:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aVDhq-0002dN-Ke; Mon, 15 Feb 2016 07:36:26 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aVDhp-0002dI-41 for xen-devel@lists.xenproject.org; Mon, 15 Feb 2016 07:36:25 +0000 Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id 49/05-08347-8FF71C65; Mon, 15 Feb 2016 07:36:24 +0000 X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-11.tower-27.messagelabs.com!1455521781!15187084!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36330 invoked from network); 15 Feb 2016 07:36:23 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-11.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 15 Feb 2016 07:36:23 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Mon, 15 Feb 2016 00:36:20 -0700 Message-Id: <56C18DFF02000078000D1E84@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Mon, 15 Feb 2016 00:36:15 -0700 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Cc: Ian Campbell , Andrew Cooper , Keir Fraser , Ian Jackson , Tim Deegan Subject: [Xen-devel] [PATCH] common: re-arrange struct kernel_param fields X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Even if placed in .init.* there's no reason to needlessly bloat the binary due to padding fields the compiler needs to insert on 64-bit architectures. Signed-off-by: Jan Beulich common: re-arrange struct kernel_param fields Even if placed in .init.* there's no reason to needlessly bloat the binary due to padding fields the compiler needs to insert on 64-bit architectures. Signed-off-by: Jan Beulich --- a/xen/include/xen/init.h +++ b/xen/include/xen/init.h @@ -81,34 +81,35 @@ struct kernel_param { OPT_SIZE, OPT_CUSTOM } type; - void *var; unsigned int len; + void *var; }; extern struct kernel_param __setup_start, __setup_end; #define __setup_str static __initdata __attribute__((__aligned__(1))) char -#define __kparam static __initsetup struct kernel_param +#define __kparam static __initsetup \ + __attribute__((__aligned__(sizeof(void *)))) struct kernel_param #define custom_param(_name, _var) \ __setup_str __setup_str_##_var[] = _name; \ - __kparam __setup_##_var = { __setup_str_##_var, OPT_CUSTOM, _var, 0 } + __kparam __setup_##_var = { __setup_str_##_var, OPT_CUSTOM, 0, _var } #define boolean_param(_name, _var) \ __setup_str __setup_str_##_var[] = _name; \ __kparam __setup_##_var = \ - { __setup_str_##_var, OPT_BOOL, &_var, sizeof(_var) } + { __setup_str_##_var, OPT_BOOL, sizeof(_var), &_var } #define integer_param(_name, _var) \ __setup_str __setup_str_##_var[] = _name; \ __kparam __setup_##_var = \ - { __setup_str_##_var, OPT_UINT, &_var, sizeof(_var) } + { __setup_str_##_var, OPT_UINT, sizeof(_var), &_var } #define size_param(_name, _var) \ __setup_str __setup_str_##_var[] = _name; \ __kparam __setup_##_var = \ - { __setup_str_##_var, OPT_SIZE, &_var, sizeof(_var) } + { __setup_str_##_var, OPT_SIZE, sizeof(_var), &_var } #define string_param(_name, _var) \ __setup_str __setup_str_##_var[] = _name; \ __kparam __setup_##_var = \ - { __setup_str_##_var, OPT_STR, &_var, sizeof(_var) } + { __setup_str_##_var, OPT_STR, sizeof(_var), &_var } #endif /* __ASSEMBLY__ */ Reviewed-by: Andrew Cooper --- a/xen/include/xen/init.h +++ b/xen/include/xen/init.h @@ -81,34 +81,35 @@ struct kernel_param { OPT_SIZE, OPT_CUSTOM } type; - void *var; unsigned int len; + void *var; }; extern struct kernel_param __setup_start, __setup_end; #define __setup_str static __initdata __attribute__((__aligned__(1))) char -#define __kparam static __initsetup struct kernel_param +#define __kparam static __initsetup \ + __attribute__((__aligned__(sizeof(void *)))) struct kernel_param #define custom_param(_name, _var) \ __setup_str __setup_str_##_var[] = _name; \ - __kparam __setup_##_var = { __setup_str_##_var, OPT_CUSTOM, _var, 0 } + __kparam __setup_##_var = { __setup_str_##_var, OPT_CUSTOM, 0, _var } #define boolean_param(_name, _var) \ __setup_str __setup_str_##_var[] = _name; \ __kparam __setup_##_var = \ - { __setup_str_##_var, OPT_BOOL, &_var, sizeof(_var) } + { __setup_str_##_var, OPT_BOOL, sizeof(_var), &_var } #define integer_param(_name, _var) \ __setup_str __setup_str_##_var[] = _name; \ __kparam __setup_##_var = \ - { __setup_str_##_var, OPT_UINT, &_var, sizeof(_var) } + { __setup_str_##_var, OPT_UINT, sizeof(_var), &_var } #define size_param(_name, _var) \ __setup_str __setup_str_##_var[] = _name; \ __kparam __setup_##_var = \ - { __setup_str_##_var, OPT_SIZE, &_var, sizeof(_var) } + { __setup_str_##_var, OPT_SIZE, sizeof(_var), &_var } #define string_param(_name, _var) \ __setup_str __setup_str_##_var[] = _name; \ __kparam __setup_##_var = \ - { __setup_str_##_var, OPT_STR, &_var, sizeof(_var) } + { __setup_str_##_var, OPT_STR, sizeof(_var), &_var } #endif /* __ASSEMBLY__ */