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-ia64-devel

[Xen-ia64-devel] [RFC][PATCH 2/3] xen&domain gdb debugger

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [RFC][PATCH 2/3] xen&domain gdb debugger
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Mon, 21 Jan 2008 21:21:04 +0900
Delivery-date: Mon, 21 Jan 2008 04:21:25 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
allow dom0 to map xen's memory.

# HG changeset patch
# User Kouya Shimura <kouya@xxxxxxxxxxxxxx>
# Date 1200914420 -32400
# Node ID dc1d6b4bae38325b3faafc534dcb4f50152b9b29
# Parent  ff90abf572f2d5aa7d4a7f764b3c343b66a06210
allow dom0 to map xen's memory.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r ff90abf572f2 -r dc1d6b4bae38 xen/arch/ia64/Rules.mk
--- a/xen/arch/ia64/Rules.mk    Fri Jan 18 14:11:20 2008 -0700
+++ b/xen/arch/ia64/Rules.mk    Mon Jan 21 20:20:20 2008 +0900
@@ -13,6 +13,7 @@ xen_ia64_tlb_track    ?= y
 xen_ia64_tlb_track     ?= y
 xen_ia64_tlb_track_cnt ?= n
 xen_ia64_tlbflush_clock        ?= y
+xen_ia64_debug_xen ?= y
 
 ifneq ($(COMPILE_ARCH),$(TARGET_ARCH))
 CROSS_COMPILE ?= /usr/local/sp_env/v2.2.5/i686/bin/ia64-unknown-linux-
@@ -59,6 +60,9 @@ ifeq ($(xen_ia64_tlbflush_clock),y)
 ifeq ($(xen_ia64_tlbflush_clock),y)
 CFLAGS += -DCONFIG_XEN_IA64_TLBFLUSH_CLOCK
 endif
+ifeq ($(xen_ia64_debug_xen),y)
+CFLAGS += -DCONFIG_XEN_IA64_DEBUG_XEN
+endif
 ifeq ($(no_warns),y)
 CFLAGS += -Wa,--fatal-warnings -Werror -Wno-uninitialized
 endif
diff -r ff90abf572f2 -r dc1d6b4bae38 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Fri Jan 18 14:11:20 2008 -0700
+++ b/xen/arch/ia64/xen/mm.c    Mon Jan 21 20:20:20 2008 +0900
@@ -1403,6 +1403,13 @@ zap_domain_page_one(struct domain *d, un
     if (pte_none(*pte))
         return;
 
+#ifdef CONFIG_XEN_IA64_DEBUG_XEN
+    if (d == dom0 && pte->pte & _PAGE_DEBUG_XEN) {
+        old_pte = ptep_get_and_clear(mm, mpaddr, pte);
+        return;
+    }
+#endif
+
     if (mfn == INVALID_MFN) {
         // clear pte
         old_pte = ptep_get_and_clear(mm, mpaddr, pte);
@@ -1512,6 +1519,35 @@ __dom0vp_add_physmap(struct domain* d, u
     //don't update p2m table because this page belongs to rd, not d.
     perfc_incr(dom0vp_add_physmap);
 out1:
+#ifdef CONFIG_XEN_IA64_DEBUG_XEN
+    if (unlikely(error != 0 && domid == DOMID_XEN)) {
+        unsigned long va = mfn << PAGE_SHIFT;
+
+        if ((va - KERNEL_START < KERNEL_TR_PAGE_SIZE) ||
+            (va - PERCPU_ADDR < PERCPU_PAGE_SIZE)) {
+            mfn = ia64_tpa(va) >> PAGE_SHIFT;
+        }
+#ifdef CONFIG_VIRTUAL_FRAME_TABLE
+        else if (va >= VIRT_FRAME_TABLE_ADDR && va < VIRT_FRAME_TABLE_END) {
+            extern long ia64_frametable_probe(unsigned long);
+            if (!ia64_frametable_probe(va))
+                return -EINVAL;
+            mfn = ia64_tpa(va) >> PAGE_SHIFT;
+        }
+#endif
+        else if (va - HYPERVISOR_VIRT_START < (1UL << IA64_MAX_PHYS_BITS)) {
+            if (!virt_addr_valid(va))
+                return -EINVAL;
+            mfn = virt_to_mfn(va);
+        }
+        else
+            return -EINVAL;
+
+        mfn |= (_PAGE_DEBUG_XEN >> PAGE_SHIFT);
+        assign_domain_page_replace(d, gpfn << PAGE_SHIFT, mfn, flags);
+        error = 0;
+    }
+#endif
     rcu_unlock_domain(rd);
     return error;
 }
diff -r ff90abf572f2 -r dc1d6b4bae38 
xen/include/asm-ia64/linux-xen/asm/pgtable.h
--- a/xen/include/asm-ia64/linux-xen/asm/pgtable.h      Fri Jan 18 14:11:20 
2008 -0700
+++ b/xen/include/asm-ia64/linux-xen/asm/pgtable.h      Mon Jan 21 20:20:20 
2008 +0900
@@ -97,6 +97,12 @@
 
 #define _PAGE_PGC_ALLOCATED_BIT        59      /* _PGC_allocated */
 #define _PAGE_PGC_ALLOCATED    (__IA64_UL(1) << _PAGE_PGC_ALLOCATED_BIT)
+
+#ifdef CONFIG_XEN_IA64_DEBUG_XEN
+#define _PAGE_DEBUG_XEN_BIT    60
+#define _PAGE_DEBUG_XEN                (__IA64_UL(1) << _PAGE_DEBUG_XEN_BIT)
+#endif
+
 /* domVTI */
 #define GPFN_MEM               (0UL << 60)     /* Guest pfn is normal mem */
 #define GPFN_FRAME_BUFFER      (1UL << 60)     /* VGA framebuffer */
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>