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.85]) by mx.groups.io with SMTP id smtpd.web10.43804.1683182372725098857 for ; Wed, 03 May 2023 23:39:33 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=2l5MJwz4; 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.85, mailfrom: abdullateef.attar@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GS16i2KTxtbS1PwuOGfG2TX2Jjh8UA2HHOjkru9zxzHBGyTMRsuEZv9RJuGMifIPGxbA2JdlEwVzP4eNMHs3EAdFQXOipUwTEOMCglgkG6TA005RO4Ts0dx4ALef1TnoKg2NwxqaJr41YttOyovxaEYRyotdOTQgzSlGGyy5qdGxc9lzdsO0uGCSs1LS1q3pwBdKzEVGALXWi8E9kvbgG7zcwH18UGPYGOMsOkQpc7RKjWKU2+XGwt2LrVv+e42k25ZZzYa8/IxKgbOYqm7o57MLbKcAsp5hXoMzUiv+LadSCdlyQ65ow7vZSdHx7BMSEi/QCkYgqhQEQDAEm2R7aA== 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=DwTb9XBpO/FJofXg5RlF1EydDcgbEA9Ok4SQIuAqbfY=; b=Fq9D6jchX2hiUD5ceZ4AY348lVeZQd/w8kQM8NWRN6GduV60UKyDffd0NUTZ9j6xqVe2CUlCoUsxWC8ASUIvpCfELYtkvEz3qFtDqYJB/tSIn6aW//mc0x8afLeQP7fgVZPoafuU2nP2dlI5yFWMCTOfav77yqkS7Cd82unemHPxxWu2hcW/TKLslB5nFD5yt3qAGLd7yFe+HBQyaSlePlWBjWtomSbp+Ss/G06eKenWOZDqs/LfQ/mGqbv2X6zl3hThA4pAik2BJbn5uR3Lrf84EIZekUOBpFccZVcfWuQJn1VbpFJjnISBEIdeP5AOTUKfOeiNjZIzq86kaRtx1g== 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=DwTb9XBpO/FJofXg5RlF1EydDcgbEA9Ok4SQIuAqbfY=; b=2l5MJwz414O46+aTB3foNh9a0+n9aURrG0og34+gj1Y9fec969DEbBkwcc2MCvZWTOTUX8fWCjne5qQDQemhXbRA8gZQpHGJ21sdfb6ulKHCFK+5QBo2sHYZyeXddPNOMStWfzaJq9FvDo5OYxf9jR+BWpXjVUriSvoObSQAXzs= Received: from BN9PR03CA0284.namprd03.prod.outlook.com (2603:10b6:408:f5::19) by MW4PR12MB5665.namprd12.prod.outlook.com (2603:10b6:303:187::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.22; Thu, 4 May 2023 06:39:29 +0000 Received: from BN8NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f5:cafe::c4) by BN9PR03CA0284.outlook.office365.com (2603:10b6:408:f5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.26 via Frontend Transport; Thu, 4 May 2023 06:39:28 +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 BN8NAM11FT054.mail.protection.outlook.com (10.13.177.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6363.22 via Frontend Transport; Thu, 4 May 2023 06:39:28 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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; Thu, 4 May 2023 01:39:28 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 4 May 2023 01:39:28 -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; Thu, 4 May 2023 01:39:24 -0500 From: "Abdul Lateef Attar" To: CC: Abdul Lateef Attar , Paul Grimes , 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 v10 0/9] Adds AmdSmmCpuFeaturesLib and MmSaveStateLib Date: Thu, 4 May 2023 12:09:12 +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: BN8NAM11FT054:EE_|MW4PR12MB5665:EE_ X-MS-Office365-Filtering-Correlation-Id: 5934b505-d0d7-411c-5ded-08db4c6a4f7c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d0r7JvWoHGTh5EiUCy8ybc6y459KahB6iYSIpCx0YX/KfwC1rj9qpFIiM/nmA3hB8anmfAzCcsOCvhXAon4xmCqBHY/V6TKU7ejNq0aDDPEhnLVQOai12v/dgO1Rox0lh4NA/QAuhLNftvFMGF4hLNpM0UAKpPzmQvnrN6GoMObyEwwuy3BDE7fxLtkyK2ZwD41XVt/mdQSf5ph2q+knq502iHTIntSNNrEpzTLLqwTa/vJOZVcpkqnamuFLev+2xo2FQQFrF3lmRTqhzXSvF3LyEDz/hcse5ZiQVj1fR5urIBZVf7o0YNCLnDZE/WlGEz+hPw7mi7hF9zKRnpkENSJIRmqxLiUtsuHN03awUBW1babqYWQal82w+ia6iYgDqcvUJBz53ApaaRfJ3SlE/D0o3Jaft62ZtyS4AVnR772H+8vc7Lv53VN4eTONpq8AWxrFHQ0S7OMpa7K82bYajlykYqkRZ+i3xKpLUlmTVV5RbA8vuDoqDfa9TmXIMxlWBnX+l28klGNgDfZzAegbmyxrLWEWXJKl5lUmoMBA/0tqYnsqnpFbV+jHSaAKp4C8/Lo8fOqgrmB/w7dQDHLaJ6ULCbtZ05TrQLP5HQu7nI9RIgP4I4l5gwVrZo59GZF0YjXbsI58tc4uex4bjVXTaXhylTfJ/rZVDlj+tPFk1T9diWvBPzXJfURBtGL/IJkg3WgrLNBt0PEYwzcksbwOWRaTgzu8jWdNmLlpA/lAK5lM6xPj9NDpSGJyzSmBSC8Z 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)(39860400002)(346002)(396003)(376002)(451199021)(46966006)(36840700001)(40470700004)(26005)(186003)(7416002)(2616005)(5660300002)(2906002)(426003)(336012)(83380400001)(47076005)(966005)(40480700001)(36860700001)(19627235002)(8936002)(8676002)(40460700003)(7696005)(82740400003)(81166007)(6666004)(70206006)(41300700001)(36756003)(356005)(82310400005)(478600001)(54906003)(6916009)(70586007)(316002)(4326008)(213903007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2023 06:39:28.6539 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5934b505-d0d7-411c-5ded-08db4c6a4f7c 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: BN8NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5665 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain PR: https://github.com/tianocore/edk2/pull/4329 V10: Delta changes: Addressed review comments from Abner. 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: 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 | 24 + .../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, 2464 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