From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.62]) by mx.groups.io with SMTP id smtpd.web08.9515.1603981131321097633 for ; Thu, 29 Oct 2020 07:18:51 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=RwWL36If; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.236.62, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hXfXo2cb1m1J3cP8s967HOVGZ65jXh37sTnR6bCC7/rPHlVl3h4yKzyYD9Ee98Lpw7jlPE8jtB4tkm7JHd2kSoOtwZnO9IfdhJPXv9tqG9GIfdSOsdK0Mj0tlEp3zbBZj7hgTMsJt80E2vINIp3fYoaqFoqToZQl0yshAFi/8V91u25ldbXHdKZHPKL9IPhtrx/3xhwMQf7cNbtvmjFV8ImschASVsFdKbU5q/oaQjMr+h/kaxqMyH+PeMMT8IiTkXnEzf28w9XDZbEh6wpPv6zFq+SAwi2QLHPFKi9s+zNlqIa0slwV4xY7aUp/NbYOXzmt54QPiUFciAUuR17bdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zQmfdxszJdrCUDcjqN+iZA+fpdnf+lanHbe30lOlSzg=; b=ZXBMe9tvqRdTrO3zI4O+1Z5zdwPF/sI2kRdqN3rsAOg1/ew44Zlu/b0DyRpaYmFcM9wU3tYysJpKHsRFmfudZ9E6k9MreEW+jKzUCsUUik7ti3JUEl8q7QpSnkJNJ0a1+77yVkS69TFxq6qeGB8JyYTriaE4Kcqmj9dAQDDc4g2dUn0szy35TCxXVHMUTVupvUhxB/dGfieQTh7DugI3XSE+VvY36gGmtfRmTIzNnqaUcxMlEXcSqb3UQ1aYoWV9FOXhMfstsJieVskIY3JSngC+g1k7td8GbPO+ZtKuseM4VmwdaU6dU+sjW7H3r6PrwBlD31RXbQwc1hqPoqk2Cw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zQmfdxszJdrCUDcjqN+iZA+fpdnf+lanHbe30lOlSzg=; b=RwWL36IfYe7X3bpsOP8Yzw6oGlyGnNrYSTupTHtrVZ+vDwNmRzEbwvpOn9QfD5O5w6f7BAUSPo3bQRKm8f5ZXs+TXdvsvr/DZVN8SnBBsu2pXN27Ui+EpE+XKS6xEq+HkBOiXI8ry5HKOFV87gS6hmnMFwW33WdhBp7olwM8/q8= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM6PR12MB3276.namprd12.prod.outlook.com (2603:10b6:5:15e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.24; Thu, 29 Oct 2020 14:18:49 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::e442:c052:8a2c:5fba]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::e442:c052:8a2c:5fba%6]) with mapi id 15.20.3499.027; Thu, 29 Oct 2020 14:18:49 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v3 04/11] OvmfPkg/VmgExitLib: Set the SW exit fields when performing VMGEXIT Date: Thu, 29 Oct 2020 09:17:55 -0500 Message-ID: X-Mailer: git-send-email 2.28.0 In-Reply-To: References: X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN4PR0201CA0003.namprd02.prod.outlook.com (2603:10b6:803:2b::13) To DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from tlendack-t1.amd.com (165.204.77.1) by SN4PR0201CA0003.namprd02.prod.outlook.com (2603:10b6:803:2b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Thu, 29 Oct 2020 14:18:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8cc6308b-e353-4b15-b443-08d87c158de2 X-MS-TrafficTypeDiagnostic: DM6PR12MB3276: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jMZNiIFmPQPAb7RFVDBGtPkXU20aH3jx2fs5XLWhGb6ZbvxezHLJr338K+f+P1jrEJ/DsIB/HwCy+jTXXyG29VgygYAvgBRrDKcjoGkAyZpyq1NR/RiiW6245+cSgHtmjc3XFCSUivJmY34d4Cjpl2ZAkokSxO0WIgZ8n4tLQMI90f3ofcIVz4ANuKN7JneTE6zcUhh0FJ21eDNgCrD6AKAh4s90ZORQMCXJ4sdBooYUxWSSPLzXB4jK6F3ufSQlTTzkpSMMjp0adfWuyRe/n2tapbrCaRDrqd1/U7CtVoHqR8d+4LVQqBRMOajg2f6j6OR9w0QlBzq1L+qoVFBnVgrloRxnMnPnojDAJvUJc36XOCtz05c4IqXEsHqRW8gJNYUs7JHkA9g535xFGDMR3w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR12MB1355.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(396003)(376002)(136003)(346002)(366004)(26005)(8676002)(186003)(16526019)(4326008)(86362001)(6486002)(83380400001)(7696005)(52116002)(54906003)(66556008)(5660300002)(2906002)(6666004)(966005)(36756003)(2616005)(478600001)(316002)(6916009)(956004)(8936002)(66476007)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: oB5HEXG3S6iwDiIcDMF+LJywrkUFGMDIsag87FrDVrQLlYGyP8SqipCnCV/ajzn6Hrx4cbadPxwgsUJAtAjpQ02PAM+51OwppgeUYdG6qrDLvGgiOT8dQg5XOHVurTq2JuIAqxOatpmct5xnjk1Q6sTrowYu6PgVdxFOlD7ddPgoShU9CiyZ7ea301azw5oPvViyZ7wseg/JNiLHh/5PQv14FmuXgBTicCHxai1vWJdQYoe4HNlelq92E7RJtyOgB26Uq91vo9+cnSoEew6rNk0I8aK/Chj0YmW3DkDcBqWd/16EtbLpEquYap7mfqkOesioQlQbHpN+LRIngatW2fL+7LJSOhYymjSBo9z3caH3HA+63Yk8MJjzqKVKJ7ymQwD4wVf+tbLH78pXtZduLmEyy1Ake9cm/Efa1OowinVt7DNgmOvqY4CM7M8lBxbLskVJr1bLNEI7bYqnC1ga1bvr3xVm0YeK5xQoEgOHnZGWmfvIU5jIwFZo5j1+5hJ0dVkki8AItk0nxrniGPgBOkEUjyn33FhLJmhSNTdcFVHHS/KJN9jd9w+vEoAbPxIvRc4uLeejO20czSZNFp1V5cR7vignxUygFEKMcYVcw4blErRpNPMv31HrOPvd8vOes7wLBwg6szNKT+ExQMQpIQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cc6308b-e353-4b15-b443-08d87c158de2 X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2020 14:18:49.1316 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g7LeS7Krw2mvxsYYt//hdKFu29itA7lNJEMZIPU0KLKF24CIEiEkCqvwfr+wZ2ajoJ48RHfBx5U0fH3DSOHKuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3276 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable From: Tom Lendacky BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3008 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 Reviewed-by: Laszlo Ersek 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/VmgE= xitLib/VmgExitLib.c index 21f68b19c94e..0540df8a04d4 100644 --- a/OvmfPkg/Library/VmgExitLib/VmgExitLib.c +++ b/OvmfPkg/Library/VmgExitLib/VmgExitLib.c @@ -110,6 +110,10 @@ VmgExit ( Ghcb->SaveArea.SwExitInfo1 =3D ExitInfo1; Ghcb->SaveArea.SwExitInfo2 =3D ExitInfo2; =20 + 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 --=20 2.28.0