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.126; helo=mga18.intel.com; envelope-from=ray.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 2D827211CACA8 for ; Wed, 20 Feb 2019 05:06:08 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2019 05:06:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,391,1544515200"; d="scan'208";a="145020083" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.31]) ([10.239.9.31]) by fmsmga002.fm.intel.com with ESMTP; 20 Feb 2019 05:06:06 -0800 To: Hao Wu , edk2-devel@lists.01.org Cc: Chao Zhang , Jiewen Yao , Eric Dong References: <20190215062338.19412-1-hao.a.wu@intel.com> <20190215062338.19412-14-hao.a.wu@intel.com> From: "Ni, Ray" Message-ID: Date: Wed, 20 Feb 2019 21:08:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190215062338.19412-14-hao.a.wu@intel.com> Subject: Re: [PATCH v5 13/13] SecurityPkg/OpalPassword: Remove HW init codes and consume SSC PPI X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2019 13:06:09 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit > +OpalPasswordStorageSecurityPpiNotify ( > + IN EFI_PEI_SERVICES **PeiServices, > + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc, > + IN VOID *Ppi > ) > { > - EFI_STATUS Status; > - EFI_BOOT_MODE BootMode; > + OPAL_PEI_DRIVER_PRIVATE_DATA *Private; > > - Status = PeiServicesGetBootMode (&BootMode); > - ASSERT_EFI_ERROR (Status); > - if (BootMode != BOOT_ON_S3_RESUME) { > - return EFI_UNSUPPORTED; > - } > + DEBUG ((DEBUG_INFO, "%a entered at S3 resume!\n", __FUNCTION__)); > > - DEBUG ((DEBUG_INFO, "%a() - enter at S3 resume\n", __FUNCTION__)); > + Private = OPAL_PEI_PRIVATE_DATA_FROM_THIS_NOTIFY (NotifyDesc); > + UnlockOpalPasswordDevices (Private); > In this Notify callback, we could use the 3rd parameter "Ppi" to get the Ssc PPI instance to perform unlock operation. With this change, the OPAL_PEI_DRIVER_PRIVATE_DATA is not needed any more and IsSscInstanceHandled() is not needed as well.