@@ -144,11 +144,28 @@ config INTEL_VMX
If your system includes a processor with Intel VT-x support, say Y.
If in doubt, say Y.
+menu "Emulated devices support"
+ visible if EXPERT
+ depends on HVM
+
config X86_PMTIMER
- def_bool HVM
+ bool "ACPI PM timer emulation support"
+ default y
+ help
+ Build pmtimer driver that emulates ACPI PM timer for HVM/PVH guests.
+
+ If unsure, say Y.
config X86_STDVGA
- def_bool HVM
+ bool "Standard VGA card emulation support"
+ default y
+ help
+ Build stdvga driver that emulates standard VGA card with VESA BIOS
+ Extensions for HVM/PVH guests.
+
+ If unsure, say Y.
+
+endmenu
config XEN_SHSTK
bool "Supervisor Shadow Stacks"
@@ -742,11 +742,17 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
static bool emulation_flags_ok(const struct domain *d, uint32_t emflags)
{
+ const uint32_t disabled_emu_mask =
+ (IS_ENABLED(CONFIG_X86_PMTIMER) ? 0 : X86_EMU_PM) |
+ (IS_ENABLED(CONFIG_X86_STDVGA) ? 0 : X86_EMU_VGA);
#ifdef CONFIG_HVM
/* This doesn't catch !CONFIG_HVM case but it is better than nothing */
BUILD_BUG_ON(X86_EMU_ALL != XEN_X86_EMU_ALL);
#endif
+ if ( emflags & disabled_emu_mask )
+ return false;
+
if ( is_hvm_domain(d) )
{
if ( is_hardware_domain(d) &&
Make it possible to build a configuration without code for PM timer or stdvga drivers. This may help to reduce code's footprint a bit for systems that don't run HVM guests and also don't need these devices emulated. Introduced additional check of domain's emulation flags, to cover the case when user explicitly states the requirement of emulated devices that are disabled in the build. HVM always require these devices to be present so domains of this type can't be created when stdvga or pmtimer are disabled. Options X86_STDVGA & X86_PMTIMER are dependant on HVM option, because these drivers are part of HVM support code. Suggested-by: Roger Pau Monné <roger.pau@citrix.com> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com> --- xen/arch/x86/Kconfig | 21 +++++++++++++++++++-- xen/arch/x86/domain.c | 6 ++++++ 2 files changed, 25 insertions(+), 2 deletions(-)