xen/pvh: Fix segment selector ABI
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 5 Mar 2020 10:35:17 +0000 (11:35 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 5 Mar 2020 10:35:17 +0000 (11:35 +0100)
commit722458767a297a3ced04743c0156e6ac614e89bf
tree0e3c9dcfaf4a5d489281b923ceec491d23896d3f
parent2ffed5c92feb23babf06a5754e7800bfea99e26b
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>
x86/pvh: Adjust dom0's starting state

Fixes: b25fb1a04e "xen/pvh: Fix segment selector ABI"
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wl@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
master commit: b25fb1a04e99cc03359eade1affb56ef0eee766f
master date: 2020-02-10 15:26:09 +0000
master commit: 6ee10313623c1f41fc72fe12372e176e744463c1
master date: 2020-02-11 11:04:26 +0000
docs/misc/pvh.markdown
tools/libxc/xc_dom_x86.c
xen/arch/x86/hvm/dom0_build.c