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.62]) by mx.groups.io with SMTP id smtpd.web10.621.1604685262832510722 for ; Fri, 06 Nov 2020 09:54:22 -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=dZgzR21/; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.223.62, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n504FFE7vAH3Sl/E547cK4cq0YDnyfFjd7eege0DhVppZN9n6AeeqCabRNRRPNBNz3eiHtBI+V0kpuNIvXctk0df6JGsieRjpR5/PZQjOaEU03N/fPANOb0rAZowAZDP9pm2oThF4lZhcOX04DqnPh3n30guQIUloGKecyXjaBT9MdB2+YCy9LqlTpPd3ulf6wzqurD0IfIJQhc0/q2esGokJK+wrtt/0TnhHOL6rWZvijIACEH0fhQrFGMsFgoksZ2fH9rOTEZhO2uoJXZxibiZ2vFULps2MiOLQAH5MTHbLcsl42KUiFqsfyu/H8reSCeH5OW7T1Zn7sspQq6a8w== 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=VbDrtzeDnb9bg6l8LG2kTd3VlkNmpNPXsk2R3WV/nIQ=; b=aNeTYMSQLZc1ixZyWyTaezKS91KOoYv4q+Cx7EqRjLAY94ui7S3GPzV6K83rjTHSMNp+hmiVsPDuzq23YHbQXAlJvhbxf8x7BjPfg/RcgimWYjMZGif4Fy4xmkZO2OJacVh0B/ms8UM0OCku42jCmJt49Z8LWwVGWVaWBRpOD/gnxqey8YxMf0ek8LyHUUuUu+MVpZByehonnuoXCj7ONlPDjZqRcPLYmPJSkx71azr5i/2g92i7ZWLYY3mIXOX1YZCTWEkeAD6GpkXTm1AdzEeF2mVCjMRqtPfOYcvwRUh/NEa5qN13oRkXiEuk/UAy158lGuSEmQo1ACNvALDwug== 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=VbDrtzeDnb9bg6l8LG2kTd3VlkNmpNPXsk2R3WV/nIQ=; b=dZgzR21/v83sNpjB+6Z/NCwBwEJdImcJMhn4FYdtxgo5GU0yjseCXorzqEFQ0YJj+G4vuUkbMjftnVGiRFN38yv5rf8YvOmNdxX5KjUtsOHp53he+4Cl3c45sscVVtAaal0hcxdDvc5yGPZHBfNo3sNIReFeLSvvX2w5CLvCHzs= 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:54:21 +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:54:21 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io CC: Brijesh Singh , Eric Dong , Ray Ni , Laszlo Ersek , Rahul Kumar Subject: [PATCH v4 07/11] UefiCpuPkg/MpInitLib: Set the SW exit fields when performing VMGEXIT Date: Fri, 6 Nov 2020 11:53:09 -0600 Message-ID: <6e11dd7e161bddeacc3fb4817467cef24510c31c.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: SA9PR13CA0121.namprd13.prod.outlook.com (2603:10b6:806:27::6) 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 SA9PR13CA0121.namprd13.prod.outlook.com (2603:10b6:806:27::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.10 via Frontend Transport; Fri, 6 Nov 2020 17:54:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: eaa1d12a-ed54-47d8-a10e-08d8827cfd8e X-MS-TrafficTypeDiagnostic: DM6PR12MB4385: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zKF71ONsMJEN5lK9BGCFrgfLXZiZIwZFZp85PVopvsqGE6wSG+PQLhd/N2hWKwyycy0uFohxeaoscDx/0cy2PU0yRK8qd0GQvVUynY41HNhpRc06WcvTOBxLc7brvi0/n3u6+MzfGPhUOk9R2EiXrBdTyu6Rzl9hBbKXkkiTPjdYZBpa6RVhNF0X3jiyu1/d0/yUtC/GBu7xbaWztIrAvGAl6X67AmJRLDLV5goUZlER/NaBGL/I06MUqEY9MpvREw/I4fqsL2Ch6ZzsBi/VrgMeuluKEDSJNvjU6qkcpvEn3YLYCz+Fkslg85qxcv3G1wMsQM+P4v5gyCq11/9KPKmFluq3HNu6dbkccXbkqaDYekPijSomqHxrr/KWXUP/2SjRZXEaydV7CDBEITm5dg== 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:(6029001)(4636009)(366004)(376002)(136003)(346002)(396003)(39860400002)(316002)(966005)(86362001)(52116002)(7696005)(66946007)(5660300002)(6916009)(6666004)(8936002)(36756003)(19627235002)(8676002)(478600001)(66476007)(16526019)(26005)(2906002)(186003)(66556008)(6486002)(4326008)(54906003)(956004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CHR3626LJOLxtxX2OVR1M7uZ8nVwF7AXtsAqRhNlpZiIqIRAiuiHsU7ChpsP9D1lrvwlExVcJPkhfVnQIftTSahDMzfJe7aXUPThx0A4JU0V9V8RpEAFACwc3bYHFrjwGk6xlrfNZ0WGAvEsxSzDpFHHvJjuS7NfXqpMICOBG2AIGZey5FBNT+N8JmpKhUqSgwJii/bbsp6D1jXBs9FRN2EaVT/IfPZ+WgmD0SP1kxw/1a4OriiVIJ41ou6j4hPDkhYxYreA19QTe+z2l5zARwGh8k7cMkzQYUuqt67V9h4K1ySVnd0Ryehh/k2zZeMBTnIdYoH6q/iGTkUv6Ztf++wnrSturAFG00CwUWbHWQ3JeA0mIkWnPqOJ3KoBgi7ZjyI4Gms9nDirLTmFlYM+vMnkaNJ2QpM93nto2jZ9JvnS1z7/+4TxNU9tr/EJNUsGtO7Imr2xq1GbKBc8NKs0olpFTF9puZz5wEWL6q2JY5wuQhfAbE6nzcOSuJPG5DT9qGMsxBIQRBWrvDE6zvTlBJVz0fI8LyyO4EwZcVWG+q/f+MgTZi9OcLR0jZ3a8fsElwIhjfDqqEsQVnLG5mnMAR/IV2WNke/8vLVVq97o64Tr+loJzeWxls5KJk6oGtB7vMJ6GS1F3xBg3athrLeWcA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: eaa1d12a-ed54-47d8-a10e-08d8827cfd8e 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:54:21.5983 (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: BA6oog/6arNFtrUnMxr/zDiO/uZBDYw9qf5VkTuEIVUUI7WvUi3873Rt6JaqV04NNiFNiieU/LBFMPV1A1w8QA== 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: 20da7ca42a33d3ef767ce4129f11496af7f67c9f Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Acked-by: Ray Ni Signed-off-by: Tom Lendacky --- UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm b/UefiCpuPkg/Lib= rary/MpInitLib/X64/MpFuncs.nasm index 5d30f35b201c..5532a1d391bc 100644 --- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm +++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm @@ -533,6 +533,12 @@ BITS 64 =20 mov rax, 0x80000004 ; VMGEXIT AP_RESET_HOLD mov [rdx + 0x390], rax + mov rax, 114 ; Set SwExitCode valid bit + bts [rdx + 0x3f0], rax + inc rax ; Set SwExitInfo1 valid bit + bts [rdx + 0x3f0], rax + inc rax ; Set SwExitInfo2 valid bit + bts [rdx + 0x3f0], rax =20 pop rdx pop rcx --=20 2.28.0