From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=helo; client-ip=104.47.38.53; helo=nam02-bl2-obe.outbound.protection.outlook.com; envelope-from=leo.duran@amd.com; receiver=edk2-devel@lists.01.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0053.outbound.protection.outlook.com [104.47.38.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1098521A0482A for ; Wed, 11 Oct 2017 12:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4T7PDVuQ9tsNEjxK+ggxUfFkUWocAlvAjAuEROj5i6Q=; b=MBmXjjN032DGuC2OyUSIu8Ebt2TgQWJtdFJeyS5TYkiL/GrnpOfqQgW5VO+WmyYtuwqGP4E9uhreJiaJrMbLlK3agsCxuZPwHjPeALa+8PawB+ouo9u8kf8+u2M2LN35UndO8zgkxDB8c6nx4axVdi3zW5wXbfI4dd5jJUNWrSM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by DM5PR12MB1243.namprd12.prod.outlook.com (10.168.237.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 11 Oct 2017 19:45:41 +0000 From: Leo Duran To: edk2-devel@lists.01.org Date: Wed, 11 Oct 2017 14:45:29 -0500 Message-Id: <1507751131-32404-1-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CO2PR05CA0063.namprd05.prod.outlook.com (10.166.88.159) To DM5PR12MB1243.namprd12.prod.outlook.com (10.168.237.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ec3f129-f5a2-430a-a207-08d510e0a800 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR12MB1243; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1243; 3:4QTqfZ5uLs9uZmwEOH9JXGW3zR+j0/2N7tYPk88BkksF93QGQgtSLtPiD63e8VUdhHhNzpuI4wIz7DMwF8ZyWp3l8MHgYxC0j3y3gKk15IFdwaxumSi0Ajv5yI206woQeIsFEuMWTYwd3YWleT+B5smrWeQTrs1IwOZYPf1MTb+ASTU8D7MMI+/8KIGOyRbMdBbckTuwwaI0fSafJs2hd9eeLPvsNA+yhfNMS3xazIkBhWJXKRSUT2cekR99fiPl; 25:WFvwOMkE8qJL93enQQq+xehRGPA6H5s3sMAPy8wcuSmbtxeJllJwZMlCP1EZweEXwyDRLA0x/VD7dt/96iXde5hNQJOOveZFQE+2W+Hj6nA9bOvfJVAnPGjIWiTveETlvTi7mUDqZOLvQZVzyo8q44zW0+8Xw1yiWCCuKP7xj4Ofnr8mlGROj/pSxJf/fvn2L1UtoImYR6wAG3lAU0lV6nA2gi2yUt66aOT07KGTysgSvSH7vFz0lZx+2ZIq32bcKrWtIkMeSMEkj0qGzdt/tNvg8ZYC8jrCzKH/1jA7jRXW5SISfgN3e3GxkO2RqkJ86cLj2zr+mXWYTdiazOBsvw==; 31:VVyTjNS+rOSqwla/4JFUtXe0S4446PNnaYVcQlfZd9GeCmHffGpXacb38v2pOXD+2wZy3rWz3OTm7zrmgxBLRl0BUy1VQtrme2Sdu65MrIzqKupPQOyp4fYD8fsMB3j2aakuCt55/W4kKY6BFVsaxnoe1bG6lxv5pBmw1sEsk3jQccv7qGxZT4TZL/JYGVH380iR8aHitV0CWAIJ++42KT6ed85y7o0bYuTHVfSpGJg= X-MS-TrafficTypeDiagnostic: DM5PR12MB1243: X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1243; 20:5TV0lklIZisSJgV07Lu6bPoAhIfWpn/TzEBJ8s/3ptINK1ElzwxA912+ql4FWsxm8BS+USxccLL6NKFp6sNJujXO1k36m0/hfoXhCprEBpheyYNL9RmBL5LJbgFjKvhQR2k2OewsjApAyIRVvq/Cs0E846bXdF3TiVMZVlEqlj7ZhFGZoy9yEGfa3rgDPWCDmomJh6yGIlkvWV0K7Kc/dcXtpalAay/GFk2bjuLm9XGkMEdyA7K2yVSjJCu13+OY6DFQGc95W4Rf4WuYBajqDrYLeh8pJzwFw42eKMNvgagq/BzAyfoeJEDfPPMjWfoj/dfXy6yb9l8w2WHvygai0RCyX6/vbjma1A+CXktEPrq1Yh8E3xh3xCJcCqeDtNWVnMFFJ8H5uGKPG5LbKgAnmH3Y9gMWfiqsFCsS2w2Rfce8L87JSiIiUOEgbKNh4Q74S86OlAZIn1flAkfrOFb6/DdGMSEwLmQNX+hYVFgoc+je79UtFiMPNzX+NbWZr4zR; 4:sI1HPNYaezDehZXTh5aNqZHMSOuNCt6nhepwvOqP1q922TWUQhQvMehmJQ8IWROfbx6v14aOBP2IUxnR4pVeI77wMoNTFuPcLuF/R3LJ97VYYZg4m582ZF3urQRkwzHWBsCGe2TM5oG8SycguG2ye1Ax15LbqXxtR6akKEeapsBNfQsKJ4rQK76e9agMAd01+ubJFB2C8zzgSdMAqrSJMequ/Lnw7T5whcJ3YsdikrIZ+Sp5Y4vI4ca8novNcQ5zEEeJGKqOnVs9OVZBoB8dAh43acGgVdomGR96FxOwASY= X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123564025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR12MB1243; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR12MB1243; X-Forefront-PRVS: 0457F11EAF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(199003)(189002)(36756003)(68736007)(189998001)(16526018)(53936002)(16586007)(50466002)(2906002)(81156014)(3846002)(48376002)(316002)(305945005)(81166006)(8676002)(86362001)(6116002)(97736004)(478600001)(8936002)(7736002)(2351001)(5003940100001)(2361001)(53416004)(6666003)(50986999)(6486002)(25786009)(106356001)(4326008)(5660300001)(105586002)(66066001)(50226002)(47776003)(33646002)(101416001)(6916009)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1243; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB1243; 23:VTTwN/crbbvcUdlwAR70Zu5PrkrowU6z/e9xL/bbm?= =?us-ascii?Q?9bmLN1ovS52WumKA6xURZuTerml72yo2RDYLRt/Ttv8+xopNM9CTDmXuJCpW?= =?us-ascii?Q?FAt5fGsBEjrxNiuCG9w7jCYd0wAFt16RZaNFuYp156Gl1gSBDqE/hLJQUxN+?= =?us-ascii?Q?bV4sDQAypJVg3KmBq+ryviz4II1XeV0TJG7jogMPlRet1PbCxbOefI9HBsWD?= =?us-ascii?Q?ZJ1qHSzSh5Lv8c63KdKbLm0Oa53g6KN9tLwafO25AkWx8ujpmsi2JmgmIsqO?= =?us-ascii?Q?u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pKVITfGBEbsYTzJ4czNTRyf5kHo5VrpdrWPneCt7prMihjBZ1yBbTgQRv1h/962t6aHCgKDzgk5N0/WL9v8WWc/Xy3s5QW0K8fsu2/l/n X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2017 19:45:41.6531 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1243 Subject: [PATCH v5 0/2] Enhanced SMM support for AMD-based x86 systems. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 19:42:14 -0000 Content-Type: text/plain This patch-set replaces Intel-specific macros with global variables to provide support for AMD-based x86 systems. The replaced macros are: 1) SRAM_SAVE_STATE_MAP_OFFSET 2) TXT_SMM_PSD_OFFSET 3) SMM_PSD_OFFSET Changes since v4: Make runtime CPUID checks and use global variables instead of PCD's. Changes since v3: Correction on cover letter. Changes since v2: The intent of this revision is to maintain compatibility with existing packages. To that end, changes to OvmgfPkg and QuarkSocPkg are reverted. Moreover, pertinent macros are replaced in the C code, rather than on header files that are shared globally. Changes since v1: Revision to Cc list for UefiCpuPkg. Leo Duran (2): UefiCpuPkg/SmmCpuFeaturesLib: Use global variables to replace macros UefiCpuPkg/PiSmmCpuDxeSmm: Use global variables to replace macros .../Library/SmmCpuFeaturesLib/Ia32/SmiEntry.S | 28 ++++++--- .../Library/SmmCpuFeaturesLib/Ia32/SmiEntry.asm | 29 ++++++--- .../Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm | 43 +++++++++---- UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCommon.h | 48 +++++++++++++++ .../Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 59 +++++++++++++++--- .../SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf | 3 + .../SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf | 3 + UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c | 39 ++++++++++-- .../Library/SmmCpuFeaturesLib/X64/SmiEntry.S | 28 ++++++--- .../Library/SmmCpuFeaturesLib/X64/SmiEntry.asm | 30 ++++++--- .../Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm | 47 ++++++++++---- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Semaphore.c | 22 ++++--- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.S | 28 ++++++--- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.asm | 21 +++++-- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm | 43 +++++++++---- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 72 ++++++++++++++++++++-- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 17 ++++- UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 18 +++--- UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c | 20 +++--- UefiCpuPkg/PiSmmCpuDxeSmm/X64/Semaphore.c | 22 ++++--- UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.S | 34 ++++++---- UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.asm | 22 +++++-- UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm | 45 ++++++++++---- 23 files changed, 547 insertions(+), 174 deletions(-) create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCommon.h -- 2.7.4