From: Horms Subject: Re: [PATCH] gdbserver-xen: fix corefile access Date: Thu, 2 Mar 2006 21:19:24 +0900 Message-ID: <20060302121921.GC4184@verge.net.au> References: <67b15d3e07c51779c332ec14ca9067fb@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <67b15d3e07c51779c332ec14ca9067fb@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Thu, Mar 02, 2006 at 10:45:02AM +0000, Keir Fraser wrote: > > On 2 Mar 2006, at 08:28, Horms wrote: > > >This patch fixes corefile access by ensuring that the open fd > >to the corefile (current_domid) is passed to the underlying > >xc_routines as neccessary. Currently the prevailing pid is passed, > >which works fine when attaching to a running domain, but fails > >for the corefile case. > > This is too gross. Sorry about that. > The correct fix is to update the xc_ptrace_core() interface to match > the xc_ptrace() interface. Kip Macy made the latter SMP aware, but > didn't fix up the former. > > It should be easy to do -- note how xc_ptrace() takes a domid on > PTRACE_ATTACH, and vcpuid at all other times. xc_ptrace_core() should > take a fd on PTRACE_ATTACH, and vcpuid at all other times. Since we > don't dump SMP core files right now, vcpuid should either be ignored > for the time being, or fail the call if vcpuid!=0. I didn't notice that, but I should have. Are you suggesting that xc_ptrace_core() should record the fd passed to it on PTRACE_ATTACH and use that later, presumably in current_domid? If so, yes that does look very easy. If not, can you explain a little further? In any case, I'll look into it tomorrow. -- Horms