Skip to contentSkip to conversation

pvh: disallow pirq eio physdevop

PATCH New Mukesh Rathor 1 participant 3 messages Mar 21, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 pvh: disallow pirq eio physdevop

Hi,

I am confused what the conclusion was on this from the previous version submitted under "pvh: misc bug fixes", so I'm submitting both versions discussed in that thread. Please apply one.

thanks
mukesh

#1 lore raw

PATCH v2 1/1 pvh: disallow PHYSDEVOP_pirq_eoi_gmfn_v2/v1

A call to do_physdev_op with PHYSDEVOP_pirq_eoi_gmfn_v2/v1 will corrupt struct hvm_domain when it writes to domain->arch.pv_domain.pirq_eoi_map. Disallow that. Currently, such a path exists for linux dom0 pvh.

---
 xen/arch/x86/hvm/hvm.c | 6 ++++++
 1 file changed, 6 insertions(+)
xen/arch/x86/hvm/hvm.c +6 -0
index 9dd56f7..08ab9cb 100644
@@ -3427,6 +3427,12 @@ static long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_irq_status_query:
     case PHYSDEVOP_get_free_pirq:
         return do_physdev_op(cmd, arg);
+
+    /* pvh fixme: coming soon */
+    case PHYSDEVOP_pirq_eoi_gmfn_v1:
+    case PHYSDEVOP_pirq_eoi_gmfn_v2:
+        return -ENOSYS;
+
     }
 }
 
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH v2 1/1 pvh: disallow PHYSDEVOP_pirq_eoi_gmfn_v2/v1

In reply to Mukesh Rathor

A call to do_physdev_op with PHYSDEVOP_pirq_eoi_gmfn_v2/v1 will corrupt struct hvm_domain when it writes to domain->arch.pv_domain.pirq_eoi_map. Disallow that. Currently, such a path exists for linux dom0 pvh.

---
 xen/arch/x86/physdev.c | 5 +++++
 1 file changed, 5 insertions(+)
xen/arch/x86/physdev.c +5 -0
index bc0634c..30af0ab 100644
@@ -343,6 +343,11 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( copy_from_guest(&info, arg, 1) != 0 )
             break;
 
+        /* pvh fixme: add pirq eoi support */
+        ret = -ENOSYS;
+        if ( is_pvh_vcpu(current) )
+            break;
+
         ret = -EINVAL;
         page = get_page_from_gfn(current->domain, info.gmfn, NULL, P2M_ALLOC);
         if ( !page )
Signature · 1 line
1.8.3.1