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] Re: [Patch][RFC] fix xc_ptrace_core for gdbserver-xen on?x86

To: Horms <horms@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: [Patch][RFC] fix xc_ptrace_core for gdbserver-xen on?x86_64.
From: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Date: Fri, 25 Aug 2006 18:03:36 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Delivery-date: Fri, 25 Aug 2006 02:04:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060825080039.17DF134047@xxxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060825080039.17DF134047@xxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, Horms

>
>It seems generaly consistent with the i386 code, and looks generaly
>fine, though I am not an expert on x86_64 either.
>
>There seem to be three distinct portions of your patch.
>
>1. Make nr_pages an unsigned long instead of a long
>
>   This seems like it should be a separate patch as its really
>   a trivial (but probably important) bugfix. Right?
>
Yes, This is trivial bugfix.

>2. Fill in map_domain_va_core() for x86_64
>
>3. Get rid of m2p_array.
>
>   I'm not sure what the relationship between 2 and 3 is.
>   Is m2p_array no longer needed because of the changes in 2?
>   Or is it a separate cleanup?
Yes, separate cleanup.

m2p_array for x86_64 is very big.
So I fix the code with the following way.

@@ -20,11 +19,18 @@ static unsigned long
 static unsigned long
 map_mtop_offset(unsigned long ma)
 {
-    return pages_offset + (m2p_array[ma >> PAGE_SHIFT] << PAGE_SHIFT);
-    return 0;
-}
-
-
+
+    unsigned long page_num;
+    for(page_num=0; page_num <nr_pages; page_num++){
+        if((ma >> PAGE_SHIFT) == p2m_array[page_num])
+               break;
+    }
+
+    return pages_offset + (page_num << PAGE_SHIFT);
+}
+
+

The way get page number of ma by searching the p2m_array without 
m2p_array.

Best Regards,

Akio Takebe


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

<Prev in Thread] Current Thread [Next in Thread>