x86/emul: Use system-segment relative memory accesses
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 1 Jul 2016 17:29:46 +0000 (18:29 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 2 Dec 2016 17:23:02 +0000 (17:23 +0000)
commit8e4b2676685f50bc26f03b5f62d8b7aea8e69dbf
treefd1c29156f56195b674391c4e853cc13d8fe8d24
parentc785f759718b0a86a0b1332901d1ee63c9e67c77
x86/emul: Use system-segment relative memory accesses

With hvm_virtual_to_linear_addr() capable of doing proper system-segment
relative memory accesses, avoid open-coding the address and limit calculations
locally.

When a table spans the 4GB boundary (32bit) or non-canonical boundary (64bit),
segmentation errors are now raised.  Previously, the use of x86_seg_none
resulted in segmentation being skipped, and the linear address being truncated
through the pagewalk, and possibly coming out valid on the far side.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <JBeulich@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/x86_emulate/x86_emulate.c