From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: hao.a.wu@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Mon, 26 Aug 2019 20:03:15 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Aug 2019 20:03:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,435,1559545200"; d="scan'208";a="355631761" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 26 Aug 2019 20:03:14 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 26 Aug 2019 20:03:14 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.62]) with mapi id 14.03.0439.000; Tue, 27 Aug 2019 11:03:11 +0800 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Zurcher, Christopher J" CC: "Kinney, Michael D" , "Yao, Jiewen" , "Wang, Jian J" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH v5 2/4] MdeModulePkg/UfsPassThruDxe: Check for RPMB W-LUN (SecurityLun) Thread-Topic: [edk2-devel] [PATCH v5 2/4] MdeModulePkg/UfsPassThruDxe: Check for RPMB W-LUN (SecurityLun) Thread-Index: AQHVWTVIeEl/DJAZGEGCJYNOFpZBxqcOQ9lw Date: Tue, 27 Aug 2019 03:03:10 +0000 Message-ID: References: <20190822220215.24536-1-christopher.j.zurcher@intel.com> <20190822220215.24536-3-christopher.j.zurcher@intel.com> In-Reply-To: <20190822220215.24536-3-christopher.j.zurcher@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Zurcher, Christopher J > Sent: Friday, August 23, 2019 6:02 AM > To: devel@edk2.groups.io > Cc: Kinney, Michael D; Yao, Jiewen; Wang, Jian J; Gao, Liming > Subject: [edk2-devel] [PATCH v5 2/4] MdeModulePkg/UfsPassThruDxe: > Check for RPMB W-LUN (SecurityLun) With the BZ information added, Reviewed-by: Hao A Wu Best Regards, Hao Wu >=20 > Currently UfsPassThru only checks for 8 common LUNs. This adds a check > for the RPMB Well-known LUN and sets the corresponding bit-mask. Further > handling of the WLUN is already present in the driver. >=20 > Cc: Michael D Kinney > Cc: Jiewen Yao > Cc: Jian J Wang > Cc: Liming Gao > Signed-off-by: Christopher J Zurcher > --- > MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c | 17 > ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > index b12404aacb..26c5a8b855 100644 > --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c > @@ -822,7 +822,9 @@ UfsPassThruDriverBindingStart ( > UINTN UfsHcBase; > UINT32 Index; > UFS_UNIT_DESC UnitDescriptor; > + UFS_DEV_DESC DeviceDescriptor; > UINT32 UnitDescriptorSize; > + UINT32 DeviceDescriptorSize; >=20 > Status =3D EFI_SUCCESS; > UfsHc =3D NULL; > @@ -916,7 +918,6 @@ UfsPassThruDriverBindingStart ( >=20 > // > // Check if 8 common luns are active and set corresponding bit mask. > - // TODO: Parse device descriptor to decide if exposing RPMB LUN to up= per > layer for authentication access. > // > UnitDescriptorSize =3D sizeof (UFS_UNIT_DESC); > for (Index =3D 0; Index < 8; Index++) { > @@ -931,6 +932,20 @@ UfsPassThruDriverBindingStart ( > } > } >=20 > + // > + // Check if RPMB WLUN is supported and set corresponding bit mask. > + // > + DeviceDescriptorSize =3D sizeof (UFS_DEV_DESC); > + Status =3D UfsRwDeviceDesc (Private, TRUE, UfsDeviceDesc, 0, 0, > &DeviceDescriptor, &DeviceDescriptorSize); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "Failed to read device descriptor, status =3D = %r\n", > Status)); > + } else { > + if (DeviceDescriptor.SecurityLun =3D=3D 0x1) { > + DEBUG ((DEBUG_INFO, "UFS WLUN RPMB is supported\n")); > + Private->Luns.BitMask |=3D BIT11; > + } > + } > + > // > // Start the asynchronous interrupt monitor > // > -- > 2.16.2.windows.1 >=20 >=20 >=20