x86/pt: add HVM check to XEN_DOMCTL_unbind_pt_irq
authorWei Liu <wei.liu2@citrix.com>
Fri, 17 Aug 2018 15:12:32 +0000 (16:12 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 21 Aug 2018 13:59:04 +0000 (14:59 +0100)
Its counterpart is HVM only. Add the check to help dead code
elimination to figure out the call to pt_irq_destroy_bind is not
needed when HVM is not enabled.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domctl.c

index 1002659de0531f2d9156e3d3f83942a22434d2c1..ab854899a50f625751b020ecb8d14ae10f1da276 100644 (file)
@@ -715,6 +715,10 @@ long arch_do_domctl(
         struct xen_domctl_bind_pt_irq *bind = &domctl->u.bind_pt_irq;
         int irq = domain_pirq_to_irq(d, bind->machine_irq);
 
+        ret = -EINVAL;
+        if ( !is_hvm_domain(d) )
+            break;
+
         ret = -EPERM;
         if ( irq <= 0 || !irq_access_permitted(currd, irq) )
             break;