On Tue, Feb 20, 2018 at 10:19:16AM +0000, Roger Pau Monné wrote:
> On Tue, Feb 20, 2018 at 02:15:24AM -0700, Jan Beulich wrote:
> > >>> On 19.02.18 at 15:16, <roger....@citrix.com> wrote:
> > > --- a/xen/include/asm-x86/indirect_thunk_asm.h
> > > +++ b/xen/include/asm-x86/indirect_thunk_asm.h
> > > @@ -3,6 +3,10 @@
> > >   * usual #ifdef'ary to turn into comments.
> > >   */
> > >  
> > > +.ifndef CONFIG_INDIRECT_THUNK
> > > +    .equ CONFIG_INDIRECT_THUNK, 0
> > > +.endif
> > 
> > I have to withdraw my R-b: This fails to build (I'm getting an error
> > on the .ifndef above for more than one assembler source). I assume
> > that's because with indirect thunks enabled the constant gets
> > replaced by literal 1 by the C preprocessor.
> 
> Right, I've just installed gcc7-devel and I'm seeing the same. Thanks
> for noticing. Let me try to solve this in another way...

So far the best way I've found to solve this issue that works with
both gcc (with and without indirect thunk support) and clang is the
following:

diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h
index 6fc13d39d8..ebd2c88a1f 100644
--- a/xen/include/asm-x86/asm_defns.h
+++ b/xen/include/asm-x86/asm_defns.h
@@ -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, "

It's fairly similar to my first approach, but at least "#ifdef
CONFIG_INDIRECT_THUNK" will still work as expected after this fix.

Roger.

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

Reply via email to