x86: Fix grant-table build error
PATCH 1/1 x86: Fix grant-table build error
Fixes build error with btrw instruction.
xen-unstable/xen/include/asm/grant_table.h:57:
Error: Incorrect register %edx' used with w' suffix
--- xen/include/asm-x86/grant_table.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
xen/include/asm-x86/grant_table.h +1 -1
@@ -54,7 +54,7 @@ static inline void gnttab_clear_flag(unsigned int nr, uint16_t *st)* Note that this cannot be clear_bit(), as the access must be * confined to the specified 2 bytes. */ - asmvolatile ("lock btrw %1,%0" :"=m" (*st) :"Ir" (nr),"m" (*st)); + asmvolatile ("lock btr %1,%0" :"=m" (*st) :"Ir" (nr),"m" (*st)); }/* Foreign mappings of HHVM-guest pages do not modify the type count. */
Signature · 1 line
1.7.2.5
Quoted 5 lines
Quoted 1 line
Quoted 1 line · Lin Ming
Fixes build error with btrw instruction.
xen-unstable/xen/include/asm/grant_table.h:57:
Error: Incorrect register%edx' used withw' suffix
With what gcc?
Quoted 11 lines
Signed-off-by Lin Ming <[email protected]>--- xen/include/asm-x86/grant_table.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)xen/include/asm-x86/grant_table.h +0
-0
xen/include/asm-x86/grant_table.h static inline void gnttab_clear_flag(unsigned int nr, · line 58
Quoted 6 lines
xen/include/asm-x86/grant_table.h +1
-1@@ -54,7 +54,7 @@ static inline void gnttab_clear_flag(unsigned int nr,uint16_t *st) * Note that this cannot be clear_bit(), as the access must be * confined to the specified 2 bytes. */ - asmvolatile ("lock btrw %1,%0" :"=m" (*st) :"Ir" (nr),"m" (*st)); + asmvolatile ("lock btr %1,%0" :"=m" (*st) :"Ir" (nr),"m" (*st));
That's definitely not the right way to fix this - did you read the description of the change that introduced this? Nevertheless I admit that change wasn't entirely correct, as it doesn't really allow the compiler to pick a register (apparently it has been picking an immediate number for everyone else up to now). I shall send a proper fix soon.
Jan
Quoted 3 lines
xen/include/asm-x86/grant_table.h +0
-0}/* Foreign mappings of HHVM-guest pages do not modify the type count. */
Quoted 7 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · Lin Ming
Fixes build error with btrw instruction.
xen-unstable/xen/include/asm/grant_table.h:57:
Error: Incorrect register%edx' used withw' suffixWith what gcc?
# gcc --version gcc (Debian 4.4.5-8) 4.4.5
Quoted 17 lines
Quoted 17 lines
Signed-off-by Lin Ming <[email protected]>---
xen/include/asm-x86/grant_table.h | 2 +-1 files changed, 1 insertions(+), 1 deletions(-)xen/include/asm-x86/grant_table.h +0
-1@@ -54,7 +54,7 @@ static inline void gnttab_clear_flag(unsigned int nr,uint16_t *st) * Note that this cannot be clear_bit(), as the access must be * confined to the specified 2 bytes. */ - asm volatile ("lock btrw %1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
Quoted 8 lines
xen/include/asm-x86/grant_table.h static inline void gnttab_clear_flag(unsigned int nr, uint16_t *st) · line 57
Quoted 1 line
xen/include/asm-x86/grant_table.h +1
-0+ asm volatile ("lock btr %1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));That's definitely not the right way to fix this - did you read the description of the change that introduced this? Nevertheless I admit that change wasn't entirely correct, as it doesn't really allow the compiler to pick a register (apparently it has been picking an immediate number for everyone else up to now). I shall send a proper fix soon.
I'd like to test it.
Lin Ming