All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH] x86/grant: Use explicit instruction size in gnttab_clear_flags()
@ 2019-07-08 22:15 Andrew Cooper
  2019-07-09 13:23 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cooper @ 2019-07-08 22:15 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Wei Liu, Jan Beulich, Roger Pau Monné

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
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/grant_table.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/grant_table.h b/xen/include/asm-x86/grant_table.h
index 568a6bb57c..61c889b297 100644
--- a/xen/include/asm-x86/grant_table.h
+++ b/xen/include/asm-x86/grant_table.h
@@ -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. */
-    asm volatile ("lock and %1,%0" : "+m" (*addr) : "ir" ((uint16_t)~mask));
+    asm volatile ("lock andw %1,%0" : "+m" (*addr) : "ir" ((uint16_t)~mask));
 }
 
 /* Foreign mappings of HVM-guest pages do not modify the type count. */
-- 
2.11.0


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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Xen-devel] [PATCH] x86/grant: Use explicit instruction size in gnttab_clear_flags()
  2019-07-08 22:15 [Xen-devel] [PATCH] x86/grant: Use explicit instruction size in gnttab_clear_flags() Andrew Cooper
@ 2019-07-09 13:23 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2019-07-09 13:23 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Xen-devel, Wei Liu, Roger Pau Monné

On 09.07.2019 00:15, Andrew Cooper wrote:
> 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.

> Full logs: https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/247600284
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-09 13:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 22:15 [Xen-devel] [PATCH] x86/grant: Use explicit instruction size in gnttab_clear_flags() Andrew Cooper
2019-07-09 13:23 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.