From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web10.5627.1603140807859024206 for ; Mon, 19 Oct 2020 13:53:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IHDXo43j; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603140807; 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=8EDPBD1SZn61INqPvka4YzKcw/rzqrUnC7BL6PZ370U=; b=IHDXo43j2l3dVboFWIhRXEaGZ1rBkl1WMlqNnhPQp6aciknHq12Hun2RkkIHLclJvfScYd cbrqVA0gKaXE4F6No5Lk/SHZ9bDI/FrfLox8lQ/fHw1BilQpcZZblB9sDUU/KgrVN1eldE SqH5uN7Eyq5khvspo59v5Tkt/RpYe/8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-502-wlSvoG8iM2G9Wck5ywxiYQ-1; Mon, 19 Oct 2020 16:53:24 -0400 X-MC-Unique: wlSvoG8iM2G9Wck5ywxiYQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A8539ADC20; Mon, 19 Oct 2020 20:53:23 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-137.ams2.redhat.com [10.36.113.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 784275D9D2; Mon, 19 Oct 2020 20:53:22 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 04/11] OvmfPkg/VmgExitLib: Set the SW exit fields when performing VMGEXIT To: devel@edk2.groups.io, thomas.lendacky@amd.com Cc: Brijesh Singh , Jordan Justen , Ard Biesheuvel References: <8ae03140ceadd7c2f16ca7a15baa07da59642b18.1602864557.git.thomas.lendacky@amd.com> From: "Laszlo Ersek" Message-ID: <381f7404-c393-f717-4f14-4953e8c1bb1a@redhat.com> Date: Mon, 19 Oct 2020 22:53:21 +0200 MIME-Version: 1.0 In-Reply-To: <8ae03140ceadd7c2f16ca7a15baa07da59642b18.1602864557.git.thomas.lendacky@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 10/16/20 18:09, Lendacky, Thomas wrote: > From: Tom Lendacky > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3008 > > All fields that are set in the GHCB should have their associated bit in > the GHCB ValidBitmap field set. Add support to set the bits for the > software exit information fields when performing a VMGEXIT (SwExitCode, > SwExitInfo1, SwExitInfo2). > > Fixes: 61bacc0fa16fd6f595a2c4222425cb6286e19977 > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Tom Lendacky > Cc: Brijesh Singh > Signed-off-by: Tom Lendacky > --- > OvmfPkg/Library/VmgExitLib/VmgExitLib.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/OvmfPkg/Library/VmgExitLib/VmgExitLib.c b/OvmfPkg/Library/VmgExitLib/VmgExitLib.c > index 3072c2265df7..ae86d850ba61 100644 > --- a/OvmfPkg/Library/VmgExitLib/VmgExitLib.c > +++ b/OvmfPkg/Library/VmgExitLib/VmgExitLib.c > @@ -110,6 +110,10 @@ VmgExit ( > Ghcb->SaveArea.SwExitInfo1 = ExitInfo1; > Ghcb->SaveArea.SwExitInfo2 = ExitInfo2; > > + VmgSetOffsetValid (Ghcb, GhcbSwExitCode); > + VmgSetOffsetValid (Ghcb, GhcbSwExitInfo1); > + VmgSetOffsetValid (Ghcb, GhcbSwExitInfo2); > + > // > // Guest memory is used for the guest-hypervisor communication, so fence > // the invocation of the VMGEXIT instruction to ensure GHCB accesses are > Reviewed-by: Laszlo Ersek