From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.81]) by mx.groups.io with SMTP id smtpd.web09.598.1604685239440336053 for ; Fri, 06 Nov 2020 09:53:59 -0800 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=sPFVYMbJ; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.223.81, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D4mhjlVR8Yw3IUb9rlOcm8cbDLPDQuErFU7KFKB70M5vRfl9OmtOywJeIyEv/kvmAJH9+qnvFYjJa7TiMkusbjX+1izWGCMQD28jXgMcFPatYlUvMQCHK6AucEU4R+9JFYPLyrVXlwGRlaxcJ92VaCJD/Q9g+d7/waKaHsxgk2wTKl6o5GtekUnAcrASzgB/ujrbw5YFcOWRUdaQR1KF1U+UR4P+SP+/SsQ2h7nYmo+rwdwEUOLYfWTGF5MEP5H7s7XjRoyOHR4VDUiRKA8VvDDlFI2dpQY7Nz/ScvHClNYb/kl0CRl2hgYsOTKjkgRt+bUbZkFmwDiphe0AB8cjxQ== 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=E9VEbNTpOG5KW6KIdNkxvmEnZsr7keOxwxBWptclhMlmx1Mr6jnlXS4dNcjpPyEkYVIGjetoEmHgSXhQNMXGKjm9rYcIevHCRSMc2qXN/d1u+443V2SqioiO6YsKkW5k+VJ7Mh2bkomvlOH/k9Tc47+oerw2bnXeUAH7U32sTR5DDlPtYfWo6F1u4OW+Pqa3JOcsc6WUYAiYPE7asIUpU1l/Z5czeIEJD+WwtoG1W7GPVd62Cn2PT0D1GmT0pXvJGvwIVGMYIGoNwWI/HbEsbK7oQJ9JFVinFVYbAJB5IwREzSC6acMzvz92qybVe0LkOx/YfrlEC5JmU8AtxgrbJA== 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=sPFVYMbJfE5EnWxj3V5fTetjSXjn2/WljQR25U1O4W6Itq6PR4LbVDxyPyL6XTrGvzcM/JPsjTs00QM1t+6hkObBop73xJZGnsz/J0qos14CNxAKjPsIs1llzzUFsh7kzcgIvPS1ANKn+MVwAgO8klWaAGOAFNvEPW2fVxs+dpQ= 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 DM6PR12MB4385.namprd12.prod.outlook.com (2603:10b6:5:2a6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21; Fri, 6 Nov 2020 17:53:58 +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.032; Fri, 6 Nov 2020 17:53:58 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v4 04/11] OvmfPkg/VmgExitLib: Set the SW exit fields when performing VMGEXIT Date: Fri, 6 Nov 2020 11:53:06 -0600 Message-ID: <986e157c13bf33e529b1d16ab1b52e99a74a734f.1604685192.git.thomas.lendacky@amd.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR21CA0046.namprd21.prod.outlook.com (2603:10b6:3:ed::32) 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 DM5PR21CA0046.namprd21.prod.outlook.com (2603:10b6:3:ed::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.6 via Frontend Transport; Fri, 6 Nov 2020 17:53:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5cf69ad4-a7cf-4857-fea0-08d8827cefcd X-MS-TrafficTypeDiagnostic: DM6PR12MB4385: 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: yeW6Qcimiph5jAZYWt7SrNgaCHu5VDfLKPSMhuZuik0mdz4vnAhGK+BlaULAo59YPdjL/KU0VUnXjZcT0rSbPGhCJz4NacUR9SmByKDwR4iZ6Y24pt4lV0DGL+aZov7S7aFY/NtY7ShtzQUqZPXuNC/1yr17n/C12kWkNDF6zvrTHBfKkIpjCxHgptbTD3tVAB3Uou1xQyROcv88UnPCsvD6ZG7TWrDSzzGs7qvz+wzhdobiHkum8mvoLCQ3Fa857Q8kWxRzM+XKYmER74CLKQ050Ft618Dp9Fma4ELnfiO+8wUdZhtoUFhNU0xgLHyrH61T52zudy554oEFIZS2zz40xjsF1tKHvjCxUo4RD3Okp+dCpXI0EQNRYm2yJ4kno/FCEhwYxerDqIMp0mI0Pg== 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)(366004)(376002)(136003)(346002)(396003)(39860400002)(316002)(966005)(86362001)(83380400001)(52116002)(7696005)(66946007)(5660300002)(6916009)(6666004)(8936002)(36756003)(8676002)(478600001)(66476007)(16526019)(26005)(2906002)(186003)(66556008)(6486002)(4326008)(54906003)(956004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 1kbNa+ONMFRFyvn8ZNOapo3LrCLT+nl0ZSnez166tRdmVOs6UcVGLBrlUCi4arKSUEsClAnRpDiWHswqi17v0fvfW9R8Yy74B7rVn6ZkoxH1rSo2DPiVmu6vwDJ5iGzUJMHwiRkssZDapAtDIJyfGuMAX23A87Qdcmhk3VNCO13Vp487L/GeERwRWbCom6JIcuz9GZTfpO5eQaC3RHzjnZQDtsXr1MO8wGTJY93QIDWEvsp7CWgjkLcTK3iDLM7If6J7vWJoq6VssS1lwSvYwANese3OluzDTm1U1HtKVhbedymPS6YWXg94inZZnM2FdTmAo86tpgTfDFU01UW+L6OGvK4u6n4DGLELdbyj4pr/qah3Ppp9nOCFHSCuTxfQKJHQtgJb14uyo2AbzIABfDqw/t3u+3LArnL5Q7HdbnqH9vbjfsuDDlHtlJ/Nok1sgAhCajKB8B3LdC7zBtl+7NLDSHzQ8nZDrEqkcMPiIrzx8vwTIEGVOA4rIms9vzyMQGB8pr53tclH3pqYtQCnot7fO0xcni1vCLpYKYi2yRVpAvPPPWJvNNMCJ7e8H+5wNLcQA7ftCfrepf+Q47LZAlzrbml12aAr5BCAF2qGAv6CLAxcjtIaHx/4gshSRG5NR8E/oQXdVjO5B5yHO8VgWA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cf69ad4-a7cf-4857-fea0-08d8827cefcd X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2020 17:53:58.4984 (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: DI2z6Zk4NY6pEo/NY53GJYVTFIfh7DhoZtfS7ow/fbaag1D2484kt+gMtXmcGnYe0j33+SvGDTl5k8X6H3BEKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4385 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