Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp310920ybh; Wed, 15 Jul 2020 02:34:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTQr3t+fE+qsVDe57kJA/0YDTyjFTMVl8ZIuGlrJl4DHuhsQlw7qiKANNCrueugZCIase5 X-Received: by 2002:aa7:c3d8:: with SMTP id l24mr8410407edr.97.1594805692877; Wed, 15 Jul 2020 02:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594805692; cv=none; d=google.com; s=arc-20160816; b=bo3oz0Etgf6e5rEnFPZyY7Kaale/ZncFOOa+KPWIjh8hNScnB7ueaD0vL1WmcsezvN qbqlRQDTM4qvpMoKgh6gDu/rgcQK67avPgnCk7z6cvExyRW379IVH6/oNBuj/Dlt9cHa l0oZ4OP6v1Zt2tfVxm8zYqvO98ZEsLRbXXI2g4r6JCou3LTHxf1327Y2ksOolGRR8u/h fAKnjut5FVTEYzonU0WmAs4W/CMWDnzo4knMqLURonYDawH7sZvIlyUrhl9Nv1Fx7gRs LYsKHWz7FqcVZQ7pLDNBAhvW0IVKbTX2lfzTYi02rJBYusbpSdF1H5xGssfVWpzup1V2 X5AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=dK8UwzUTgUNLePBN/9TrjpAB3tyGtmDfMqWT0SbBnEY=; b=F/XW9uCrAqOGrqsyAFYLd+q2divS/4sEz0EUr0nxWb+AIFu8Lfrl0Q3Mf3Vo1qEPs9 Afd9wnC2tLRFP8jHiZW9YjOYx+SUL18oD4vXljum1xEDkissxezP8iNtuB9LOMNdlGWM 1H2WgrxN59BmjR+dampT4B9vn0VnInKmBDRxlicRpePg087sv55QgNciYY3J5jI6mZPd VRCWSdw1Kh9rg7wpAFze/6wt6eF8EDWb0w2o8ataC1mqU+7mJgdQTTCINcNoQzYde8aw r/CjOvkDPb7biJI2+RqpA/ziWoY5hOFX57nsxaAKnK5Bt+STus1bbGRk3j/xjLJB2ZsB ndRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=SYThOw0D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si897165edy.128.2020.07.15.02.34.30; Wed, 15 Jul 2020 02:34:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=SYThOw0D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730665AbgGOJZW (ORCPT + 99 others); Wed, 15 Jul 2020 05:25:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729672AbgGOJZW (ORCPT ); Wed, 15 Jul 2020 05:25:22 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15F65C061755; Wed, 15 Jul 2020 02:25:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=dK8UwzUTgUNLePBN/9TrjpAB3tyGtmDfMqWT0SbBnEY=; b=SYThOw0DKQ59j+xOZ9e7s9giuM tDfpXRj67AxyxcDD/DruSpiV3lLLocgumIGHcor3cLJvMbB67U/P86WHzwLBDWnMM7/VE7d5DilUf 4YM2HlWFCuP5zJIWETM4zuvR53OwsBKsLKMox2dndow+qB3qgoNDTu5XP018d/PmLoVEQc1+4SV8H EWEbQpfJpVa6/+Ui67qnx6GgCoPLKU0raNxCb0U6Ww2OCVdoVtagwaYzi4qgDr5u/1i9S5Ss2tK9y XIbatbd4Y1yNWkVo40PSHRKeEh/tlULCWSefU7V9Uf0In+2TOyvTgUB9j1R0/FONOEmAyGtW0Sf5P TNZ6ff8Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvdeu-0001jJ-Bk; Wed, 15 Jul 2020 09:25:00 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 4FE7C305B23; Wed, 15 Jul 2020 11:24:56 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 438C6207A6655; Wed, 15 Jul 2020 11:24:56 +0200 (CEST) Date: Wed, 15 Jul 2020 11:24:56 +0200 From: Peter Zijlstra 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 Subject: Re: [PATCH v4 00/75] x86: SEV-ES Guest Support 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 Content-Disposition: inline In-Reply-To: <20200714120917.11253-1-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.