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 AF029D811A4 for ; Thu, 22 Feb 2024 17:30:31 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=KfFQuzS6EvZHuyLmr2smNQxy9dThoZeFYGS8GzDLE10=; 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=1708623030; v=1; b=JYEx+skoxx8JnsYb2lIWbJ0Xdi4ddbeRdCLaXFVzJlofT4kWcudKpCo6Puq/X8p20Kxt15jW NdeeJjyFNhlShO20oYa7PS7d5VF0N3YzVDKA4BaR2eRyHPNiv+XggkiUbIwV0r7NKZXEfH1qAc0 QeRtA4TYu2p6KHvSbdng/W9s= X-Received: by 127.0.0.2 with SMTP id UgaIYY7687511xkiKT4VtNwx; Thu, 22 Feb 2024 09:30:30 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.63]) by mx.groups.io with SMTP id smtpd.web10.19077.1708623029774765774 for ; Thu, 22 Feb 2024 09:30:29 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HML1v6JqCcgjHX61mvVx+L6BiWli7sl/LVFB6poIjnjvT6gZ0U3xnOYtccNkNfTwx8btPpvXrtmbcOyp9m9PV51G3PDceOndPcFUrier9NNEs3nIJIKNNo6+Myh1QASp4KOhKy0CP4iwgp7VXBBWqHjqE32jAOGjuO2mpETE2ozD39uYG/dzYezpwqvmYWdny0nP2AE2Y8yrMr/lDOui3HtDvNyQHfvSq3ydJ0m+BwqyfUkhZMM1szwh1DJzjPLjyQRIdh+GeaCxDi8XxyEI8ahXfyIXykRbOZtNsTkfCANZq3ay9bqysEIiyo0sOdMAl5k0RcO2eKLaEshL/z/2ug== 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=37gJZ8LyUUYSzkLKKWo6s67wJfx+CgQ7Yeym2ediAro=; b=GPzlI/1xFEQ1AvMMvk2qgqVK9AyUzrUR2MUcmkxmdYV8tDA/7Y05g+nSH8Aeu+iq1xttO+E9MOaJX751hLGoka2KDKrek/qElVgxo2u5koo4B/CiqkAQxyb10c3zeONPyHfTdGmf3aiUQLehYcZNMO9Jcq81GguolbnEw76mDXxzwnMMxLOjEqdqp2QlefFY2EPBlkI2NsI0bw1eKPqD5VhWXhZOu2HtGDVAy0TEV9axtXi1U+bd61UAEipI6j3wqyIWllh7kjwHGHzzCWlaXE7mOu4EsAHYG/3d2LlgqK+P/tPaLj/EiRUDgsLmNy0ZJIU4REepN7EbyuNXnjXSZA== 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 BN0PR04CA0089.namprd04.prod.outlook.com (2603:10b6:408:ea::34) by DS7PR12MB5768.namprd12.prod.outlook.com (2603:10b6:8:77::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.20; Thu, 22 Feb 2024 17:30:27 +0000 X-Received: from BN2PEPF000044A5.namprd04.prod.outlook.com (2603:10b6:408:ea:cafe::9f) by BN0PR04CA0089.outlook.office365.com (2603:10b6:408:ea::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.44 via Frontend Transport; Thu, 22 Feb 2024 17:30:26 +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 BN2PEPF000044A5.mail.protection.outlook.com (10.167.243.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.25 via Frontend Transport; Thu, 22 Feb 2024 17:30:26 +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.35; Thu, 22 Feb 2024 11:30:25 -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 v2 02/23] MdePkg: GHCB APIC ID retrieval support definitions Date: Thu, 22 Feb 2024 11:29:41 -0600 Message-ID: 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: BN2PEPF000044A5:EE_|DS7PR12MB5768:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f2a3c94-f3d0-4c03-289a-08dc33cbf573 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: k02amqCHbaCIJpGPDH5pjlOSK+FAww5sEtUFYXnOKIyG5XYx5/f8sb+CiqA4pnTLkb2LmiqM8g5t7XxV2iAqLcx0CrC/8oilz5L6LTgew/C1djY45hJ/wbefrf8PoTH00EO4raUK9q59OrJsH92OzihyAYkSOkzNkLJd0XhoEp1veB9YXrSfK3InqAHqtz4j0/l0UD3YWqq+20KHs2LOr8mzBigPdY4johQHYMC05xRrimwrEKWp6PvmKGQF4g7zpHrWxlBzGtUXmHybRHUAT90m1kktZ9DuXll1Vg2KI8MBU5yJvtBmJTNEKDMek8v2qB/cOAq7GCCZtLO/zjKH3xacE2Qe/oYRw9iWkoQFHi4g3joUut9+6tPaGefqKbMKoHG8W5QHOWvUwH+cA3zK//d0CyjGFFqrKzhc3/W7OaniXNiA31ehWsmO7X6slWD7n/S+wR3SmSF6m9Ef/2KXHa6MnpveJ9CtGEi74ZDbGVjkof5/696AxHBzOt1x5CxhOE3B3FxUds1Hy4kjkZSX3c2dKqbpg9PCf/MOHzDzC3/IZWH82SKWzroCvoEK/dZ6SY9DGwmd8IIUz/dJhMuez8L7jBY3mO11oJdZIaA/8B7MPbYc9I8HAu3rneZwTENf3zZO8vTtUFq5KoZUXnVR8g== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2024 17:30:26.8797 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f2a3c94-f3d0-4c03-289a-08dc33cbf573 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: BN2PEPF000044A5.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5768 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: binhoQbtV6vxgfrqPiCyDcZvx7686176AA= 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=JYEx+sko; 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=pass (policy=none) header.from=groups.io; 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. Acked-by: Gerd Hoffmann Signed-off-by: Tom Lendacky --- MdePkg/MdePkg.dec | 5 ++++- MdePkg/Include/Register/Amd/Ghcb.h | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 0459418906f8..7d3f54a46f54 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -9,7 +9,7 @@ # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP
# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.
# Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
-# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2023 - 2024, Advanced Micro Devices, Inc. All rights reser= ved.
# Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -876,6 +876,9 @@ [Guids] ## Include/Protocol/CcMeasurement.h gEfiCcFinalEventsTableGuid =3D { 0xdd4a4648, 0x2de7, 0x4665, { 0x96,= 0x4d, 0x21, 0xd9, 0xef, 0x5f, 0xb4, 0x46 }} =20 + ## Include/Register/Amd/Ghcb.h + gEfiApicIdsGuid =3D { 0xbc964338, 0xee39, 0x4fc8, { 0xa2,= 0x24, 0x10, 0x10, 0x8b, 0x17, 0x80, 0x1b }} + [Guids.IA32, Guids.X64] ## Include/Guid/Cper.h gEfiIa32X64ErrorTypeCacheCheckGuid =3D { 0xA55701F5, 0xE3EF, 0x43de, { 0= xAC, 0x72, 0x24, 0x9B, 0x57, 0x3F, 0xAD, 0x2C }} diff --git a/MdePkg/Include/Register/Amd/Ghcb.h b/MdePkg/Include/Register/A= md/Ghcb.h index dab396f3ede8..432d67e3e223 100644 --- a/MdePkg/Include/Register/Amd/Ghcb.h +++ b/MdePkg/Include/Register/Amd/Ghcb.h @@ -4,7 +4,7 @@ Provides data types allowing an SEV-ES guest to interact with the hyperv= isor using the GHCB protocol. =20 - Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved. + Copyright (C) 2020 - 2024, Advanced Micro Devices, Inc. All rights reser= ved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Specification Reference: @@ -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. @@ -202,6 +204,18 @@ typedef struct { SNP_PAGE_STATE_ENTRY Entry[SNP_PAGE_STATE_MAX_ENTRY]; } SNP_PAGE_STATE_CHANGE_INFO; =20 +// +// Get APIC IDs +// +#define EFI_APIC_IDS_GUID \ + { 0xbc964338, 0xee39, 0x4fc8, { 0xa2, 0x24, 0x10, 0x10, 0x8b, 0x17, 0x80= , 0x1b }} +extern EFI_GUID gEfiApicIdsGuid; + +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 (#115837): https://edk2.groups.io/g/devel/message/115837 Mute This Topic: https://groups.io/mt/104512930/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-