xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Lukasz Hawrylko" <lukasz.hawrylko@linux.intel.com>,
	"Wei Liu" <wl@xen.org>, "Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH] x86: Misc trivial cleanup of bootsym_phys()
Date: Mon, 9 Sep 2019 11:44:07 +0100	[thread overview]
Message-ID: <20190909104407.13666-1-andrew.cooper3@citrix.com> (raw)

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>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Lukasz Hawrylko <lukasz.hawrylko@linux.intel.com>
---
 xen/arch/x86/smpboot.c | 4 +---
 xen/arch/x86/tboot.c   | 9 +++------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 911416c1e1..6904ef5771 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -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 )
diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c
index 8263f24009..3e828fe204 100644
--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -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
-- 
2.11.0


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

             reply	other threads:[~2019-09-09 10:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09 10:44 Andrew Cooper [this message]
2019-09-09 11:45 ` [Xen-devel] [PATCH] x86: Misc trivial cleanup of bootsym_phys() 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=20190909104407.13666-1-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=lukasz.hawrylko@linux.intel.com \
    --cc=roger.pau@citrix.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).