x86: slightly re-arrange 32-bit handling in dom0_construct_pv()
authorJan Beulich <jbeulich@suse.com>
Fri, 7 Aug 2020 11:14:02 +0000 (13:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Aug 2020 11:14:02 +0000 (13:14 +0200)
commit16dcc135e89663628ee2eaf2d02991fc9ce954bf
tree153b5f1983acd004b1b75bdce2498e75e4e618ff
parentd87c5166daee1f9e1570961b2d204a4a2570acf5
x86: slightly re-arrange 32-bit handling in dom0_construct_pv()

Add #ifdef-s (the 2nd one will be needed in particular, to guard the
uses of m2p_compat_vstart and HYPERVISOR_COMPAT_VIRT_START()) and fold
duplicate uses of elf_32bit().

Also adjust what gets logged: Avoid "compat32" when support isn't built
in, and don't assume ELF class <> ELFCLASS64 means ELFCLASS32.

While doing this, in code getting touched anyway:
- use ROUNDUP() instead of open-coding it,
- drop a stale (dead) BUG_ON(),
- replace panic() by printk() plus error return, for being consistent
  with other code.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/pv/dom0_build.c