]> xenbits.xensource.com Git - people/hx242/xen.git/commitdiff
x86: Misc trivial cleanup of bootsym_phys()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 9 Sep 2019 10:43:28 +0000 (11:43 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 18 Sep 2019 18:03:15 +0000 (19:03 +0100)
In smpboot, there is no need to abstract setup_trampoline() away.  Drop the
define and use bootsym_phys() directly.

In tboot, the 3 size calculations are invariant of their bootsym_phys()/__pa()
transformations, but the compiler can't tell this.  Drop the tranformations,
which simplifies the compiled function.

  add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-134 (-134)
  Function                                     old     new   delta
  tboot_shutdown                               620     486    -134
  Total: Before=3337042, After=3336908, chg -0.00%

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/smpboot.c
xen/arch/x86/tboot.c

index 73a1afc687b9cab643681b45bc862724e511ce3a..5b3be25f8a3bb6b71025235ec9c70c39d51d7f6a 100644 (file)
@@ -46,8 +46,6 @@
 #include <asm/tboot.h>
 #include <mach_apic.h>
 
-#define setup_trampoline()    (bootsym_phys(trampoline_realmode_entry))
-
 unsigned long __read_mostly trampoline_phys;
 
 /* representing HT siblings of each logical CPU */
@@ -545,7 +543,7 @@ static int do_boot_cpu(int apicid, int cpu)
 
     booting_cpu = cpu;
 
-    start_eip = setup_trampoline();
+    start_eip = bootsym_phys(trampoline_realmode_entry);
 
     /* start_eip needs be page aligned, and below the 1M boundary. */
     if ( start_eip & ~0xff000 )
index 8263f2400920780f10ca5126dd6b2aa647c1a412..3e828fe2040e21ceb8d1ad147947a8687095070b 100644 (file)
@@ -370,16 +370,13 @@ void tboot_shutdown(uint32_t shutdown_type)
         g_tboot_shared->num_mac_regions = 3;
         /* S3 resume code (and other real mode trampoline code) */
         g_tboot_shared->mac_regions[0].start = bootsym_phys(trampoline_start);
-        g_tboot_shared->mac_regions[0].size = bootsym_phys(trampoline_end) -
-                                              bootsym_phys(trampoline_start);
+        g_tboot_shared->mac_regions[0].size = trampoline_end - trampoline_start;
         /* hypervisor .text + .rodata */
         g_tboot_shared->mac_regions[1].start = (uint64_t)__pa(&_stext);
-        g_tboot_shared->mac_regions[1].size = __pa(&__2M_rodata_end) -
-                                              __pa(&_stext);
+        g_tboot_shared->mac_regions[1].size = __2M_rodata_end - _stext;
         /* hypervisor .data + .bss */
         g_tboot_shared->mac_regions[2].start = (uint64_t)__pa(&__2M_rwdata_start);
-        g_tboot_shared->mac_regions[2].size = __pa(&__2M_rwdata_end) -
-                                              __pa(&__2M_rwdata_start);
+        g_tboot_shared->mac_regions[2].size = __2M_rwdata_end - __2M_rwdata_start;
 
         /*
          * MAC domains and other Xen memory