Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1496141ybg; Thu, 11 Jun 2020 11:19:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmF4wlL/JVyy+ce3/KnQ2FDSBw/dRoPIoZ6rBqMbcvnHoK8baarN8ckLsZ5D/S/spk2/Rd X-Received: by 2002:a05:6402:943:: with SMTP id h3mr8469138edz.89.1591899552830; Thu, 11 Jun 2020 11:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591899552; cv=none; d=google.com; s=arc-20160816; b=OMrQDfMXPjVuglOUmB28AmXMGn4ESi8kwM2SOcc55E0swq8efwGsnO9Gvu+pbSDpbW zSyeE+mw6oyTJsC5AJ3YdCE4S7kE2qULViOaHvqxs6N8n8XJmjwvAT6iDq1sGxRvi29S fvUeQyshnpDC+kwV/p+zsOLN2F7Vpf0fhyxFEsJz9+lSYIvZQoRLJDh5/sBdLNO5Sa2a KqFa6tnCeEEoWToJyc+MlLMtsDuHGuCyraoMkmLwwGN3LgPDd41UrqIDINGh/vH2Ue+v phzTK4Dz6QuFa+awDKBMKQQ0Os1y64t8Cc6ZojeY1CXXMIBVeBJSAiD9H4rNWSPs32JO iFog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=oBV7EDX/XyomyQ5aqOkgJzyEPXThLFgp9IMpWF/T8I8=; b=mgHVrLh7RcKni6KYPVi3tJr7a3OiP4zPHgcRaRuGOhamjw4jraZePt/QGl6XTD8I57 KkNTEISMopPMrWqIBjuPo+4Wn5rB7aIYDsj2MmSekqUxjT6aBRt52qYwijehz1w9NoGV 7YEY+MGantR9VgXR0+EAZcOP1MdQPYxtg5xREzS1PkHo+0rRMb/79oeeNX0KRGWeCSLw FbixM8KFCL5MTUnvJ/PhxT/NmDtDTzyhMOgbKW+ivO6PmpDhXFF5n6A899SN9f+0fSoz JWPIioKa9wvlgjIqgtbiui++SJd/OgU3hcXzb28bl4pDCpvMDTAE1P2Pz+wWT3aX8nbl sZqQ== ARC-Authentication-Results: i=1; mx.google.com; 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 t25si1971251edw.39.2020.06.11.11.18.49; Thu, 11 Jun 2020 11:19:12 -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; 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 S1726757AbgFKSQx (ORCPT + 99 others); Thu, 11 Jun 2020 14:16:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:57744 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbgFKSQw (ORCPT ); Thu, 11 Jun 2020 14:16:52 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 12C16B158; Thu, 11 Jun 2020 18:16:48 +0000 (UTC) Date: Thu, 11 Jun 2020 20:16:41 +0200 From: Joerg Roedel To: Sean Christopherson Cc: Joerg Roedel , Borislav Petkov , x86@kernel.org, hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Thomas Hellstrom , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v3 47/75] x86/sev-es: Add Runtime #VC Exception Handler Message-ID: <20200611181641.GD12636@suse.de> References: <20200428151725.31091-1-joro@8bytes.org> <20200428151725.31091-48-joro@8bytes.org> <20200523075924.GB27431@zn.tnic> <20200611114831.GA11924@8bytes.org> <20200611173848.GK29918@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200611173848.GK29918@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 11, 2020 at 10:38:48AM -0700, Sean Christopherson wrote: > Isn't it possible for the #VC handler to hit a #PF, e.g. on copy_from_user() > in insn_fetch_from_user()? If that happens, what prevents the #PF handler > from hitting a #VC? AIUI, do_vmm_communication() panics if the backup GHCB > is already in use, e.g. #VC->#PF->#VC->NMI->#VC would be fatal. This would be possible, if the #PF handler is able to trigger a #VC. But I am not sure how it could, except when it has to call printk. If #PF can trigger a #VC, then a fix is to further limit the time the GHCB is active, and make sure there are not faults of any kind when it actually is active. Then the only vector to care about is NMI. I will look into that. Regards, Joerg