From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.59]) by mx.groups.io with SMTP id smtpd.web09.9492.1621349005402441632 for ; Tue, 18 May 2021 07:43:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=eHIdh3KF; spf=pass (domain: arm.com, ip: 40.107.22.59, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fm82aoeg9k8SBFGL2WdwouVQgDt59pQ4wMYs02/iws8=; b=eHIdh3KFQZJyrtJREgCDh68AVIvYGNvBMFlHNYKALypVhfD7Ek27qsp/DG1s4kVkruU0Zmfo0qmdf4XeN9X6nix23pTFLlzSpU+ypWRWrpXG4h8wD43jLHKKQrhXvYwTW/SEoXlxxZxeA1r8mYTcY+pxT5e+bHo1dFpVWYsj7X8= Received: from DB9PR05CA0027.eurprd05.prod.outlook.com (2603:10a6:10:1da::32) by PAXPR08MB6494.eurprd08.prod.outlook.com (2603:10a6:102:154::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Tue, 18 May 2021 14:43:22 +0000 Received: from DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1da:cafe::9c) by DB9PR05CA0027.outlook.office365.com (2603:10a6:10:1da::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; Tue, 18 May 2021 14:43:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT030.mail.protection.outlook.com (10.152.20.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Tue, 18 May 2021 14:43:22 +0000 Received: ("Tessian outbound ea2c9a942a09:v92"); Tue, 18 May 2021 14:43:21 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 884425e83764ff3a X-CR-MTA-TID: 64aa7808 Received: from ff7b741313b1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6BEF9534-F783-4CF9-978C-EDF2C2425C1C.1; Tue, 18 May 2021 14:43:15 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ff7b741313b1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 18 May 2021 14:43:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mS0A2Zi2eBkNtdw4AL7l+5R4xtgKN7X7evUCLvg9rO194C/PvVyKEbEPbIIrX/Pr09FIpUkNcxLf7WyjX81WhPh+WA5csFPxY857rrlJAtGPiuZgcHFz0SDAneS8OZiBwQ+c/yyd/wtjX9kv/nNO29/Hz2s+AW3Je2sHIC6Ggw7jEUWvn9PYuxzsjmuPp5YMe10xekEFVckg3HyEYY9S36REVgAIM0RM+97jTWLEAkhCeMQr2IKY/wM0Dp517eDtWFAPfUpt+/GVFMh6vKw1rgJRjRW7ysDcdeC0R/v+tU1wIXGAPdtzdseLtdAmfwRQNRhs/418n4Wka/paDdDmIg== 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=fm82aoeg9k8SBFGL2WdwouVQgDt59pQ4wMYs02/iws8=; b=ZdYxvB3J3dSGolEMIjOuhrT7pGPVD9+bD0X0wuKPwn91gyqPrW3Ef+ksvyNiXCTeUN20fsNwzKCk4TsacmMzFc7tgO9VRk3Bj3Eka0bC1SjUQ6ZMKVgxHtYqFoeiobc+WgbS+Bx8xRkvR3gIa12vj+7ZwANI55zDVOkHA/H5FbDUkZ4A3O2BhtHskjYqDm0Jd9V5+4pJJT7VCSHYgIEqXbvGxcQz0Cb6J3ecJxl1wruXKyGtdInwzjDiH6lz/cDKeJvltwOZ3XhwZmjztNRKjFhLgnsYehMzQ1/+LVgpSkEnfeQQcshbgTj3AaCTD561fkeuaYRfb+fBwDFdd2IK9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fm82aoeg9k8SBFGL2WdwouVQgDt59pQ4wMYs02/iws8=; b=eHIdh3KFQZJyrtJREgCDh68AVIvYGNvBMFlHNYKALypVhfD7Ek27qsp/DG1s4kVkruU0Zmfo0qmdf4XeN9X6nix23pTFLlzSpU+ypWRWrpXG4h8wD43jLHKKQrhXvYwTW/SEoXlxxZxeA1r8mYTcY+pxT5e+bHo1dFpVWYsj7X8= Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AS8PR08MB6166.eurprd08.prod.outlook.com (2603:10a6:20b:296::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Tue, 18 May 2021 14:43:12 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::80cb:878d:c8f1:2688]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::80cb:878d:c8f1:2688%7]) with mapi id 15.20.4129.031; Tue, 18 May 2021 14:43:12 +0000 Subject: Re: [edk2-platforms][PATCH v2 5/6] Drivers/OpTee: address cast build warning issue in 32b mode To: Etienne Carriere , devel@edk2.groups.io Cc: Ard Biesheuvel , Ilias Apalodimas , Leif Lindholm , Sughosh Ganu , Thomas Abraham , nd@arm.com References: <20210517055047.30814-1-etienne.carriere@linaro.org> <20210517055047.30814-5-etienne.carriere@linaro.org> From: "Sami Mujawar" Message-ID: <42e0f19e-3fc3-2088-519b-ad33fdb9868c@arm.com> Date: Tue, 18 May 2021 15:43:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20210517055047.30814-5-etienne.carriere@linaro.org> X-Originating-IP: [217.140.106.52] X-ClientProxiedBy: LO4P123CA0163.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18a::6) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.1.196.43] (217.140.106.52) by LO4P123CA0163.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Tue, 18 May 2021 14:43:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9448475e-2626-49d6-8f10-08d91a0b48f4 X-MS-TrafficTypeDiagnostic: AS8PR08MB6166:|PAXPR08MB6494: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: W+G38e5IIPZC1IFJdbidFdjAbF9aV0NkrRC/6flfTeWPw3Odyw/VqyfcheLO3+IMfCGbK+feeIP6ZdMaPNrn1Dg3F540TxoK9gzpbnMPfsCC0VVUv/RTpsl1XMoR9qsp7oyrMNhtatQLRerCdb5xQMwQOv0CSYrZrjBAbnTB7aCf9aapSd6wMtw25xTn9QdqaiAHOwjspsevBU9Dm3adW92/k2TPBHq7P3DlugtAyc6s8d2dIHm3qoyPuedoHG/ziRitd5UgtA758ym+j3D3aZUG0iRW092cq/PxfFPQaGjnF7YcIf97NMnmqQksGddU/kmeMwkJcfs+a3dZRaOUVsUs/flxh4QzS+2DBQAjo6JWGHXkSsquaWSuU60xVquOJ0271bNs1TFlHONJzfrltLUQvjiECD7dL1VY4Oy1UgWyZIBsQrkvQFBNfDuIVJ1dwhW3rpMld23WIVm+KvkvtiLDlMlmbcwaQarl+6lbLsGEEHa7v82m6MhsrFC0Y7kyKuqJJiirPKMU+B1rkvwsYyXRJTEsZ+nCDn7hpAIspaOH8U25etV/wGSj5FAdUxQcRMaexWYfop8i7zvyaevfSXQ/xtKzCAgs11xQyeVUqtSTBVGu5wyP60y/Zqsy1T50uR3vrKo+1HgvJ/bmH5ir/r8j7e0KWL2MzcLZtXVFp1eDo+cER9M246gVklhw2LUinrzilDwVxj1H9cUiKUF1vgRuiLUfFcnFFeVZ8ahnN5A= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(4636009)(136003)(39850400004)(396003)(346002)(376002)(366004)(956004)(2616005)(26005)(53546011)(16526019)(186003)(44832011)(4326008)(6486002)(36756003)(38100700002)(5660300002)(83380400001)(31686004)(2906002)(38350700002)(66946007)(8676002)(316002)(16576012)(52116002)(54906003)(66556008)(8936002)(66476007)(31696002)(86362001)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?T2ZxODh2RmF1djNyTlpLRGdRM1ZTNVVLVnRNeUtxTzdHVkxOckZvUFRoaktl?= =?utf-8?B?c1pMYnNiVU9nWWZob1FWSWdLRnVvWThRVzlYOWl1MWRUaTU2ZGQ2Y1NlRkVJ?= =?utf-8?B?RHRrNkhSOGxhQXorUlM0ZGNDZkw0NnVJblQzR2xFSjFCd3cxTFA5T21sN2JL?= =?utf-8?B?dWVwVnc2TEhGVHhqRVU3T210TTRrck9sQ1JIMG9JRXBSNW5yNFU0RXFiNlZl?= =?utf-8?B?ZGZQZ1dGZ3ZGbHBkaFFiUW5pTzZNUURjNlNCajd5Q0c3aGwwb0dtVVFLVGJs?= =?utf-8?B?WFk1V0lvNG9yMmE3cEw0a2tEZzFjcllibVQ2b2FqSlZnWWx2djlYL0FDUjVw?= =?utf-8?B?Z3AxNHlkTXlaNVI0dkFldXVWWi9hNVpXZ1RQbE9ydGRlQU1Vcm1SUmtkNVdr?= =?utf-8?B?NTUrZ1FZRXkzUFFHdWE2ZXdGbmgxc2NZaDBON3BIdWV6YzRlTm9ZZGJLcVpD?= =?utf-8?B?TjZxUE1tV2RUZklwTkNoVTlLS28ycUFML2VaSjVYUllaV0JOSi9ReGl4M05p?= =?utf-8?B?emNBaGJ1RHR0dWZzTWtUNlpOak16SHVDeC9BYkNyZ3REZmZKTWZmek5uTE9x?= =?utf-8?B?ZWVDV1M1bFBRRzVmNWVyM3ErUGFnZENJdGtleWFEem5oZVl1RzJFbUN5WW9o?= =?utf-8?B?c1gzMnp5MWFkQVZ4bnlHUmhIS0ZFcjkrVFZNT2hyS2RUN2dHaHlaNUUyaDlD?= =?utf-8?B?ZHQwSmp5TFlCRGxDY29DbmtvY1ZnRGcyeFYrY0taR3BldmJaMVdFNDZqOTVo?= =?utf-8?B?V0k4ZHVYRDdFNEtIbFNCVWJKVmNKdE9XclRleTF2akVZUGJIRHBQZnFnalpU?= =?utf-8?B?WW9GR3FTbVZ3bTZheEE1TXhoNWNPYzV3NHZXMjlSWXRVZEFOMkp3MUw0TmM2?= =?utf-8?B?MXVlYmczM0NPc2R6SEFuZ3hJT3Y2ZVE2aWpaalJCRmU4eml0ODdGUkhObzha?= =?utf-8?B?TEcvMERVSFUzSEZIeGlndmROOENWdCtWc3lkWFU4ZTVnQlNWN1dHQXlnMjd0?= =?utf-8?B?MGJRM3dlL040YnQ3dktGWll3cS9CWkxjYWJBT1pBNkxUVG1MYU1LdktsZUx6?= =?utf-8?B?YjhPc0JYYytIVnNzWFlsTTZGVXQwRVQ2WVY3MjVtcFl0VmFkMUYrMGx2L3dn?= =?utf-8?B?WXQvR0VSMkVaWTB2MkFsUVlES2pEZjhaU0szaktxTUprZlkrbjdYbW1HQjJK?= =?utf-8?B?WlJ6V0lFTFo5RU9JTUp2bmh2U2V1aWd4RzVxK09xdWhsQ05xTXFyZHVkMjJr?= =?utf-8?B?aUwybldOejZvWXR2RXExOWNkaXQ4aEtvUXVxc0hUY2tzTEV0WHdWZlp2TURC?= =?utf-8?B?SWtSc1J6Q0RoMkwxRWMrY0c2ZEt6UGU2TUlMMUhpUEh3SGJFMkRFNUZFVm5S?= =?utf-8?B?VWZoUlZxTWpldU50VFpudFN6MUpPU3laRlMrUHJvY0l1bnphTmxIMEdYdWNY?= =?utf-8?B?eHRiN1NoVllhT1drQ3dreDF2RzI0NTM1RkJSalJPV0JpbS9SZ2dQU2U0Z05I?= =?utf-8?B?bE1yQmgxWmdJNWRTZ2MxRGFVRTFVd203UjFPUi9MSHVZeG9Ma2hBRnB0MEJ3?= =?utf-8?B?c2dOSldNRTd6cDRRTFIxZWJXTFVuRkxvZUk1Yk1QT0JleHZzaVpHUjR0bmpN?= =?utf-8?B?MlVQU1gwZHhRbkJLdU1yVTVYakNnMHVTb0VxNzgwcm9PY1BqcXlpK3hCdExv?= =?utf-8?B?a2xHeHFmb1lqTFZrTTliSGFVaWhXVnQ5Z1JFb25lWlhqNDc1N1l1Ni8wdis5?= =?utf-8?Q?+Lr+WDzx2bkKMEeWZX1vh3hqbxR/UMlZNVpPcgl?= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6166 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 62a06b2c-fcc8-40a8-3fb5-08d91a0b435c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qZGQ/FkMQokKZGcrspnAN1nVF/9JTN3WYG6WqyP3PI9ifjRsIGjbfwkYJsMerKGi4yqCirB/ru6smfAkvkcNNLTeRZt0FIW8fjHFrV37G7oMa9Iawk+6W4CvfLbltc2/KJ1h3kDUkpk26afBbJHjflr9K93xt7dODh/3xV3Jhgy/mNmv0JuYCIa5W30PaxRCr3/x4pLq/StNrUeIV8Dm6o+ItDgCRwALDwfSxNPE/lq0GjkxoMQdIbZoDyDrmndH5TzOZE+VFIbvwchFvTp8jxi5qRs/nT+piHPk8qAd85U1wrCX2e1I1ROdvhXbXu7+yeKs7G3uIVxAyJaAMBSFENrWc7W5K+LMD5UEr2+KdeElYiC4108laTy19TOFRlclKFb4nv65KNQGK0StBwgxosOC0azrCnv0bxDEjFCe1XA9U7u1yipeCSnuo7BgwSMvO+su1oOG4imIo4TtKehjD9URQ+LJHHm+Mk3HFukMkmDCuvJFvKVRhlCjK4FPYhz/nyQza/iBnmlmaDAUw0WNjw0admBIh3n212e8rzabPvqPQw4KLO/lnMcJb+U9bIDKFavI4Zjzk1ASs5VdwatD376FuSakw7tNp+BKC0zlZ8uf/8Rdl35M9ABeiRy3Ai6JkExqXsYVK4B/27RjHuCAAhZAYKo2pPSIuPunS1CaQAFbf2tD1q5vIRxT//KnuIIR X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(6029001)(4636009)(346002)(396003)(376002)(39850400004)(136003)(36840700001)(46966006)(54906003)(336012)(82310400003)(31696002)(6486002)(31686004)(81166007)(83380400001)(47076005)(36756003)(16526019)(2616005)(86362001)(44832011)(8676002)(956004)(70206006)(26005)(36860700001)(16576012)(316002)(53546011)(70586007)(82740400003)(478600001)(8936002)(186003)(2906002)(4326008)(356005)(5660300002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2021 14:43:22.0515 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9448475e-2626-49d6-8f10-08d91a0b48f4 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6494 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Hi Etienn, This patch looks good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 17/05/2021 06:50 AM, Etienne Carriere wrote: > Use (UINTN) cast to cast physical or virtual address values to the > pointer size before casting from/to a pointer value. > > Cc: Ard Biesheuvel > Cc: Ilias Apalodimas > Cc: Leif Lindholm > Cc: Sami Mujawar > Signed-off-by: Etienne Carriere > --- > No change since v1 > --- > Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c | 21 +++++++++++++------- > 1 file changed, 14 insertions(+), 7 deletions(-) > > diff --git a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c > index 6eb19bed0e..83c2750368 100644 > --- a/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c > +++ b/Drivers/OpTee/OpteeRpmbPkg/OpTeeRpmbFvb.c > @@ -305,7 +305,8 @@ OpTeeRpmbFvbRead ( > } > } > > - Base = (VOID *)Instance->MemBaseAddress + (Lba * Instance->BlockSize) + Offset; > + Base = (VOID *)(UINTN)Instance->MemBaseAddress + (Lba * Instance->BlockSize) + > + Offset; > // We could read the data from the RPMB instead of memory > // The 2 copies should already be identical > // Copy from memory image > @@ -387,7 +388,8 @@ OpTeeRpmbFvbWrite ( > return Status; > } > } > - Base = (VOID *)Instance->MemBaseAddress + Lba * Instance->BlockSize + Offset; > + Base = (VOID *)(UINTN)Instance->MemBaseAddress + (Lba * Instance->BlockSize) + > + Offset; > Status = ReadWriteRpmb ( > SP_SVC_RPMB_WRITE, > (UINTN)Buffer, > @@ -477,7 +479,8 @@ OpTeeRpmbFvbErase ( > return EFI_INVALID_PARAMETER; > } > NumBytes = NumLba * Instance->BlockSize; > - Base = (VOID *)Instance->MemBaseAddress + Start * Instance->BlockSize; > + Base = (VOID *)(UINTN)Instance->MemBaseAddress + > + (Start * Instance->BlockSize); > Buf = AllocatePool (NumLba * Instance->BlockSize); > if (Buf == NULL) { > return EFI_DEVICE_ERROR; > @@ -689,7 +692,7 @@ InitializeFvAndVariableStoreHeaders ( > goto Exit; > } > // Install the combined header in memory > - CopyMem ((VOID*)Instance->MemBaseAddress, Headers, HeadersLength); > + CopyMem ((VOID*)(UINTN)Instance->MemBaseAddress, Headers, HeadersLength); > > Exit: > FreePool (Headers); > @@ -747,14 +750,18 @@ FvbInitialize ( > // Read the file from disk and copy it to memory > ReadEntireFlash (Instance); > > - FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *)Instance->MemBaseAddress; > + FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)Instance->MemBaseAddress; > Status = ValidateFvHeader (FwVolHeader); > if (EFI_ERROR (Status)) { > // There is no valid header, so time to install one. > DEBUG ((DEBUG_INFO, "%a: The FVB Header is not valid.\n", __FUNCTION__)); > > // Reset memory > - SetMem64 ((VOID *)Instance->MemBaseAddress, Instance->NBlocks * Instance->BlockSize, ~0UL); > + SetMem64 ( > + (VOID *)(UINTN)Instance->MemBaseAddress, > + Instance->NBlocks * Instance->BlockSize, > + ~0UL > + ); > DEBUG ((DEBUG_INFO, "%a: Erasing Flash.\n", __FUNCTION__)); > Status = ReadWriteRpmb ( > SP_SVC_RPMB_WRITE, > @@ -827,7 +834,7 @@ OpTeeRpmbFvbInit ( > mInstance.FvbProtocol.Write = OpTeeRpmbFvbWrite; > mInstance.FvbProtocol.Read = OpTeeRpmbFvbRead; > > - mInstance.MemBaseAddress = (EFI_PHYSICAL_ADDRESS)Addr; > + mInstance.MemBaseAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)Addr; > mInstance.Signature = FLASH_SIGNATURE; > mInstance.Initialize = FvbInitialize; > mInstance.BlockSize = EFI_PAGE_SIZE;