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-changelog

[Xen-changelog] [xen-unstable] [IA64] Remove GPFN_INV_MASK

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] Remove GPFN_INV_MASK
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 08 Apr 2008 02:00:31 -0700
Delivery-date: Tue, 08 Apr 2008 02:00:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1204920587 25200
# Node ID 6225df3ff209b3a985e3be8b737d49d948c53691
# Parent  d5bcf03596ccdc56828ffd3de1d86ff62d774ade
[IA64] Remove GPFN_INV_MASK

This slightly simplify code and frees a pte bit.

Signed-off-by: Tristan Gingold <tgingold@xxxxxxx>
---
 xen/arch/ia64/vmx/sioemu.c                   |    3 +--
 xen/arch/ia64/xen/mm.c                       |    8 +++-----
 xen/include/asm-ia64/linux-xen/asm/pgtable.h |    4 +---
 xen/include/asm-ia64/mm.h                    |    8 +++-----
 4 files changed, 8 insertions(+), 15 deletions(-)

diff -r d5bcf03596cc -r 6225df3ff209 xen/arch/ia64/vmx/sioemu.c
--- a/xen/arch/ia64/vmx/sioemu.c        Fri Mar 07 12:44:26 2008 -0700
+++ b/xen/arch/ia64/vmx/sioemu.c        Fri Mar 07 13:09:47 2008 -0700
@@ -166,8 +166,7 @@ sioemu_add_io_physmap (struct domain *d,
 
     /* Check area is currently unassigned.  */
     for (i = start; i < start + size; i += PAGE_SIZE) {
-        unsigned long mpa = ____lookup_domain_mpa(d, i);
-        if (mpa != GPFN_INV_MASK && mpa != INVALID_MFN)
+        if (____lookup_domain_mpa(d, i) != INVALID_MFN)
             return -EBUSY;
     }
 
diff -r d5bcf03596cc -r 6225df3ff209 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Fri Mar 07 12:44:26 2008 -0700
+++ b/xen/arch/ia64/xen/mm.c    Fri Mar 07 13:09:47 2008 -0700
@@ -726,8 +726,6 @@ ____lookup_domain_mpa(struct domain *d, 
 
     if (pte_present(*pte))
         return (pte->pte & _PFN_MASK);
-    else if (VMX_DOMAIN(d->vcpu[0]))
-        return GPFN_INV_MASK;
     return INVALID_MFN;
 }
 
@@ -742,8 +740,8 @@ unsigned long lookup_domain_mpa(struct d
             if (entry != NULL)
                 p2m_entry_set(entry, pte, tmp_pte);
             return pte_val(tmp_pte);
-        } else if (VMX_DOMAIN(d->vcpu[0]))
-            return GPFN_INV_MASK;
+        } else if (is_hvm_domain(d))
+            return INVALID_MFN;
     }
 
     if (mpaddr < d->arch.convmem_end && !d->is_dying) {
@@ -2797,7 +2795,7 @@ arch_memory_op(int op, XEN_GUEST_HANDLE(
         }
 
         /* This hypercall is used for VT-i domain only */
-        if (!VMX_DOMAIN(d->vcpu[0])) {
+        if (!is_hvm_domain(d)) {
             rcu_unlock_domain(d);
             return -ENOSYS;
         }
diff -r d5bcf03596cc -r 6225df3ff209 
xen/include/asm-ia64/linux-xen/asm/pgtable.h
--- a/xen/include/asm-ia64/linux-xen/asm/pgtable.h      Fri Mar 07 12:44:26 
2008 -0700
+++ b/xen/include/asm-ia64/linux-xen/asm/pgtable.h      Fri Mar 07 13:09:47 
2008 -0700
@@ -108,7 +108,6 @@
 #define GPFN_HIGH_MMIO         (7UL << 60)     /* High MMIO range */
 
 #define GPFN_IO_MASK           (7UL << 60)     /* Guest pfn is I/O type */
-#define GPFN_INV_MASK          (1UL << 63)     /* Guest pfn is invalid */
 
 #else
 #define _PAGE_PROTNONE         (__IA64_UL(1) << 63)
@@ -342,8 +341,7 @@ set_pte_rel(volatile pte_t* ptep, pte_t 
 #define pte_file(pte)          ((pte_val(pte) & _PAGE_FILE) != 0)
 #ifdef XEN
 #define pte_pgc_allocated(pte) ((pte_val(pte) & _PAGE_PGC_ALLOCATED) != 0)
-#define pte_mem(pte) \
-       (!(pte_val(pte) & (GPFN_IO_MASK | GPFN_INV_MASK)) && !pte_none(pte))
+#define pte_mem(pte)   (!(pte_val(pte) & GPFN_IO_MASK) && !pte_none(pte))
 #endif
 /*
  * Note: we convert AR_RWX to AR_RX and AR_RW to AR_R by clearing the 2nd bit 
in the
diff -r d5bcf03596cc -r 6225df3ff209 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h Fri Mar 07 12:44:26 2008 -0700
+++ b/xen/include/asm-ia64/mm.h Fri Mar 07 13:09:47 2008 -0700
@@ -479,7 +479,7 @@ extern u64 translate_domain_pte(u64 ptev
     gmfn_to_mfn_foreign((_d), (gpfn))
 
 #define __gpfn_invalid(_d, gpfn)                       \
-       (lookup_domain_mpa((_d), ((gpfn)<<PAGE_SHIFT), NULL) & GPFN_INV_MASK)
+       (lookup_domain_mpa((_d), ((gpfn)<<PAGE_SHIFT), NULL) == INVALID_MFN)
 
 #define __gmfn_valid(_d, gpfn) !__gpfn_invalid(_d, gpfn)
 
@@ -488,8 +488,7 @@ extern u64 translate_domain_pte(u64 ptev
 ({                                          \
     u64 pte, ret=0;                                \
     pte = lookup_domain_mpa((_d), ((gpfn)<<PAGE_SHIFT), NULL); \
-    if(!(pte&GPFN_INV_MASK))        \
-        ret = pte & GPFN_IO_MASK;        \
+    ret = (pte != INVALID_MFN) ? pte & GPFN_IO_MASK : 0;        \
     ret;                \
 })
 
@@ -497,8 +496,7 @@ extern u64 translate_domain_pte(u64 ptev
 ({                                          \
     u64 pte, ret=0;                                \
     pte = lookup_domain_mpa((_d), ((gpfn)<<PAGE_SHIFT), NULL);            \
-    if((!(pte&GPFN_INV_MASK))&&((pte & GPFN_IO_MASK)==GPFN_MEM))   \
-        ret = 1;             \
+    ret = (pte != INVALID_MFN) && (pte & GPFN_IO_MASK) == GPFN_MEM;        \
     ret;                \
 })
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] Remove GPFN_INV_MASK, Xen patchbot-unstable <=