From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Juergen Gross <jgross@suse.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
<linux-kernel@vger.kernel.org>, <xen-devel@lists.xenproject.org>,
<x86@kernel.org>
Cc: <tglx@linutronix.de>, <mingo@redhat.com>, <luto@amacapital.net>,
<hpa@zytor.com>
Subject: Re: [Xen-devel] [PATCH v3] xen: get rid of paravirt op adjust_exception_frame
Date: Tue, 8 Aug 2017 11:01:47 +0100 [thread overview]
Message-ID: <522caac2-fbf2-09f6-e21f-df26b7261c3d@citrix.com> (raw)
In-Reply-To: <b1003e16-ae62-e5b1-f619-e6501a3f935a@suse.com>
On 08/08/17 08:02, Juergen Gross wrote:
> On 07/08/17 22:56, Boris Ostrovsky wrote:
>>> diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
>>> index 811e4ddb3f37..a3dcd83187ce 100644
>>> --- a/arch/x86/xen/enlighten_pv.c
>>> +++ b/arch/x86/xen/enlighten_pv.c
>>> @@ -579,6 +579,71 @@ static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum,
>>> preempt_enable();
>>> }
>>>
>>> +#ifdef CONFIG_X86_64
>>> +static struct {
>>> + void (*orig)(void);
>>> + void (*xen)(void);
>>> + bool ist_okay;
>>> + bool handle;
>>> +} trap_array[] = {
>>> + { debug, xen_xendebug, true, true },
>>> + { int3, xen_xenint3, true, true },
>>> + { double_fault, xen_double_fault, true, false },
>> Is it really worth adding 'handle' member to the structure because of a
>> single special case? We don't expect to ever have another such vector.
> Hmm, maybe you are right. We don't expect to ever see a double_fault in
> a pv domain, so we could just drop that special case by handling it like
> the other IST traps.
(This is steeped in a lot of history.) There is no path where Xen will
raise #DF with a PV guest.
As Linux sets the DPL of the #DF handler to 0, the `int $8` emulation
will inject #GP (even for kernel uses!) rather than follow the #DF path.
I do however want to see about making Xen's behaviour rather more
architectural, e.g. raising #NP rather than crashing the guest. If we
do get to a position of properly using contributory exceptions, #DF will
behave as #MC and #NMI currently do, by either switching from userspace
to the kernel stack, or pushed normally onto the current stack.
In some copious free time, it might also be good to invent a PV ABI to
behave like IST (even if only for the failsafe callback) so Linux can
actually recover sufficiently from a stack overflow to print some
diagnostics.
~Andrew
prev parent reply other threads:[~2017-08-08 10:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 15:45 Juergen Gross
2017-08-07 20:56 ` Boris Ostrovsky
2017-08-08 2:51 ` Andy Lutomirski
2017-08-08 7:02 ` Juergen Gross
2017-08-08 10:01 ` 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=522caac2-fbf2-09f6-e21f-df26b7261c3d@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--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
all inboxes | Powered by JetHome®