From nobody Fri Dec 27 18:49:12 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1501752740168713.8991588131819; Thu, 3 Aug 2017 02:32:20 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C20862095DB90; Thu, 3 Aug 2017 02:30:01 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 92F7A21AEB0B0 for ; Thu, 3 Aug 2017 02:30:00 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2017 02:32:11 -0700 Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.51]) by orsmga002.jf.intel.com with ESMTP; 03 Aug 2017 02:32:10 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,315,1498546800"; d="scan'208";a="119098248" From: Eric Dong To: edk2-devel@lists.01.org Date: Thu, 3 Aug 2017 17:32:02 +0800 Message-Id: <1501752726-14072-4-git-send-email-eric.dong@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1501752726-14072-1-git-send-email-eric.dong@intel.com> References: <1501752726-14072-1-git-send-email-eric.dong@intel.com> Subject: [edk2] [Patch 3/7] UefiCpuPkg CpuDxe: Enhance get mtrr mask logic. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Jeff Fan MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In order to not use the deprecated macro, refine get mtrr mask value logic. Cc: Jeff Fan Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong Reviewed-by: Ruiyu Ni --- UefiCpuPkg/CpuDxe/CpuDxe.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c index 8680656..6218670 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.c +++ b/UefiCpuPkg/CpuDxe/CpuDxe.c @@ -25,8 +25,8 @@ BOOLEAN InterruptState =3D FALSE; EFI_HANDLE mCpuHandle =3D NULL; BOOLEAN mIsFlushingGCD; -UINT64 mValidMtrrAddressMask =3D MTRR_LIB_CACHE_VALID_A= DDRESS; -UINT64 mValidMtrrBitsMask =3D MTRR_LIB_MSR_VALID_MAS= K; +UINT64 mValidMtrrAddressMask; +UINT64 mValidMtrrBitsMask; UINT64 mTimerPeriod =3D 0; =20 FIXED_MTRR mFixedMtrrTable[] =3D { @@ -510,13 +510,12 @@ InitializeMtrrMask ( AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL); =20 PhysicalAddressBits =3D (UINT8) RegEax; - - mValidMtrrBitsMask =3D LShiftU64 (1, PhysicalAddressBits) - 1; - mValidMtrrAddressMask =3D mValidMtrrBitsMask & 0xfffffffffffff000ULL; } else { - mValidMtrrBitsMask =3D MTRR_LIB_MSR_VALID_MASK; - mValidMtrrAddressMask =3D MTRR_LIB_CACHE_VALID_ADDRESS; + PhysicalAddressBits =3D 36; } + + mValidMtrrBitsMask =3D LShiftU64 (1, PhysicalAddressBits) - 1; + mValidMtrrAddressMask =3D mValidMtrrBitsMask & 0xfffffffffffff000ULL; } =20 /** --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel