From: Ian Campbell Subject: Re: [PATCH v2 10/12] xenctx: change is_kernel_text() into is_kernel_addr(). Date: Fri, 8 Nov 2013 09:50:27 +0000 Message-ID: <1383904227.3189.53.camel@kazak.uk.xensource.com> References: <1383768500-4245-1-git-send-email-dslutz@terremark.com> <1383768500-4245-11-git-send-email-dslutz@terremark.com> <527B5EEC02000078001007BD@nat28.tlf.novell.com> <527C359A.5090301@terremark.com> <527CB1790200007800101139@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Veii0-0004vk-SF for xen-devel@lists.xenproject.org; Fri, 08 Nov 2013 09:50:33 +0000 In-Reply-To: <527CB1790200007800101139@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Stefano Stabellini , George Dunlap , Don Slutz , Ian Jackson , Don Slutz , xen-devel List-Id: xen-devel@lists.xenproject.org On Fri, 2013-11-08 at 08:40 +0000, Jan Beulich wrote: > >>> On 08.11.13 at 01:51, Don Slutz wrote: > > On 11/07/13 03:35, Jan Beulich wrote: > >>>>> On 06.11.13 at 21:08, Don Slutz wrote: > >>> + return KERNEL_TEXT_ADDR; > >>> if (addr >= kernel_sinittext && > >>> addr <= kernel_einittext) > >>> - return 1; > >>> - return 0; > >>> + return KERNEL_TEXT_ADDR; > >>> + if (addr >= kernel_text && > >>> + addr <= kernel_end) > >>> + return KERNEL_DATA_ADDR; > >> As you supposedly filtered out all text ranges before, did you really > >> mean to compare to kernel_text here (rather than kernel_start)? > > Yes, I did. I think it is better to use the value that is in the system map > > over the default. It has changed: > > > > dcs-xen-54:~/xen>grep " _text" /boot/System.map-* > > /boot/System.map-2.6.18-128.el5:ffffffff80000000 A _text > > /boot/System.map-3.6.11-5.fc17.x86_64:ffffffff81000000 T _text > > /boot/System.map-3.8.11-100.fc17.x86_64:ffffffff81000000 T _text > > > > But since it is a command line argument, if specified, should it be used > > instead? > > I guess so. Yes, since the user may not have a symbol table for the given kernel and it may not even be Linux. I'm sure a Windows kernel guru debugging a Windows guest would know the right number for that version of Windows. (IIRC the option was added by just such a guru...) > In any event - after having split out all text pieces > (hopefully), the check here should cover the whole kernel image, > no matter how the ordering between text and data is. > > Jan >