[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen/x86: Introduce early_invalid_op() handler.



On 09/09/2013 07:30, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

>>>> On 09.09.13 at 16:17, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> 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

> Jan
> 
>> +    for ( ; ; )
>> +        halt();
>> +}
> 
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.