From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.82]) by mx.groups.io with SMTP id smtpd.web10.42240.1681125003294672929 for ; Mon, 10 Apr 2023 04:10:03 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=miQB9apF; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.237.82, mailfrom: abdullateef.attar@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f1xm/565vyMhe9kg8oryhClrS7tJTREBKkByShYsc2qEAQSviJhN3XceboV4RqqEP97aIRMp9OACSuuknaMAXB9YbLS6RTC4tLv2BxFBvpaNy8OwEKtuPMk3lFX8txp7jQhR5W7qxLBVqeYbt/VD4PdYJORoxWyJ7mTFULpgZdCCoKghJ1w680SDkSfS/lGuCVULQYJjE5IflCcE9tm0gPWUKqswiL7+E1XjBtJglEfMfIw8fhvH2imA1opv7IdZT1m0aa76LCFbTXX9StHWxsZKMw1+Vsl3DQlSdP+kMIfpXuXkEKXG18TrLIFSiv7D9XkCPOqCx3j13NsbEg+ZKw== 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=w1H7yid2Yd3fx8e97MWnl8gv0fLDi0aaPVajp72QWbk=; b=AHG5oMdCRaPiSgON63cGXJvVpWybsg5HNiZa/8YymRtk+pldkhnK7S+3GBLmm22CgQlYBzrhv2E6dJ0qJckEyMrIs1GOI3opzF3kmjKC+7M5yR4FMEHPlKpFw8atyYVkexV7iSn/bINPT+XRpt2dh3nSGF1e859UDzsz1bP+eehoMGEUYlwCv80LKK93uoUt/rPYnUcLBXDQnh/x+5VTmpEJy1JzrcE+dyNTH9zWl0lL/hDvoLL6k09CSRlP4zDB/ueVF6kOpzaGGteuNAVURgzD5BGVKw+f3tb5JRzgMwtgH7gTVNkzEW5XLy0waFd2YcUdH6HYRhXNcIt3sTEn3w== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w1H7yid2Yd3fx8e97MWnl8gv0fLDi0aaPVajp72QWbk=; b=miQB9apFc74n05ihtj/NLMX/Nej5FkaK2pmRp3zqkYveNpuqVGO1Klp+SG8W1h89AC7n74sPjepZKmjPKV1w6NsY0Gh2U2GI+nYHVBRf7eF6XaKsTCRQkynF0UJOtOn6hE3DkYxv9CAuyaHMP0TjeDUJBDMgWHfEd7Eg26tGlzI= Received: from BN9PR03CA0301.namprd03.prod.outlook.com (2603:10b6:408:112::6) by CH3PR12MB8353.namprd12.prod.outlook.com (2603:10b6:610:12c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Mon, 10 Apr 2023 11:09:59 +0000 Received: from BN8NAM11FT023.eop-nam11.prod.protection.outlook.com (2603:10b6:408:112:cafe::93) by BN9PR03CA0301.outlook.office365.com (2603:10b6:408:112::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38 via Frontend Transport; Mon, 10 Apr 2023 11:09:58 +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 Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT023.mail.protection.outlook.com (10.13.177.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.20 via Frontend Transport; Mon, 10 Apr 2023 11:09:58 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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.2375.34; Mon, 10 Apr 2023 06:09:56 -0500 Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 10 Apr 2023 06:09:52 -0500 From: "Abdul Lateef Attar" To: CC: Abdul Lateef Attar , Paul Grimes , Garrett Kirkendall , Abner Chang , Eric Dong , Ray Ni , Rahul Kumar , Gerd Hoffmann , Michael D Kinney , "Liming Gao" , Zhiguang Liu , "Ard Biesheuvel" , Jiewen Yao , Jordan Justen Subject: [PATCH v8 0/9] Adds AmdSmmCpuFeaturesLib and SmmSmramSaveStateLib Date: Mon, 10 Apr 2023 16:39:39 +0530 Message-ID: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Return-Path: AbdulLateef.Attar@amd.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT023:EE_|CH3PR12MB8353:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bdce718-8857-4ac1-d0cf-08db39b41f89 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ttCEtN12brSSIAQQUhrIJXLOUkeUX4IxRBJj/Ml66Ok9u168rVpNrP8TT1ufeZJ6jOrDMZ3MXvRJbgxA1EGplvkYjn58C3dnq3FjrneYmj/O2RlbaMpcxKLHGLsYI7IarCtCysXJTPGjqo6AQic0HeFXooSDHjhztHoBk8dscbZ1q/axmkRcMN5muYJFmbyk2wVpoZhkSoOUgtjIRfNrmejbPzh7X5l4nS4XJ6h7cYW10AAOZ3nZujiLwD4arEdRD3TAz0RhMKaH36sZSHSIGFDbEP3qxDIZWsJ3kulh4Icged65GRO/jQc2A5C0y5+X8ktPHt/1aqsEebqEmAmb/xZGublUXS2VCqOLH6z6SRqkupNHN22+ZcQnAJatNncGMisb1ZmoqWCkLh12GD3x4kgZpUM00ii1U+fDCZwjzp3ZONyHyrjIRlCW0O5gZcHBCEPFtxI2LsYglxiKonz4y7hUuy8xLHulIX8CKdloFsugJjncgwBjF6thy3d4siYfKFVdnfkii85ZIThWblf4Fut1y//ldegSepUa9JbIauqfIAvPimUdc824Wkdplh2BUyJNOxlrYoT8CjOcrJfefAwq0msndnqCuyQvUOT1dux/OCmELVLyzbDdtFt0xeluvgL1GJiurt7KmuBS+dYsOKT4j5aBXGL0AHUaOFOHFcsY/y+RK/mXmVgs9bddxZqA15PXtdWAU5OnIKpsetPXCaaFcTu2ENoA6qq+V+XOLiZJbl//c2eQb9FFiGgxBN/A X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(376002)(396003)(346002)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(8936002)(6666004)(7696005)(40480700001)(40460700003)(7416002)(966005)(5660300002)(70586007)(8676002)(70206006)(6916009)(4326008)(478600001)(19627235002)(316002)(82310400005)(36860700001)(82740400003)(81166007)(356005)(54906003)(2906002)(26005)(2616005)(83380400001)(47076005)(336012)(426003)(186003)(41300700001)(36756003)(213903007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2023 11:09:58.8610 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bdce718-8857-4ac1-d0cf-08db39b41f89 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: BN8NAM11FT023.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8353 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain PR: https://github.com/tianocore/edk2/pull/4258 V8 delta changes: Addressed review comments from Abner, Fix the whitespace error. Seperate the Ovmf changes to another patch V7 delta changes: Adds SmmSmramSaveStateLib for Intel processor. Integrate SmmSmramSaveStateLib library. V6 delta changes: Addressed review comments for Ray NI. removed unnecessary EFIAPI. V5 delta changes: rebase to master branch. updated Reviewed-by V4 delta changes: rebase to master branch. added reviewed-by. V3 delta changes: Addressed review comments from Abner chang. Re-arranged patch order. Cc: Paul Grimes Cc: Garrett Kirkendall Cc: Abner Chang Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Abdul Lateef Attar Abdul Lateef Attar (9): MdePkg: Adds AMD SMRAM save state map UefiCpuPkg: Adds SmmSmramSaveStateLib library class UefiCpuPkg: Implements SmmSmramSaveStateLib library class UefiCpuPkg/SmmCpuFeaturesLib: Restructure arch-dependent code UefiCpuPkg: Initial implementation of AMD's SmmCpuFeaturesLib UefiCpuPkg: Implements SmmCpuFeaturesLib for AMD Family UefiCpuPkg: Implements SmmSmramSaveStateLib for Intel UefiCpuPkg: Uses SmmSmramSaveStateLib library OvmfPkg: Uses SmmSmramSaveStateLib library UefiCpuPkg/UefiCpuPkg.dec | 4 + OvmfPkg/OvmfPkgIa32X64.dsc | 2 + UefiCpuPkg/UefiCpuPkg.dsc | 15 + .../AmdSmmCpuFeaturesLib.inf | 38 ++ .../AmdSmmSmramSaveStateLib.inf | 28 + .../IntelSmmSmramSaveStateLib.inf | 28 + UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 2 + .../Include/Register/Amd/SmramSaveStateMap.h | 194 +++++++ .../Include/Library/SmmSmramSaveStateLib.h | 70 +++ .../SmmSmramSaveStateLib/SmramSaveState.h | 100 ++++ UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 2 + .../SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.c | 445 ++++++++++++++++ .../IntelSmmCpuFeaturesLib.c | 128 +++++ .../SmmCpuFeaturesLibCommon.c | 128 ----- .../SmmSmramSaveStateLib/AmdSmramSaveState.c | 286 ++++++++++ .../IntelSmramSaveState.c | 359 +++++++++++++ .../SmramSaveStateCommon.c | 232 ++++++++ UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 5 +- UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c | 500 +----------------- MdePkg/MdePkg.ci.yaml | 4 +- 20 files changed, 1941 insertions(+), 629 deletions(-) create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesL= ib.inf create mode 100644 UefiCpuPkg/Library/SmmSmramSaveStateLib/AmdSmmSmramSave= StateLib.inf create mode 100644 UefiCpuPkg/Library/SmmSmramSaveStateLib/IntelSmmSmramSa= veStateLib.inf create mode 100644 MdePkg/Include/Register/Amd/SmramSaveStateMap.h create mode 100644 UefiCpuPkg/Include/Library/SmmSmramSaveStateLib.h create mode 100644 UefiCpuPkg/Library/SmmSmramSaveStateLib/SmramSaveState.= h create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesL= ib.c create mode 100644 UefiCpuPkg/Library/SmmSmramSaveStateLib/AmdSmramSaveSta= te.c create mode 100644 UefiCpuPkg/Library/SmmSmramSaveStateLib/IntelSmramSaveS= tate.c create mode 100644 UefiCpuPkg/Library/SmmSmramSaveStateLib/SmramSaveStateC= ommon.c --=20 2.25.1