WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 1/2] xen: rename PHYSDEVOP_pirq_eoi_mfn to PHYSDEVOP_

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 1/2] xen: rename PHYSDEVOP_pirq_eoi_mfn to PHYSDEVOP_pirq_eoi_gmfn
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Wed, 3 Dec 2008 11:25:58 +0900
Cc:
Delivery-date: Tue, 02 Dec 2008 18:26:26 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
physdev: make PHYSDEVOP_pirq_eoi_mfn use of gmfn instead of mfn.

To pass a page from a guest to hypervisor, gmfn should be used
instead of mfn like grant table and other hypercalls. It's more consistent.
So make use of gmfn instead of mfn for PHYSDEVOP_pirq_eoi_mfn hypercall.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1817,7 +1817,7 @@ int domain_relinquish_resources(struct d
         if ( d->arch.pirq_eoi_map != NULL )
         {
             unmap_domain_page_global(d->arch.pirq_eoi_map);
-            put_page_and_type(mfn_to_page(d->arch.pirq_eoi_map_mfn));
+            put_page_and_type(mfn_to_page(d->arch.pirq_eoi_map_gmfn));
             d->arch.pirq_eoi_map = NULL;
         }
 
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -200,8 +200,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
-    case PHYSDEVOP_pirq_eoi_mfn: {
-        struct physdev_pirq_eoi_mfn info;
+    case PHYSDEVOP_pirq_eoi_gmfn: {
+        struct physdev_pirq_eoi_gmfn info;
 
         BUILD_BUG_ON(NR_IRQS > (PAGE_SIZE * 8));
 
@@ -210,23 +210,23 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             break;
 
         ret = -EINVAL;
-        if ( !mfn_valid(info.mfn) ||
-             !get_page_and_type(mfn_to_page(info.mfn), v->domain,
+        if ( !mfn_valid(info.gmfn) ||
+             !get_page_and_type(mfn_to_page(info.gmfn), v->domain,
                                 PGT_writable_page) )
             break;
 
-        if ( cmpxchg(&v->domain->arch.pirq_eoi_map_mfn, 0, info.mfn) != 0 )
+        if ( cmpxchg(&v->domain->arch.pirq_eoi_map_gmfn, 0, info.gmfn) != 0 )
         {
-            put_page_and_type(mfn_to_page(info.mfn));
+            put_page_and_type(mfn_to_page(info.gmfn));
             ret = -EBUSY;
             break;
         }
 
-        v->domain->arch.pirq_eoi_map = map_domain_page_global(info.mfn);
+        v->domain->arch.pirq_eoi_map = map_domain_page_global(info.gmfn);
         if ( v->domain->arch.pirq_eoi_map == NULL )
         {
-            v->domain->arch.pirq_eoi_map_mfn = 0;
-            put_page_and_type(mfn_to_page(info.mfn));
+            v->domain->arch.pirq_eoi_map_gmfn = 0;
+            put_page_and_type(mfn_to_page(info.gmfn));
             ret = -ENOSPC;
             break;
         }
diff --git a/xen/arch/x86/x86_64/physdev.c b/xen/arch/x86/x86_64/physdev.c
--- a/xen/arch/x86/x86_64/physdev.c
+++ b/xen/arch/x86/x86_64/physdev.c
@@ -18,8 +18,8 @@
 #define physdev_eoi                compat_physdev_eoi
 #define physdev_eoi_t              physdev_eoi_compat_t
 
-#define physdev_pirq_eoi_mfn       compat_physdev_pirq_eoi_mfn
-#define physdev_pirq_eoi_mfn_t     physdev_pirq_eoi_mfn_compat_t
+#define physdev_pirq_eoi_gmfn      compat_physdev_pirq_eoi_gmfn
+#define physdev_pirq_eoi_gmfn_t    physdev_pirq_eoi_gmfn_compat_t
 
 #define physdev_set_iobitmap       compat_physdev_set_iobitmap
 #define physdev_set_iobitmap_t     physdev_set_iobitmap_compat_t
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -240,7 +240,7 @@ struct arch_domain
 
     /* Shared page for notifying that explicit PIRQ EOI is required. */
     unsigned long *pirq_eoi_map;
-    unsigned long pirq_eoi_map_mfn;
+    unsigned long pirq_eoi_map_gmfn;
 
     /* Pseudophysical e820 map (XENMEM_memory_map).  */
     struct e820entry e820[3];
diff --git a/xen/include/public/physdev.h b/xen/include/public/physdev.h
--- a/xen/include/public/physdev.h
+++ b/xen/include/public/physdev.h
@@ -47,13 +47,13 @@ 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_mfn          17
-struct physdev_pirq_eoi_mfn {
+#define PHYSDEVOP_pirq_eoi_gmfn         17
+struct physdev_pirq_eoi_gmfn {
     /* IN */
-    xen_pfn_t mfn;
+    xen_pfn_t gmfn;
 };
-typedef struct physdev_pirq_eoi_mfn physdev_pirq_eoi_mfn_t;
-DEFINE_XEN_GUEST_HANDLE(physdev_pirq_eoi_mfn_t);
+typedef struct physdev_pirq_eoi_gmfn physdev_pirq_eoi_gmfn_t;
+DEFINE_XEN_GUEST_HANDLE(physdev_pirq_eoi_gmfn_t);
 
 /*
  * Query the status of an IRQ line.


-- 
yamahata

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 1/2] xen: rename PHYSDEVOP_pirq_eoi_mfn to PHYSDEVOP_pirq_eoi_gmfn, Isaku Yamahata <=