From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.68]) by mx.groups.io with SMTP id smtpd.web10.19641.1602864601009924176 for ; Fri, 16 Oct 2020 09:10:01 -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=IEod9ZrX; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.94.68, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jiHd8XNslOaC/UM4jZzERlylL2YxK8arDRRISEaFyAFQKR4iwVv0ROU9Fr/EemAAD7IsCB93BcXGC/nAFtyXlnvAI1MhlltQzRt8wv4nn4Ld86wJArm1WcL4/xvHTjReMP3pb0pngfNZLm7zYJ1iXVYpkOhA0oG+bKaxtoAOn1l9kJiPDmh68DYk7NXtspWev6EqDsxScL8r0UHlgF1nOnypQYelv/iyFhe6GZ1lA8jqH0uPSVkIOcIMjTIW2QpmQhtBI8xBHPCLGtsLfwDxkNbjPmaOmjaHdhY7tgZ3Vry0zUoOdrD5pPfE0opst5LkLjtQxo8owIeab7JqUg/R0g== 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=qrM5yJMp6y8UIwKkGOcX9OeX8qEoYNyQih32Yl2iKPo=; b=VC++NVaZCU/JGV9Iz4taDZcNuJUEav32NS6Jb9uePWlLotPzlsWs3TDyMvDSMDUr1j5ZKyp1OPqTAA3NnlVSYxdIfd4cCbaSwA3+eTwD3QvDCA3Pk9w2knWZFkxY/jAd5ptK06fU6ogwJe+8of1/PUPBh6WGOCrUGHRLgNeilxleK8grOJDoEkuVKvj+liKKwDy00jwYX4NIMbJr0TXVLshYY0KsQGPxoXtO+rYNwQ3bmw7YDmaptXjQvyHQ4KYHe+iumzpecsvI1dawCkgYkDxdco18LO25IAIlDyn1FA3Hcb+GmPF40tCbKK6wDRDnfy7xkzxaClnf0iOBhJG6FQ== 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=qrM5yJMp6y8UIwKkGOcX9OeX8qEoYNyQih32Yl2iKPo=; b=IEod9ZrXqZ/RIQXyrLnWFVEL6CaXSCEZ9Pgzo553oCMn+X5f/Pf2RNJ6ZAA1ajoS6+Djn/qh2lt21eiUE/w/D5oOsSViuLyoJAJhC+URmBV+c65p/YTpNEZ2dxWDPXAaLqn/azeKp6mTdaIiiB7GwdSEnn/qZMAe0IGJD2rcgBk= 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 DM6PR12MB4926.namprd12.prod.outlook.com (2603:10b6:5:1bb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.20; Fri, 16 Oct 2020 16:09:59 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4d88:9239:2419:7348]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4d88:9239:2419:7348%2]) with mapi id 15.20.3455.030; Fri, 16 Oct 2020 16:09:59 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v2 04/11] OvmfPkg/VmgExitLib: Set the SW exit fields when performing VMGEXIT Date: Fri, 16 Oct 2020 11:09:10 -0500 Message-ID: <8ae03140ceadd7c2f16ca7a15baa07da59642b18.1602864557.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: DM5PR10CA0024.namprd10.prod.outlook.com (2603:10b6:4:2::34) 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 DM5PR10CA0024.namprd10.prod.outlook.com (2603:10b6:4:2::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.24 via Frontend Transport; Fri, 16 Oct 2020 16:09:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 33f11e27-de1b-4cce-7082-08d871edee72 X-MS-TrafficTypeDiagnostic: DM6PR12MB4926: 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: ycM10bQS/YObvGYHQCjPrwPRalwq/oYG/mWOnivONLq9bqWj+dsJjF6kaWIxKfIOd+lOyiCaYXV3xtF8aB5t4XFUf9Z+oATi+5DKuaAyJo/1pAhiffUA4sABGuWDDSA5DpO77VPlTBHQzJqhUkY+byYlFTJhwOX6HRNsJz4As1fMYLhOlodwU830kiCW6DV8sxKcdxiGx7G8PmHsLiF1W+qnC5f4TJlZvMDGvjdCxQwoCaSSVCffrQSt4cbjRtN8auLtHwpQUnMLHOp1GAtg97HAntmsU66si/0SPqxqLgNxUZ4LlHdIwli7PnkrzJXEnDrdjnKYwWMlMd0omggGZOkqSPQXpNbi4AVaRllbmjB6hExmoJrmYs2YMKghhrYwLR5JzRQsxmJhnrP+55PxgU+MqoA0WRdcBvHs3JIL7SYS8wfViKdT/y1mtTiBHJVfMzyvS+jJNwJN0vx208soaw== 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)(136003)(396003)(376002)(366004)(346002)(7696005)(52116002)(83380400001)(66556008)(66476007)(86362001)(66946007)(36756003)(4326008)(2906002)(316002)(6666004)(54906003)(6486002)(34490700002)(5660300002)(6916009)(26005)(956004)(2616005)(16526019)(478600001)(8936002)(966005)(8676002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: OdJzHQaKhcu4OFW999COXMOhvyz95sQzbcHrqBdJvVr9fjHXaKrOc6Pev46A92Gdd0KbHaejdpgTvEXoIEOUGk63Ey1ZPDAcI4jUcYkxli+tgo5bMgx9qv2w2Bjm2BpBe7j+z/HKa/9qDzR2L4pAYO4VqTVJl1t0fQsNNMY56rxVEXCTbnlDZX3JlE/DPMo6Sk4t02EffTv5qOTB9Yqf9tn4BBNDdeQUCC9v28ECjcSQOUjNky3xVYhY4R1C/gYbNfNx4Lh1PgSf5EjjeCzSBZu+ICvlWSx7PlQqBRvBAXqWKr7yZVfoH/Q1boOQOADBkatxyDPzFZopjG32ZHFdmOff25bz4lZCPvw5zSk1/HdQGcixUBBQsubHPjOwlpXhYVDc2WuFm3DstTgkYh7v9fHByfspvMeVr+hWEl5DQIybnFVPYpSzDtndfNpvRgjyXkoSPSVbU08B2Ba+0B8RH6KpMIxHCP17RDCjdkXXWLRJ5lI/AEIAd+xUYle0T97itVajRISMJxZ4WQWqKWd1dItP+6uqi25t1U78FvT6XZlecC4cz33iS6R068ftvp0Ni7UzX2u6IAtvKeOYfiBNxOmrZDGtNh9s/qTWFJD+OlnYyQ1moUSPBLw8jqg508OYMcAFN0mtF8bUG/WoqDyPGA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33f11e27-de1b-4cce-7082-08d871edee72 X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2020 16:09:59.6689 (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: DnF6pOoixWiWlheC1y33IcCh1qbM28tBeQ7DLEMBVMdd+D48fAywyP8BSIGnMLPiP12tAJGWtIFQWiqTOfr7zA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4926 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 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 3072c2265df7..ae86d850ba61 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