|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 4/4] x86/PV: enable the emulated PIT
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@xxxxxxxxxx>
---
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
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(-)
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index 46cfafb..7f47cc5 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -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;
}
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 159d960..8ee5d76 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -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",
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 76c7b0f..08bd3fb 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -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! */
--
1.9.5 (Apple Git-50.3)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |