[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 16/23] x86: Allow LAPIC-only emulation_flags for HVM guests
PVHv2 guests may request LAPIC emulation (and nothing else) Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> --- v2: * Note: I kept the code as is (with minor style adjustments). Roger's version (with emulation_flags_ok()) has slighly more logic to account for dom0. Without that I didn't feel it's worth factoring this code into a separate routine. xen/arch/x86/domain.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 1133ea2..34a4eb5 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -545,25 +545,31 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags, } else { - if ( (config->emulation_flags & ~XEN_X86_EMU_ALL) != 0 ) + uint32_t emflags; + + if ( is_hardware_domain(d) ) + config->emulation_flags |= XEN_X86_EMU_PIT; + + emflags = config->emulation_flags; + if ( emflags & ~XEN_X86_EMU_ALL ) { printk(XENLOG_G_ERR "d%d: Invalid emulation bitmap: %#x\n", - d->domain_id, config->emulation_flags); + d->domain_id, emflags); return -EINVAL; } - if ( is_hardware_domain(d) ) - config->emulation_flags |= XEN_X86_EMU_PIT; - if ( config->emulation_flags != 0 && - (config->emulation_flags != - (is_hvm_domain(d) ? XEN_X86_EMU_ALL : XEN_X86_EMU_PIT)) ) + + /* PVHv2 guests can request emulated APIC. */ + if ( emflags && + (is_hvm_domain(d) ? ((emflags != XEN_X86_EMU_ALL) && + (emflags != XEN_X86_EMU_LAPIC)) : + (emflags != 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", - d->domain_id, is_hvm_domain(d) ? "HVM" : "PV", - config->emulation_flags); + d->domain_id, is_hvm_domain(d) ? "HVM" : "PV", emflags); return -EOPNOTSUPP; } - d->arch.emulation_flags = config->emulation_flags; + d->arch.emulation_flags = emflags; } if ( has_hvm_container_domain(d) ) -- 1.8.3.1 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |