]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86: fix indirect thunk usage of CONFIG_INDIRECT_THUNK
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 23 Feb 2018 10:00:31 +0000 (11:00 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 23 Feb 2018 10:00:31 +0000 (11:00 +0100)
When indirect_thunk_asm.h is instantiated directly into assembly files
CONFIG_INDIRECT_THUNK might not be defined, and thus using .if against
it is wrong.

Add a check to define CONFIG_INDIRECT_THUNK to 0 if not defined, so
that using .if CONFIG_INDIRECT_THUNK is always correct.

This suppresses the following clang error:

<instantiation>:8:9: error: expected absolute expression
    .if CONFIG_INDIRECT_THUNK == 1
        ^
<instantiation>:1:1: note: while in macro instantiation
INDIRECT_BRANCH call %rdx
^
entry.S:589:9: note: while in macro instantiation
        INDIRECT_CALL %rdx
        ^

Note that this is a preparatory patch in order to enable clang's
integrated assembler, the integrated assembler is not yet enabled for
assembly files.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/include/asm-x86/asm_defns.h

index 6fc13d39d8910f7a5981b70f3eb05e60da37ca62..ebd2c88a1ffebba729548888978a8871940b7421 100644 (file)
@@ -15,6 +15,9 @@
 #include <asm/alternative.h>
 
 #ifdef __ASSEMBLY__
+#ifndef CONFIG_INDIRECT_THUNK
+.equ CONFIG_INDIRECT_THUNK, 0
+#endif
 # include <asm/indirect_thunk_asm.h>
 #else
 asm ( "\t.equ CONFIG_INDIRECT_THUNK, "