@@ -13,8 +13,14 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
LIBXL_DEVICE_MODEL_VERSION_NONE) {
/* HVM domains with a device model. */
xc_config->emulation_flags = XEN_X86_EMU_ALL;
+ } else if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV) {
+ /* PV domains. */
+ xc_config->emulation_flags = XEN_X86_EMU_PIT;
} else {
- /* PV or HVM domains without a device model. */
+ assert(d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM);
+ assert(d_config->b_info.device_model_version ==
+ LIBXL_DEVICE_MODEL_VERSION_NONE);
+ /* HVMlite domains. */
xc_config->emulation_flags = 0;
}
@@ -542,8 +542,9 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
d->domain_id, config->emulation_flags);
return -EINVAL;
}
- if ( config->emulation_flags != 0 &&
- (!is_hvm_domain(d) || config->emulation_flags != XEN_X86_EMU_ALL) )
+ if ( (is_hvm_domain(d) && config->emulation_flags != XEN_X86_EMU_ALL &&
+ config->emulation_flags != 0) ||
+ (!is_hvm_domain(d) && config->emulation_flags != XEN_X86_EMU_PIT) )
{
printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation "
"with the current selection of emulators: %#x\n",
@@ -582,7 +582,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
.parity = 'n',
.stop_bits = 1
};
- struct xen_arch_domainconfig config = { .emulation_flags = 0 };
+ struct xen_arch_domainconfig config = {
+ .emulation_flags = XEN_X86_EMU_PIT,
+ };
/* Critical region without IDT or TSS. Any fault is deadly! */
The HVMlite series removed the initialization of the emulated PIT for PV guests, this patch re-enables it. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> --- Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Cc: Jan Beulich <jbeulich@suse.com> Cc: Andrew Cooper <andrew.cooper3@citrix.com> --- NB: Since it's not clear why an emulated PIT is needed, it won't be enabled by default for HVMlite guests until we can figure out if/why it's needed. --- Changes since v1: - New in this version. --- tools/libxl/libxl_x86.c | 8 +++++++- xen/arch/x86/domain.c | 5 +++-- xen/arch/x86/setup.c | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-)