Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751365AbdGZOBy (ORCPT ); Wed, 26 Jul 2017 10:01:54 -0400 Received: from smtp.eu.citrix.com ([185.25.65.24]:45516 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750826AbdGZOBx (ORCPT ); Wed, 26 Jul 2017 10:01:53 -0400 X-IronPort-AV: E=Sophos;i="5.40,415,1496102400"; d="scan'208";a="49976106" Subject: Re: [Xen-devel] [PATCH v1] xen: get rid of paravirt op adjust_exception_frame To: Andy Lutomirski , Juergen Gross References: <20170724142853.26448-1-jgross@suse.com> CC: X86 ML , "linux-kernel@vger.kernel.org" , Ingo Molnar , "H. Peter Anvin" , "xen-devel@lists.xenproject.org" , Boris Ostrovsky , Thomas Gleixner From: Andrew Cooper Message-ID: <45d0e5c7-a946-d7be-20e5-6965cb9f6629@citrix.com> Date: Wed, 26 Jul 2017 15:01:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 939 Lines: 24 On 26/07/17 14:48, Andy Lutomirski wrote: > >> /* Runs on exception stack */ >> -ENTRY(nmi) >> - /* >> - * Fix up the exception frame if we're on Xen. >> - * PARAVIRT_ADJUST_EXCEPTION_FRAME is guaranteed to push at most >> - * one value to the stack on native, so it may clobber the rdx >> - * scratch slot, but it won't clobber any of the important >> - * slots past it. >> - * >> - * Xen is a different story, because the Xen frame itself overlaps >> - * the "NMI executing" variable. >> - */ > I would keep this comment. The Xen frame really is in the way AFAICT. (For reasons best explained by the original authors) there is only ever a single stack which a PV guest registers with Xen, which functions equivalently to tss.sp0. There is no support for stack switching via task switch or IST. Therefore, nested NMIs won't clobber the top of this stack. ~Andrew