x86/grant: Use explicit instruction size in gnttab_clear_flags()
PATCH 1/1 x86/grant: Use explicit instruction size in gnttab_clear_flags()
The OpenSUSE Leap compilers complain about ambiguity:
In file included from grant_table.c:33:
In file included from ...xen/include/xen/grant_table.h:30:...xen/include/asm/grant_table.h:67:19: error: ambiguous instructions require an explicit suffix (could be 'andb', 'andw', 'andl', or 'andq')
asm volatile ("lock and %1,%0" : "+m" (*addr) : "ir" ((uint16_t)~mask));
^
<inline asm>:1:2: note: instantiated into assembly here
lock and $-17,(%rsi)
^Full logs: https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/247600284
---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>
--- xen/include/asm-x86/grant_table.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/asm-x86/grant_table.h +1 -1
@@ -64,7 +64,7 @@ static inline void gnttab_clear_flags(struct domain *d, unsigned int mask, uint16_t *addr) {/* Access must be confined to the specified 2 bytes. */ - asmvolatile ("lock and %1,%0" :"+m" (*addr) :"ir" ((uint16_t )~mask)); + asmvolatile ("lock andw %1,%0" :"+m" (*addr) :"ir" ((uint16_t )~mask)); }/* Foreign mappings of HVM-guest pages do not modify the type count. */
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 11 lines · Andrew Cooper
The OpenSUSE Leap compilers complain about ambiguity:
In file included from grant_table.c:33:
In file included from...xen/include/xen/grant_table.h:30:...xen/include/asm/grant_table.h:67:19: error: ambiguous instructions require an explicit suffix (could be 'andb', 'andw', 'andl', or 'andq')asm volatile ("lock and %1,%0" : "+m" (*addr) : "ir" ((uint16_t)~mask)); ^ <inline asm>:1:2: note: instantiated into assembly here lock and $-17,(%rsi) ^
Wow - pretty helpful improvement to the compiler, albeit I have no idea how this actually work. The assembler would have picked andl here.
Quoted 2 lines
Full logs: https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/247600284
Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel