From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.81]) by mx.groups.io with SMTP id smtpd.web10.6900.1621335950264704640 for ; Tue, 18 May 2021 04:05:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=NIH8a6cA; spf=pass (domain: arm.com, ip: 40.107.7.81, 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=IeDL2Oy/ZrCSnFX8UHMKyHaFxHT2LM6LCy3U9baMD1k=; b=NIH8a6cAMwC51ErzA2BLK4/bt64wCMMDYHThda6BaotSHx3ld3R7hk1htv0GZzGxxRxhYr8Bv5Zt9LzCkIcA9ROkLlfQxfZaeKd/QuMm7vDzhmUTYJAxJfynVbVyI3UJzfo1VsYXSx+p5NNla3OvI7pc5hqgKlCIMEKNbbf+M3M= Received: from AM0PR02CA0209.eurprd02.prod.outlook.com (2603:10a6:20b:28f::16) by AM0PR08MB4580.eurprd08.prod.outlook.com (2603:10a6:208:10c::21) 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 11:05:45 +0000 Received: from VE1EUR03FT057.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:28f:cafe::aa) by AM0PR02CA0209.outlook.office365.com (2603:10a6:20b:28f::16) 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 11:05:45 +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 VE1EUR03FT057.mail.protection.outlook.com (10.152.19.123) 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 11:05:45 +0000 Received: ("Tessian outbound 6c8a2be3c2e7:v92"); Tue, 18 May 2021 11:05:44 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5a38847ded65303d X-CR-MTA-TID: 64aa7808 Received: from f251c852e0a1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 41097E30-52D5-41F7-AA8F-FE5847F1DF62.1; Tue, 18 May 2021 11:05:31 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f251c852e0a1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 18 May 2021 11:05:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G7PRCR/KRIrDuxvil/EFwksSU6GTk09lbgmld/s54En9e3pmH4COhke2XpyBF4wleLdAmh5zqxkgFEH8/MIDTYEqtOq6bFI13UW1UIR16oAfahZjHgp+GgOR4mwenAMcJhIOJOogiu7wqc2XkUWcSCYNNg5lDLvr1V0V6ZWLYqVxomZ71pbEFuu3skSE9im7R1u2hioSNyH9BZ025ULN6+ufXs/31hjCm7A8F4/v2V1lVcbpDB7qLhWDPgZhT6PQGPDGg+maBOzIfLHNfzEXgfdUnizfeaq3jq8QIM5rD+J1aQIOzYw2QzFsQwPZrxWCksFfQDQ5e9GaR3I4N3HQ4A== 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=IeDL2Oy/ZrCSnFX8UHMKyHaFxHT2LM6LCy3U9baMD1k=; b=bWubsncHbmOKYQCxXbVqAvRUiHvEX7FZ9EU9V+M44y6kbNOBdzHifp/DF/QoO1F4XZlH13OM53naC/9+w3tLzCb+bZU955Px9CpIppS9wiBYvRgEU3g7PvegIg7OfJQZdo4cMx5818QWIpcVh8KV0ucio4cSg1YNf3MbrLuNBCQFzxkZBZVrv9rNwi4tBytkDWCCIKThBLln3q1Av5ypFJX+UJ/10rjIcCf22VEOPJ7JxoF1SDmB+sunRe5Iq3irSK/ONyl50oY8+Gal98dw0q+VhaZNx0zRa9W9bh48U36TCOSsst9RQfFz/C8LjG1sQ0pTvk0MGxPra7jKF7yVog== 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=IeDL2Oy/ZrCSnFX8UHMKyHaFxHT2LM6LCy3U9baMD1k=; b=NIH8a6cAMwC51ErzA2BLK4/bt64wCMMDYHThda6BaotSHx3ld3R7hk1htv0GZzGxxRxhYr8Bv5Zt9LzCkIcA9ROkLlfQxfZaeKd/QuMm7vDzhmUTYJAxJfynVbVyI3UJzfo1VsYXSx+p5NNla3OvI7pc5hqgKlCIMEKNbbf+M3M= 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 11:05:29 +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 11:05:29 +0000 Subject: Re: [PATCH v3 4/5] StandaloneMmPkg: fix pointer/int casts against 32bit architectures To: Etienne Carriere , devel@edk2.groups.io Cc: Achin Gupta , Ard Biesheuvel , Jiewen Yao , Leif Lindholm , Sughosh Ganu , nd@arm.com References: <20210517074054.30281-1-etienne.carriere@linaro.org> <20210517074054.30281-4-etienne.carriere@linaro.org> From: "Sami Mujawar" Message-ID: Date: Tue, 18 May 2021 12:05:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20210517074054.30281-4-etienne.carriere@linaro.org> X-Originating-IP: [217.140.106.52] X-ClientProxiedBy: LO4P123CA0217.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a6::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 LO4P123CA0217.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a6::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.32 via Frontend Transport; Tue, 18 May 2021 11:05:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 834faa7c-d6ce-44e1-3fe5-08d919ece2a1 X-MS-TrafficTypeDiagnostic: AS8PR08MB6166:|AM0PR08MB4580: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: kfz0DB/j/LgAJMJKVJnM5QT1q6ApnQkX5NBwraf7ZjUUBmaQxoI5v43mGzvR0ACDp4woI9nwVpZeE+mBLDpAiiCeGGwacgU5LZ4JPdVu4HgOgbdZh7XychoZKexo/xAE2354V7a+7UYFRzqwUxWxqS5bUnO+m9hLzRJKaY8ElD/Kt70BtqqCnSgp0WPDlta0nCiXwHSGQL4EiYh8IFKqHsdsuiCpZcnq3XpV8B8FyC3iTh2Pz1irlegRd8ora5X5In/UehuMjCxvXjmNXcHcA4scegL6+aQCDGxB4YmFyNzeM7BVSBzgnSVpasn4YFKJPvMvfj8AY32/jVof3XYInlCMvv9rmo8bGKNlBViyvJssA5QIFfu/7QGIBvQT7O39TQ2hzjIZSWtIQrEA+V9JIDoUaIqz0GeZrvequqQEUSt/Sw5PwQV/bh8I5nfHuy9Yr+rFcyGge+WTjX+R63Wo0zhbzRkQbt/CXbzEdOUykpxJ8A2ox37WMnHHK7GyKG0X5ktmaEy1DskXIUxjJ08A2L5RG+/h6BjXxFV4lGjJtPncKgVoFfGvuQ/j2eDfcsDQycSxF7yLkVkyT2mQgbAQzKsGmO2pzq5tDbEFl82+7Sr4BYzyVlaVhaSyKYPHMIV9huw/EfqIQLEtyGC+JC/X3oV5n+ttpcZryzmbV2ruvllUQYgVtjslh/ai7046qwHmK67xKRB2rK5v730FB1A9KZoOzIhvOtShXZDkoffFXg0= 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)(346002)(136003)(39850400004)(396003)(376002)(366004)(956004)(2616005)(26005)(53546011)(4326008)(44832011)(36756003)(6486002)(186003)(16526019)(38100700002)(5660300002)(31686004)(30864003)(2906002)(38350700002)(83380400001)(8676002)(316002)(16576012)(52116002)(54906003)(66946007)(66476007)(66556008)(8936002)(33964004)(31696002)(86362001)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?ZnBiVXpGWWhaQ1FsRUdBbnNkVWlUQnc2OW02cUdUSmVMZjZBYi9GbkhRMEFu?= =?utf-8?B?U2V2YlN4ZXBSbnpoZ1JUdDk3SkxycisrdkFVdjZ5U2VpY1RSUHIxWUpRSmVq?= =?utf-8?B?Y1pEUEIyUGFLRGlZbDI1NWhrSDNDa1RCT1hMKzFMMGFBSUk3QTZ3TG12dTVM?= =?utf-8?B?MnZoSHMxd0NsZTZ5S2V2OEZZbTMrZnZxMHFBVHZ0VTZLTFJIajFuZHk0UUtZ?= =?utf-8?B?Z2lQRjlvL1Vqc0xaUXBJWGJMRHlNWnIwdjhkK2s1emNpUXZUdmpEcGpNV1g4?= =?utf-8?B?bHNYQUFIRGxCd2hKZ0g3ZERhSHJtOG5GKzZlU3luRU9aRU1qUU1OMWNJVzl2?= =?utf-8?B?MTUwMlBHZC9VdGJWM2dGL2NCVmRONmNoTzRia09zbm5GdkpIOHVkVXYzYkdx?= =?utf-8?B?VWR5VWRSVzMyMkx0TWNhall6TVF2bjU1cFBQdHlHSG9yNlp2ektFNlJaS1N1?= =?utf-8?B?T2ZST1NUL1RGZjJpcmpJdDNLaDdYbTBSYmFZb0tSbEEyTlpmbTA2UEh4d21B?= =?utf-8?B?N1ZNS0p4VnN0VjRvL1kveHBKWnA0UmxzTURXV1NHSGhCREZ1R2JneEdXS0RH?= =?utf-8?B?QU51NW1EZmVKeVMxUXp2YmEySGpEMGJ6ZjBVdmhhSXFpdlVBL0VITlphNTAx?= =?utf-8?B?YUFPejdrbXBZU3YwQ3puaDUrUm9leFFKTHlpUmpaVGZzUnZoQjJ5WXR5QlVL?= =?utf-8?B?MmI1aXJ0SmVoK3IyNXUrRkNRQjJXZnI3cDkxbmc0cE9mUHhxU25RL0hxeW1B?= =?utf-8?B?bFMzSlA4eFdTSVhKcVFMcW5tbVRjZ2p0VVNZTndCaVRqT1A1N2NEeE5ZRnRL?= =?utf-8?B?OEd3Vlh0VHhlYXhuRWN6TkVJblBsNWlNeGxlTjJWMGR3dVlTOXg0MG1rL21J?= =?utf-8?B?YlNGemdpbWxHU1k1UmJaNDZxZE9PV3h4TXZvbUJDeGFPdFFobEFncExxM1Fw?= =?utf-8?B?YzhrRXdiaWhjL3ROZjBuSlhsWWQ5Umt4NlFOdm9XQ0VMOER4UXNVM0t1UG5G?= =?utf-8?B?VjdGV1ZPcUlxTVk2SVhxN3R6czdDV2F3YjVpRnRoOVQ0eDRTWFBDcFdIRzBD?= =?utf-8?B?WFIzZVg3aXJjazdmS1ZiMGcwWXQxanptc1QzWGE4N2pWWk8vc2tCY0NnRFZB?= =?utf-8?B?SUcrVi9nOEVPNWVUSEw3Qis0aW1BNlNSV1E4cEVHd1JnTWVjQy9vMFBTUGda?= =?utf-8?B?Ym53Z1hCRjlHQ0VRMGgyR2RhcFlrcG5IaU04U1FQcWphQ2M0LzNXb3JRTWZB?= =?utf-8?B?LzVCd25sa1pHUjBWNHZIOUVhYWpVcUJ3Q1VMYkFITnNvb0xJVlJFY2YxVkQv?= =?utf-8?B?dEV3ZE9LdFdaZXNvUW1QY3JqaWJ6cGNEYUJGU21FUFNJdHM4WkJPREFjNktX?= =?utf-8?B?TVlud1B1YjJ6K2lmTWtXS3ZidkpsaENIN2xOSDZGNFl2L2tadjk1SFZzeTJk?= =?utf-8?B?RWlaNW1OUUxJZVpaQmg3ZXJwMisvYWxxMmpSMm1EUURCNDd3Q3RyMDQ5ZDBD?= =?utf-8?B?UDlWcHBVWlhTbUhQMnF1bmRyY2RTV1N1b0RFLzRnWHhlMHdFWUU0TkJLZUR6?= =?utf-8?B?STFEd0NwRGpKTksxcHhBQUU4OE1HODlQb2ZvQWhXNnBzNzVjT0VqM251SnZa?= =?utf-8?B?ME5YV2x5VDFMU2l4Mmd6QXNYcmx1K1AxUkFlcDFhV1VLSWY4NEVuTzhReXRG?= =?utf-8?B?YVpYakNKK3dwM21zU3NiQzl1cDNtMWF0dTBhYk53QXNKelpDOG1EeUU0eDd0?= =?utf-8?Q?+DhF7xzi0rzRXTqZ2ZeUXdX1O7p/04O+DdmbzQt?= 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: VE1EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 431221ff-d0ee-4043-5f64-08d919ecd886 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: So/1uNUtO6lHtq1mRxv+WGKPJIN0E6FKNusqkKrDG/3SUbN9lPiqWCcZRfDKWG4ukTd5zftkRw5hD2aptXjxZUnjpRMxorLt/cB6xzDqLq9Igbc/ie+OXSkNEKu+DE30QFH/Bof8ONVO5eHZHf2pj5vhS1xbJR1KQeetMFEqM33iO3MDnVt91FQxxd8/W/dirz7iwZcymMThr84Z0wpxxFmSKkvPuoxG7npKIwOb0DG2eW06fbkMcaq6DSDDm4Lq7DJxaVQZbOvPsY9Yp5iVOrEFvCx0CSYQHaxvDusdIHjsbuD80LZ3rtuzH65NdS/JMUPgtYDg5m0okKbuFKx5SGD31G9yki78gDUNXFS66cBQXaBZ3mkF/FUO6Rm+/jdYkHc/ZXv/XrmFeKuP9Ru3iDPmIXH3z17O0biH2VW/0vXdO7DXiKtaHbHUV72FyXZNU39MO4o/6btzr0i2OJoIbmLRuBcQ1saENbfEFLjCxHZXciawPh6IJs5Ez+vh9VOb0SLBQrW5UhFPjqniwzlVQf0zfw4Bhm0ZVaFVss2IG+cumAhyuq7SViP3okXRT3jiQyyVM6uAqDq9dqpshcBklcnScxA1BIxFuRnImKTvgNGw/dw7TiwqHbimGQxo8pjQlS7fdQ2KmWLCb4fDadhjNt5+agf6a1H+ar77AqnQUnf2ZU6+eoyojZEEzmXEJ6bF 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)(376002)(396003)(136003)(39850400004)(36840700001)(46966006)(70586007)(86362001)(70206006)(36860700001)(478600001)(31686004)(81166007)(356005)(83380400001)(2906002)(36756003)(82740400003)(82310400003)(53546011)(31696002)(26005)(33964004)(2616005)(956004)(5660300002)(54906003)(336012)(16576012)(186003)(47076005)(16526019)(4326008)(8676002)(44832011)(8936002)(6486002)(30864003)(316002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2021 11:05:45.3161 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 834faa7c-d6ce-44e1-3fe5-08d919ece2a1 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: VE1EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4580 Content-Type: multipart/alternative; boundary="------------005A7496DEC1CAE9B34CCE1F" Content-Language: en-GB --------------005A7496DEC1CAE9B34CCE1F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi Etienne, Thank you for this patch. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 17/05/2021 08:40 AM, Etienne Carriere wrote: > Use intermediate (UINTN) cast when casting int from/to pointer. This > is needed as UINT64 values cast from/to 32bit pointer for 32bit > architectures. > > Cc: Achin Gupta > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Sughosh Ganu > Signed-off-by: Etienne Carriere > --- > No change since v2 > No change since v1 > --- > StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c | 8 ++++---- > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c | 14 +++++++------- > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c | 2 +- > 3 files changed, 12 insertions(+), 12 deletions(-) > > diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c > index 6884095c49..d4590bcd19 100644 > --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c > +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c > @@ -164,8 +164,8 @@ StandaloneMmCpuInitialize ( > > // Share the entry point of the CPU driver > DEBUG ((DEBUG_INFO, "Sharing Cpu Driver EP *0x%lx = 0x%lx\n", > - (UINT64) CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr, > - (UINT64) PiMmStandaloneArmTfCpuDriverEntry)); > + (UINTN) CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr, > + (UINTN) PiMmStandaloneArmTfCpuDriverEntry)); > *(CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr) = PiMmStandaloneArmTfCpuDriverEntry; > > // Find the descriptor that contains the whereabouts of the buffer for > @@ -180,8 +180,8 @@ StandaloneMmCpuInitialize ( > return Status; > } > > - DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalStart - 0x%lx\n", (UINT64) NsCommBufMmramRange->PhysicalStart)); > - DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalSize - 0x%lx\n", (UINT64) NsCommBufMmramRange->PhysicalSize)); > + DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalStart - 0x%lx\n", (UINTN) NsCommBufMmramRange->PhysicalStart)); > + DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalSize - 0x%lx\n", (UINTN) NsCommBufMmramRange->PhysicalSize)); > > CopyMem (&mNsCommBuffer, NsCommBufMmramRange, sizeof(EFI_MMRAM_DESCRIPTOR)); > DEBUG ((DEBUG_INFO, "mNsCommBuffer: 0x%016lx - 0x%lx\n", mNsCommBuffer.CpuStart, mNsCommBuffer.PhysicalSize)); > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c > index e8fb96bd6e..4d4cf3d5ff 100644 > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c > @@ -72,14 +72,14 @@ CreateHobListFromBootInfo ( > > // Create a hoblist with a PHIT and EOH > HobStart = HobConstructor ( > - (VOID *) PayloadBootInfo->SpMemBase, > + (VOID *) (UINTN) PayloadBootInfo->SpMemBase, > (UINTN) PayloadBootInfo->SpMemLimit - PayloadBootInfo->SpMemBase, > - (VOID *) PayloadBootInfo->SpHeapBase, > - (VOID *) (PayloadBootInfo->SpHeapBase + PayloadBootInfo->SpHeapSize) > + (VOID *) (UINTN) PayloadBootInfo->SpHeapBase, > + (VOID *) (UINTN) (PayloadBootInfo->SpHeapBase + PayloadBootInfo->SpHeapSize) > ); > > // Check that the Hoblist starts at the bottom of the Heap > - ASSERT (HobStart == (VOID *) PayloadBootInfo->SpHeapBase); > + ASSERT (HobStart == (VOID *) (UINTN) PayloadBootInfo->SpHeapBase); > > // Build a Boot Firmware Volume HOB > BuildFvHob (PayloadBootInfo->SpImageBase, PayloadBootInfo->SpImageSize); > @@ -190,9 +190,9 @@ CreateHobListFromBootInfo ( > MmramRanges[3].RegionState = EFI_CACHEABLE | EFI_ALLOCATED; > > // Base and size of heap memory shared by all cpus > - MmramRanges[4].PhysicalStart = (EFI_PHYSICAL_ADDRESS) HobStart; > - MmramRanges[4].CpuStart = (EFI_PHYSICAL_ADDRESS) HobStart; > - MmramRanges[4].PhysicalSize = HobStart->EfiFreeMemoryBottom - (EFI_PHYSICAL_ADDRESS) HobStart; > + MmramRanges[4].PhysicalStart = (EFI_PHYSICAL_ADDRESS) (UINTN) HobStart; > + MmramRanges[4].CpuStart = (EFI_PHYSICAL_ADDRESS) (UINTN) HobStart; > + MmramRanges[4].PhysicalSize = HobStart->EfiFreeMemoryBottom - (EFI_PHYSICAL_ADDRESS) (UINTN) HobStart; > MmramRanges[4].RegionState = EFI_CACHEABLE | EFI_ALLOCATED; > > // Base and size of heap memory shared by all cpus > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c > index 6c50f470aa..b445d6942e 100644 > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c > @@ -328,7 +328,7 @@ _ModuleEntryPoint ( > > // Locate PE/COFF File information for the Standalone MM core module > Status = LocateStandaloneMmCorePeCoffData ( > - (EFI_FIRMWARE_VOLUME_HEADER *) PayloadBootInfo->SpImageBase, > + (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PayloadBootInfo->SpImageBase, > &TeData, > &TeDataSize > ); --------------005A7496DEC1CAE9B34CCE1F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

Hi Etienne,

Thank you for this patch.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar


On 17/05/2021 08:40 AM, Etienne Carriere wrote:
Use intermediate (UINTN) cast when casting int from/to pointer. This
is needed as UINT64 values cast from/to 32bit pointer for 32bit
architectures.

Cc: Achin Gupta <achin.gupta@arm.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Sughosh Ganu <sughosh.ganu@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
No change since v2
No change since v1
---
 StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c                       |  8 ++++----
 StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c              | 14 +++++++-------
 StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c
index 6884095c49..d4590bcd19 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c
@@ -164,8 +164,8 @@ StandaloneMmCpuInitialize (
 
   // Share the entry point of the CPU driver
   DEBUG ((DEBUG_INFO, "Sharing Cpu Driver EP *0x%lx = 0x%lx\n",
-          (UINT64) CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr,
-          (UINT64) PiMmStandaloneArmTfCpuDriverEntry));
+          (UINTN) CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr,
+          (UINTN) PiMmStandaloneArmTfCpuDriverEntry));
   *(CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr) = PiMmStandaloneArmTfCpuDriverEntry;
 
   // Find the descriptor that contains the whereabouts of the buffer for
@@ -180,8 +180,8 @@ StandaloneMmCpuInitialize (
     return Status;
   }
 
-  DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalStart - 0x%lx\n", (UINT64) NsCommBufMmramRange->PhysicalStart));
-  DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalSize - 0x%lx\n", (UINT64) NsCommBufMmramRange->PhysicalSize));
+  DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalStart - 0x%lx\n", (UINTN) NsCommBufMmramRange->PhysicalStart));
+  DEBUG ((DEBUG_INFO, "mNsCommBuffer.PhysicalSize - 0x%lx\n", (UINTN) NsCommBufMmramRange->PhysicalSize));
 
   CopyMem (&mNsCommBuffer, NsCommBufMmramRange, sizeof(EFI_MMRAM_DESCRIPTOR));
   DEBUG ((DEBUG_INFO, "mNsCommBuffer: 0x%016lx - 0x%lx\n", mNsCommBuffer.CpuStart, mNsCommBuffer.PhysicalSize));
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c
index e8fb96bd6e..4d4cf3d5ff 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c
@@ -72,14 +72,14 @@ CreateHobListFromBootInfo (
 
   // Create a hoblist with a PHIT and EOH
   HobStart = HobConstructor (
-               (VOID *) PayloadBootInfo->SpMemBase,
+               (VOID *) (UINTN) PayloadBootInfo->SpMemBase,
                (UINTN)  PayloadBootInfo->SpMemLimit - PayloadBootInfo->SpMemBase,
-               (VOID *) PayloadBootInfo->SpHeapBase,
-               (VOID *) (PayloadBootInfo->SpHeapBase + PayloadBootInfo->SpHeapSize)
+               (VOID *) (UINTN) PayloadBootInfo->SpHeapBase,
+               (VOID *) (UINTN) (PayloadBootInfo->SpHeapBase + PayloadBootInfo->SpHeapSize)
                );
 
   // Check that the Hoblist starts at the bottom of the Heap
-  ASSERT (HobStart == (VOID *) PayloadBootInfo->SpHeapBase);
+  ASSERT (HobStart == (VOID *) (UINTN) PayloadBootInfo->SpHeapBase);
 
   // Build a Boot Firmware Volume HOB
   BuildFvHob (PayloadBootInfo->SpImageBase, PayloadBootInfo->SpImageSize);
@@ -190,9 +190,9 @@ CreateHobListFromBootInfo (
   MmramRanges[3].RegionState   = EFI_CACHEABLE | EFI_ALLOCATED;
 
   // Base and size of heap memory shared by all cpus
-  MmramRanges[4].PhysicalStart = (EFI_PHYSICAL_ADDRESS) HobStart;
-  MmramRanges[4].CpuStart      = (EFI_PHYSICAL_ADDRESS) HobStart;
-  MmramRanges[4].PhysicalSize  = HobStart->EfiFreeMemoryBottom - (EFI_PHYSICAL_ADDRESS) HobStart;
+  MmramRanges[4].PhysicalStart = (EFI_PHYSICAL_ADDRESS) (UINTN) HobStart;
+  MmramRanges[4].CpuStart      = (EFI_PHYSICAL_ADDRESS) (UINTN) HobStart;
+  MmramRanges[4].PhysicalSize  = HobStart->EfiFreeMemoryBottom - (EFI_PHYSICAL_ADDRESS) (UINTN) HobStart;
   MmramRanges[4].RegionState   = EFI_CACHEABLE | EFI_ALLOCATED;
 
   // Base and size of heap memory shared by all cpus
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
index 6c50f470aa..b445d6942e 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
@@ -328,7 +328,7 @@ _ModuleEntryPoint (
 
   // Locate PE/COFF File information for the Standalone MM core module
   Status = LocateStandaloneMmCorePeCoffData (
-             (EFI_FIRMWARE_VOLUME_HEADER *) PayloadBootInfo->SpImageBase,
+             (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PayloadBootInfo->SpImageBase,
              &TeData,
              &TeDataSize
              );

--------------005A7496DEC1CAE9B34CCE1F--