From: "Jan Beulich" Subject: Re: [PATCH] x86: don't deliver NMI to PVH Dom0 Date: Thu, 11 Dec 2014 13:20:29 +0000 Message-ID: <5489A82D020000780004EF86@mail.emea.novell.com> References: <54898449020000780004EDDD@mail.emea.novell.com> <20141211130026.GA53825@deinos.phlegethon.org> <5489A584020000780004EF49@mail.emea.novell.com> <20141211131617.GE53811@deinos.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xz3fS-0006eb-M8 for xen-devel@lists.xenproject.org; Thu, 11 Dec 2014 13:20:30 +0000 In-Reply-To: <20141211131617.GE53811@deinos.phlegethon.org> 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: Tim Deegan Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 11.12.14 at 14:16, wrote: > At 13:09 +0000 on 11 Dec (1418299748), Jan Beulich wrote: >> >>> On 11.12.14 at 14:00, wrote: >> > At 10:47 +0000 on 11 Dec (1418291241), Jan Beulich wrote: >> >> ... for the time being: The mechanism used depends on the domain's use >> >> of the IRET hypercall. >> > >> > Can you elaborate? Looking at the existing code it seems like what it >> > does is set v->nmi_pending and make sure the vcpu gets scheduled >> > appropriately. >> > >> > The HVM code will deliver an NMI if it sees v->nmi_pending (which is >> > what vlapic_accept_irq does, for example). Is there some other piece >> > I'm missing? >> >> Just so that others see the answer too: The problem is that the >> temporary affinity adjustment gets undone in the HYPERVISOR_iret >> handler, yet PVH can't call that hypercall. > > Thanks. So to make this work for PVH we'd want to do something like > calling async_exception_cleanup() from vlapic_EOI_set()? No, that's the wrong place - there's no EOI involved in ACK-ing an NMI. Instead there ought to be (optional?) VM exits upon clearing of the NMI masked state, and their handling code should presumably call that function. Jan