x86/hvm: Don't truncate the hvm hypercall index before range checking it
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 4 Aug 2016 18:01:15 +0000 (18:01 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 28 Oct 2016 10:53:48 +0000 (11:53 +0100)
commit35ac0c08178ac15565b32ca56b00fa5414f1d3b1
tree28dc698c92c9ba594e29613864555887b74b9ab3
parenta418ec07cf2668197548c6503924139a2098e41d
x86/hvm: Don't truncate the hvm hypercall index before range checking it

c/s 5eeca68f introduced the 64bit ABI for HVM guests, and chose to explicitly
truncate the index, despite the fact that the `mov $imm32, %eax` in the
hypercall page already provides the expected truncation.

The truncation isn't very obvious, and is counterintuitive, seeing as all
other 64bit parameters are passed without truncation.  It is also different to
the PV ABI, which is otherwise identical.

As the hypercall page has always been present for HVM guests (and indeed, is
basically mandatory to abstract away vendor differences), it is exceedingly
unlikely that any code exists which enters hvm_do_hypercall() with upper bits
set in %rax.

Therefore, take the opportunity to fix the ABI before it becomes impossible to
fix.

While tweaking this area, fix one piece of trailing whitespace.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/hvm/hvm.c