From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A610922135D24 for ; Wed, 7 Mar 2018 05:13:06 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2018 05:19:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,435,1515484800"; d="scan'208";a="22725211" Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.158.46]) by orsmga007.jf.intel.com with ESMTP; 07 Mar 2018 05:19:19 -0800 From: Star Zeng To: edk2-devel@lists.01.org Cc: Star Zeng , Jiewen Yao , Eric Dong , Chao Zhang Date: Wed, 7 Mar 2018 21:19:10 +0800 Message-Id: <1520428757-69040-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [PATCH V2 0/7] OpalPassword: New solution without SMM device code X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Mar 2018 13:13:07 -0000 The patch series is also at https://github.com/lzeng14/edk2 OpalPasswordNewV2 branch. After IOMMU is enabled in S3, original solution with SMM device code (OpalPasswordSmm) to unlock OPAL device for S3 will not work as the DMA operation will be aborted without granted DMA buffer. Instead, this solution is to add OpalPasswordPei to eliminate SMM device code, and OPAL setup UI produced by OpalPasswordDxe will be updated to send requests (set password, update password, and etc), and then the requests will be processed in next boot before SmmReadyToLock, password and device info will be saved to lock box used by OpalPasswordPei to unlock OPAL device for S3. The old solution related codes are also removed. V2: Thanks for Jiewen's great comments. 1. Still use suppressif for unavailabe requests, and use grayoutif for conflict requests. 2. Zero DevInfo in BuildOpalDeviceInfoAta() and BuildOpalDeviceInfoNvme(). 3. Zero Mask and Unicode in OpalDriverPopUpPsidInput() and OpalDriverPopUpPasswordInput() even for NULL return path. 4. Do some HII related refinement. 5. Do more NULL pointer check. Cc: Jiewen Yao Cc: Eric Dong Cc: Chao Zhang Star Zeng (7): MdeModulePkg LockBoxLib: Support LOCK_BOX_ATTRIBUTE_RESTORE_IN_S3_ONLY SecurityPkg TcgStorageOpalLib: Make it be base type really SecurityPkg TcgStorageCoreLib: Make it be base type really SecurityPkg OpalPassword: Add solution without SMM device code SecurityPkg OpalPassword: Remove old solution SecurityPkg OpalPasswordSupportLib: Remove it SecurityPkg OpalPasswordExtraInfoVariable.h: Remove it MdeModulePkg/Include/Library/LockBoxLib.h | 14 +- .../Library/SmmLockBoxLib/SmmLockBoxDxeLib.c | 4 +- .../Library/SmmLockBoxLib/SmmLockBoxSmmLib.c | 227 +- .../Library/SmmLockBoxLib/SmmLockBoxSmmLib.inf | 10 +- .../Include/Guid/OpalPasswordExtraInfoVariable.h | 27 - .../Include/Library/OpalPasswordSupportLib.h | 289 -- .../OpalPasswordSupportLib.c | 781 ----- .../OpalPasswordSupportLib.inf | 55 - .../OpalPasswordSupportNotify.h | 55 - .../TcgStorageCoreLib/TcgStorageCoreLib.inf | 4 +- .../TcgStorageOpalLib/TcgStorageOpalLib.inf | 8 +- SecurityPkg/SecurityPkg.dec | 4 - SecurityPkg/SecurityPkg.dsc | 6 +- .../ComponentName.c | 0 .../OpalAhciMode.c | 492 ++-- .../OpalAhciMode.h | 93 +- SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 3003 ++++++++++++++++++++ .../{OpalPasswordDxe => OpalPassword}/OpalDriver.h | 215 +- .../{OpalPasswordDxe => OpalPassword}/OpalHii.c | 895 ++---- .../OpalHiiPrivate.h => OpalPassword/OpalHii.h} | 150 +- .../OpalHiiCallbacks.c | 6 +- .../OpalHiiFormStrings.uni | 49 +- .../OpalHiiFormValues.h | 97 +- .../OpalNvmeMode.c | 95 +- .../OpalNvmeMode.h | 19 +- .../OpalNvmeReg.h | 5 +- .../Tcg/Opal/OpalPassword/OpalPasswordCommon.h | 65 + .../OpalPasswordDxe.inf | 25 +- .../OpalPasswordForm.vfr | 279 +- .../Tcg/Opal/OpalPassword/OpalPasswordPei.c | 940 ++++++ .../Tcg/Opal/OpalPassword/OpalPasswordPei.h | 133 + .../Tcg/Opal/OpalPassword/OpalPasswordPei.inf | 63 + SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c | 1091 ------- .../Tcg/Opal/OpalPasswordDxe/OpalDriverPrivate.h | 102 - SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.h | 146 - SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalIdeMode.c | 767 ----- SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalIdeMode.h | 173 -- .../Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.c | 1088 ------- .../Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.h | 299 -- .../Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.inf | 77 - 40 files changed, 5656 insertions(+), 6195 deletions(-) delete mode 100644 SecurityPkg/Include/Guid/OpalPasswordExtraInfoVariable.h delete mode 100644 SecurityPkg/Include/Library/OpalPasswordSupportLib.h delete mode 100644 SecurityPkg/Library/OpalPasswordSupportLib/OpalPasswordSupportLib.c delete mode 100644 SecurityPkg/Library/OpalPasswordSupportLib/OpalPasswordSupportLib.inf delete mode 100644 SecurityPkg/Library/OpalPasswordSupportLib/OpalPasswordSupportNotify.h rename SecurityPkg/Tcg/Opal/{OpalPasswordDxe => OpalPassword}/ComponentName.c (100%) rename SecurityPkg/Tcg/Opal/{OpalPasswordSmm => OpalPassword}/OpalAhciMode.c (68%) rename SecurityPkg/Tcg/Opal/{OpalPasswordSmm => OpalPassword}/OpalAhciMode.h (85%) create mode 100644 SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c rename SecurityPkg/Tcg/Opal/{OpalPasswordDxe => OpalPassword}/OpalDriver.h (71%) rename SecurityPkg/Tcg/Opal/{OpalPasswordDxe => OpalPassword}/OpalHii.c (56%) rename SecurityPkg/Tcg/Opal/{OpalPasswordDxe/OpalHiiPrivate.h => OpalPassword/OpalHii.h} (72%) rename SecurityPkg/Tcg/Opal/{OpalPasswordDxe => OpalPassword}/OpalHiiCallbacks.c (91%) rename SecurityPkg/Tcg/Opal/{OpalPasswordDxe => OpalPassword}/OpalHiiFormStrings.uni (66%) rename SecurityPkg/Tcg/Opal/{OpalPasswordDxe => OpalPassword}/OpalHiiFormValues.h (56%) rename SecurityPkg/Tcg/Opal/{OpalPasswordSmm => OpalPassword}/OpalNvmeMode.c (93%) rename SecurityPkg/Tcg/Opal/{OpalPasswordSmm => OpalPassword}/OpalNvmeMode.h (93%) rename SecurityPkg/Tcg/Opal/{OpalPasswordSmm => OpalPassword}/OpalNvmeReg.h (96%) create mode 100644 SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordCommon.h rename SecurityPkg/Tcg/Opal/{OpalPasswordDxe => OpalPassword}/OpalPasswordDxe.inf (80%) rename SecurityPkg/Tcg/Opal/{OpalPasswordDxe => OpalPassword}/OpalPasswordForm.vfr (55%) create mode 100644 SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c create mode 100644 SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.h create mode 100644 SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.inf delete mode 100644 SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c delete mode 100644 SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriverPrivate.h delete mode 100644 SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.h delete mode 100644 SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalIdeMode.c delete mode 100644 SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalIdeMode.h delete mode 100644 SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.c delete mode 100644 SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.h delete mode 100644 SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.inf -- 2.7.0.windows.1