Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp418904pxw; Fri, 8 Apr 2022 10:42:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyDYPMthUaWIuQt6L0GF6LbVz17TlM/dkRg0romwDUUby5Z4ZjNyT0ND+dEbDFEWhzHAA5 X-Received: by 2002:a17:90b:3902:b0:1cb:27ad:d69a with SMTP id ob2-20020a17090b390200b001cb27add69amr8494846pjb.69.1649439761349; Fri, 08 Apr 2022 10:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649439761; cv=none; d=google.com; s=arc-20160816; b=OXU8JXpALqjQGeB+8D8fWOGoAR5kSvSCWTlwdC6TqRK4vJ4FLf2Jl/qgNLI92ACekQ lbtAYjXwpa8Jr4oLATgdj21WhRLhPSxATuRcU95sIz2e6x8Fjuct9HomUkx8M6cJyeOn y3/Rwqgx7YJUyrx4AoEjrSA+S3BOT4kCn2bbnJRn213Gv9o53i1wbLMF6ybl1LbHbjlG GLSSgSB750FOQfMGcxi2lgFGZ5I8ivRZWrJis/tITxJf8kpwDJgzgdhrkLoWtQy9QqOZ cBNfD/alaZzw6LMdiUK/k6Sr8IXaLT9E/VxRuGueR2fyy5lq6daZ+gWU1mQ19Cg6nVKv 7LKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=a+9a9sX+AtnfbLsfaAjyC7PbSX1PutNOnfHgO4MQy9Y=; b=IbQBVFozuainpJPtYcbP0+uwVjB93PYGAgCX7QLAP3rHYSqaRrckT70CirdoWTYCt+ b9+e+LzH49DF2gQwbxJb5B44XxuAvWHobsCkamT7PoWIIO/DsVo2EdyO99+uuEYw/S8t 5wtjXlcC9tNcvSyeziOwYTZOZDPB8Rx/1Qg/yAim2CEpDG6Vv2Q8zidF7vm06W1lZfiK n36wHdOHGQ+oETo+e4E6fyadMDcOLt+NRQ5bW4aPsUEe0vVY+61mQbgqNkVNnAiAi3m6 4B7cGYSiokv8Jy4/7K2TtTQnqsai9NBEBqlSh7FQaYbEibDyxIwPfEVidDag24xOf7Ax h1Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="0b/UdOA6"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="/S9Jb7s3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a056a00138b00b004fa8042c398si1885176pfg.190.2022.04.08.10.42.26; Fri, 08 Apr 2022 10:42:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="0b/UdOA6"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="/S9Jb7s3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232758AbiDHJKz (ORCPT + 99 others); Fri, 8 Apr 2022 05:10:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232587AbiDHJKm (ORCPT ); Fri, 8 Apr 2022 05:10:42 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E675111D78D; Fri, 8 Apr 2022 02:08:38 -0700 (PDT) Date: Fri, 08 Apr 2022 09:08:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1649408917; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a+9a9sX+AtnfbLsfaAjyC7PbSX1PutNOnfHgO4MQy9Y=; b=0b/UdOA65NGtE7G3E5v/kKPesG6Syz2TYWVe8RU7SjyptIZED8oQit55b9tgLxNKN6nPCp BgLPN8g8XReEUjNI49w4Zcaym+ybF8PYn5UGUKs/MEdzzVl+2RxzHevtVZcE0QF1LfHx7a 5TUqoFjigLybKV5g2rVFMED/pYoCCfN5UrJ9qA9AbREx0JVuM9X6JeGjKVCD8fduDMvVXp FYPRVeDMJ1amMSJD/mVeHmHKjjb2yHZF2gQD+8LqQIeCQRTQfNfJ+cXzhNCwgH4ac/XQKS Y4MG19jktDJ1vASBNEjp2L1C23tJvgujx8KwNX5AtBTE4RIM+MvXTuqIPIFg3g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1649408917; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a+9a9sX+AtnfbLsfaAjyC7PbSX1PutNOnfHgO4MQy9Y=; b=/S9Jb7s3tMpul8Ja7m/mBLzIvX3wT44SVEQjcH1796Pd0im50bC8FhhJ+UPXcIb9T9ze6P oC7R5HCgO5kiZtBw== From: "tip-bot2 for Michael Roth" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/sev] virt: sevguest: Add documentation for SEV-SNP CPUID Enforcement Cc: Michael Roth , Brijesh Singh , Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220307213356.2797205-47-brijesh.singh@amd.com> References: <20220307213356.2797205-47-brijesh.singh@amd.com> MIME-Version: 1.0 Message-ID: <164940891648.389.595050059106700206.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/sev branch of tip: Commit-ID: 92a99584d965b930988b28f36d925bd9675828b3 Gitweb: https://git.kernel.org/tip/92a99584d965b930988b28f36d925bd9675828b3 Author: Michael Roth AuthorDate: Thu, 24 Feb 2022 10:56:25 -06:00 Committer: Borislav Petkov CommitterDate: Thu, 07 Apr 2022 16:47:12 +02:00 virt: sevguest: Add documentation for SEV-SNP CPUID Enforcement Update the documentation with information regarding SEV-SNP CPUID Enforcement details and what sort of assurances it provides to guests. Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-47-brijesh.singh@amd.com --- Documentation/virt/coco/sevguest.rst | 29 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+) diff --git a/Documentation/virt/coco/sevguest.rst b/Documentation/virt/coco/sevguest.rst index 625de22..bf593e8 100644 --- a/Documentation/virt/coco/sevguest.rst +++ b/Documentation/virt/coco/sevguest.rst @@ -118,6 +118,35 @@ be updated with the expected value. See GHCB specification for further detail on how to parse the certificate blob. +3. SEV-SNP CPUID Enforcement +============================ + +SEV-SNP guests can access a special page that contains a table of CPUID values +that have been validated by the PSP as part of the SNP_LAUNCH_UPDATE firmware +command. It provides the following assurances regarding the validity of CPUID +values: + + - Its address is obtained via bootloader/firmware (via CC blob), and those + binaries will be measured as part of the SEV-SNP attestation report. + - Its initial state will be encrypted/pvalidated, so attempts to modify + it during run-time will result in garbage being written, or #VC exceptions + being generated due to changes in validation state if the hypervisor tries + to swap the backing page. + - Attempts to bypass PSP checks by the hypervisor by using a normal page, or + a non-CPUID encrypted page will change the measurement provided by the + SEV-SNP attestation report. + - The CPUID page contents are *not* measured, but attempts to modify the + expected contents of a CPUID page as part of guest initialization will be + gated by the PSP CPUID enforcement policy checks performed on the page + during SNP_LAUNCH_UPDATE, and noticeable later if the guest owner + implements their own checks of the CPUID values. + +It is important to note that this last assurance is only useful if the kernel +has taken care to make use of the SEV-SNP CPUID throughout all stages of boot. +Otherwise, guest owner attestation provides no assurance that the kernel wasn't +fed incorrect values at some point during boot. + + Reference ---------