From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Keir Fraser <keir.xen@gmail.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH] xen/x86: Introduce early_invalid_op() handler.
Date: Mon, 9 Sep 2013 15:43:37 +0100 [thread overview]
Message-ID: <522DDE99.8040503@citrix.com> (raw)
In-Reply-To: <CE532B1F.5D232%keir.xen@gmail.com>
On 09/09/13 15:37, Keir Fraser wrote:
> On 09/09/2013 07:30, "Jan Beulich" <JBeulich@suse.com> wrote:
>
>>>>> On 09.09.13 at 16:17, Andrew Cooper <andrew.cooper3@citrix.com> 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
prev parent reply other threads:[~2013-09-09 14:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-09 14:17 [PATCH] xen/x86: Introduce early_invalid_op() handler Andrew Cooper
2013-09-09 14:30 ` Jan Beulich
2013-09-09 14:37 ` Keir Fraser
2013-09-09 14:43 ` Andrew Cooper [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=522DDE99.8040503@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir.xen@gmail.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).