From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (NAM02-BN1-obe.outbound.protection.outlook.com [40.107.212.43]) by mx.groups.io with SMTP id smtpd.web10.2403.1682493773482677043 for ; Wed, 26 Apr 2023 00:22:53 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=HCdQ2J74; 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.212.43, mailfrom: abdullateef.attar@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k+TeQj9Gt12J9CnIekpy2uNSeIwn7sXyRnQ602/Kn5OzWZnXpL3qycFZuCOfzbmJeytfF4e1wfE757hniTWsqegqaxjJaERqbbr3bV24nNg0nufur0Nb6YUnhV1ifpupyPD1e0KtGVa1K2ZkXmyS+JpIofQKhnlzEtE/F0BjiK2nn7rLO2AWK2VJ9IQFA5Vu6osFx67ggBJH8EzcrZlmCDAh5Kf3bcMXs0SxHhX+PgleDInJU4yXDjHWFh0WZW7PR+LSHOCZhyfcetSivuHBQmAl7CXfNYYSn1Q9HXECArt5YDrl3Uv8L6VOAXrIAdLj+zfhRHadRn96Sk7qb5pCrQ== 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=ZWF2vq43Rm2bDIwjS4q5PTZ8tqd0GFIwRY1q6aR0vh4=; b=Ahm7130ILB7tEKNp1RM6zMRd+Dsc+jZqTIxm2BcGfAfhZJk5Y/UZ9E8PtIGIl/wtA5k6GdG1HlMHy3cQ0i9uCXdaOjBAE3uZGKrjc1QPQ9Cm4/LS5dWZNmxZh745x/9J3W/spa+ElsthnTNQvQEp41mTojN4uksxg4w1BjigJiFZfMye7lE8fHTy8AfjQXjG7OqOnzwLYIq50L5GCZktkvk1IwqGPQ46bg9U1cSVB4fav6QdANuBHc9y6hQesUUVA1KRTyXATFsS5wAwJdeVFsUc+0dJYl4y+BDaEuVRLbZ/qjPUW7RqqZNKgUQOLcGwPOXLN/QaojU1IEVbjTpubw== 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=ZWF2vq43Rm2bDIwjS4q5PTZ8tqd0GFIwRY1q6aR0vh4=; b=HCdQ2J7449b4Am4Lv8j82seN5Bf4GZkXpOkX9Zx2so0E1E9sLO6GJesFs0e47HwdzIopu27EgdlIj2II3rZGbxUDT1sGabwQYzVxBLRL4xcWhw7ZzgOCXrcQ0XrzRCDM3evYx312hizbM6rFymbXvRCGkf4rf5vYf9IwUp0U2A0= Received: from MN2PR03CA0028.namprd03.prod.outlook.com (2603:10b6:208:23a::33) by IA0PR12MB7723.namprd12.prod.outlook.com (2603:10b6:208:431::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.21; Wed, 26 Apr 2023 07:22:50 +0000 Received: from BL02EPF000145B9.namprd05.prod.outlook.com (2603:10b6:208:23a:cafe::11) by MN2PR03CA0028.outlook.office365.com (2603:10b6:208:23a::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.21 via Frontend Transport; Wed, 26 Apr 2023 07:22:50 +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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BL02EPF000145B9.mail.protection.outlook.com (10.167.241.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6340.16 via Frontend Transport; Wed, 26 Apr 2023 07:22:50 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 26 Apr 2023 02:22:37 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 26 Apr 2023 00:22:37 -0700 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; Wed, 26 Apr 2023 02:22:32 -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 v9 0/9] Adds AmdSmmCpuFeaturesLib and MmSaveStateLib Date: Wed, 26 Apr 2023 12:52:18 +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: BL02EPF000145B9:EE_|IA0PR12MB7723:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e92abc1-105e-4d70-8702-08db46270b35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bpz95PbkB9NnPBF7InIA+X2XxziHYH8rYRWEQ8Fd9zSXa0/cb5Bqk6dwiYDbmrHICJG2b12WTQt3Ap+C6P0xH2C5rkiC+Sp/807lxwLyxZBrTgWBjpD30o2WzYJ6LNidBUmCtzDlxfAQu98+Bh50CiT864Ac8ZPAoqy5zQW5Aoa4Sa+9RsSXZ4H3/YbaGf5tydmym4pCCQgmhT4PyYiepIiGG5kpNKxqLNVOTgXsufjiHPaELwv49XiTttUWRN9AA131GBbX7GQfELYK/EKmMULgV3vhEkE/zi96vGD79nmoWD/xFKiz76J+DY8vFGA7eV0wIawzQwqaGpy89eZjw0j99M2OdR1yzyDsPgx49ShTn9VE/hHIvfnfHGBW40tR8rkqDLVsU1w1+LSNXzFd6vU5Fj6q3n723hUFBRIolZ/4AHPd5t5RAHsvjurkwIsUwl7ccyoOICwQLvgzdEvjQhuqbjy7WssWXc7awaDiI/htrR5IxadHJ67zuX9MAEbLikmAgyoe9xXWeuiwz3TViADSjt3QcKgcxBIsqty1Fwnghj0kDcXhB5YcbDg3+I8vs+3KmlAkWDD6dgo/pgadtM4B2vNNsxw3b8BkBV1BA/KvwDltpV4u3jazxyxdBiwZdVYbz3XEHXt+NvJfNwByDwVNCX48eBvuYdYk0oox6XR5eghQt2XFNvSN4eMbU/SIjmy3jkNKF0FoM3WRUR3I/HYJ0ookiCpv/tdLOm9F8gfm55mUjzWjq57rKR9AjpZK X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(6029001)(4636009)(136003)(396003)(39860400002)(376002)(346002)(451199021)(40470700004)(46966006)(36840700001)(7696005)(6666004)(966005)(36756003)(36860700001)(83380400001)(47076005)(2906002)(40480700001)(186003)(26005)(54906003)(19627235002)(2616005)(426003)(336012)(478600001)(82310400005)(6916009)(4326008)(316002)(82740400003)(81166007)(41300700001)(356005)(40460700003)(5660300002)(8936002)(70586007)(8676002)(70206006)(7416002)(213903007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2023 07:22:50.8158 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e92abc1-105e-4d70-8702-08db46270b35 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000145B9.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7723 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain PR: https://github.com/tianocore/edk2/pull/4282 V9: Delta changes: Addressed review comments. Rename to MmSaveStateLib. Also rename SMM_ defines to MM_. Implemented OVMF MmSaveStateLib. Removes SmmCpuFeaturesReadSaveStateRegister and SmmCpuFeaturesWriteSaveSt= ateRegister function interface. 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 MmSaveStateLib library class UefiCpuPkg: Implements MmSaveStateLib library instance UefiCpuPkg/SmmCpuFeaturesLib: Restructure arch-dependent code UefiCpuPkg: Implements SmmCpuFeaturesLib for AMD Family UefiCpuPkg: Implements MmSaveStateLib for Intel UefiCpuPkg: Implements MmSaveStateLib for Ovmf UefiCpuPkg: Removes SmmCpuFeaturesReadSaveStateRegister OvmfPkg: Uses MmSaveStateLib library UefiCpuPkg/UefiCpuPkg.dec | 4 + OvmfPkg/OvmfPkgIa32.dsc | 1 + OvmfPkg/OvmfPkgIa32X64.dsc | 3 + OvmfPkg/OvmfPkgX64.dsc | 1 + UefiCpuPkg/UefiCpuPkg.dsc | 25 + .../MmSaveStateLib/AmdMmSaveStateLib.inf | 28 + .../MmSaveStateLib/IntelMmSaveStateLib.inf | 28 + .../MmSaveStateLib/OvmfMmSaveStateLib.inf | 29 + .../AmdSmmCpuFeaturesLib.inf | 38 + UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 2 + .../Include/Register/Amd/SmramSaveStateMap.h | 194 +++++ UefiCpuPkg/Include/Library/MmSaveStateLib.h | 70 ++ .../Include/Library/SmmCpuFeaturesLib.h | 52 -- .../Library/MmSaveStateLib/MmSaveState.h | 102 +++ UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 56 +- .../SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 767 ------------------ .../Library/MmSaveStateLib/AmdMmSaveState.c | 309 +++++++ .../Library/MmSaveStateLib/IntelMmSaveState.c | 413 ++++++++++ .../MmSaveStateLib/MmSaveStateCommon.c | 138 ++++ .../Library/MmSaveStateLib/OvmfMmSaveState.c | 612 ++++++++++++++ .../SmmCpuFeaturesLib/AmdSmmCpuFeaturesLib.c | 387 +++++++++ .../IntelSmmCpuFeaturesLib.c | 70 ++ .../SmmCpuFeaturesLibCommon.c | 128 --- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 11 +- UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c | 500 +----------- MdePkg/MdePkg.ci.yaml | 4 +- UefiCpuPkg/UefiCpuPkg.ci.yaml | 1 + 27 files changed, 2465 insertions(+), 1508 deletions(-) create mode 100644 UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveStateLib.inf create mode 100644 UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveStateLib.i= nf create mode 100644 UefiCpuPkg/Library/MmSaveStateLib/OvmfMmSaveStateLib.in= f create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesL= ib.inf create mode 100644 MdePkg/Include/Register/Amd/SmramSaveStateMap.h create mode 100644 UefiCpuPkg/Include/Library/MmSaveStateLib.h create mode 100644 UefiCpuPkg/Library/MmSaveStateLib/MmSaveState.h create mode 100644 UefiCpuPkg/Library/MmSaveStateLib/AmdMmSaveState.c create mode 100644 UefiCpuPkg/Library/MmSaveStateLib/IntelMmSaveState.c create mode 100644 UefiCpuPkg/Library/MmSaveStateLib/MmSaveStateCommon.c create mode 100644 UefiCpuPkg/Library/MmSaveStateLib/OvmfMmSaveState.c create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/AmdSmmCpuFeaturesL= ib.c --=20 2.25.1