From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.377.1686191300320666390 for ; Wed, 07 Jun 2023 19:28:20 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=j9Z8M/+C; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: dun.tan@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686191300; x=1717727300; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=OZuYWPxDZDMfJGzTKZsZRSjtzQixS0/M62WflWepJEI=; b=j9Z8M/+CppAw5caIRJjCEQ2aNOu59ojuQVofYq95XEKcmj+Rn2i+kDy7 JQX8jHc/s6NNmSQww6mt+McdsiuI2Ym5wAwHOWQzu9XoYf7rCLGqcCp5H STRpSPecClafpDP7oQmmKKcxx/LudqpfVDO9vG7mGsHigQu4T/apvnmaU K/kfi1YeZ+B4NegfEEs46zPZPSOwJ/bN2h++yHsRzv4ui8jrmE49ZDEyS 2ZaMKfaanpUQlS8PCdIvZiCo00buDoeQItuQWNvvZKkBHey2dNweLNrVJ OyD3qJcx5keTLzlvndfKgfg5y9rL36HDlBN3K2AUprJ9GtW88UI4CRIz3 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="357184141" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="357184141" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 19:28:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="774877649" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="774877649" Received: from shwdeopenlab702.ccr.corp.intel.com ([10.239.55.158]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 19:28:19 -0700 From: "duntan" To: devel@edk2.groups.io Subject: [Patch V5 00/14] Use CpuPageTableLib to create and update smm page table Date: Thu, 8 Jun 2023 10:27:28 +0800 Message-Id: <20230608022742.1292-1-dun.tan@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In V5 patch set: 1.Remove duplicated patches to add CpuPageTableLib into some DSC files. 2.Seperate the DEBUG_CODE of ConvertMemoryPageAttributes() to a new patch 'Add DEBUG_CODE for special case when clear RP'. Also fix issues in the DEBUG_CODE and add more detailed debug message about it 3.Fix boundary bug in 'Avoid setting non-present range to RO/NX' code and adjust the code to make it easier to understand. 4.Use local variable instead of AllocatePoll in 'Sort mSmmCpuSmramRanges in FindSmramInfo' and 'Sort mProtectionMemRange when ReadyToLock' 5.Remove mXdSupported check in 'Refinement to smm runtime InitPaging() code' Dun Tan (14): OvmfPkg:Remove code that apply AddressEncMask to non-leaf entry MdeModulePkg: Remove RO and NX protection when unset guard page UefiCpuPkg: Use CpuPageTableLib to convert SMM paging attribute. UefiCpuPkg: Add DEBUG_CODE for special case when clear RP UefiCpuPkg/PiSmmCpuDxeSmm: Avoid setting non-present range to RO/NX UefiCpuPkg/PiSmmCpuDxeSmm: Add 2 function to disable/enable CR0.WP UefiCpuPkg/PiSmmCpuDxeSmm: Clear CR0.WP before modify page table UefiCpuPkg: Extern mSmmShadowStackSize in PiSmmCpuDxeSmm.h UefiCpuPkg: Add GenSmmPageTable() to create smm page table UefiCpuPkg: Use GenSmmPageTable() to create Smm S3 page table UefiCpuPkg: Sort mSmmCpuSmramRanges in FindSmramInfo UefiCpuPkg: Sort mProtectionMemRange when ReadyToLock UefiCpuPkg: Refinement to smm runtime InitPaging() code UefiCpuPkg/PiSmmCpuDxeSmm: Remove unnecessary function MdeModulePkg/Core/PiSmmCore/HeapGuard.c | 2 +- OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c | 6 +++--- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c | 5 +++-- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmFuncsArch.c | 3 +-- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmProfileArch.c | 2 +- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 132 ------------------------------------------------------------------------------------------------------------------------------------ UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 40 ++++++++++++++++++++++++++++++++++++++-- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 1 + UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 795 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c | 324 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c | 229 ++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmFuncsArch.c | 3 +-- UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmProfileArch.c | 20 ++++---------------- 14 files changed, 668 insertions(+), 1015 deletions(-) -- 2.31.1.windows.1