[PATCH] x86/guest: Fix assembler warnings with newer binutils

Andrew Cooper posted 1 patch 3 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20200512162830.5912-1-andrew.cooper3@citrix.com
xen/arch/x86/guest/xen/hypercall_page.S | 1 -
1 file changed, 1 deletion(-)
[PATCH] x86/guest: Fix assembler warnings with newer binutils
Posted by Andrew Cooper 3 years, 10 months ago
GAS of at least version 2.34 complains:

  hypercall_page.S: Assembler messages:
  hypercall_page.S:24: Warning: symbol 'HYPERCALL_set_trap_table' already has its type set
  ...
  hypercall_page.S:71: Warning: symbol 'HYPERCALL_arch_7' already has its type set

This is because the whole page is declared as STT_OBJECT, and then every
hypercall within it is declared as STT_FUNC.  As these are function-like and
in .text, retain the STT_FUNC type and drop STT_OBJECT.

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>

Alternative suggestions welcome.  I've got half a mind to strip the unused
hypercalls, as a large chunk of them are PV only and will never be used by a
PVH Xen.  This would also remove the existing alias between hypercall_page and
HYPERCALL_set_trap_table.
---
 xen/arch/x86/guest/xen/hypercall_page.S | 1 -
 1 file changed, 1 deletion(-)

diff --git a/xen/arch/x86/guest/xen/hypercall_page.S b/xen/arch/x86/guest/xen/hypercall_page.S
index 6485e9150e..9673846b7d 100644
--- a/xen/arch/x86/guest/xen/hypercall_page.S
+++ b/xen/arch/x86/guest/xen/hypercall_page.S
@@ -8,7 +8,6 @@
 GLOBAL(hypercall_page)
          /* Poisoned with `ret` for safety before hypercalls are set up. */
         .fill PAGE_SIZE, 1, 0xc3
-        .type hypercall_page, STT_OBJECT
         .size hypercall_page, PAGE_SIZE
 
 /*
-- 
2.11.0


Re: [PATCH] x86/guest: Fix assembler warnings with newer binutils
Posted by Jan Beulich 3 years, 10 months ago
On 12.05.2020 18:28, Andrew Cooper wrote:
> --- a/xen/arch/x86/guest/xen/hypercall_page.S
> +++ b/xen/arch/x86/guest/xen/hypercall_page.S
> @@ -8,7 +8,6 @@
>  GLOBAL(hypercall_page)
>           /* Poisoned with `ret` for safety before hypercalls are set up. */
>          .fill PAGE_SIZE, 1, 0xc3
> -        .type hypercall_page, STT_OBJECT
>          .size hypercall_page, PAGE_SIZE

Looks like we don't need to sacrifice type setting here: Simply
moving .type ahead of .set in DECLARE_HYPERCALL() seems to also
help. To save a roundtrip, this alternative change
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan