x86/entry: Correct comparisons against boolean variables
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 21 Feb 2018 13:00:23 +0000 (13:00 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 5 Mar 2018 17:36:31 +0000 (17:36 +0000)
commit344c55229847365462ad9d2fe9190366d2ee41ae
tree906f19bf35325c7e3ec0690f80f0c9804f6206d0
parent9fd181540c7e67bd3df53c61337a8999cf679fd6
x86/entry: Correct comparisons against boolean variables

The correct way to check a boolean is `cmpb $0` or `testb $0xff`, whereas a
lot of our entry code uses `testb $1`.  This will work in principle for values
which are really C _Bool types, but won't work for other integer types which
are intended to have boolean properties.

cmp is the more logical way of thinking about the operation, so adjust all
outstanding uses of `testb $1` against boolean values.  Changing test to cmp
changes the logical mnemonic of the following condition from 'zero' to
'equal', but the actual encoding remains the same.

No functional change, as all uses are real C _Bool types, and confirmed by
diffing the disassembly.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/x86_64/compat/entry.S
xen/arch/x86/x86_64/entry.S