From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 4/4] x86: check for canonical address before doing page walks Date: Thu, 10 Oct 2013 15:17:40 +0100 Message-ID: <5256B704.1010206@citrix.com> References: <5256CC6F02000078000FA3D0@nat28.tlf.novell.com> <5256CDEE02000078000FA3EE@nat28.tlf.novell.com> <5256B352.1050307@citrix.com> <5256D16902000078000FA46C@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VUH3p-00050V-Ur for xen-devel@lists.xenproject.org; Thu, 10 Oct 2013 14:17:54 +0000 In-Reply-To: <5256D16902000078000FA46C@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: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 10/10/13 15:10, Jan Beulich wrote: >>>> On 10.10.13 at 16:01, Andrew Cooper wrote: >> On 10/10/13 14:55, Jan Beulich wrote: >>> --- a/xen/arch/x86/x86_64/traps.c >>> +++ b/xen/arch/x86/x86_64/traps.c >>> @@ -170,6 +170,8 @@ void show_page_walk(unsigned long addr) >>> l1_pgentry_t l1e, *l1t; >>> >>> printk("Pagetable walk from %016lx:\n", addr); >>> + if ( !is_canonical_address(addr) ) >>> + return; >>> >>> l4t = map_domain_page(mfn); >>> l4e = l4t[l4_table_offset(addr)]; >>> >> I was intending something a little more like >> >> if ( !is_canonical_address(addr) ) >> { >> printk(" Not canonical\n"); >> return; >> } >> >> So it doesn't appear on the console that show_page_walk() got stuck >> somewhere. > Seems pretty pointless - the address is being printed, and anyone > (I would hope) can easily see whether it is non-canonical. > > Jan > True I suppose, although it would start getting harder if/when the non-canonical section shrinks in size. I would prefer the printk(), but am not overly fussed and the other fix is certainly good, so Reviewed-by: Andrew Cooper