[Xen-devel] [PATCH] x86/boot: Improve code generation from bootsym()

Andrew Cooper posted 1 patch 24 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20190909104351.13444-1-andrew.cooper3@citrix.com
xen/include/asm-x86/config.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

[Xen-devel] [PATCH] x86/boot: Improve code generation from bootsym()

Posted by Andrew Cooper 24 weeks ago
The code generation for bootsym() is atrocious, and unnecesserily
complicated.  Given the appropriate physical address, all we need is to
construct a virtual address of the appropriate type.

  add/remove: 0/0 grow/shrink: 0/9 up/down: 0/-4256 (-4256)
  Function                                     old     new   delta
  kexec_reserve_area.constprop                 165     159      -6
  reset_videomode_after_s3                     231      70    -161
  identify_cpu                                1341    1176    -165
  parse_acpi_sleep                             408     240    -168
  early_init_intel                             632     440    -192
  __cpu_up                                    1983    1682    -301
  do_platform_op                              6469    5526    -943
  compat_platform_op                          6433    5482    -951
  __start_xen                                12939   11570   -1369
  Total: Before=3341298, After=3337042, chg -0.13%

No functional change.

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>
---
 xen/include/asm-x86/config.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index f950247029..dab7d7bade 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -91,8 +91,8 @@ extern unsigned long trampoline_phys;
 #define bootsym_phys(sym)                                 \
     (((unsigned long)&(sym)-(unsigned long)&trampoline_start)+trampoline_phys)
 #define bootsym(sym)                                      \
-    (*RELOC_HIDE((typeof(&(sym)))__va(__pa(&(sym))),      \
-                 trampoline_phys-__pa(trampoline_start)))
+    (*((typeof(sym) *)__va(bootsym_phys(sym))))
+
 extern char trampoline_start[], trampoline_end[];
 extern char trampoline_realmode_entry[];
 extern unsigned int trampoline_xen_phys_start;
-- 
2.11.0


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

Re: [Xen-devel] [PATCH] x86/boot: Improve code generation from bootsym()

Posted by Jan Beulich 24 weeks ago
On 09.09.2019 12:43, Andrew Cooper wrote:
> The code generation for bootsym() is atrocious, and unnecesserily
> complicated.  Given the appropriate physical address, all we need is to
> construct a virtual address of the appropriate type.
> 
>   add/remove: 0/0 grow/shrink: 0/9 up/down: 0/-4256 (-4256)
>   Function                                     old     new   delta
>   kexec_reserve_area.constprop                 165     159      -6
>   reset_videomode_after_s3                     231      70    -161
>   identify_cpu                                1341    1176    -165
>   parse_acpi_sleep                             408     240    -168
>   early_init_intel                             632     440    -192
>   __cpu_up                                    1983    1682    -301
>   do_platform_op                              6469    5526    -943
>   compat_platform_op                          6433    5482    -951
>   __start_xen                                12939   11570   -1369
>   Total: Before=3341298, After=3337042, chg -0.13%
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

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