x86/pv: Fix construction of 32bit dom0's
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 14 Feb 2019 11:10:09 +0000 (11:10 +0000)
committerWei Liu <wei.liu2@citrix.com>
Fri, 15 Mar 2019 14:59:27 +0000 (14:59 +0000)
commit356f437171c5bb90701ac9dd7ba4dbbd05988e38
tree596f0e9add4067278d371f1a3591de4c645653c6
parentcc56d87dc3e203a5701f21fb3a81f347cf0ae9eb
x86/pv: Fix construction of 32bit dom0's

dom0_construct_pv() has logic to transition dom0 into a compat domain when
booting an ELF32 image.

One aspect which is missing is the CPUID policy recalculation, meaning that a
32bit dom0 sees a 64bit policy, which differ by the Long Mode feature flag in
particular.  Another missing item is the x87_fip_width initialisation.

Update dom0_construct_pv() to use switch_compat(), rather than retaining the
opencoding.  Position the call to switch_compat() such that the compat32 local
variable can disappear entirely.

The 32bit monitor table is now created by setup_compat_l4(), avoiding the need
to for manual creation later.

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