xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Malcolm Crossley <malcolm.crossley@citrix.com>,
	"Tim (Xen.org)" <tim@xen.org>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT handler
Date: Thu, 28 Feb 2013 14:45:37 +0000	[thread overview]
Message-ID: <512F6D91.2070309@citrix.com> (raw)
In-Reply-To: <512F7ADE02000078000C211A@nat28.tlf.novell.com>

On 28/02/13 14:42, Jan Beulich wrote:
>>>> On 28.02.13 at 15:25, Tim Deegan <tim@xen.org> wrote:
>> At 13:39 +0000 on 28 Feb (1362058773), Jan Beulich wrote:
>>> (realizing that dealing with the PV side of the issue will be left to
>>> me in the end)
>> For PV, would you be happy with something like this, or do you want to
>> avoid the extra IRET in cases where we would be returning with IRET
>> anyway?
> No, and not so much because of the redundant IRET, but
> because ...
>
>> --- a/xen/arch/x86/traps.c
>> +++ b/xen/arch/x86/traps.c
>> @@ -3211,7 +3211,7 @@ void do_nmi(struct cpu_user_regs *regs)
>>      ++nmi_count(cpu);
>>  
>>      if ( nmi_callback(regs, cpu) )
>> -        return;
>> +        goto out;
>>  
>>      if ( nmi_watchdog )
>>          nmi_watchdog_tick(regs);
>> @@ -3227,6 +3227,9 @@ void do_nmi(struct cpu_user_regs *regs)
>>          if ( !(reason & 0xc0) && !nmi_watchdog )
>>              unknown_nmi_error(regs, reason);
>>      }
>> +
>> +out:
>> +    enable_nmis();
> ... this must not be done when on the NMI stack (i.e. when the
> NMI was raised while in hypervisor context). Checking for this
> here would be strait forward, but I was really considering to do
> all of this in the assembly exit path, and I was still undecided
> whether we shouldn't follow Linux in skipping softirq processing
> (and hence scheduling) on the way out from an NMI (I don't
> think we'd need to do the same for MCE).
>
> Jan

It is furthermore pointless.  If we interrupted a guest with the NMI, we
would have moved onto the main stack.  We would only be on the NMI stack
at this point if we interrupted Xen with the NMI, at which point we will
be iret'ing back anyway.

~Andrew

>
>>  }
>>  
>>  void set_nmi_callback(nmi_callback_t callback)
>
>

  reply	other threads:[~2013-02-28 14:45 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22 15:00 [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT handler Andrew Cooper
2012-11-22 15:15 ` Jan Beulich
2012-11-22 15:16   ` Andrew Cooper
2012-11-22 15:21     ` Jan Beulich
2012-11-22 15:37       ` Andrew Cooper
2012-11-22 15:55         ` Jan Beulich
2012-11-22 16:05           ` Andrew Cooper
2012-11-22 16:12             ` Jan Beulich
2012-11-22 16:31               ` Andrew Cooper
2013-02-28  9:58             ` Jan Beulich
2013-02-28 12:32               ` Andrew Cooper
2013-02-28 13:00               ` Tim Deegan
2013-02-28 13:12                 ` Andrew Cooper
2013-02-28 13:39                 ` Jan Beulich
2013-02-28 14:25                   ` Tim Deegan
2013-02-28 14:42                     ` Jan Beulich
2013-02-28 14:45                       ` Andrew Cooper [this message]
2013-02-28 14:49                       ` Tim Deegan
2013-02-28 15:01                         ` Jan Beulich
2013-02-28 15:41                       ` Jan Beulich
2013-02-28 15:52                         ` Andrew Cooper
2013-02-28 15:55                         ` Tim Deegan
2013-02-28 16:12                           ` Jan Beulich
2013-02-28 16:01                         ` Keir Fraser
2013-02-28 16:17                           ` Jan Beulich
2013-02-28 19:02                             ` Keir Fraser
2013-03-01 10:49                               ` [PATCH v2 0/2] x86: defer processing events on the NMI exit path Jan Beulich
2013-03-01 10:56                                 ` [PATCH v2 1/2] " Jan Beulich
2013-03-01 11:37                                   ` Andrew Cooper
2013-03-01 11:53                                     ` Jan Beulich
2013-03-01 15:56                                       ` Keir Fraser
2013-03-01 16:01                                         ` Andrew Cooper
2013-03-01 16:08                                           ` Jan Beulich
2013-03-01 10:57                                 ` [PATCH v2 2/2] x86: don't rely on __softirq_pending to be the first field in irq_cpustat_t Jan Beulich
2013-03-01 15:55                                 ` [PATCH v2 0/2] x86: defer processing events on the NMI exit path Keir Fraser
2013-02-28 13:42                 ` [PATCH V3] vmx/nmi: Do not use self_nmi() in VMEXIT handler Jan Beulich
2013-02-28 14:04                   ` Tim Deegan
2013-02-28 14:51                 ` Konrad Rzeszutek Wilk
2012-11-22 15:22     ` Mats Petersson
2012-11-22 16:00       ` Jan Beulich
2012-11-22 17:34 ` Tim Deegan
2012-11-26 11:50   ` George Dunlap

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=512F6D91.2070309@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=malcolm.crossley@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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).