Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp703642ybh; Wed, 15 Jul 2020 12:53:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJUlEiVbB4Wu8LRmktSW1ch1ofnWI8n3SEBNqzrQ/D1t8SY3NhH+KwuobAxU1hMc0J+NkL X-Received: by 2002:a17:906:4d4c:: with SMTP id b12mr542478ejv.506.1594842809892; Wed, 15 Jul 2020 12:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594842809; cv=none; d=google.com; s=arc-20160816; b=s7Hd+2oBt0wreb+NULSPCcNJ/lpQMn22pKkYLywohU+ArnmysanDEdAj14ZUmixL+J +dzAcjcc44bX627ongSZPRaQqDi5JbhdU2Dz/EBU3cuNDo4ns2a8L1R/yqiirUKQfaGd 28wA5L7hyUouWMrx0//MBqhKZc4djjfxyo449MMgCK8Owkge5Vsft2WSUWmrvNQMmd72 dh8RbPf38lHQuHDukgWeBALbkDd8gNl07pmMMhjyhxEEtfRowZ3NkpEHDsv30YIVmKt5 Vt9tUV8D/jjEiKb6tMkpniDQ5wgbIIFsEfDIRFtP0v8pCRn/jdBWLLEcX2kRG7s3OivU u2qQ== 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=yppoieqawtommMNv7F4xEsaylvTK3ZvGj7dcQjgO2TY=; b=cdXOtvNNJS1d5XYEOdeJS7DZ/f2ULq2MuESifwpsxZtJpN5KzgOB51LlnMxBeMzScF 0JPMeLA7m2oeslXXXJ5/PMD4LGn/qw4snBkxOvGi7mx/+NrbPWSUbOQAsGsvhfzDvdpy 4sWud4Rue1zhjABr6dU6Po4j1uITOTQXk/jvUh37bZ89D/yAvEyXK/TbwjlsVi5B3LuJ v/iTs1sSxMGs591nYNPqg1rteyuFqYOQ8CdJDuGiGJY3WOEtpGRCRLvzkB5YnDNgm9el BU/A68LJcmeRcK3cwemssTcP+BFWi2GbbzUzDvFzx1YSAoOmi5aL80BvWYudtFx4IjDi ErOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j2qfngMt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h7si1715780ejy.82.2020.07.15.12.53.06; Wed, 15 Jul 2020 12:53:29 -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=pass header.i=@chromium.org header.s=google header.b=j2qfngMt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728153AbgGOTt1 (ORCPT + 99 others); Wed, 15 Jul 2020 15:49:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727096AbgGOTtZ (ORCPT ); Wed, 15 Jul 2020 15:49:25 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87EB0C061755 for ; Wed, 15 Jul 2020 12:49:25 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id l6so2812197plt.7 for ; Wed, 15 Jul 2020 12:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yppoieqawtommMNv7F4xEsaylvTK3ZvGj7dcQjgO2TY=; b=j2qfngMt1we3l0IhZifI4twKJ3j3kBQ/HIpn7YZ5j2qvGCpY3D4CxXVvbwFlxonJnk 6FWAS/JQzC3Vr2RY57kmgM9BiR+ZrBL3UMBVX0Dg1AEdjzFvwUMCdolO9hvbOeEsYa6u jBGIyYHDqd0rQYUMQHt3Rxit3HX4mUF8GqeNY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yppoieqawtommMNv7F4xEsaylvTK3ZvGj7dcQjgO2TY=; b=DvMLDS6npP25PVnkTLRHaU7gvmqMZFi9/PxrPay7nJMuwAMbH5dYJWL2+3N1SIdNqJ fBJUFP28AJWFcQsVN+5VdF5kIV2pDE9VJJE//J6mlozZSGFvV4KoqtVHFMv/0fWVyenY rMYaGy6iKYGUykeML3coT3/qgjIXn2y9zUHC4J5L99UCWSs3k0gapa73Q3N1bW8Y/6VV +//QMfwfWMFtOnBxe6RZ01iz/s4F1jDdLE1KzF1eNn9QnjyO+ja0foxvr0WVgRipmXCp D21cqluSWhREnvBlnuy86iAZD+/6s5MkmrAr62LCoThEkAgRJjuQF8VL9dZsnTpO06Jl QVPg== X-Gm-Message-State: AOAM531Q4prjYSo6l7SthYQQUq9bna5q3V7MGWKvOxWCN47Pp82XpM/+ UhsSxI9e1JJDem+wwpeN40ZA2g== X-Received: by 2002:a17:902:8c91:: with SMTP id t17mr825746plo.235.1594842565095; Wed, 15 Jul 2020 12:49:25 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id g7sm2685716pfh.210.2020.07.15.12.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 12:49:24 -0700 (PDT) Date: Wed, 15 Jul 2020 12:49:23 -0700 From: Kees Cook To: Joerg Roedel Cc: Joerg Roedel , x86@kernel.org, hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , 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 70/75] x86/head/64: Don't call verify_cpu() on starting APs Message-ID: <202007151244.315DCBAE@keescook> References: <20200714120917.11253-1-joro@8bytes.org> <20200714120917.11253-71-joro@8bytes.org> <202007141837.2B93BBD78@keescook> <20200715092638.GJ16200@suse.de> <202007150815.A81E879@keescook> <20200715154856.GA24822@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200715154856.GA24822@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 15, 2020 at 05:48:56PM +0200, Joerg Roedel wrote: > It is actually the CPUID instructions that cause #VC exceptions. The > MSRs that are accessed on AMD processors are not intercepted in the > hypervisors this code has been tested on, so these will not cause #VC > exceptions. Aaah. I see. Thanks for the details there. So ... can you add a bunch more comments about why/when the new entry path is being used? I really don't want to accidentally discover some unrelated refactoring down the road (in months, years, unrelated to SEV, etc) starts to also skip verify_cpu() on Intel systems. There had been a lot of BIOSes that set this MSR to disable NX, and I don't want to repeat that pain: Linux must never start an Intel CPU with that MSR set. :P -- Kees Cook