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.498.1572840488333953125 for ; Sun, 03 Nov 2019 20:08:08 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: jiewen.yao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Nov 2019 20:08:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,265,1569308400"; d="scan'208";a="284853735" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 03 Nov 2019 20:08:07 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 3 Nov 2019 20:08:07 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 3 Nov 2019 20:08:06 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.108]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.2]) with mapi id 14.03.0439.000; Mon, 4 Nov 2019 12:08:04 +0800 From: "Yao, Jiewen" To: "Chu, Maggie" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Zhang, Chao B" Subject: Re: [PATCH] SecurityPkg/OpalPassword: Remove dependency on EFI_BLOCK_IO_PROTOCOL Thread-Topic: [PATCH] SecurityPkg/OpalPassword: Remove dependency on EFI_BLOCK_IO_PROTOCOL Thread-Index: AQHVksT43+jtZdrS3U24SHXYHftIGqd6ZUaQ Date: Mon, 4 Nov 2019 04:08:04 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F8391FC@shsmsx102.ccr.corp.intel.com> References: <20191104040428.1542-1-maggie.chu@intel.com> In-Reply-To: <20191104040428.1542-1-maggie.chu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjI3OGQyMWMtY2JmZS00MTBmLWIwMzAtNjljZTE1MjA4OWM5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidjN3UUM1dVN0Y0xcL0NDQ0xjenIxektUUXFEbHM1dzk3MGJvblJMK2pGM1RMeVpORXNFV2hLckkzK3ExNFoyV28ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: jiewen.yao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello May I know what test has been done for this patch? > -----Original Message----- > From: Chu, Maggie > Sent: Monday, November 4, 2019 12:04 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Zhang, Chao B > ; Yao, Jiewen > Subject: [PATCH] SecurityPkg/OpalPassword: Remove dependency on > EFI_BLOCK_IO_PROTOCOL >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2327 >=20 > RAID drivers abstract their physical drives that make up > the array into a single unit, and do not supply individual > EFI_BLOCK_IO_PROTOCOL instances for each physical drive in the array. > This breaks support for the Security Storage Command Protocol, > which currently requires an EFI_BLOCK_IO_PROTOCOL to be associated > with the same device the protocol is installed on and provide > all the same parameters. >=20 > This patch remove dependency on EFI_BLOCK_IO_PROTOCOL and > allows access to Opal drive members of a RAID array. >=20 > Signed-off-by: Maggie Chu > Cc: Eric Dong > Cc: Chao Zhang > Cc: Jiewen Yao > --- > SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 70 ++++++++++----------= ---- > -- > 1 file changed, 27 insertions(+), 43 deletions(-) >=20 > diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c > b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c > index 77905d2bf9..6bec54b932 100644 > --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c > +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c > @@ -2667,7 +2667,6 @@ OpalEfiDriverBindingSupported( > { >=20 > EFI_STATUS Status; >=20 > EFI_STORAGE_SECURITY_COMMAND_PROTOCOL* SecurityCommand; >=20 > - EFI_BLOCK_IO_PROTOCOL* BlkIo; >=20 >=20 >=20 > if (mOpalEndOfDxe) { >=20 > return EFI_UNSUPPORTED; >=20 > @@ -2703,33 +2702,6 @@ OpalEfiDriverBindingSupported( > Controller >=20 > ); >=20 >=20 >=20 > - // >=20 > - // Test EFI_BLOCK_IO_PROTOCOL on controller Handle, required by > EFI_STORAGE_SECURITY_COMMAND_PROTOCOL >=20 > - // function APIs >=20 > - // >=20 > - Status =3D gBS->OpenProtocol( >=20 > - Controller, >=20 > - &gEfiBlockIoProtocolGuid, >=20 > - (VOID **)&BlkIo, >=20 > - This->DriverBindingHandle, >=20 > - Controller, >=20 > - EFI_OPEN_PROTOCOL_BY_DRIVER >=20 > - ); >=20 > - >=20 > - if (EFI_ERROR(Status)) { >=20 > - DEBUG((DEBUG_INFO, "No EFI_BLOCK_IO_PROTOCOL on controller\n")); >=20 > - return Status; >=20 > - } >=20 > - >=20 > - // >=20 > - // Close protocol and reopen in Start call >=20 > - // >=20 > - gBS->CloseProtocol( >=20 > - Controller, >=20 > - &gEfiBlockIoProtocolGuid, >=20 > - This->DriverBindingHandle, >=20 > - Controller >=20 > - ); >=20 >=20 >=20 > return EFI_SUCCESS; >=20 > } >=20 > @@ -2827,30 +2799,42 @@ OpalEfiDriverBindingStart( > ); >=20 > if (EFI_ERROR(Status)) { >=20 > // >=20 > - // Close storage security that was opened >=20 > + // Block_IO not supported on handle >=20 > // >=20 > - gBS->CloseProtocol( >=20 > - Controller, >=20 > - &gEfiStorageSecurityCommandProtocolGuid, >=20 > - This->DriverBindingHandle, >=20 > - Controller >=20 > - ); >=20 > + if(Status =3D=3D EFI_UNSUPPORTED) { >=20 > + BlkIo =3D NULL; >=20 > + } else { >=20 > + // >=20 > + // Close storage security that was opened >=20 > + // >=20 > + gBS->CloseProtocol( >=20 > + Controller, >=20 > + &gEfiStorageSecurityCommandProtocolGuid, >=20 > + This->DriverBindingHandle, >=20 > + Controller >=20 > + ); >=20 >=20 >=20 > - FreePool(Dev); >=20 > - return Status; >=20 > + FreePool(Dev); >=20 > + return Status; >=20 > + } >=20 > } >=20 >=20 >=20 > // >=20 > // Save mediaId >=20 > // >=20 > - Dev->MediaId =3D BlkIo->Media->MediaId; >=20 > + if(BlkIo =3D=3D NULL) { >=20 > + // If no Block IO present, use defined MediaId value. >=20 > + Dev->MediaId =3D 0x0; >=20 > + } else { >=20 > + Dev->MediaId =3D BlkIo->Media->MediaId; >=20 >=20 >=20 > - gBS->CloseProtocol( >=20 > - Controller, >=20 > - &gEfiBlockIoProtocolGuid, >=20 > - This->DriverBindingHandle, >=20 > - Controller >=20 > + gBS->CloseProtocol( >=20 > + Controller, >=20 > + &gEfiBlockIoProtocolGuid, >=20 > + This->DriverBindingHandle, >=20 > + Controller >=20 > ); >=20 > + } >=20 >=20 >=20 > // >=20 > // Acquire Ascii printable name of child, if not found, then ignore de= vice >=20 > -- > 2.16.2.windows.1