From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v4 00/75] x86: SEV-ES Guest Support Date: Wed, 15 Jul 2020 11:24:56 +0200 Message-ID: <20200715092456.GE10769@hirez.programming.kicks-ass.net> References: <20200714120917.11253-1-joro@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200714120917.11253-1-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org To: Joerg Roedel Cc: x86@kernel.org, Joerg Roedel , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Sean Christopherson , Martin Radev , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org List-Id: virtualization@lists.linuxfoundation.org On Tue, Jul 14, 2020 at 02:08:02PM +0200, Joerg Roedel wrote: > The #VC entry code now tries to pretend that the #VC handler does not > use an IST stack by switching to the task stack if entered from > user-mode or the SYSCALL entry path. When it is entered from > kernel-mode it is doing its best to switch back to the interrupted > stack. This is only possible if it is entered from a known and safe > kernel stack (e.g. not the entry stack). If the previous stack is not > safe to use the #VC handler switches to a fall-back stack and calls a > special handler function which, as of now, just panics the system. For > now this is safe as #VC exceptions only happen at know places which > use a safe stack. > > The use of the fall-back stack is necessary so that the special > handler function can safely raise nested #VC exceptions, for > example to print a panic message. Can we get some more words -- preferably in actual code comments, on when exactly #VC happens? Because the only thing I remember is that #VC could happen on any memop, but I also have vague memories of that being a later extention.