From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 712872232BDE6 for ; Wed, 17 Jan 2018 03:55:40 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2018 04:01:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,372,1511856000"; d="scan'208";a="27176225" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 17 Jan 2018 04:00:57 -0800 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 17 Jan 2018 04:00:29 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 17 Jan 2018 03:59:24 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Wed, 17 Jan 2018 19:59:22 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] IntelSiliconPkg IntelVTdDxe: Fix DMA does not work issue Thread-Index: AQHTj4pPEnMRtBAgt0OoqkXHGT4/06N39hLQ Date: Wed, 17 Jan 2018 11:59:21 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AA80524@shsmsx102.ccr.corp.intel.com> References: <1516190211-19048-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1516190211-19048-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODc4MWNkODUtOTFhNS00ODMxLTgwNTQtZWEwMDRhYjNiMDQ1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJVK0hId1wva1wvQ1dBOGYxR2pVYnU3d1dyakJ3dWtnTjUzNDF5cmFLZjVcL2lDdzVKajF0aG9IeWlEaGQwSkNMWjErIn0= 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 IntelVTdDxe: Fix DMA does not work issue 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, 17 Jan 2018 11:55:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Good catch. Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Zeng, Star > Sent: Wednesday, January 17, 2018 7:57 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen > Subject: [PATCH] IntelSiliconPkg IntelVTdDxe: Fix DMA does not work issue >=20 > Fix DMA does not work issue when system memory is not > greater than 4G. >=20 > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Star Zeng > --- > IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c | 11 +++++++-= --- > 1 file changed, 7 insertions(+), 4 deletions(-) >=20 > diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c > b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c > index cecb5d23efbf..7f64d5e418f6 100644 > --- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c > +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c > @@ -286,11 +286,14 @@ CreateSecondLevelPagingEntry ( > if (SecondLevelPagingEntry =3D=3D NULL) { > return NULL; > } > - SecondLevelPagingEntry =3D CreateSecondLevelPagingEntryTable (VtdIndex= , > SecondLevelPagingEntry, SIZE_4GB, mAbove4GMemoryLimit, IoMmuAccess); > - if (SecondLevelPagingEntry =3D=3D NULL) { > - return NULL; > - } >=20 > + if (mAbove4GMemoryLimit !=3D 0) { > + ASSERT (mAbove4GMemoryLimit > BASE_4GB); > + SecondLevelPagingEntry =3D CreateSecondLevelPagingEntryTable (VtdInd= ex, > SecondLevelPagingEntry, SIZE_4GB, mAbove4GMemoryLimit, IoMmuAccess); > + if (SecondLevelPagingEntry =3D=3D NULL) { > + return NULL; > + } > + } > return SecondLevelPagingEntry; > } >=20 > -- > 2.7.0.windows.1