All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Wei Liu" <wl@xen.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Julien Grall" <julien.grall@arm.com>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH 3/4] xen/link: Fold .data.read_mostly into .data
Date: Wed, 19 Jun 2019 21:11:26 +0100	[thread overview]
Message-ID: <1560975087-25632-4-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1560975087-25632-1-git-send-email-andrew.cooper3@citrix.com>

.data.read_mostly only needs separating from adjacent data by one cache line
to be effective, and placing it adjacent to .data.page_aligned fulfills this
requirement.

For ARM, .ex_table appears to be a vestigial remnant.  Nothing in the
resulting build ever inspects or acts on the contents of the table.  The arm32
build does however have some assembly routines which fill .ex_table.

Drop all of ARM's .ex_table infrastructure, to reduce the size of the compiled
binary, and avoid giving the illusion of exception handling working.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien.grall@arm.com>

Only compile tested on ARM.
---
 xen/arch/arm/arm32/lib/assembler.h | 19 ++-----------------
 xen/arch/arm/xen.lds.S             | 16 +---------------
 xen/arch/x86/xen.lds.S             |  7 ++-----
 3 files changed, 5 insertions(+), 37 deletions(-)

diff --git a/xen/arch/arm/arm32/lib/assembler.h b/xen/arch/arm/arm32/lib/assembler.h
index 6de2638..42eaabb 100644
--- a/xen/arch/arm/arm32/lib/assembler.h
+++ b/xen/arch/arm/arm32/lib/assembler.h
@@ -160,13 +160,6 @@
 	restore_irqs_notrace \oldcpsr
 	.endm
 
-#define USER(x...)				\
-9999:	x;					\
-	.pushsection __ex_table,"a";		\
-	.align	3;				\
-	.long	9999b,9001f;			\
-	.popsection
-
 #ifdef CONFIG_SMP
 #define ALT_SMP(instr...)					\
 9998:	instr
@@ -247,7 +240,7 @@
 #ifdef CONFIG_THUMB2_KERNEL
 
 	.macro	usraccoff, instr, reg, ptr, inc, off, cond, abort, t=T()
-9999:
+
 	.if	\inc == 1
 	\instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
 	.elseif	\inc == 4
@@ -256,10 +249,6 @@
 	.error	"Unsupported inc macro argument"
 	.endif
 
-	.pushsection __ex_table,"a"
-	.align	3
-	.long	9999b, \abort
-	.popsection
 	.endm
 
 	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort
@@ -288,7 +277,7 @@
 
 	.macro	usracc, instr, reg, ptr, inc, cond, rept, abort, t=T()
 	.rept	\rept
-9999:
+
 	.if	\inc == 1
 	\instr\cond\()b\()\t \reg, [\ptr], #\inc
 	.elseif	\inc == 4
@@ -297,10 +286,6 @@
 	.error	"Unsupported inc macro argument"
 	.endif
 
-	.pushsection __ex_table,"a"
-	.align	3
-	.long	9999b, \abort
-	.popsection
 	.endr
 	.endm
 
diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index 2b44e5d..3dc5117 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -94,27 +94,13 @@ SECTIONS
   _erodata = .;                /* End of read-only data */
 
   .data : {                    /* Data */
+       *(.data.read_mostly)
        . = ALIGN(PAGE_SIZE);
        *(.data.page_aligned)
        *(.data)
        *(.data.*)
   } :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)
-  } :text
-
   . = ALIGN(8);
   .arch.info : {
       _splatform = .;
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 9fa6c99..ef11949 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -264,12 +264,9 @@ SECTIONS
   __2M_init_end = .;
 
   __2M_rwdata_start = .;       /* Start of 2M superpages, mapped RW. */
-  . = ALIGN(SMP_CACHE_BYTES);
-  DECL_SECTION(.data.read_mostly) {
-       *(.data.read_mostly)
-  } :text
-
   DECL_SECTION(.data) {
+       *(.data.read_mostly)
+       . = ALIGN(PAGE_SIZE);
        *(.data.page_aligned)
        *(.data)
        *(.data.*)
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-06-19 20:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 20:11 [Xen-devel] [PATCH 0/4] xen/link: Fixes and improvements to Xen's linking Andrew Cooper
2019-06-19 20:11 ` [Xen-devel] [PATCH 1/4] xen/link: Cope with .rodata.cst* sections Andrew Cooper
2019-06-19 21:18   ` Julien Grall
2019-06-20  8:26     ` Roger Pau Monné
2019-06-21  9:05   ` Jan Beulich
2019-06-19 20:11 ` [Xen-devel] [PATCH 2/4] xen/link: Link .data.schedulers and CONSTRUCTERS in more appropriate locations Andrew Cooper
2019-06-19 21:21   ` Julien Grall
2019-06-20  8:40   ` Roger Pau Monné
2019-06-20 12:34     ` Andrew Cooper
2019-06-21  9:14   ` Jan Beulich
2019-06-19 20:11 ` Andrew Cooper [this message]
2019-06-19 21:28   ` [Xen-devel] [PATCH 3/4] xen/link: Fold .data.read_mostly into .data Julien Grall
2019-06-19 21:48     ` Andrew Cooper
2019-06-20 12:24       ` Julien Grall
2019-06-21  9:24   ` Jan Beulich
2019-06-19 20:11 ` [Xen-devel] [PATCH 4/4] xen/link: Misc cleanup Andrew Cooper
2019-06-19 21:30   ` Julien Grall
2019-06-19 21:38     ` Andrew Cooper
2019-06-20 12:29       ` Julien Grall
2019-06-20  8:43   ` Roger Pau Monné
2019-06-21  9:34   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1560975087-25632-4-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.