From patchwork Wed Feb 24 19:07:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 8411461 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 2D1EA9F88A for ; Wed, 24 Feb 2016 19:10:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55C702026C for ; Wed, 24 Feb 2016 19:10:47 +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 5A9A82035D for ; Wed, 24 Feb 2016 19:10:45 +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 1aYemn-0002FX-5x; Wed, 24 Feb 2016 19:07:45 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYemk-0002Ee-AF for xen-devel@lists.xen.org; Wed, 24 Feb 2016 19:07:42 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id 58/67-03303-E7FFDC65; Wed, 24 Feb 2016 19:07:42 +0000 X-Env-Sender: prvs=8552da0fd=Andrew.Cooper3@citrix.com X-Msg-Ref: server-8.tower-206.messagelabs.com!1456340859!24522550!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34774 invoked from network); 24 Feb 2016 19:07:41 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 24 Feb 2016 19:07:41 -0000 X-IronPort-AV: E=Sophos;i="5.22,494,1449532800"; d="scan'208";a="340848380" From: Andrew Cooper To: Xen-devel Date: Wed, 24 Feb 2016 19:07:34 +0000 Message-ID: <1456340856-3065-7-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456340856-3065-1-git-send-email-andrew.cooper3@citrix.com> References: <1456340856-3065-1-git-send-email-andrew.cooper3@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Andrew Cooper , Jan Beulich Subject: [Xen-devel] [PATCH] xen/x86: Reorder .data and .init when linking 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 In preparation for using superpage mappings, .data and .bss will both want to be mapped as read-write. By making them adjacent, they can share the same superpage and will not require superpage alignment between themselves. While making this change, fix a latent alignment bug whereby the alignment for .bss.stack_aligned was in .init. __init_end only needs page alignment (due to being reclaimed after boot), while .bss.stack_aligned really does needs STACK_SIZE alignment. Signed-off-by: Andrew Cooper --- CC: Jan Beulich v2: * New v3: * Swap __bss_start and its alignment. --- xen/arch/x86/xen.lds.S | 63 +++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 8390ec2..f78309d 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -74,36 +74,6 @@ SECTIONS #endif } :text - . = ALIGN(SMP_CACHE_BYTES); - .data.read_mostly : { - /* Exception table */ - __start___ex_table = .; - *(.ex_table) - __stop___ex_table = .; - - /* Pre-exception table */ - __start___pre_ex_table = .; - *(.ex_table.pre) - __stop___pre_ex_table = .; - - *(.data.read_mostly) - . = ALIGN(8); - __start_schedulers_array = .; - *(.data.schedulers) - __end_schedulers_array = .; - *(.data.rel.ro) - *(.data.rel.ro.*) - } :text - - .data : { /* Data */ - . = ALIGN(PAGE_SIZE); - *(.data.page_aligned) - *(.data) - *(.data.rel) - *(.data.rel.*) - CONSTRUCTORS - } :text - . = ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin = .; .init.text : { @@ -163,10 +133,41 @@ SECTIONS *(.xsm_initcall.init) __xsm_initcall_end = .; } :text - . = ALIGN(STACK_SIZE); + . = ALIGN(PAGE_SIZE); __init_end = .; + . = ALIGN(SMP_CACHE_BYTES); + .data.read_mostly : { + /* Exception table */ + __start___ex_table = .; + *(.ex_table) + __stop___ex_table = .; + + /* Pre-exception table */ + __start___pre_ex_table = .; + *(.ex_table.pre) + __stop___pre_ex_table = .; + + *(.data.read_mostly) + . = ALIGN(8); + __start_schedulers_array = .; + *(.data.schedulers) + __end_schedulers_array = .; + *(.data.rel.ro) + *(.data.rel.ro.*) + } :text + + .data : { /* Data */ + . = ALIGN(PAGE_SIZE); + *(.data.page_aligned) + *(.data) + *(.data.rel) + *(.data.rel.*) + CONSTRUCTORS + } :text + .bss : { /* BSS */ + . = ALIGN(STACK_SIZE); __bss_start = .; *(.bss.stack_aligned) . = ALIGN(PAGE_SIZE);