x86emul: disable FPU/MMX/SIMD insn emulation when !HVM
authorJan Beulich <jbeulich@suse.com>
Fri, 29 May 2020 15:31:13 +0000 (17:31 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 29 May 2020 15:31:13 +0000 (17:31 +0200)
commitfced27b002c73c47c6c24ece2fe32b78157ad6b6
treed5dddb136fe3c4cf87c9614943ab441612e9240d
parent8c439e9ee4aa202306f5c0ca1391b6c8adf0f7e1
x86emul: disable FPU/MMX/SIMD insn emulation when !HVM

In a pure PV environment (the PV shim in particular) we don't really
need emulation of all these. To limit #ifdef-ary utilize some of the
CASE_*() macros we have, by providing variants expanding to
(effectively) nothing (really a label, which in turn requires passing
-Wno-unused-label to the compiler when build such configurations).

Due to the mixture of macro and #ifdef use, the placement of some of
the #ifdef-s is a little arbitrary.

The resulting object file's .text is less than half the size of the
original, and looks to also be compiling a little more quickly.

This is meant as a first step; more parts can likely be disabled down
the road.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Bregrudingly-acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/Makefile
xen/arch/x86/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.c