x86/pv: Short-circuit is_pv_{32,64}bit_domain() in !CONFIG_PV32 builds
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 17 Apr 2020 14:36:06 +0000 (15:36 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 29 Apr 2020 20:13:00 +0000 (21:13 +0100)
commit9050cf4816a77e2d8c9b3de47a68b7e12661135f
tree0244692dae8fb15ccda9e1e053312cca3d645cd0
parent68d757df8dd23b88bebfb6a56c9f51df59de969f
x86/pv: Short-circuit is_pv_{32,64}bit_domain() in !CONFIG_PV32 builds

... and move arch.is_32bit_pv into the pv union while at it.

Adjust the impacted code to use true/false, dropping the hunk
pv_domain_initialise() which is storing 0 into an already zeroed
datastructure.

Bloat-o-meter reports the following net savings with some notable differences
highlighted:

  add/remove: 4/6 grow/shrink: 5/76 up/down: 1955/-18792 (-16837)
  Function                                     old     new   delta
  ...
  pv_vcpu_initialise                           411     158    -253
  guest_cpuid                                 1837    1584    -253
  pv_hypercall                                 579     297    -282
  check_descriptor                             427     130    -297
  _get_page_type                              5915    5202    -713
  arch_get_info_guest                         2225    1195   -1030
  context_switch                              3831    2635   -1196
  dom0_construct_pv                          10284    8939   -1345
  arch_set_info_guest                         5564    3267   -2297
  Total: Before=3079563, After=3062726, chg -0.55%

In principle, DOMAIN_is_32bit_pv should be based on CONFIG_PV32, but the
assembly code is going to need further untangling before that becomes easy to
do.  For now, use CONFIG_PV as missed accidentally by c/s ec651bd2460 "x86:
make entry point code build when !CONFIG_PV".

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wl@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domctl.c
xen/arch/x86/pv/domain.c
xen/arch/x86/pv/hypercall.c
xen/arch/x86/x86_64/asm-offsets.c
xen/include/asm-x86/domain.h
xen/include/xen/sched.h