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.36.1620753504281306099 for ; Tue, 11 May 2021 10:18:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VYb4RGik; 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=1620753503; 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=wxyCAQQ97Vxs9uWq1QAjp7YuPqs8AbSxP1pXRmjfsuE=; b=VYb4RGikC7woGr/sEU6OSHgTnz0u9siynBAYTUSXOxecc+MxF835i8nQsTlXJTHNgMDhE3 5IGlPc3LuxX3F9G2ObKEuNd2rY6Z4FUuji/PkMnWjP41qBQ5INYr+LUapG66J5YkeyIztC Q4iOGmm7cM8+2wmwdEfIj0Ui5k5Oo8A= 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-431-tazKuTzfPD2pwrJLtS3zYg-1; Tue, 11 May 2021 13:18:19 -0400 X-MC-Unique: tazKuTzfPD2pwrJLtS3zYg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1498B1006C81; Tue, 11 May 2021 17:18:18 +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 B84E260862; Tue, 11 May 2021 17:18:16 +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: From: "Laszlo Ersek" Message-ID: Date: Tue, 11 May 2021 19:18:15 +0200 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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 16:24, Lendacky, Thomas 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. > > 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); > > // > Reviewed-by: Laszlo Ersek