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.100; helo=mga07.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 37BBA225501D3 for ; Thu, 29 Mar 2018 18:59:57 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2018 18:59:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,378,1517904000"; d="scan'208";a="28725192" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga008.fm.intel.com with ESMTP; 29 Mar 2018 18:59:57 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 29 Mar 2018 18:59:56 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 29 Mar 2018 18:59:56 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.80]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.166]) with mapi id 14.03.0319.002; Fri, 30 Mar 2018 09:59:54 +0800 From: "Zeng, Star" To: Heyi Guo , "edk2-devel@lists.01.org" CC: Yi Li , Renhao Liang , "Dong, Eric" , "Kinney, Michael D" , "Gao, Liming" , "Wang, Jian J" , "Ni, Ruiyu" , "Zeng, Star" Thread-Topic: [PATCH 1/1] MdeModulePkg/Gcd: Fix bug of attribute conversion Thread-Index: AQHTxzbVMQvHVBZY20yNQkEJtf3o/KPoBxEA Date: Fri, 30 Mar 2018 01:59:54 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BA749F9@shsmsx102.ccr.corp.intel.com> References: <1522311590-104218-1-git-send-email-heyi.guo@linaro.org> In-Reply-To: <1522311590-104218-1-git-send-email-heyi.guo@linaro.org> 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 Subject: Re: [PATCH 1/1] MdeModulePkg/Gcd: Fix bug of attribute conversion X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Mar 2018 01:59:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng Thanks, Star -----Original Message----- From: Heyi Guo [mailto:heyi.guo@linaro.org]=20 Sent: Thursday, March 29, 2018 4:20 PM To: edk2-devel@lists.01.org Cc: Heyi Guo ; Yi Li ; Renhao= Liang ; Zeng, Star ; Dong, Er= ic ; Kinney, Michael D ; G= ao, Liming ; Wang, Jian J ; Ni= , Ruiyu Subject: [PATCH 1/1] MdeModulePkg/Gcd: Fix bug of attribute conversion For gDS->SetMemorySpaceAttributes(), when user passes a combined memory att= ribute including CPU arch attribute and other attributes, like EFI_MEMORY_R= UNTIME, ConverToCpuArchAttributes() will return INVALID_CPU_ARCH_ATTRIBUTES= and skip setting page/cache attribute for the specified memory space. We don't see any reason to forbid combining CPU arch attributes and non-CPU= -arch attributes when calling gDS->SetMemorySpaceAttributes(), so we remove= the check code in ConverToCpuArchAttributes(); the remaining code is enoug= h to grab the interested bits for Cpu->SetMemoryAttributes(). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo Signed-off-by: Yi Li Signed-off-by: Renhao Liang Cc: Star Zeng Cc: Eric Dong Cc: Michael D Kinney Cc: Liming Gao Cc: Jian J Wang Cc: Ruiyu Ni --- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gc= d.c index 77f4adb4bc01..907245a3f512 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -673,11 +673,6 @@ ConverToCpuArchAttributes ( { UINT64 CpuArchAttributes; =20 - if ((Attributes & ~(EXCLUSIVE_MEMORY_ATTRIBUTES | - NONEXCLUSIVE_MEMORY_ATTRIBUTES)) !=3D 0) { - return INVALID_CPU_ARCH_ATTRIBUTES; - } - CpuArchAttributes =3D Attributes & NONEXCLUSIVE_MEMORY_ATTRIBUTES; =20 if ( (Attributes & EFI_MEMORY_UC) =3D=3D EFI_MEMORY_UC) { -- 2.7.4