]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
lockprof: move .lockprofile.data into .rodata
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 25 Feb 2016 12:03:43 +0000 (13:03 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 15 Mar 2016 16:32:29 +0000 (16:32 +0000)
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 <andrew.cooper3@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/arm/xen.lds.S
xen/arch/x86/xen.lds.S
xen/include/asm-arm/config.h
xen/include/asm-x86/config.h
xen/include/xen/spinlock.h

index 9f7f915c518478b1a5ee2bb13acf7d97bd5d6f5e..51a3c6ff13ba8c447cb9d38dc65606fdf402f094 100644 (file)
@@ -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 = .;
index b3eb20719f1035c1483cbc882dcf1b59985883b8..a2373598debe0faba5db45194bcd98054c19e2be 100644 (file)
@@ -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 : {
index c3a2c3068e728647078f04702c5fb2c599d73824..c0ad469e02afb242573c09d1afd69a0ad716edf5 100644 (file)
@@ -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
index 07f3c1f16930a26e32c60939b497b0d92aad9e56..7291b5970b641838805a4b270f89f3756eba3775 100644 (file)
@@ -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
 
index 77ab7d5bfe0df968342bbfabab628e702591e13f..88b53f96ea0f949d5790ab79c8461b8663635612 100644 (file)
@@ -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 }