From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] xen/x86: Introduce early_invalid_op() handler.
Date: Mon, 09 Sep 2013 07:37:03 -0700 [thread overview]
Message-ID: <CE532B1F.5D232%keir.xen@gmail.com> (raw)
In-Reply-To: <522DF7B302000078000F1942@nat28.tlf.novell.com>
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
> Jan
>
>> + for ( ; ; )
>> + halt();
>> +}
>
>
next prev parent reply other threads:[~2013-09-09 14:37 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 [this message]
2013-09-09 14:43 ` Andrew Cooper
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=CE532B1F.5D232%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.