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] libxc: improve foreign p2m exposur

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] libxc: improve foreign p2m exposure.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Oct 2008 20:00:38 -0700
Delivery-date: Fri, 10 Oct 2008 20:01:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1222936077 -32400
# Node ID c383ae0b803ddc970e35147301aeb92bf7863232
# Parent  e82909f42732b9f79dd417ad8164f547a5611501
[IA64] libxc: improve foreign p2m exposure.

make foreign p2m exposure _PAGE_IO_BIT aware for robustness.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 tools/libxc/ia64/xc_ia64_stubs.c |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff -r e82909f42732 -r c383ae0b803d tools/libxc/ia64/xc_ia64_stubs.c
--- a/tools/libxc/ia64/xc_ia64_stubs.c  Thu Oct 02 15:32:54 2008 +0900
+++ b/tools/libxc/ia64/xc_ia64_stubs.c  Thu Oct 02 17:27:57 2008 +0900
@@ -153,6 +153,8 @@ xc_ia64_p2m_unmap(struct xen_ia64_p2m_ta
 #define _PAGE_P                 (1UL << _PAGE_P_BIT)      /* page present bit 
*/
 #define _PAGE_PGC_ALLOCATED_BIT 59      /* _PGC_allocated */
 #define _PAGE_PGC_ALLOCATED     (1UL << _PAGE_PGC_ALLOCATED_BIT)
+#define _PAGE_IO_BIT            60
+#define _PAGE_IO                (1UL << _PAGE_IO_BIT)
 
 #define IA64_MAX_PHYS_BITS      50      /* max. number of physical address 
bits (architected) */
 #define _PAGE_PPN_MASK  (((1UL << IA64_MAX_PHYS_BITS) - 1) & ~0xfffUL)
@@ -160,17 +162,20 @@ int
 int
 xc_ia64_p2m_present(struct xen_ia64_p2m_table *p2m_table, unsigned long gpfn)
 {
-    if (sizeof(p2m_table->p2m[0]) * gpfn < p2m_table->size)
-        return !!(p2m_table->p2m[gpfn] & _PAGE_P);
-    return 0;
-}
-
-int
-xc_ia64_p2m_allocated(struct xen_ia64_p2m_table *p2m_table, unsigned long gpfn)
-{
     if (sizeof(p2m_table->p2m[0]) * gpfn < p2m_table->size) {
         unsigned long pte = p2m_table->p2m[gpfn];
-        return !!((pte & _PAGE_P) && (pte & _PAGE_PGC_ALLOCATED));
+        return !!((pte & _PAGE_P) && !(pte & _PAGE_IO));
+    }
+    return 0;
+}
+
+int
+xc_ia64_p2m_allocated(struct xen_ia64_p2m_table *p2m_table, unsigned long gpfn)
+{
+    if (sizeof(p2m_table->p2m[0]) * gpfn < p2m_table->size) {
+        unsigned long pte = p2m_table->p2m[gpfn];
+        return !!((pte & _PAGE_P) && (pte & _PAGE_PGC_ALLOCATED) &&
+                  !(pte & _PAGE_IO));
     }
     return 0;
 }
@@ -183,6 +188,8 @@ xc_ia64_p2m_mfn(struct xen_ia64_p2m_tabl
     if (sizeof(p2m_table->p2m[0]) * gpfn >= p2m_table->size)
         return INVALID_MFN;
     pte = p2m_table->p2m[gpfn];
+    if (pte & _PAGE_IO)
+        return INVALID_MFN;
     if (!(pte & _PAGE_P))
         return INVALID_MFN;
     return (pte & _PAGE_PPN_MASK) >> PAGE_SHIFT;

_______________________________________________
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] libxc: improve foreign p2m exposure., Xen patchbot-unstable <=