From nobody Mon Feb 9 10:33:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1649151305; cv=none; d=zohomail.com; s=zohoarc; b=nSMnAyCnNSMc0gqTzL6LHtXVwOt+4bEjOLflVu4ul18T2yPKJZ7Guq6ANw5n70/djHeN21IUGiTh/2lrXSqgvO56eO5p4DpBQx7T53MndDmSccP5gHLzobZd4lT7ckhehpWhUmyGU5ybfd6htxYwMw68dFopuDERH1Mkv/oY/gs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649151305; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=65LAApyknJ4Ap/WBTWbz9LDqY048gEZBR+OKXqDXuFo=; b=V1OyXrgUXZx0sXvkz63DdIutB/FqVt4J6dUN2jX+Fx4UIwEF9JsMlA3+WHB6jsFsJoBoghRNk6RhyFVwZU77Ww3+pQcF20uwkPdCwO/KyJyZNQiL58tm3xnJ7PxlFG5S5Bui+neru3K8kgBaKHTpUkbwQCiylOZex7cWiQORBqw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1649151305661259.43970063988843; Tue, 5 Apr 2022 02:35:05 -0700 (PDT) Received: from localhost ([::1]:41604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbfaa-0008PQ-BF for importer@patchew.org; Tue, 05 Apr 2022 05:35:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbfMB-0006mO-Kd for qemu-devel@nongnu.org; Tue, 05 Apr 2022 05:20:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbfM8-0001os-4x for qemu-devel@nongnu.org; Tue, 05 Apr 2022 05:20:10 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-144-P4gyo0feNF-kgldOZDbNEw-1; Tue, 05 Apr 2022 05:20:04 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EB436801585 for ; Tue, 5 Apr 2022 09:20:03 +0000 (UTC) Received: from avogadro.mxp.redhat.com (unknown [10.32.181.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C6582167D9B for ; Tue, 5 Apr 2022 09:20:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649150405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=65LAApyknJ4Ap/WBTWbz9LDqY048gEZBR+OKXqDXuFo=; b=L3q8GMJd3SRnA2aNrRaJEDfsGCG5QTDkT3RoPSfKUjULFOEljr8m3UY6IdPey/c8bl4xrE jUGu0Wnep3xlBFE4jOwBL1AUmaHR/29nbQkiKejkvptjSUmXbiiPuSV6t0gibx0f1WS8gM VZG4xL3MGaiLyVPCdF6AlaNhcXlPviw= X-MC-Unique: P4gyo0feNF-kgldOZDbNEw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 1/3] coverity: update model for latest tools Date: Tue, 5 Apr 2022 11:19:59 +0200 Message-Id: <20220405092001.104507-2-pbonzini@redhat.com> In-Reply-To: <20220405092001.104507-1-pbonzini@redhat.com> References: <20220405092001.104507-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1649151306364100001 Content-Type: text/plain; charset="utf-8" Coverity is now rejecting incomplete types in the modeling file. Just use a random number (in the neighborhood of the actual one) for the size of a GIOChannel. Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/model.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/coverity-scan/model.c b/scripts/coverity-scan/model.c index 9d4fba53d9..686d1a3008 100644 --- a/scripts/coverity-scan/model.c +++ b/scripts/coverity-scan/model.c @@ -356,7 +356,8 @@ int g_poll (GPollFD *fds, unsigned nfds, int timeout) typedef struct _GIOChannel GIOChannel; GIOChannel *g_io_channel_unix_new(int fd) { - GIOChannel *c =3D g_malloc0(sizeof(GIOChannel)); + /* cannot use incomplete type, the actual struct is roughly this size.= */ + GIOChannel *c =3D g_malloc0(20 * sizeof(void *)); __coverity_escape__(fd); return c; } --=20 2.35.1 From nobody Mon Feb 9 10:33:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1649151457481975.2832147180452; Tue, 5 Apr 2022 02:37:37 -0700 (PDT) Received: from localhost ([::1]:44136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbfd2-0001re-77 for importer@patchew.org; Tue, 05 Apr 2022 05:37:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbfMP-0006pZ-HA for qemu-devel@nongnu.org; Tue, 05 Apr 2022 05:20:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbfMI-0001qR-AM for qemu-devel@nongnu.org; Tue, 05 Apr 2022 05:20:19 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-380-XOLbiRrmNvKyyXxRutNxyw-1; Tue, 05 Apr 2022 05:20:14 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 556C3800882; Tue, 5 Apr 2022 09:20:14 +0000 (UTC) Received: from avogadro.mxp.redhat.com (unknown [10.32.181.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27A902167D9B; Tue, 5 Apr 2022 09:20:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649150417; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GjZaBCs6xPPvOTcK99tzAcs0y9oxheE4duMLgEWctqc=; b=ENbw0KvFX2RhqFYUs41Uojtv6wppwzk/aba262ibSk4hYpabbTsqfo5MPXSH3igRo1VAy7 WuE0swk+ynHsPtUmMXKBdW/SfIK9E1JR3/fzZR7Hog8ID0mVIHwXQzwVrYgujk1Kvxgvc9 LxkzpLqgM8zmvNbfeeL9y/0Xo8+7tT8= X-MC-Unique: XOLbiRrmNvKyyXxRutNxyw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 2/3] qga/vss-win32: fix compilation with clang++ Date: Tue, 5 Apr 2022 11:20:00 +0200 Message-Id: <20220405092001.104507-3-pbonzini@redhat.com> In-Reply-To: <20220405092001.104507-1-pbonzini@redhat.com> References: <20220405092001.104507-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Helge Konetzka , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Konstantin Kostiuk Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1649151459091100005 From: Helge Konetzka This fixes: qga/vss-win32/install.cpp:49:24: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *' char *msg =3D NULL, *nul =3D strchr(text, '('); ^ ~~~~~~~~~~~~~~~~~ Signed-off-by: Helge Konetzka Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Konstantin Kostiuk Message-Id: <39400817-3dc9-516d-9096-bc1f68862531@zapateado.de> Signed-off-by: Paolo Bonzini --- qga/vss-win32/install.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp index 8076efe3cb..b57508fbe0 100644 --- a/qga/vss-win32/install.cpp +++ b/qga/vss-win32/install.cpp @@ -46,7 +46,8 @@ void errmsg(DWORD err, const char *text) * If text doesn't contains '(', negative precision is given, which is * treated as though it were missing. */ - char *msg =3D NULL, *nul =3D strchr(text, '('); + char *msg =3D NULL; + const char *nul =3D strchr(text, '('); int len =3D nul ? nul - text : -1; =20 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | --=20 2.35.1 From nobody Mon Feb 9 10:33:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1649150655; cv=none; d=zohomail.com; s=zohoarc; b=SRjf97+SvvAwbb5WnVwncMxQctbfjYdaXSGmhGPe8FPJ7IVuwS1t67j236mOCremcGgRFK3NmGWSWONRypCgY3iMISRNzBFjFDuKrKD6TB9Lfbj94XVqnZ1LpmlRqsQ5DG/FZ91Ds3sE3nr3tfdL+FGiyE1kKwSTU7WbzsWzQFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649150655; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MSIIupJkNjNuDdJLmggJgcRZoBsx2nog8emsWpZU8tE=; b=TNKYE/z3cEc6A6d43w9w8rbIqYojyqIFMlZm0mHaqDiQoNC049+M5WPQ2ZIrD5mivU6mfIwFQhBYKYxrYNmgmR+8MFtAwPgV7bai+OEMDWG6o3eHSHb/ojkHnfuNCBdi7Y1vJfMuZWfRW2kS6qphIkAMxyVXQv2LFeE3vrJFakg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1649150655858607.4813509407302; Tue, 5 Apr 2022 02:24:15 -0700 (PDT) Received: from localhost ([::1]:58856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbfQ6-0000Wx-Fn for importer@patchew.org; Tue, 05 Apr 2022 05:24:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbfMS-0006pz-GV for qemu-devel@nongnu.org; Tue, 05 Apr 2022 05:20:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:35345) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbfMN-0001s1-Hw for qemu-devel@nongnu.org; Tue, 05 Apr 2022 05:20:26 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-377-pMfRKna5OaOgOUqnWcxDwA-1; Tue, 05 Apr 2022 05:20:19 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B2DCC3800509; Tue, 5 Apr 2022 09:20:18 +0000 (UTC) Received: from avogadro.mxp.redhat.com (unknown [10.32.181.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87A0B2167D9B; Tue, 5 Apr 2022 09:20:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649150422; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MSIIupJkNjNuDdJLmggJgcRZoBsx2nog8emsWpZU8tE=; b=FuC80AvHICRZWhNhaeLU6fsTW4U+1GfCMHbfAWd4crWmAzsMVGeEWQslWn6+MtM5puOKII lnPbEI0qUWpyDQGwJhUJSIhMNRKjlUlrqvoqQmy5htXzwArwmcKy+ZSAPAXsVu01pwmsoq RaZWwJQ8FR5DquMqGdRU/LU0nlaWI+M= X-MC-Unique: pMfRKna5OaOgOUqnWcxDwA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 3/3] docs/system/i386: Add measurement calculation details to amd-memory-encryption Date: Tue, 5 Apr 2022 11:20:01 +0200 Message-Id: <20220405092001.104507-4-pbonzini@redhat.com> In-Reply-To: <20220405092001.104507-1-pbonzini@redhat.com> References: <20220405092001.104507-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dov Murik , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , "Dr . David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1649150658153100001 From: Dov Murik Add a section explaining how the Guest Owner should calculate the expected guest launch measurement for SEV and SEV-ES. Also update the name and links to the SEV API Spec document. Signed-off-by: Dov Murik Suggested-by: Daniel P. Berrang=C3=A9 Reviewed-by: Dr. David Alan Gilbert Message-Id: <20220217110059.2320497-1-dovmurik@linux.ibm.com> Signed-off-by: Paolo Bonzini --- docs/system/i386/amd-memory-encryption.rst | 54 ++++++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/docs/system/i386/amd-memory-encryption.rst b/docs/system/i386/= amd-memory-encryption.rst index 215946f813..dcf4add0e7 100644 --- a/docs/system/i386/amd-memory-encryption.rst +++ b/docs/system/i386/amd-memory-encryption.rst @@ -47,7 +47,7 @@ The guest policy is passed as plaintext. A hypervisor may= choose to read it, but should not modify it (any modification of the policy bits will result in bad measurement). The guest policy is a 4-byte data structure containing several flags that restricts what can be done on a running SEV guest. -See KM Spec section 3 and 6.2 for more details. +See SEV API Spec ([SEVAPI]_) section 3 and 6.2 for more details. =20 The guest policy can be provided via the ``policy`` property:: =20 @@ -92,7 +92,7 @@ expects. ``LAUNCH_FINISH`` finalizes the guest launch and destroys the cryptographic context. =20 -See SEV KM API Spec ([SEVKM]_) 'Launching a guest' usage flow (Appendix A)= for the +See SEV API Spec ([SEVAPI]_) 'Launching a guest' usage flow (Appendix A) f= or the complete flow chart. =20 To launch a SEV guest:: @@ -118,6 +118,49 @@ a SEV-ES guest: - Requires in-kernel irqchip - the burden is placed on the hypervisor to manage booting APs. =20 +Calculating expected guest launch measurement +--------------------------------------------- + +In order to verify the guest launch measurement, The Guest Owner must comp= ute +it in the exact same way as it is calculated by the AMD-SP. SEV API Spec +([SEVAPI]_) section 6.5.1 describes the AMD-SP operations: + + GCTX.LD is finalized, producing the hash digest of all plaintext data + imported into the guest. + + The launch measurement is calculated as: + + HMAC(0x04 || API_MAJOR || API_MINOR || BUILD || GCTX.POLICY || GCTX.LD= || MNONCE; GCTX.TIK) + + where "||" represents concatenation. + +The values of API_MAJOR, API_MINOR, BUILD, and GCTX.POLICY can be obtained +from the ``query-sev`` qmp command. + +The value of MNONCE is part of the response of ``query-sev-launch-measure`= `: it +is the last 16 bytes of the base64-decoded data field (see SEV API Spec +([SEVAPI]_) section 6.5.2 Table 52: LAUNCH_MEASURE Measurement Buffer). + +The value of GCTX.LD is +``SHA256(firmware_blob || kernel_hashes_blob || vmsas_blob)``, where: + +* ``firmware_blob`` is the content of the entire firmware flash file (for + example, ``OVMF.fd``). Note that you must build a stateless firmware fi= le + which doesn't use an NVRAM store, because the NVRAM area is not measured= , and + therefore it is not secure to use a firmware which uses state from an NV= RAM + store. +* if kernel is used, and ``kernel-hashes=3Don``, then ``kernel_hashes_blob= `` is + the content of PaddedSevHashTable (including the zero padding), which it= self + includes the hashes of kernel, initrd, and cmdline that are passed to the + guest. The PaddedSevHashTable struct is defined in ``target/i386/sev.c`= `. +* if SEV-ES is enabled (``policy & 0x4 !=3D 0``), ``vmsas_blob`` is the + concatenation of all VMSAs of the guest vcpus. Each VMSA is 4096 bytes = long; + its content is defined inside Linux kernel code as ``struct vmcb_save_ar= ea``, + or in AMD APM Volume 2 ([APMVOL2]_) Table B-2: VMCB Layout, State Save A= rea. + +If kernel hashes are not used, or SEV-ES is disabled, use empty blobs for +``kernel_hashes_blob`` and ``vmsas_blob`` as needed. + Debugging --------- =20 @@ -142,8 +185,11 @@ References `AMD Memory Encryption whitepaper `_ =20 -.. [SEVKM] `Secure Encrypted Virtualization Key Management - `_ +.. [SEVAPI] `Secure Encrypted Virtualization API + `_ + +.. [APMVOL2] `AMD64 Architecture Programmer's Manual Volume 2: System Prog= ramming + `_ =20 KVM Forum slides: =20 --=20 2.35.1