x86/pv: Compile out compat_gdt in !CONFIG_PV builds
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 17 Apr 2020 14:49:59 +0000 (15:49 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 29 Apr 2020 20:13:00 +0000 (21:13 +0100)
commit950f41a9da4a151dfb9701eccffedb78cf752adc
tree0a85da1b566ba825d93f8855dbd36836032ffe79
parent9050cf4816a77e2d8c9b3de47a68b7e12661135f
x86/pv: Compile out compat_gdt in !CONFIG_PV builds

There is no need for the Compat GDT if there are no 32bit PV guests.  This
saves 4k per online CPU

Bloat-o-meter reports the following savings in Xen itself:

  add/remove: 0/3 grow/shrink: 1/4 up/down: 7/-4612 (-4605)
  Function                                     old     new   delta
  cpu_smpboot_free                            1249    1256      +7
  per_cpu__compat_gdt_l1e                        8       -      -8
  per_cpu__compat_gdt                            8       -      -8
  init_idt_traps                               442     420     -22
  load_system_tables                           414     364     -50
  trap_init                                    444     280    -164
  cpu_smpboot_callback                        1255     991    -264
  boot_compat_gdt                             4096       -   -4096
  Total: Before=3062726, After=3058121, chg -0.15%

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wl@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/common.c
xen/arch/x86/desc.c
xen/arch/x86/smpboot.c
xen/arch/x86/traps.c