From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 5CBD7D80A07 for ; Fri, 26 Jan 2024 22:14:49 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=IJqqovRRzrbK4bPLxl+6Dk39utxZDoKYDhHe8OwFbSk=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1706307288; v=1; b=Ig+zJ9rVWsn93bwT99Pu0oviyAG+7qeV0EDsxIN/n7FDbLRGtwNR3G3DTBj3vRtZdbuA3cNx HjbruRL5iIksdfJAJjVYNIx1W+zPcIzOCnsNRrVMtUZemEYV+RhuXlE+GsdUADgjd5HpnJaHU3o B4YaAuBDpLdLh0EiSAd6R/zg= X-Received: by 127.0.0.2 with SMTP id GVkBYY7687511x0ix4pkXQ7t; Fri, 26 Jan 2024 14:14:48 -0800 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.42]) by mx.groups.io with SMTP id smtpd.web11.2970.1706307287375114360 for ; Fri, 26 Jan 2024 14:14:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eLu3W0TtJ2I0sVExTB8gEGVKlJvH8TXvovCCfLzBN6FaxRHcGLckHngynwQnN8i0KhOa8YlWLqcJ2Hx16O5zZQNlTrKaNyX2092OaMrUH40C4GCtbS7bQQR/Kg4kmvpeAFI4JtmVRE+AB0zuwnnPs9m4y2+oCKFT1GwHIn4eXqxhDWdovHyYLIdKsy4IEMtb3i2mw5ckXYrMORAURX8MYygHKvKDaE7k5OuKIXdioE0JadXMC7EgCicaId2Zf20CyfHeaptXFjRWheEtp+ROQO6XtIVzxhthbmaQe6GjX23B0mBscMOYABBEtECd7EaoavLXMfTjh6wadmHqY1jJ6w== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WkRcvtV0avRcvi6Vm9msOHXTitioRR9O6lRq7b4ya38=; b=hga1nL52s5WCYZ8R1UM4hGlFMz7g/V3aJD+WrKnsV+RTgGYYQFLbnVBaAJfw797iSPZukLrdd/zUv+hwVeHRaJoOY2Pyj90liQYrKL5plPWoGAHApigKrv61pw+QLXsovQwV6deS/rra3pMFQmP+8GFMZJds9IMWiYbLjCgI8kp4klvXtgcPHHkvs7Lr/K8E/7UbBlkKHSwvtMm9xGp1ILyBSsPw2fnfcib4p5hVKzP7EAkNmXnBFJ3l21/o7G2bwDZTG9J4RxE6eQGxyTqffrw6p4SrTvpZDwaO/pPR/Apdge0YTT/KebLAHam7EuOi+XN1EeUbpoP/K9fSmXpTAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from DS7PR06CA0018.namprd06.prod.outlook.com (2603:10b6:8:2a::9) by PH7PR12MB8123.namprd12.prod.outlook.com (2603:10b6:510:2bb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.31; Fri, 26 Jan 2024 22:14:42 +0000 X-Received: from DS2PEPF00003440.namprd02.prod.outlook.com (2603:10b6:8:2a:cafe::49) by DS7PR06CA0018.outlook.office365.com (2603:10b6:8:2a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.27 via Frontend Transport; Fri, 26 Jan 2024 22:14:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF00003440.mail.protection.outlook.com (10.167.18.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7228.16 via Frontend Transport; Fri, 26 Jan 2024 22:14:42 +0000 X-Received: from tlendack-t1.amdoffice.net (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 26 Jan 2024 16:14:41 -0600 From: "Lendacky, Thomas via groups.io" To: CC: Ard Biesheuvel , Erdem Aktas , Gerd Hoffmann , Jiewen Yao , Laszlo Ersek , Liming Gao , Michael D Kinney , Min Xu , Zhiguang Liu , "Rahul Kumar" , Ray Ni , Michael Roth Subject: [edk2-devel] [PATCH 10/16] MdePkg: GHCB APIC ID retrieval support definitions Date: Fri, 26 Jan 2024 16:13:09 -0600 Message-ID: <163f1b66d4c516c81270506391cef77ba7b1c546.1706307195.git.thomas.lendacky@amd.com> In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003440:EE_|PH7PR12MB8123:EE_ X-MS-Office365-Filtering-Correlation-Id: b2d8b668-6b90-4076-20a5-08dc1ebc3217 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: BQvm9ym74mDcL/AELuC6AyQn8nIXVrdVEqMYV1q+XaQ20jJpIJwnLIhQGmiU4gPxMs7BdLtcZ7mvvFcdVk2GQ1xq83Csa3YCvRSG6snzaTn0arCDb/JeV5fjD1jelIWnmq0WXJJGXNWc/KdjgzNGJl7Kiuhc+igDSmd+pxTr5Kpg4IgAVIhL/7FbYBJcfxYQ7TGeghsvZMEIn6oa8Rh9yNSpEbutitS1B19oixNW82JIuVFUFEfUewPGrxZrO0lDhUs+NStAVOLRwdFv0KNNS6qK/Ctm5Rga0MzT+ROQ1lTNq5q+kUuFx9J9ay2ziwvqg1E2ChU23U3xZkXOYIm4pv+7COnh3D0md+KSmA8ceS1anFPVvC1G9KWk+WNfDASmYPjaIKBBHw2RgqFeuTp0VRYsHkfLAe3zN2q861Hs15r/Z8deNJdXtNd3IbAGh1PTiu12NkcM976qjeNnGqIX0eh4DjqAeU3eTxQb3OwMXj/CGCmzDjzD80uGrnogVCNE7gKPHs5iIfbqg6vLfw8jvBgmwoQJIKBeTV0Rp9M1ySaUSeH/GZHKzVP33NYblJdtEiHNSyErybq6hU+XB80zAGWHlUBPdm8OSkEbB2TSZG9GIweq9CLPlm8lgO9OyqbpYI5w4wZ4O2UOO4n/c+6RWSdE2rU0E2ydlRQe+rN0ORlIhMBM/FIFGyA/e7s+MBKwDTAtztiQW6SrFEpGi1Wj45IdX3C4ey3ZLsReHgDK4oxeHxVEu4ghSye36ScX2BUtIcGpsXYhPeEAPW5zAVi3Dw== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 22:14:42.2204 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2d8b668-6b90-4076-20a5-08dc1ebc3217 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003440.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8123 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,thomas.lendacky@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ztWkzj7MLYvxqwSFcH2fWc1Jx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Ig+zJ9rV; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4654 When an SVSM is present, starting the APs requires knowledge of the APIC IDs. Create the definitions required to retrieve and hold the APIC ID information of all the vCPUs present in the guest. Signed-off-by: Tom Lendacky --- MdePkg/Include/Register/Amd/Ghcb.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MdePkg/Include/Register/Amd/Ghcb.h b/MdePkg/Include/Register/A= md/Ghcb.h index 29b2e45d0163..cb581b14723d 100644 --- a/MdePkg/Include/Register/Amd/Ghcb.h +++ b/MdePkg/Include/Register/Amd/Ghcb.h @@ -56,6 +56,7 @@ #define SVM_EXIT_AP_JUMP_TABLE 0x80000005ULL #define SVM_EXIT_SNP_PAGE_STATE_CHANGE 0x80000010ULL #define SVM_EXIT_SNP_AP_CREATION 0x80000013ULL +#define SVM_EXIT_GET_APIC_IDS 0x80000017ULL #define SVM_EXIT_HYPERVISOR_FEATURES 0x8000FFFDULL #define SVM_EXIT_UNSUPPORTED 0x8000FFFFULL =20 @@ -170,6 +171,7 @@ typedef union { #define GHCB_HV_FEATURES_SNP_AP_CREATE (GHCB_HV_FEATURES= _SNP | BIT1) #define GHCB_HV_FEATURES_SNP_RESTRICTED_INJECTION (GHCB_HV_FEATURES= _SNP_AP_CREATE | BIT2) #define GHCB_HV_FEATURES_SNP_RESTRICTED_INJECTION_TIMER (GHCB_HV_FEATURES= _SNP_RESTRICTED_INJECTION | BIT3) +#define GHCB_HV_FEATURES_APIC_ID_LIST BIT4 =20 // // SNP Page State Change. @@ -203,6 +205,14 @@ typedef struct { #define SNP_PAGE_STATE_MAX_ENTRY \ ((sizeof (((GHCB *)0)->SharedBuffer) - sizeof (SNP_PAGE_STATE_HEADER)) /= sizeof (SNP_PAGE_STATE_ENTRY)) =20 +// +// Get APIC IDs +// +typedef struct { + UINT32 NumEntries; + UINT32 ApicIds[]; +} GHCB_APIC_IDS; + // // SEV-ES save area mapping structures used for SEV-SNP AP Creation. // Only the fields required to be set to a non-zero value are defined. --=20 2.42.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114636): https://edk2.groups.io/g/devel/message/114636 Mute This Topic: https://groups.io/mt/103986461/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-