]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
x86/PV: allow PV guests to have an emulated PIT
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 22 Jan 2016 15:18:29 +0000 (16:18 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 22 Jan 2016 15:18:29 +0000 (16:18 +0100)
This fixes the fallout from the HVMlite series, that removed the emulated
PIT from PV(H) guests. Also, this patch forces the hardware domain to
always have an emulated PIT, regardless of whether the toolstack specified
one or not.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain.c
xen/arch/x86/hvm/i8254.c

index e70c12532a4a68e0b82640cce3cce824323a09a4..352c194f4f1409e5d351b39707704b8abf5882ef 100644 (file)
@@ -542,8 +542,11 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags,
                    d->domain_id, config->emulation_flags);
             return -EINVAL;
         }
+        if ( is_hardware_domain(d) )
+            config->emulation_flags |= XEN_X86_EMU_PIT;
         if ( config->emulation_flags != 0 &&
-             (!is_hvm_domain(d) || config->emulation_flags != XEN_X86_EMU_ALL) )
+             (config->emulation_flags !=
+              (is_hvm_domain(d) ? XEN_X86_EMU_ALL : 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",
index b517cd636bd820ca38f9bfe765eb0590f5c5b39d..577b43cff0a14254d74df50e6b192bbd8c8e833f 100644 (file)
@@ -568,6 +568,9 @@ int pv_pit_handler(int port, int data, int write)
         .data = data
     };
 
+    if ( !has_vpit(current->domain) )
+        return ~0;
+
     if ( is_hardware_domain(current->domain) && hwdom_pit_access(&ioreq) )
     {
         /* nothing to do */;