From patchwork Wed Feb 24 19:07:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 8411481 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 052D39F88A for ; Wed, 24 Feb 2016 19:10:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2726A20266 for ; Wed, 24 Feb 2016 19:10:50 +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 0D791202E6 for ; Wed, 24 Feb 2016 19:10:49 +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-0002Fe-Oa; Wed, 24 Feb 2016 19:07:45 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aYeml-0002Eu-0O for xen-devel@lists.xen.org; Wed, 24 Feb 2016 19:07:43 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id 6E/71-03294-E7FFDC65; Wed, 24 Feb 2016 19:07:42 +0000 X-Env-Sender: prvs=8552da0fd=Andrew.Cooper3@citrix.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1456340859!24834267!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26160 invoked from network); 24 Feb 2016 19:07:41 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-5.tower-31.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="334263050" From: Andrew Cooper To: Xen-devel Date: Wed, 24 Feb 2016 19:07:29 +0000 Message-ID: <1456340856-3065-2-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 , Stefano Stabellini , Ian Campbell , Jan Beulich Subject: [Xen-devel] [PATCH] xen/lockprof: Move .lockprofile.data into .rodata 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 The entire contents of .lockprofile.data are unchanging pointers to lock_profile structure in .data. Annotate the type as such, and link the section in .rodata. As these are just pointers, 32byte alignment is unnecessary. Signed-off-by: Andrew Cooper Acked-by: Stefano Stabellini --- CC: Jan Beulich CC: Ian Campbell CC: Stefano Stabellini v2: * New v3: * Explicitly introduce POINTER_ALIGN to avoid forcing 8 byte alignment on arm32 --- xen/arch/arm/xen.lds.S | 15 ++++++++------- xen/arch/x86/xen.lds.S | 14 +++++++------- xen/include/asm-arm/config.h | 1 + xen/include/asm-x86/config.h | 1 + xen/include/xen/spinlock.h | 2 +- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index f501a2f..1b5e516 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -50,6 +50,14 @@ SECTIONS __stop_bug_frames_2 = .; *(.rodata) *(.rodata.*) + +#ifdef LOCK_PROFILE + . = ALIGN(POINTER_ALIGN); + __lock_profile_start = .; + *(.lockprofile.data) + __lock_profile_end = .; +#endif + _erodata = .; /* End of read-only data */ } :text @@ -83,13 +91,6 @@ SECTIONS *(.data.rel.ro.*) } :text -#ifdef LOCK_PROFILE - . = ALIGN(32); - __lock_profile_start = .; - .lockprofile.data : { *(.lockprofile.data) } :text - __lock_profile_end = .; -#endif - . = ALIGN(8); .arch.info : { _splatform = .; diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 9fde1db..8390ec2 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -65,6 +65,13 @@ SECTIONS *(.rodata) *(.rodata.*) + +#ifdef LOCK_PROFILE + . = ALIGN(POINTER_ALIGN); + __lock_profile_start = .; + *(.lockprofile.data) + __lock_profile_end = .; +#endif } :text . = ALIGN(SMP_CACHE_BYTES); @@ -97,13 +104,6 @@ SECTIONS CONSTRUCTORS } :text -#ifdef LOCK_PROFILE - . = ALIGN(32); - __lock_profile_start = .; - .lockprofile.data : { *(.lockprofile.data) } :text - __lock_profile_end = .; -#endif - . = ALIGN(PAGE_SIZE); /* Init code and data */ __init_begin = .; .init.text : { diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h index c3a2c30..c0ad469 100644 --- a/xen/include/asm-arm/config.h +++ b/xen/include/asm-arm/config.h @@ -15,6 +15,7 @@ #define BYTES_PER_LONG (1 << LONG_BYTEORDER) #define BITS_PER_LONG (BYTES_PER_LONG << 3) +#define POINTER_ALIGN BYTES_PER_LONG /* xen_ulong_t is always 64 bits */ #define BITS_PER_XEN_ULONG 64 diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index 07f3c1f..7291b59 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -13,6 +13,7 @@ #define BYTES_PER_LONG (1 << LONG_BYTEORDER) #define BITS_PER_LONG (BYTES_PER_LONG << 3) #define BITS_PER_BYTE 8 +#define POINTER_ALIGN BYTES_PER_LONG #define BITS_PER_XEN_ULONG BITS_PER_LONG diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h index 77ab7d5..88b53f9 100644 --- a/xen/include/xen/spinlock.h +++ b/xen/include/xen/spinlock.h @@ -79,7 +79,7 @@ struct lock_profile_qhead { #define _LOCK_PROFILE(name) { 0, #name, &name, 0, 0, 0, 0, 0 } #define _LOCK_PROFILE_PTR(name) \ - static struct lock_profile *__lock_profile_##name \ + static struct lock_profile * const __lock_profile_##name \ __used_section(".lockprofile.data") = \ &__lock_profile_data_##name #define _SPIN_LOCK_UNLOCKED(x) { { 0 }, SPINLOCK_NO_CPU, 0, _LOCK_DEBUG, x }