From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.47]) by mx.groups.io with SMTP id smtpd.web11.27959.1683346036323861170 for ; Fri, 05 May 2023 21:07:16 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=2HORUGQm; 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.244.47, mailfrom: abdullateef.attar@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wb1YGcvZSgz4SxV8Fh6gzd9Dd7eg6GzOejVWBOuriJTaB24ZCehzNlJMkuWo4G2ciZO2EiyUTEOCdJK5xHfwaam+4z4OZ/NNcowbDf0aOF0HPFy+0Q4cFMQzpZO1uiz7hnN6wMPGttlB4GUBdw2itqUpkL8BI6EcR0iGn3hwnpVgd35zYhNQ2naDOgzYpTmUkt4ThViHTdN5E/UmAZYjU4FezJLE2bbmvhcUmC4nmhZx8ZnIEVFqrvWBw5s1+1TDiqY+OIMYeeS38o9UdcBuf/bZZS1JGEpcmWN5k2+2N73YRnnr6BzJ5FWbXnAyNE05Ex4c0DShtgMOc2BxUxH23w== 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=bhsXjOANl/atQVjdVF7aFP/BHP/JzJJMHxrYkYRUuWo=; b=j4gJTO0qQXIH2vTlxX4diB/a8RGub1/OgGVj9Q40Idl3YKcTbHF3dTGLO5WarxdPFZoz38sx8syfuGS5gI7nzfnVVjdc8QzPeB38G9xl5S6kUJ5mJN4IBGt76G8Qhwww2ApQjQL+JUc8HZbtqV8Z6ZgxE1REtQxReIpbTL0uo5hTb29mvPByOtlqxma0pW+oRjodg4fQnPFDDU6OShwmu/Sh61x+266StJnSGdVq1dT0fdlFNtY19PGAZkGvjer9s85qXQv1vFAriyU4sxZTzk7f5gyVHZlXAE2nljBazP/0m2RBRGtVS2Fx2jNu5X0zEJapqCuxiWcyz5Ho/2INIw== 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=bhsXjOANl/atQVjdVF7aFP/BHP/JzJJMHxrYkYRUuWo=; b=2HORUGQmvWzkwfFLheIQsaMvfcTqwY92fgU4W6HDT3c9/zElgjm+YAXZAdzuv3Sr/meddzVUY3btSfIYIr1XVtkCKHL41IzYw6dOl1HeTR5obbEtj5pWriVmMITRsgLTUs3BXKsFG5FfnkIyes2R89a/AoyRFSLsvTaqlvsXS7o= Received: from MW4PR02CA0016.namprd02.prod.outlook.com (2603:10b6:303:16d::22) by BL0PR12MB5508.namprd12.prod.outlook.com (2603:10b6:208:1c1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.29; Sat, 6 May 2023 04:07:12 +0000 Received: from CO1PEPF000042AE.namprd03.prod.outlook.com (2603:10b6:303:16d:cafe::86) by MW4PR02CA0016.outlook.office365.com (2603:10b6:303:16d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.27 via Frontend Transport; Sat, 6 May 2023 04:07:12 +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 CO1PEPF000042AE.mail.protection.outlook.com (10.167.243.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6363.21 via Frontend Transport; Sat, 6 May 2023 04:07:11 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Fri, 5 May 2023 23:07:11 -0500 Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Fri, 5 May 2023 23:07:07 -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 v11 0/8] Adds AmdSmmCpuFeaturesLib and MmSaveStateLib Date: Sat, 6 May 2023 09:36:56 +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: CO1PEPF000042AE:EE_|BL0PR12MB5508:EE_ X-MS-Office365-Filtering-Correlation-Id: 5837367a-476b-4221-a1f5-08db4de75e76 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VMco5Vvble7/nGZP3wslOapZMUReS9SXLCLNK5Jpg4B1Q2JnCoZOnzvJ/vS41HNP6Q9Yl7EJkCUrQyH4tyUc8Eq203myB5xCRzEqJnnYQTMIIXWtvw7S9EoifjF8GLIVXLbvVR0Xo8rrlXa7bACCzUu8tC0gmfRa/3M4+6PCnS3RDeGMQHSLW0eXTzBingsPTcV+2XxPuHQl914zL/iAfpc6jLPr68wUz5AvDEsiU01Usj57rQN8u8yiW1Cgm0/UXKPFUCLm+BjWRaDK0shAxy+b1bYuOUbGqk73DoFG6igXvXcb04c1eHDv9o1V/Soud7YMv8VhtmssKVJ1xp/63IpJ7VaUNcApg5555uJ4gqYQoR7OfbyC7Bo0598vpyAx01hm++eB2falhNmsguINGTAzfyDOnTwn99Xorb1NVhKn4jjWUTdoy6yEkrtt/OGVqfTC8WBr38pgqN2BSoWvE+poMSop0wdGrU8ydO61UeTwoKRJE0YZVR4OpPTMP25ARJscQF0MfgDNUx6RuVAvzAoQyRMxute4Af5UrKgIHhKalGop/WOClOO1DOIZmE9rkB/zoqBNLV1XoJPP20f0qAY1VzGA+bPnrIfxpOw6isnQiayMpFyybxT0YeyP0DSAhkwsh/kfgOMW1U95eio2okakhICBt4hm+EPuDSQapUMwnFzElhGHDEbg2k4ydnitRbAgd8/NkM+VZ/JxqxYuCSxYkcX4VCLe5bf+71bb/0lh6ApIlnHmY431Oo+Fl7dj 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)(39860400002)(396003)(136003)(346002)(376002)(451199021)(40470700004)(36840700001)(46966006)(7416002)(8676002)(8936002)(40480700001)(966005)(7696005)(6916009)(70586007)(70206006)(4326008)(82740400003)(81166007)(356005)(5660300002)(40460700003)(36756003)(82310400005)(478600001)(336012)(426003)(83380400001)(2616005)(26005)(47076005)(41300700001)(19627235002)(2906002)(186003)(316002)(54906003)(36860700001)(6666004)(213903007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2023 04:07:11.9268 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5837367a-476b-4221-a1f5-08db4de75e76 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: CO1PEPF000042AE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB5508 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain PR: https://github.com/tianocore/edk2/pull/4341 V11: Delta changes Drop the OVMF implementation of MmSaveStateLib 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 (8): 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: 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 | 14 + .../MmSaveStateLib/AmdMmSaveStateLib.inf | 28 + .../MmSaveStateLib/IntelMmSaveStateLib.inf | 28 + .../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 ++++ .../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 +- 24 files changed, 1812 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/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/SmmCpuFeaturesLib/AmdSmmCpuFeaturesL= ib.c --=20 2.25.1