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.136; helo=mga12.intel.com; envelope-from=michael.d.kinney@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 C3E0321F85E6C for ; Mon, 2 Apr 2018 15:40:27 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Apr 2018 15:40:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,397,1517904000"; d="scan'208";a="216956924" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.241.98.37]) by fmsmga006.fm.intel.com with ESMTP; 02 Apr 2018 15:40:26 -0700 From: "Kinney, Michael D" To: edk2-devel@lists.01.org Cc: Heyi Guo , Yi Li , Renhao Liang , Star Zeng , Eric Dong , Liming Gao , Jian J Wang , Ruiyu Ni , Michael D Kinney Date: Mon, 2 Apr 2018 15:40:24 -0700 Message-Id: <20180402224024.20848-1-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.14.2.windows.3 Subject: [Patch] MdeModulePkg/Gcd: Filter gCpu->SetMemoryAttributes() calls 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: Mon, 02 Apr 2018 22:40:28 -0000 This patch fixes an issue with VlvTbltDevicePkg introduced by commit: https://github.com/tianocore/edk2/commit/5b91bf82c67b586b9588cbe4bbffa1588f6b5926 This patch filters the call to gCpu->SetMemoryAttributes() if the requested attributes is 0. It also removes the #define INVALID_CPU_ARCH_ATTRIBUTES that is no longer used. Cc: Heyi Guo Cc: Yi Li Cc: Renhao Liang Cc: Star Zeng Cc: Eric Dong Cc: Liming Gao Cc: Jian J Wang Cc: Ruiyu Ni Signed-off-by: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 1.1 --- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c index 907245a3f5..45ed6280db 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -48,8 +48,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define NONEXCLUSIVE_MEMORY_ATTRIBUTES (EFI_MEMORY_XP | EFI_MEMORY_RP | \ EFI_MEMORY_RO) -#define INVALID_CPU_ARCH_ATTRIBUTES 0xffffffff - // // Module Variables // @@ -873,7 +871,7 @@ CoreConvertSpace ( // Call CPU Arch Protocol to attempt to set attributes on the range // CpuArchAttributes = ConverToCpuArchAttributes (Attributes); - if (CpuArchAttributes != INVALID_CPU_ARCH_ATTRIBUTES) { + if (CpuArchAttributes != 0) { if (gCpu == NULL) { Status = EFI_NOT_AVAILABLE_YET; } else { -- 2.14.2.windows.3