[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-4.1-testing] xen: introduce PHYSDEVOP_pirq_eoi_gmfn_v2



# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
# Date 1333124358 -3600
# Node ID b574b8b6bb108a7768825471a5f85f40c20b1cec
# Parent  54b4ae0dfb60c635001f56916de2de552b1c1072
xen: introduce PHYSDEVOP_pirq_eoi_gmfn_v2

PHYSDEVOP_pirq_eoi_gmfn changes the semantics of PHYSDEVOP_eoi.
In order to improve the interface this patch:

- renames PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1;

- introduces PHYSDEVOP_pirq_eoi_gmfn_v2, that is like
  PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't modify the behaviour of
  another hypercall;

- #define PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Committed-by: Keir Fraser <keir@xxxxxxx>
xen-unstable changeset:   24616:3bd3949854ef
xen-unstable date:        Sat Jan 28 13:45:13 2012 +0000
---


diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/ia64/xen/domain.c        Fri Mar 30 17:19:18 2012 +0100
@@ -1729,6 +1729,7 @@ int domain_relinquish_resources(struct d
                if (d->arch.pirq_eoi_map != NULL) {
                        put_page(virt_to_page(d->arch.pirq_eoi_map));
                        d->arch.pirq_eoi_map = NULL;
+                       d->arch.auto_unmask = 0;
                }
 
                /* Tear down shadow mode stuff. */
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c     Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/ia64/xen/hypercall.c     Fri Mar 30 17:19:18 2012 +0100
@@ -65,7 +65,7 @@ static long __do_pirq_guest_eoi(struct d
 {
        if ( pirq < 0 || pirq >= NR_IRQS )
                return -EINVAL;
-       if ( d->arch.pirq_eoi_map )
+       if ( d->arch.auto_unmask ) {
                evtchn_unmask(d->pirq_to_evtchn[pirq]);
        return pirq_guest_eoi(d, pirq);
 }
@@ -504,7 +504,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HA
         break;
     }
 
-    case PHYSDEVOP_pirq_eoi_gmfn: {
+    case PHYSDEVOP_pirq_eoi_gmfn_v1:
+    case PHYSDEVOP_pirq_eoi_gmfn_v2: {
         struct physdev_pirq_eoi_gmfn info;
         unsigned long mfn;
 
@@ -527,6 +528,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HA
         }
 
         current->domain->arch.pirq_eoi_map = mfn_to_virt(mfn);
+        if ( cmd == PHYSDEVOP_pirq_eoi_gmfn_v1 )
+            current->domain->arch.auto_unmask = 1;
         ret = 0;
         break;
     }
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/x86/domain.c     Fri Mar 30 17:19:18 2012 +0100
@@ -1981,6 +1981,7 @@ int domain_relinquish_resources(struct d
             unmap_domain_page_global(d->arch.pirq_eoi_map);
             put_page_and_type(mfn_to_page(d->arch.pirq_eoi_map_mfn));
             d->arch.pirq_eoi_map = NULL;
+            d->arch.auto_unmask = 0;
         }
 
         d->arch.relmem = RELMEM_xen;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c    Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/x86/physdev.c    Fri Mar 30 17:19:18 2012 +0100
@@ -271,7 +271,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         ret = -EINVAL;
         if ( eoi.irq >= v->domain->nr_pirqs )
             break;
-        if ( v->domain->arch.pirq_eoi_map )
+        if ( v->domain->arch.auto_unmask )
             evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]);
         if ( !is_hvm_domain(v->domain) ||
              domain_pirq_to_irq(v->domain, eoi.irq) > 0 )
@@ -295,7 +295,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
-    case PHYSDEVOP_pirq_eoi_gmfn: {
+    case PHYSDEVOP_pirq_eoi_gmfn_v2:
+    case PHYSDEVOP_pirq_eoi_gmfn_v1: {
         struct physdev_pirq_eoi_gmfn info;
         unsigned long mfn;
 
@@ -325,6 +326,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             ret = -ENOSPC;
             break;
         }
+        if ( cmd == PHYSDEVOP_pirq_eoi_gmfn_v1 )
+            v->domain->arch.auto_unmask = 1;
 
         ret = 0;
         break;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h     Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/include/asm-ia64/domain.h     Fri Mar 30 17:19:18 2012 +0100
@@ -182,6 +182,9 @@ struct arch_domain {
     /* Shared page for notifying that explicit PIRQ EOI is required. */
     unsigned long *pirq_eoi_map;
     unsigned long pirq_eoi_map_mfn;
+    /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically
+     * unmask the event channel */
+    bool_t auto_unmask;
 
     /* Address of efi_runtime_services_t (placed in domain memory)  */
     void *efi_runtime;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h      Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/include/asm-x86/domain.h      Fri Mar 30 17:19:18 2012 +0100
@@ -268,6 +268,9 @@ struct arch_domain
     /* Shared page for notifying that explicit PIRQ EOI is required. */
     unsigned long *pirq_eoi_map;
     unsigned long pirq_eoi_map_mfn;
+    /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically
+     * unmask the event channel */
+    bool_t auto_unmask;
 
     /* Pseudophysical e820 map (XENMEM_memory_map).  */
     spinlock_t e820_lock;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/include/public/physdev.h
--- a/xen/include/public/physdev.h      Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/include/public/physdev.h      Fri Mar 30 17:19:18 2012 +0100
@@ -49,7 +49,15 @@ DEFINE_XEN_GUEST_HANDLE(physdev_eoi_t);
  * will automatically get unmasked. The page registered is used as a bit
  * array indexed by Xen's PIRQ value.
  */
-#define PHYSDEVOP_pirq_eoi_gmfn         17
+#define PHYSDEVOP_pirq_eoi_gmfn_v1       17
+/*
+ * Register a shared page for the hypervisor to indicate whether the
+ * guest must issue PHYSDEVOP_eoi. This hypercall is very similar to
+ * PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't change the semantics of
+ * PHYSDEVOP_eoi. The page registered is used as a bit array indexed by
+ * Xen's PIRQ value.
+ */
+#define PHYSDEVOP_pirq_eoi_gmfn_v2       28
 struct physdev_pirq_eoi_gmfn {
     /* IN */
     xen_pfn_t gmfn;
@@ -276,6 +284,8 @@ DEFINE_XEN_GUEST_HANDLE(physdev_get_free
 #define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
 #define PHYSDEVOP_IRQ_SHARED             XENIRQSTAT_shared
 
+#define PHYSDEVOP_pirq_eoi_gmfn PHYSDEVOP_pirq_eoi_gmfn_v1
+
 #endif /* __XEN_PUBLIC_PHYSDEV_H__ */
 
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.