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.65; helo=mga03.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 5B35D2257C2D0 for ; Mon, 5 Mar 2018 14:32:44 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 14:38:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,428,1515484800"; d="scan'208";a="35710043" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 05 Mar 2018 14:38:57 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Mar 2018 14:38:56 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Tue, 6 Mar 2018 06:38:51 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] IntelSiliconPkg VTdPmrPei: Return SUCCESS when Mapping == NULL in Unmap Thread-Index: AQHTtIaX38ahBLznk02KwQl2JCyAYaPCPFZA Date: Mon, 5 Mar 2018 22:38:51 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AADD277@shsmsx102.ccr.corp.intel.com> References: <20180305133332.9644-1-star.zeng@intel.com> In-Reply-To: <20180305133332.9644-1-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjcyZDJhNjUtYmI5YS00YjA2LWE1ZjQtM2UwNzc0N2I4NjI5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJHWHJMSSt0RGpnYzRYOHJ2OE5udSt2RFlLRjVvemMzc3Q2RENlQk9UMGw3MUo1QVVWMDhxZVBKTjBwWGdFeVI4In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] IntelSiliconPkg VTdPmrPei: Return SUCCESS when Mapping == NULL in Unmap 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: Mon, 05 Mar 2018 22:32:44 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: jiewen.yao@intel.com > -----Original Message----- > From: Zeng, Star > Sent: Monday, March 5, 2018 9:34 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen > Subject: [PATCH] IntelSiliconPkg VTdPmrPei: Return SUCCESS when Mapping = =3D=3D > NULL in Unmap >=20 > NULL is returned to Mapping when Operation is BusMasterCommonBuffer or > EdkiiIoMmuOperationBusMasterCommonBuffer64 in PeiIoMmuMap(). > So Mapping =3D=3D NULL is valid when calling PeiIoMmuUnmap(). >=20 > 940dbd071e9f01717236af236740aa0da716805f wrongly changed > EFI_SUCCESS > to EFI_INVALID_PARAMETER when Mapping =3D=3D NULL in PeiIoMmuUnmap(). > This patch is to correct it. >=20 > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c > b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c > index ea3091ef911c..6289834fcb38 100644 > --- a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c > +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c > @@ -189,7 +189,7 @@ PeiIoMmuMap ( > if (Operation =3D=3D EdkiiIoMmuOperationBusMasterCommonBuffer || > Operation =3D=3D EdkiiIoMmuOperationBusMasterCommonBuffer64) { > *DeviceAddress =3D (UINTN)HostAddress; > - *Mapping =3D 0; > + *Mapping =3D NULL; > return EFI_SUCCESS; > } >=20 > @@ -266,7 +266,7 @@ PeiIoMmuUnmap ( > } >=20 > if (Mapping =3D=3D NULL) { > - return EFI_INVALID_PARAMETER; > + return EFI_SUCCESS; > } >=20 > MapInfo =3D Mapping; > -- > 2.13.3.windows.1