From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.70]) by mx.groups.io with SMTP id smtpd.web10.2368.1620675213415213946 for ; Mon, 10 May 2021 12:33:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=i9hC+kLJ; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.223.70, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bADWcfJAP/xaOIiNp6e8sON07ilFYgmO6au92I6LMJVV5S6+zv/6vIZN/tExL35htAI0U7T22E5lhWH5eG4H2oo2hDTAm5nYsujdfAyIP1VyNCkX+KIkoLMmn6wWHOcf3EykIXCe8mxiIqk2773HiC+OZGNg7aBZN62NQ/1EBu06nbqT0WK+zpQPYPKESlPOgFMuqY3vk65Jbm7E7w3sgjBnI3+sSDMAw/Zwymp0CZ0bRvZOdPvXnH1iNJR9Ye6wHvzf2C+DJnkPLJjLkSucuj4wjOnkip+Pe/iu9MlofcmZLCVMWyL274kukkgorset3oMFOq4jVe4Q+8D6cLKa2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dEy/c9k/ECAYyLWIzw1Oi5Cai7PcoY+H+2+pE7wGKpY=; b=GeYl28GSK8M71nOxWMM008QSgHKnajb5l6mhvFIOpjtcUVz3QoSQEF/F4mo8Yynkylr+gZQATFmJUHg09Q6/V+fIcTwpCD8M4t1jKnvIaOheCTSR3mQdmFkSi04qBtFDv5/FxZeBLOb/X1HK9IkvhVrv3R+p3WMtlqI8mGiw2zStd7FrlZHm1Ve3kxAjMOaG8wOwx54xlM4vDGcuGaK31L3kjXjPdoQlXCfv8mom4Pr0PA5p+wZgqya8bSFSwtQtx0OZqYDowtM8OKOfkwIHkKFc2mUCkciYz1jFjuSAxCtR437BBq9hU5lnN+a8eNj0iSmdeNAjBFUb190K6a1axg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dEy/c9k/ECAYyLWIzw1Oi5Cai7PcoY+H+2+pE7wGKpY=; b=i9hC+kLJuWp8UVwQfJcL1OKvTyDpxvd2YuRM6zoZP8gClGjmanW0A5QoBVizPmrZidQ+YQtM67VisMxp54nSy7ys1dggduaqrx6GaH3YL9uFDL52Dm/AAOjo5Ss9tEoigaKl1veccLA6MwjmN8LS76MU+hKYz2ElKUUL/5YLFFg= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM6PR12MB3964.namprd12.prod.outlook.com (2603:10b6:5:1c5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24; Mon, 10 May 2021 19:33:31 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::b914:4704:ad6f:aba9]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::b914:4704:ad6f:aba9%12]) with mapi id 15.20.4108.031; Mon, 10 May 2021 19:33:31 +0000 Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/MpInitLib: Properly cast from PCD to SEV-ES jump table pointer To: devel@edk2.groups.io Cc: Brijesh Singh , Eric Dong , Ray Ni , Laszlo Ersek , Rahul Kumar References: <167DBAB14C9048A8.15120@groups.io> From: "Lendacky, Thomas" Message-ID: <43d51ae5-9b5d-ed79-b766-3b7a25b42b28@amd.com> Date: Mon, 10 May 2021 14:33:29 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 In-Reply-To: <167DBAB14C9048A8.15120@groups.io> X-Originating-IP: [67.79.209.213] X-ClientProxiedBy: SN1PR12CA0097.namprd12.prod.outlook.com (2603:10b6:802:21::32) To DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from office-linux.texastahm.com (67.79.209.213) by SN1PR12CA0097.namprd12.prod.outlook.com (2603:10b6:802:21::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 19:33:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c2ddf060-5fd9-4259-8d6c-08d913ea7e60 X-MS-TrafficTypeDiagnostic: DM6PR12MB3964: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:873; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DKFAlnuiqDZwitILbSrUP1XP9hKCaeATZ0puJWD7Wf1uC5K4R8DknLQhvoHAV3I5yRgWdxwyId4KJmc/QqXX0ig7MqkjtZqJV9chEMYLNeMezGsoofN3fEN5aEtGDKzuoLG6MR7YTrzo9VBJpUF9kjQThylSwM0L3L4r5aprTVzURTtE+mCvpvtPjU2Fw1e+rKj0R1p/1hmPPs4YRPk7EgrOZoM25XsNmocp+j0ip0NjDexSwKQ/pxV/rqRmYcdd89uYMZbANWyA8zLx+Vrlq3ixqUNTzfsrk5UyLQs+vRcFRGfJ0xf/d/rDJuHbTaSMmpJSllXZgmVq0B69ZbIzp5E+dbZTh54Fi+mzox8r6Oc0iF+syeUnApwVkckv7A/k8OcYZnNxAfuZjzEqUTn3u+FLZ7jBbj+gRbi4bNneuQ+4ioaz6h8BCChjG9YOzohpv3zz1zPExPE1hwldQWVSX9fqdyIc/Cvkbp8T4IeqQNeeyW73PGI8aHcAAbGZnoVtiYOgRnM2QkvXmSglxhXfQYy2E7QNJuEz4ManWBTEwk8ASit2x548yEVm06GAY1ct2k+yoqfHmiha/8hbaXITxJogv3cYIgGGq4LeNJjR2HYsEFG+vYT3K497oQW4gCtFJpcsBAHcypX0omyo+22JVoeQ0FERr6Qc1GLIqvRmctJ9GguDXvB3ybY590vFm2/J+A6pWrqpPjr5Y+J58EpkgG+C1Y4g838QW16oEETnkQsgScvLELaqPchboYYB1BjYZEcm9yAbjGI7lxjZJlRbiA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR12MB1355.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(4636009)(39860400002)(366004)(376002)(136003)(396003)(346002)(316002)(4326008)(31696002)(186003)(66476007)(66946007)(6512007)(16526019)(83380400001)(6486002)(5660300002)(36756003)(38100700002)(966005)(2906002)(31686004)(8676002)(478600001)(2616005)(956004)(26005)(66556008)(86362001)(6506007)(54906003)(53546011)(6916009)(8936002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?WnJtYWR6WTBhM2FNeFYvVXB4K0ptNzhOMzgvUVF2UW1qNEE1ZGplL3NpWGxj?= =?utf-8?B?cWhudHJ4S2tOK21IWDg5MWZhbDJCTU4rM0xuWHhzQ2wvTUdTNTVnWTFzdG5H?= =?utf-8?B?dnp4VzZocFBsY0J1QjNwQ2J6Ukg1dWM3cHFiMlVsUXpSb0p6ZnhMVzVkZWxn?= =?utf-8?B?YkxpM1ozckZDWmxvMFhoR1FzQ2xkM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tsdkNSMmo4UFBDd3FZWFlWdnhkVzc5VmdEYnZu?= =?utf-8?B?NDBwQlR5NCt1R3AxeENOZ3dCOEhuQVZuTXF0Uktma1FNM1BQWkgzb1Vpc0M1?= =?utf-8?B?Q1liQThlaHkyWC9IS0NhUllRWkVuS2hKRVoxSis1RisrWndNc3FKL2NqSmNL?= =?utf-8?B?cWxXVUF1dU5TYWdLVFBlaDdBb0o2Ui9EYXE1N2Rsd2Jac0NIMUY2NVJNUVZq?= =?utf-8?B?cDl6WUJSdzdZUS94QmtFNUdibVp4aEFCbGZOdGNwcWdvL2VkcUJ1eU9VaEZB?= =?utf-8?B?ZjQvQThoMU95dUF1bnNjNmhORTFHZVc1T2VrSmxBdkRtYkpnSHZydURLRFkw?= =?utf-8?B?RWZwUHBDeWh5bFQ3bzM5Z0NMb1VBMWlxVVBaZUFkS05pdjBvcW1aQmtmRFZ0?= =?utf-8?B?cHdTU2o4bEVRdkd5QmFoNTh1bGs5SjI4Z1FIREsvQll2dUJOWGtCdWJWSGtr?= =?utf-8?B?amFCUU5SNTdqWHREb3Ryblh4OUN3N3hDMjlkQkh1NTRBenU4aXRjMWxudXZi?= =?utf-8?B?M1VVd0NMelVJY25hbHM0NkpDaTc2bXYvZG9NZFVDdnlXQk8vODc3bGdTWENO?= =?utf-8?B?Tk1ZbGlsS1dGMWQybllqSXhiTHVxOGFXUXFxUC92bW5lZEdEUnpJQXNQTVE1?= =?utf-8?Q?8Q3pUusymdYYdxX/dT2sEwshZJiAesldzXEBT4k?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c2ddf060-5fd9-4259-8d6c-08d913ea7e60 X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 19:33:31.4677 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +pUpEVF7xfZtGhcpbbA7/7vD+rA/SzfU9L2tpSCJDo/4epbq8EQ19sQWrNNKdBFworo2WealDxtOWoTXJSlCqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3964 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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. 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); > > // >