From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 6C83E81915 for ; Sun, 8 Jan 2017 22:38:41 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 08 Jan 2017 22:38:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,339,1477983600"; d="scan'208";a="1080760480" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 08 Jan 2017 22:38:40 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 8 Jan 2017 22:38:40 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 8 Jan 2017 22:38:40 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Mon, 9 Jan 2017 14:38:38 +0800 From: "Zeng, Star" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" CC: "Tian, Feng" , "Zeng, Star" Thread-Topic: [PATCH] MdeModulePkg/DxeCore:Clear RT attribute on SetCapabilities. Thread-Index: AQHSakKFC1zhjEwBa0eTCY42g/Npd6EvsVpA Date: Mon, 9 Jan 2017 06:38:38 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B7F6C96@shsmsx102.ccr.corp.intel.com> References: <1483943693-14680-1-git-send-email-jiewen.yao@intel.com> In-Reply-To: <1483943693-14680-1-git-send-email-jiewen.yao@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 Subject: Re: [PATCH] MdeModulePkg/DxeCore:Clear RT attribute on SetCapabilities. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 06:38:41 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: Yao, Jiewen=20 Sent: Monday, January 9, 2017 2:35 PM To: edk2-devel@lists.01.org Cc: Zeng, Star ; Tian, Feng Subject: [PATCH] MdeModulePkg/DxeCore:Clear RT attribute on SetCapabilities= . When gDS->SetMemorySpaceCapabilities() is called, current DXE core will syn= c all GCD attributes to memory map attributes, including RUNTIME attributes= . It is wrong, because RUNTIME attributes should be set for runtime memory on= ly. This fix clears the RUNTIME attributes before convert to UEFI memory map. S= o that the UEFI memory map is good after gDS->SetMemorySpaceCapabilities() is called. Cc: Star Zeng Cc: Feng Tian Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gc= d.c index bd7c6c6..056fc6a 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -1624,7 +1624,7 @@ CoreSetMemorySpaceCapabilities ( =20 Status =3D CoreConvertSpace (GCD_SET_CAPABILITIES_MEMORY_OPERATION, (EFI= _GCD_MEMORY_TYPE) 0, (EFI_GCD_IO_TYPE) 0, BaseAddress, Length, Capabilities= , 0); if (!EFI_ERROR(Status)) { - CoreUpdateMemoryAttributes(BaseAddress, RShiftU64(Length, EFI_PAGE_SHI= FT), Capabilities); + CoreUpdateMemoryAttributes(BaseAddress, RShiftU64(Length,=20 + EFI_PAGE_SHIFT), Capabilities & (~EFI_MEMORY_RUNTIME)); } =20 return Status; -- 2.7.4.windows.1