summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg
diff options
context:
space:
mode:
authorLendacky, Thomas <thomas.lendacky@amd.com>2021-05-10 09:24:55 -0500
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-05-11 17:45:40 +0000
commit6933c78e4dc20cb5a633fa917e57158a6646e62e (patch)
tree0693d7c651e9b01c37d1af921905e44cce27b070 /UefiCpuPkg
parent4e5ecdbac8bdf235b2072baa0c5e170cd9f57463 (diff)
downloadedk2-6933c78e4dc20cb5a633fa917e57158a6646e62e.tar.gz
edk2-6933c78e4dc20cb5a633fa917e57158a6646e62e.tar.bz2
edk2-6933c78e4dc20cb5a633fa917e57158a6646e62e.zip
UefiCpuPkg/MpInitLib: Properly cast from PCD to SEV-ES jump table pointer
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3385 A VS2012 build fails with a cast conversion warning when the SEV-ES work area PCD is cast as a pointer to the SEV_ES_AP_JMP_FAR type. When casting from a PCD value to a pointer, the cast should first be done to a UINTN and then to the pointer. Update the code to perform a cast to a UINTN before casting to a pointer to the SEV_ES_AP_JMP_FAR type. Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Fixes: 7b7508ad784d16a5208c8d12dff43aef6df0835b Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Message-Id: <c89bc819856d448360430c32cb3833a9667f987b.1620656694.git.thomas.lendacky@amd.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index 3d945972a0..dc2a54aa31 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -1265,7 +1265,7 @@ SetSevEsJumpTable (
UINT32 Offset, InsnByte;
UINT8 LoNib, HiNib;
- JmpFar = (SEV_ES_AP_JMP_FAR *) FixedPcdGet32 (PcdSevEsWorkAreaBase);
+ JmpFar = (SEV_ES_AP_JMP_FAR *) (UINTN) FixedPcdGet32 (PcdSevEsWorkAreaBase);
ASSERT (JmpFar != NULL);
//