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.web12.521.1620755604400252737 for ; Tue, 11 May 2021 10:53:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dYgUF011; 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=1620755603; 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=sh/9RIChA3tLFui9oFDgj5r3ash/rAlI6JcRf2PQXWE=; b=dYgUF011LFIkridGHeikIogBuQ6qhynL7GTmmzlnIAu4rZ9kQA9xcNtW2PPveVykxl9bBq Wd9R/RHOv8YFkXc9nEoN+xhMuQy2kMKJH+TECAhXtbugq5nET2FJMER6wL2vZpxvj9ZeKK k7lXO1JEm7YHdqekidITI1evThh1XZ8= 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-389-fhpCgFtQOz6QaSzHXwuhVQ-1; Tue, 11 May 2021 13:53:17 -0400 X-MC-Unique: fhpCgFtQOz6QaSzHXwuhVQ-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 5C36D9F92E; Tue, 11 May 2021 17:53:16 +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 1120760C04; Tue, 11 May 2021 17:53:14 +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:53:14 +0200 MIME-Version: 1.0 In-Reply-To: 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 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); > > // > Merged as commit 6933c78e4dc2, via . Thanks Laszlo