From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.76.1620753666210620706 for ; Tue, 11 May 2021 10:21:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OHWN9J+G; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620753665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xPA6azj6WMd88zj8qs9n5Zwb2Rhhu8TL+qpb9ro834I=; b=OHWN9J+G89qXSP5OkXv7fq37EiKlFpGfsWZHgoTIq6TfMs3XcbZlG89I1Qk07/u52fZRWl K44Z1B784CWvgbN0Sr2UBM0qTElaR+z9vWGSuE0oSu4pLUPjkAR4/tTTq2VULtR9ImKUkV yoBCuTyaxqPVsDN5nVuJsjP6MEe80dA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-425-u7s_gN-wPvGIDb1lqQnMfg-1; Tue, 11 May 2021 13:21:01 -0400 X-MC-Unique: u7s_gN-wPvGIDb1lqQnMfg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BFC7107ACC7; Tue, 11 May 2021 17:21:00 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-165.ams2.redhat.com [10.36.113.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0943F60C04; Tue, 11 May 2021 17:20:58 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/MpInitLib: Properly cast from PCD to SEV-ES jump table pointer To: devel@edk2.groups.io, thomas.lendacky@amd.com Cc: Brijesh Singh , Eric Dong , Ray Ni , Rahul Kumar References: <167DBAB14C9048A8.15120@groups.io> <43d51ae5-9b5d-ed79-b766-3b7a25b42b28@amd.com> From: "Laszlo Ersek" Message-ID: Date: Tue, 11 May 2021 19:20:58 +0200 MIME-Version: 1.0 In-Reply-To: <43d51ae5-9b5d-ed79-b766-3b7a25b42b28@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 05/10/21 21:33, Lendacky, Thomas wrote: > On 5/10/21 9:24 AM, Lendacky, Thomas via groups.io wrote: >> 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. >> > > I should have included a Fixes: 7b7508ad784d16a5208c8d12dff43aef6df0835b tag. > Thanks for the note, I'm picking that up. Laszlo > Tom > >> Cc: Eric Dong >> Cc: Ray Ni >> Cc: Laszlo Ersek >> Cc: Rahul Kumar >> Signed-off-by: Tom Lendacky >> --- >> UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c >> index 3d945972a025..dc2a54aa31e8 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); >> >> // >> > > > > >