From nobody Sat Nov 2 14:40:50 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.zoho.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 1490246872174465.72629223287527; Wed, 22 Mar 2017 22:27:52 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 816828046D; Wed, 22 Mar 2017 22:27:48 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 561D98042C for ; Wed, 22 Mar 2017 22:27:47 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Mar 2017 22:27:47 -0700 Received: from jfan12-desk.ccr.corp.intel.com ([10.239.158.57]) by fmsmga001.fm.intel.com with ESMTP; 22 Mar 2017 22:27:46 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490246867; x=1521782867; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=QyDElpv0mjfWU7K6ifssDt8efcOJhCcVC/rxn1nuQzY=; b=LyY1Fn0KHPbrfqsP5rKmvNHkZKkQoJeljQxkCrIqLkcxNJNMgSzZRGRT 7MvaSqZFgQBZnzl7XatkrKdgLBgKLw==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,208,1486454400"; d="scan'208";a="1126061572" From: Jeff Fan To: edk2-devel@lists.01.org Date: Thu, 23 Mar 2017 13:27:37 +0800 Message-Id: <20170323052738.10888-2-jeff.fan@intel.com> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20170323052738.10888-1-jeff.fan@intel.com> References: <20170323052738.10888-1-jeff.fan@intel.com> Subject: [edk2] [PATCH 1/2] UefiCpuPkg/RegisterCpuFeaturesLib: Define Index to UINT64 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: Michael Kinney , Feng Tian 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" The input parameter Index of PreSmmCpuRegisterTableWrite() and CpuRegisterTableWrite() is defined as UINT32. Index is MSR/MMIO address that will be saved in CPU register table. UINT32 blocks the MMIO address > 4GB. This fix is to define Index to UINT64 instead of UINT32. Cc: Feng Tian Cc: Michael Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan --- UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h | 4 ++-- .../Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c | 8 ++++= ---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h b/UefiCpuP= kg/Include/Library/RegisterCpuFeaturesLib.h index 42eb3b2..3fb8209 100644 --- a/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h +++ b/UefiCpuPkg/Include/Library/RegisterCpuFeaturesLib.h @@ -366,7 +366,7 @@ EFIAPI CpuRegisterTableWrite ( IN UINTN ProcessorNumber, IN REGISTER_TYPE RegisterType, - IN UINT32 Index, + IN UINT64 Index, IN UINT64 ValueMask, IN UINT64 Value ); @@ -390,7 +390,7 @@ EFIAPI PreSmmCpuRegisterTableWrite ( IN UINTN ProcessorNumber, IN REGISTER_TYPE RegisterType, - IN UINT32 Index, + IN UINT64 Index, IN UINT64 ValueMask, IN UINT64 Value ); diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesL= ib.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c index 396618b..32189cb 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c @@ -506,7 +506,7 @@ CpuRegisterTableWriteWorker ( IN BOOLEAN PreSmmFlag, IN UINTN ProcessorNumber, IN REGISTER_TYPE RegisterType, - IN UINT32 Index, + IN UINT64 Index, IN UINT8 ValidBitStart, IN UINT8 ValidBitLength, IN UINT64 Value @@ -550,7 +550,7 @@ CpuRegisterTableWriteWorker ( // RegisterTableEntry =3D (CPU_REGISTER_TABLE_ENTRY *) (UINTN) RegisterTabl= e->RegisterTableEntry; RegisterTableEntry[RegisterTable->TableLength].RegisterType =3D Regist= erType; - RegisterTableEntry[RegisterTable->TableLength].Index =3D Index; + RegisterTableEntry[RegisterTable->TableLength].Index =3D (UINT3= 2) Index; RegisterTableEntry[RegisterTable->TableLength].ValidBitStart =3D ValidB= itStart; RegisterTableEntry[RegisterTable->TableLength].ValidBitLength =3D ValidB= itLength; RegisterTableEntry[RegisterTable->TableLength].Value =3D Value; @@ -577,7 +577,7 @@ EFIAPI CpuRegisterTableWrite ( IN UINTN ProcessorNumber, IN REGISTER_TYPE RegisterType, - IN UINT32 Index, + IN UINT64 Index, IN UINT64 ValueMask, IN UINT64 Value ) @@ -611,7 +611,7 @@ EFIAPI PreSmmCpuRegisterTableWrite ( IN UINTN ProcessorNumber, IN REGISTER_TYPE RegisterType, - IN UINT32 Index, + IN UINT64 Index, IN UINT64 ValueMask, IN UINT64 Value ) --=20 2.9.3.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel