From: Akio Takebe Subject: Re: [Patch][RFC] fix xc_ptrace_core for gdbserver-xen on?x86_64. Date: Fri, 25 Aug 2006 18:03:36 +0900 Message-ID: <58C6C825592784takebe_akio@jp.fujitsu.com> References: <20060825080039.17DF134047@koto.vergenet.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20060825080039.17DF134047@koto.vergenet.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Horms Cc: xen-devel@lists.xensource.com, Akio Takebe List-Id: xen-devel@lists.xenproject.org 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 > 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