xen/pvh: Fix segment selector ABI
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sat, 8 Feb 2020 14:47:48 +0000 (14:47 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 10 Feb 2020 15:26:09 +0000 (15:26 +0000)
commitb25fb1a04e99cc03359eade1affb56ef0eee766f
tree85396892b318f00d7cb23db1108d1f5011451e9e
parent270ff9a835fb4bcfead85a84d0f384b77bde93c0
xen/pvh: Fix segment selector ABI

The written ABI states that %es will be set up, but libxc doesn't do so.  In
practice, it breaks `rep movs` inside guests before they reload %es.

The written ABI doesn't mention %ss, but libxc does set it up.  Having %ds
different to %ss is obnoxous to work with, as different registers have
different implicit segments.

Modify the spec to state that %ss is set up as a flat read/write segment.
This a) matches the Multiboot 1 spec, b) matches what is set up in practice,
and c) is the more sane behaviour for guests to use.

Fixes: 68e1183411b ('libxc: introduce a xc_dom_arch for hvm-3.0-x86_32 guests')
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wl@xen.org>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
docs/misc/pvh.pandoc
tools/libxc/xc_dom_x86.c