Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5538152pxb; Wed, 26 Jan 2022 14:28:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRP9Xp2XEQV6pL+AxiZ2UTZr4p9CzSr+N1L/Tp2mKVGOdpJ7yG8lmzUKWjzh+b/+l2I457 X-Received: by 2002:a05:6402:348b:: with SMTP id v11mr973620edc.353.1643236114614; Wed, 26 Jan 2022 14:28:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643236114; cv=none; d=google.com; s=arc-20160816; b=vOrb06Rk1NKrgu6aYKJepCALxenNPrIIkZ/RL7E+wQ9p6lGn8rqYeZt5fM1F8HNppN QKVSSjRD7LxLHs1v1VAPc/hrgjXcX4M+RE7HTPZ2021o4ZYi6+AJtUnNr5VK+Lr0q9Nz 0FN1DIRWXrLsseNSQ3xdi5TaVeVnwNnHCcNJukfeDRnfoxQZ7DLteopeY5Jd/K7hpQtc AHxAKl6HhGKdmCeqD7iSdvF1BW6W9+ozGXcVWVncQ7jYxOP+rH7UGpW+5wrE4NWeWM5f hptNuU7BPo7Syese2PJmK8OVqcmtV5PjOpM6E9nzFYN/iVlYNHH1MqO4yc+kWzFFWCaT qzcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=96A3476Qu+7SjsWY2hSBFw1C0Xznd/Zn6tLR1Pkup4Q=; b=daFqglXc3jkHPEFk0z99nY+zWRDgMee/olzv4SP5qX9qEkCy+8H97DS5F3/AEPelLt xU3/vNtbXfcNCF6SKsSPLUZj6S6b13vdkX8cd+QE+2l9MalN7Aha0geCAJQTfu1wdfNH 0E6glnsDeOr8P5qDDHQGLDPiKyJaK8bHsMN3LIXn8+xm+/oVX6aB+Teoi3RhCk0Uw5Xp SM/gKnbvh2CvOHR9cNSoVDc7023gHhu4ImHmnGY8FIBpgbARDZJzQnrjO1S7mGc+ixnl rGRYt+TE8MoadZltYCXr7jPzIphko1Dce5llpT6bxrrEbbuGqBLXSGGIGDzh27nv4c1k 0A8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=jmiefYcs; 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=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fz1si315075ejc.338.2022.01.26.14.28.09; Wed, 26 Jan 2022 14:28:34 -0800 (PST) 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=@alien8.de header.s=dkim header.b=jmiefYcs; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244195AbiAZSfQ (ORCPT + 99 others); Wed, 26 Jan 2022 13:35:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244223AbiAZSfO (ORCPT ); Wed, 26 Jan 2022 13:35:14 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1738C06173B; Wed, 26 Jan 2022 10:35:13 -0800 (PST) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id E87731EC0523; Wed, 26 Jan 2022 19:35:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1643222108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=96A3476Qu+7SjsWY2hSBFw1C0Xznd/Zn6tLR1Pkup4Q=; b=jmiefYcsIsHCM6x1nXxo3vEUg7F1AGEwOS9cHwytrWbNL/9AD1ypRH2QAD6Tl6zikwBu0d aQKA2K0jhIfsl4e3eBUV8VyXS1d6ygLtnULQpASCWSDAmLARaktXvbZlmc1Sv9Cr64YOiX J1apVcrQoag5o9EvKUnS6zi8V7qwRGo= Date: Wed, 26 Jan 2022 19:35:04 +0100 From: Borislav Petkov To: Brijesh Singh Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Michael Roth , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , "Dr . David Alan Gilbert" , tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH v8 35/40] x86/sev: use firmware-validated CPUID for SEV-SNP guests Message-ID: References: <20211210154332.11526-1-brijesh.singh@amd.com> <20211210154332.11526-36-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211210154332.11526-36-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 10, 2021 at 09:43:27AM -0600, Brijesh Singh wrote: > From: Michael Roth > > SEV-SNP guests will be provided the location of special 'secrets' and > 'CPUID' pages via the Confidential Computing blob. This blob is > provided to the run-time kernel either through bootparams field that ^ a > was initialized by the boot/compressed kernel, or via a setup_data > structure as defined by the Linux Boot Protocol. > > Locate the Confidential Computing from these sources and, if found, ^ blob > use the provided CPUID page/table address to create a copy that the > run-time kernel will use when servicing cpuid instructions via a #VC ^^^^^ Please capitalize all instruction mnemonics in text. > +/* > + * It is useful from an auditing/testing perspective to provide an easy way > + * for the guest owner to know that the CPUID table has been initialized as > + * expected, but that initialization happens too early in boot to print any > + * sort of indicator, and there's not really any other good place to do it. So > + * do it here, and while at it, go ahead and re-verify that nothing strange has > + * happened between early boot and now. > + */ > +static int __init snp_cpuid_check_status(void) That function's redundant now, I believe, since we terminate the guest if there's something wrong with the CPUID page. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette