From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] xen/x86: Introduce early_invalid_op() handler. Date: Mon, 9 Sep 2013 15:43:37 +0100 Message-ID: <522DDE99.8040503@citrix.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VJ2gn-0007FQ-Cg for xen-devel@lists.xenproject.org; Mon, 09 Sep 2013 14:43:41 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Keir Fraser Cc: xen-devel , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 09/09/13 15:37, Keir Fraser wrote: > On 09/09/2013 07:30, "Jan Beulich" wrote: > >>>>> On 09.09.13 at 16:17, Andrew Cooper wrote: >>> +void __init __attribute__((noreturn)) >>> +do_early_invalid_op(struct cpu_user_regs *regs) >>> +{ >>> + if ( *(u16 *)regs->eip == 0x0b0f ) >> Without even a range check on regs->eip? I don't think we want to >> needlessly risk #PF or #GP here... >> >>> + printk("Early ud2 at %p - BUG/WARN/ASSERT perhaps?\n", >>> _p(regs->eip)); >>> + else >>> + printk("Unidentified early #UD at %p\n", _p(regs->eip)); >>> + >> You probably also meant to at least print the same raw stack >> dump that do_early_page_fault() produces? > I suggest less cleverness in this printk and indeed dump regs and error > code. More useful, potentially. Also then the handler will not be > UD-specific and could be called for all early exceptions (except those with > a more specific handler such as #PG). > > All that would be needed in asm is a per-exception push/mov and jmp to > common asm which does the SAVE_ALL stuff and jmp to C. > > -- Keir Ok - I will see about implementing this. ~Andrew > >> Jan >> >>> + for ( ; ; ) >>> + halt(); >>> +} >> > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel