From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (EUR02-DB5-obe.outbound.protection.outlook.com [40.107.249.50]) by mx.groups.io with SMTP id smtpd.web10.835.1684854995927322303 for ; Tue, 23 May 2023 08:16:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=oh3Nd6A+; spf=pass (domain: arm.com, ip: 40.107.249.50, 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=ryZxzCW+f58CMkPxWLMqd6U9LmDin3iGGNUwNJftKME=; b=oh3Nd6A+6QBCASjz/CgU5PgpYiyCUID1a2gY2ehROMJmkFV4VF6LThePnrvnNnZz7y68ixeQoxS13c0crZcF9UQvWx/tUKAUgHtfDFZm29kFTYdHjGWgC9zLmaD1TwcaJq8+SBjj6DT9vlzaGtoCbgkQLoEUNw8AgjN4NG2NWKI= Received: from DB6PR07CA0056.eurprd07.prod.outlook.com (2603:10a6:6:2a::18) by VI1PR08MB5472.eurprd08.prod.outlook.com (2603:10a6:803:13b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 15:16:26 +0000 Received: from DBAEUR03FT035.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2a:cafe::5f) by DB6PR07CA0056.outlook.office365.com (2603:10a6:6:2a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.14 via Frontend Transport; Tue, 23 May 2023 15:16:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT035.mail.protection.outlook.com (100.127.142.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15 via Frontend Transport; Tue, 23 May 2023 15:16:26 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Tue, 23 May 2023 15:16:26 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 0fbab89b27f117e3 X-CR-MTA-TID: 64aa7808 Received: from 07e1cddb188b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A027B852-271A-4094-A85B-97F07CAF6B5D.1; Tue, 23 May 2023 15:16:19 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 07e1cddb188b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 May 2023 15:16:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZyovX1g12d4syKX+pdV4hqIG1mdEy5YRNoGpedI4v+QvnGDVXhDCQ2d2NU9f3hfMiv721JEoP7W7P1by4tWRtEvi1OWE5kNmdVXvkd4tmrasG3PzJIVcjxWxlS2YV4aSLCn9kKYYXuY6cTCdZ7riFw+gC6WHribrjoN157vBEg/OXlbDcGA7286uindGgp+n8dnQAkMrIevlvza4kIRvk1x+fmNcrCWaKPyfxa/mefmaH+/ZZjM3cgIe9ZM+Rv+o+1Ueld2dqgIZxXLMYPfK20DliXLKClznQiltgmY3ajm7MkJmgXuku8sKGk2uAnMBH0f1gwIYoR02hXqJRpJ8BQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ryZxzCW+f58CMkPxWLMqd6U9LmDin3iGGNUwNJftKME=; b=Pe0ty8rwO03UcFXDB+NBfocO/GaaOLbIp2OIGUW9s8X9ONgh3BnYBvGsusyeyGNOq95XZIlFHOuB5UmRbvlZH2n7iCeFoQsZEYHa7QLvvgThGyBZE6ajHGuSPWu8ocxa3HaBm6AK9y5FsAr8pkNjgTvSiEEF+Rats/LEYyEpa9tIcgkE4MvNNd//t6RgsZgAxF6tKU5ex7MTyaYK2LZOUkkNK55UGHdE/vt1GrwsCkMt6PGP9irdQbG1Dq0lYWJSN/xOR7ltyxhQX8wFMi7izGg7S7JSk55LHyAHwztOvFzvux1Ea7MV9VXmqehb8M6/jfZtfQKnV1917d9rxi7qfQ== 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=ryZxzCW+f58CMkPxWLMqd6U9LmDin3iGGNUwNJftKME=; b=oh3Nd6A+6QBCASjz/CgU5PgpYiyCUID1a2gY2ehROMJmkFV4VF6LThePnrvnNnZz7y68ixeQoxS13c0crZcF9UQvWx/tUKAUgHtfDFZm29kFTYdHjGWgC9zLmaD1TwcaJq8+SBjj6DT9vlzaGtoCbgkQLoEUNw8AgjN4NG2NWKI= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by DB3PR08MB8985.eurprd08.prod.outlook.com (2603:10a6:10:43f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 15:16:17 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::7afd:553d:71b8:4c8c]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::7afd:553d:71b8:4c8c%6]) with mapi id 15.20.6411.029; Tue, 23 May 2023 15:16:17 +0000 Message-ID: <95e700ce-56f5-e851-40b1-aa54d821a320@arm.com> Date: Tue, 23 May 2023 16:16:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [edk2-devel] [PATCH v1 08/12] ArmPkg: Typecast IntID to UINT32 in ArmGicV2EndOfInterrupt To: Ard Biesheuvel , devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, quic_llindhol@quicinc.com, neil.jones@blaize.com, pedro.falcato@gmail.com, pierre.gondois@arm.com, Matteo.Carlini@arm.com, Akanksha.Jain2@arm.com, Ben.Adderson@arm.com, Sibel.Allinson@arm.com, nd@arm.com References: <20230523130421.10804-1-sami.mujawar@arm.com> <20230523130421.10804-9-sami.mujawar@arm.com> From: "Sami Mujawar" In-Reply-To: X-ClientProxiedBy: LO4P265CA0121.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c6::9) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6806:EE_|DB3PR08MB8985:EE_|DBAEUR03FT035:EE_|VI1PR08MB5472:EE_ X-MS-Office365-Filtering-Correlation-Id: 1959c8e0-0011-42dc-3ee4-08db5ba0ad45 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: PjEcLTj0S08Va4napbN6fMWq7j9AFmXYHzLKdSHUq23XWgzJFdZSqqF13canhZRUfmN93S2u5wDqgFA4PrNySVgcdLBcTU29r6MyYhqjYQP0OchOX+E/WD/Q3Gj99aJ3e1aPK65G7x+mMqtR2wyzUu8LhPx7E4ngooAmb1xVAH5BZicjmXAId7jQ6mnXlvqp5J9vdw0Mkeqfb086ACvaNGW28Kx5HpppAaB/jzyHnXT3bWj8zz4NOFKr4WccI0QxF4qca/DwHpZ0qoS6REjknqHZiH5txgYl3/519ItaB+5rx63ZD9qb/lZqpyX+ElqQpNtXU4dg326z1pQr0L3D07mmimpzuua+3+jQa02zpo9T2XA8fI/VEZhGipPUPGurL4/j/yuzdwziQrDXK38OwtSsX6X9b+CIDSc5mGLYjrpQNlD+EUTRc+JCZ8TLnWr9BqhwKmHPSuW8su94n5A24dV5/E4UDlZeii94bLUtv4Wa9JbFfUihzAU0I4yeLSAPwViVaZEct8qWX4CplWOE/qKdkOCR2/irea60TjgE4nuDoYmcAqm+Us3SO5QNWlgAviVg7q79GXxCsHY82I64MRs1kwVqunGlHYQ3ls0J2noS/MbhRw1KaCHsgjZVhjb+HNAXP8734sQcqsXokMCmFkQKOn3d4GotcMcGFD1Q2v8= 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:(13230028)(6029001)(4636009)(396003)(39850400004)(136003)(366004)(346002)(376002)(451199021)(41300700001)(6486002)(31686004)(478600001)(31696002)(19627235002)(966005)(316002)(4326008)(66946007)(66556008)(66476007)(86362001)(66899021)(5660300002)(8936002)(8676002)(38100700002)(44832011)(2906002)(26005)(6512007)(6506007)(186003)(53546011)(83380400001)(2616005)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8985 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT035.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a56b8353-f788-4670-38ea-08db5ba0a79e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5lYqu7dGAR2iYAIi3LKwpEKP6+MbXjcaZ4VR/RI4URi+/jk773cn0DB7X8tpuvyxnrVziVeD4Vf3niu1DfCR1WHbshal65yNS1YlLXGwSZ+y8qsptfA1G611gmH0udOCDnNZkyvQVcQeirbB2tamglzOD5ecXkIzPloIzcFbaFJ+Krd2ezLb7bVX2q9AMUsfBAy8GprbZgEr4hEWTy7+82iXw15vZiebBV0B/9aQ0QyJfB4SWMoho5U8pmLnu5pvlZ4iZysFwKmej4NkqvkbOt5VYYOern/hsUWCRb/6e/o+OnhGE/BVAZA4JdXhMXsZHKqdeXaMihw/9xjRrGqEF8mKrNmmV2HIRvS+ma6JaGZLujTEK5GYW3dRSnQpcVpZkCn2QN0EcoaYEe4VL7rEfwxeYU+ksOC9c5XnTklzIDWxPmx9K/9oe35+GVgwoF/GUihSPS+FJ9OgECyr6L7fCM8DRYZ4i/ttuG3EBjhO8Su7rlLGso0lTD46Xds/XNHFHh0CVPNWyFcxRfMj/uq8TGhwmri70qDva6M2a4A6rALzD7NKPwz1LB1Gkg70ciD3bI/1JQk+d76SU2ieLafJ0eJiw1uYYUK6M3yyxUB4qwZR2MoYHdF2PrpMgAx/matfcMsE4w7WJBwkzgexAYSi7lrFlWUSe2EBfqyJ/16trtz3Qbx0K+P7dPwyx88jC8Oh0dCnSGqrGJgk+SjWtY/eLow93eeNoGIy75xkMqrp+PyfVBC/EJx8Gt5C6MrKqAfEzqoOC6UfmpE3ynQSJJ0E5xPeEsFBatjbIkgdWhRYTPc= 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:(13230028)(6029001)(4636009)(136003)(346002)(39850400004)(396003)(376002)(451199021)(40470700004)(46966006)(36840700001)(31686004)(82310400005)(70206006)(70586007)(478600001)(31696002)(41300700001)(6486002)(966005)(316002)(19627235002)(4326008)(86362001)(8936002)(8676002)(5660300002)(66899021)(44832011)(356005)(26005)(81166007)(6512007)(186003)(53546011)(82740400003)(40460700003)(6506007)(83380400001)(2906002)(336012)(40480700001)(2616005)(36756003)(36860700001)(47076005)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 15:16:26.2948 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1959c8e0-0011-42dc-3ee4-08db5ba0ad45 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: DBAEUR03FT035.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5472 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Ard, Thank you for the feedback. I will fix this in the next series. Regards, Sami Mujawar On 23/05/2023 02:26 pm, Ard Biesheuvel wrote: > On Tue, 23 May 2023 at 15:04, Sami Mujawar wrote: >> The EIOR register of the Gic CPU interface is a 32 bit register. >> However, the HARDWARE_INTERRUPT_SOURCE used to represent the >> interrupt source (Interrupt ID) is typedefed as UINTN, see >> EmbeddedPkg\Include\Protocol\HardwareInterrupt.h >> >> Therfore, typecast the interrupt ID (Source) value to UINT32 >> before setting the EOIR register. Also, add an assert to check >> that the value does not exceed 32 bits. >> >> Signed-off-by: Sami Mujawar >> --- >> ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c >> index 80115b243afabd5e4faad88089af738b19ce4cd1..e98cd9705616e7a8dfc7aaba7c80b176f8f6d0c9 100644 >> --- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c >> +++ b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Lib.c >> @@ -7,6 +7,7 @@ >> **/ >> >> #include >> +#include >> #include >> >> UINTN >> @@ -26,5 +27,6 @@ ArmGicV2EndOfInterrupt ( >> IN UINTN Source >> ) >> { >> - MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCEIOR, Source); >> + ASSERT (Source < MAX_UINT32); > Should this be <= ? > >> + MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCEIOR, (UINT32)Source); >> } >> -- >> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' >> >> >> >> >> >>