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.126; helo=mga18.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 D803A2194D387 for ; Fri, 7 Sep 2018 19:48:05 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2018 19:48:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,344,1531810800"; d="scan'208";a="71549306" Received: from jwang36-mobl2.ccr.corp.intel.com ([10.239.192.24]) by orsmga008.jf.intel.com with ESMTP; 07 Sep 2018 19:48:04 -0700 From: Jian J Wang To: edk2-devel@lists.01.org Cc: Hao A Wu Date: Sat, 8 Sep 2018 10:48:02 +0800 Message-Id: <20180908024802.13488-1-jian.j.wang@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 Subject: [PATCH] UefiCpuPkg/CpuDxe: fix an incorrect bit-wise operation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Sep 2018 02:48:06 -0000 The left operand is 64-bit but right operand could be 32-bit. A typecast is a must because of '~' op before it. Cc: Hao A Wu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang --- UefiCpuPkg/CpuDxe/CpuPageTable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/CpuPageTable.c index ef6e080a07..0a980b9753 100644 --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c @@ -1181,7 +1181,7 @@ DebugExceptionHandler ( for (PFEntry = 0; PFEntry < mPFEntryCount[CpuIndex]; PFEntry++) { if (mLastPFEntryPointer[CpuIndex][PFEntry] != NULL) { - *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~IA32_PG_P; + *mLastPFEntryPointer[CpuIndex][PFEntry] &= ~(UINT64)IA32_PG_P; } } -- 2.16.2.windows.1