From: "Jan Beulich" Subject: Re: [PATCH] x86/nmi: Fix shootdown of pcpus running in VMX non-root mode Date: Mon, 09 Feb 2015 13:26:08 +0000 Message-ID: <54D8C380020000780005E397@mail.emea.novell.com> References: <1423481108-31722-1-git-send-email-andrew.cooper3@citrix.com> <20150209114311.GA9644@deinos.phlegethon.org> <54D89F73.7020700@citrix.com> <54D8BCA0020000780005E324@mail.emea.novell.com> <54D8B294.9010401@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54D8B294.9010401@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Tim Deegan Cc: Xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 09.02.15 at 14:13, wrote: > On 09/02/15 12:56, Jan Beulich wrote: >> So wouldn't it be possible to get rid of nmi_crash() and have >> nmi() call *nmi_handler instead of don_nmi (and nmi_handler >> would really just become an alias of exception_table[2]? > > nmi_crash() deliberately doesn't follow the handle_ist_exception path to > avoid possibly switching stack and possibly returning back to a guest. Is the stack switching really dangerous here? And if it is, wouldn't checking a suitable flag to skip it still be better than the mess of NMI entry points? > It has an emergency ud2 on the end to cover errors in do_nmi_crash(). That could as well be a BUG() at the end of do_nmi_crash() itself. > Reusing exception_table[2] might be preferable to adding a new variable, > but it would involve moving exception_table[] from rodata to data, which > is rather less preferable overall. Considering the purpose you need the modification for, stealing an unused (at that time) fixmap entry and creating a writeable alias mapping would seem a reasonable alternative to me. Jan