From nobody Mon Sep 16 18:55:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105248+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=arm.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1684935556947847.1126730482441; Wed, 24 May 2023 06:39:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id H2WuYY1788612xyRPSdw3iox; Wed, 24 May 2023 06:39:16 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.73]) by mx.groups.io with SMTP id smtpd.web10.9084.1684935555556756397 for ; Wed, 24 May 2023 06:39:15 -0700 X-Received: from DU2PR04CA0037.eurprd04.prod.outlook.com (2603:10a6:10:234::12) by PAVPR08MB10339.eurprd08.prod.outlook.com (2603:10a6:102:30c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Wed, 24 May 2023 13:39:11 +0000 X-Received: from DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:234:cafe::43) by DU2PR04CA0037.outlook.office365.com (2603:10a6:10:234::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15 via Frontend Transport; Wed, 24 May 2023 13:39:11 +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 (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105248+1787277+3901457@groups.io; helo=mail02.groups.io; 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 X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT021.mail.protection.outlook.com (100.127.142.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15 via Frontend Transport; Wed, 24 May 2023 13:39:11 +0000 X-Received: ("Tessian outbound 945aec65ec65:v136"); Wed, 24 May 2023 13:39:10 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 615fbd475068209d X-CR-MTA-TID: 64aa7808 X-Received: from 52c52a9ee9eb.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B4077154-A46E-4034-B984-F8BF73A55808.1; Wed, 24 May 2023 13:38:58 +0000 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 52c52a9ee9eb.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 24 May 2023 13:38:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fvYvYCkLGTy3l3Y7Z7gahePeamMuRm9QA2c6pgZw5Ln5GJNe1SHDDZUadvevPOepvlAkvbI9VhM/tlLJdwyehsIeqh6CrOSgWFfR93gRiIZrqkq1cksScXqRqQzWi+VQzO9T51urQOrfWDYTBOWv9x5CjOyUXJT779Ax/YW/RtfaZLIupbDoPlbJf4Ox+UeJvcHAm6n1Qf3t43Bz37JxVZLxsmz+Nk1fxSX6Eidqa3VtJO8etUaHbGPhSnb8S8UVpIrWFQ9FrelYqUCrEaU+4vGVPUQFf48e7ZzxTcEGw1TDCY9OlSOYp4TQ48bb85EBs3+476ns529Po+levDHdAg== 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=3Vene/6hxr3I8YpVLItf60BqV5Y3VtR6Uu3E89ljt2Q=; b=l2gWhUALpDiQKGZofmYRmANg8AGaIw9Se16btEFAkr/oqw/A5g11BadKAn4zloDS8LmJbO35JvspHY1SPNRUcxkDbGX5zpW8+Qw76JOW7gpTjxojejCtjtDmRXRqO0MUjGp1mmkcFPFc/NVTBpbfYqftvAU0TL5RxEpeB6gN86ShsWEnSvv3ZVc5xMpWWuH5ZkLbTaXcst2cUgKOT8h5Ia1hHXjK6KQsye1JBvNE+Tvefy8Vr7KCv0REROnD+RCN8Cdl7uvLQRNJh1KmptJDJjhw0P6DoGVhqLYK3b+pLXy2CRbYVDMcCw/jd+Z18+1u5MAgTIfYFxM9Y1szeW8rqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from DU2PR04CA0246.eurprd04.prod.outlook.com (2603:10a6:10:28e::11) by AS8PR08MB6055.eurprd08.prod.outlook.com (2603:10a6:20b:293::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15; Wed, 24 May 2023 13:38:56 +0000 X-Received: from DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28e:cafe::2c) by DU2PR04CA0246.outlook.office365.com (2603:10a6:10:28e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.15 via Frontend Transport; Wed, 24 May 2023 13:38:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C X-Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT044.mail.protection.outlook.com (100.127.142.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6433.15 via Frontend Transport; Wed, 24 May 2023 13:38:56 +0000 X-Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 24 May 2023 13:38:46 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 24 May 2023 13:38:46 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Wed, 24 May 2023 13:38:46 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [edk2-devel] [PATCH v2 11/11] ArmPkg: Fix ArmGicAcknowledgeInterrupt () for GICv3 Date: Wed, 24 May 2023 14:38:40 +0100 Message-ID: <20230524133840.28612-12-sami.mujawar@arm.com> In-Reply-To: <20230524133840.28612-1-sami.mujawar@arm.com> References: <20230524133840.28612-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT044:EE_|AS8PR08MB6055:EE_|DBAEUR03FT021:EE_|PAVPR08MB10339:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fab2df8-1cdc-44a8-acb1-08db5c5c419a 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: Fk3PG/tM1sqcvgg9gX0hzo2ESadcM7YQSOSG6/evIJ9PiGvvp31afZDDZu8p84mfwXthUshFzI1QRDcICsFqLWhdM3ZgoblxQIhrTvAhr963q3I/T7eX/tzIt9UhNOOOF8caVoxSRr5GKdjY7y9Eb6gB+K2aOZF6+hjFJ7W/wV+GfsiD4/esibGeUnpJaiY0squaH2+fjvKHZBYTZlC8PjrXpm/DrUkmPoitVj5kLvFd22qXJuThfehPYMQ1pJWHvVvPGJf6RWgWMB4jEp6Wpi0LFgpLMcgVfSnUgX4zt4ju+3EDZgOW8L3RA5DUpsEiSWJonwRs+hQBzq2EVTBTotGVU/I5iVLncxIQK1RzQhczOSwcyFgwWU4u9Nj7iA4s+14YbFepaPFZI72du94b9haL/aJhicm2iThqvdtcyFMmL20pQHyl404Qo8cZtduW5QiedPpkG92Jt7tU5V0a1nnhTLYh4Xb6kl8c6uCAn2nDm1UgINPzsF5WP0/LshWEmYO57F/vPdsRR0LAOSetGsr77SeuyaZj4PK1hnKg6DPovnsWn/bm/s84IoguospmoyRszC0bF+O9Bknyw7/OZGCtpHJLjY099/k3/zvUnq48K7/IbYptu+uDXHKK5XpTY8DndwzcTyBlSH+G/PKXkbl5kLPYAlHtrdtVyxEvY4Ll7UIXn4rtLI469Cj5WNDParMMXj7V102YbfPONwZmgUpSmOGa1QwGTFRd1quplcFs0dQmz31u4Bc7CJCc/1w0 X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(396003)(39860400002)(451199021)(36840700001)(46966006)(47076005)(83380400001)(82740400003)(6916009)(4326008)(81166007)(356005)(70206006)(70586007)(2906002)(41300700001)(44832011)(8936002)(8676002)(5660300002)(316002)(36860700001)(40480700001)(86362001)(36756003)(2616005)(54906003)(6666004)(26005)(7696005)(1076003)(186003)(82310400005)(478600001)(19627235002)(336012)(426003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6055 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 22a8f227-2755-46bd-14a1-08db5c5c38ff X-Microsoft-Antispam-Message-Info: G5EvQafFFWhepMNAwTHiiOEMkEQQ7LQ43qaA8NgZyhwfxI9Y7YsL0Hhk6v/wWcqgkIWFi5FQBHUaAn6gQeFbjZt2ZsdFAN/gPZETpb8izk4cEj+hv2sJSQ+Qgve7sgC5hbGCXSiLZDq8XgV4OJ3pDF7jNRY1dTwu9UC1FjqJsqpDeBtAMVn1KKJvn/F5Ja5TFimp7ZTNGV9Jt8WF8EBkLjD79Jtw61L9FmnXV9iwf4M9RmPWfKtoU+KwfcGQ150uAUvVjSjQ2vcC2a8BHtAFbUvV1yUxvGbZ4XFj3j7vOaz39xUff7IUVfOyZuaeSY2UMSyTk3FsL5kvyyyWRehbnb0jick0aO27QmrEgahlva2Rm5uEYTO/8+J1i3eDaoJpaFDNxhFz3pKAOVSlVlh+Xpu2QZj3yNnwg8o0jCAH0rxro/d+zAebywdhkPBqrePLnEGkR2MfKxxhaLF5TuiMdRU5VxKRDqaQldvS6datp2HJpEyKRBXpD7g7o1UN6/sFnZrCJe8FUPRnAySFAtyMjFDWJ0+j8BQohgllyTvhwjOUV5XI86thkQKWZYyJZjxCR2gy+QymG6AXnqMLbicbiUIRBs1w5hZfD7xbBucOHQudtMBxRveAlsKBFui7oUYGgYlmUV9/J02qaCorzif8GK+lLNmrxZtRNwbgoVVv7960Qf7u7uSOq8qdd0RvShK1dtl5363jdQ7FzPw8PxAEP4DgF18qB8mifpE6tB7EiKEsVZuaPUcBOTFWNIRInuOe X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2023 13:39:11.0147 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0fab2df8-1cdc-44a8-acb1-08db5c5c419a 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: DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB10339 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com X-Gm-Message-State: qd8wNmX6IFSUH2E8ScRpj5yJx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1684935556; bh=U/huMcRXxUOVnahRhwASvJvJ2aKGhyircKrCXk564pI=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Lg4DjwLXu6Cl58G5US6uYwCUqsahMrHsv/m6oKkaYX91mpUGzVJoi486eMDAi2kTxds 562AxFjbt4bjfYBccWwEWh1amnMCGdm/mBxFdJbxqYuSwdeAWehax3BWCpZbZYdnvgmGJ XOsXmceyD18LHnRwJKysLsmqMOkafnbfMME= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1684935557553100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The ArmGicAcknowledgeInterrupt () returns the value returned by the Interrupt Acknowledge Register and the InterruptID separately in an out parameter. The function documents the following: 'InterruptId is returned separately from the register value because in the GICv2 the register value contains the CpuId and InterruptId while in the GICv3 the register value is only the InterruptId.' This function skips setting the InterruptId in the out parameter for GICv3. Although the return value from the function is the InterruptId for GICv3, this breaks the function usage model as the caller expects the InterruptId in the out parameter for the function. e.g. The caller may end up using the InterruptID which could potentially be an uninitialised variable value. Therefore, set the InterruptID in the function out parameter for GICv3 as well. Signed-off-by: Sami Mujawar Reviewed-by: Ard Biesheuvel --- Notes: v2: - No updates since v1 series [Sami] ArmPkg/Drivers/ArmGic/ArmGicLib.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmG= icLib.c index 8f3315d76f6f2b28a551d73400938430ff3e23c7..7f4bb248fc7225bf63f0aea7204= 86092b30ced10 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c @@ -176,19 +176,17 @@ ArmGicAcknowledgeInterrupt ( ) { UINTN Value; + UINTN IntId; ARM_GIC_ARCH_REVISION Revision; =20 + ASSERT (InterruptId !=3D NULL); Revision =3D ArmGicGetSupportedArchRevision (); if (Revision =3D=3D ARM_GIC_ARCH_REVISION_2) { Value =3D ArmGicV2AcknowledgeInterrupt (GicInterruptInterfaceBase); - // InterruptId is required for the caller to know if a valid or spurio= us - // interrupt has been read - ASSERT (InterruptId !=3D NULL); - if (InterruptId !=3D NULL) { - *InterruptId =3D Value & ARM_GIC_ICCIAR_ACKINTID; - } + IntId =3D Value & ARM_GIC_ICCIAR_ACKINTID; } else if (Revision =3D=3D ARM_GIC_ARCH_REVISION_3) { Value =3D ArmGicV3AcknowledgeInterrupt (); + IntId =3D Value; } else { ASSERT_EFI_ERROR (EFI_UNSUPPORTED); // Report Spurious interrupt which is what the above controllers would @@ -196,6 +194,12 @@ ArmGicAcknowledgeInterrupt ( Value =3D 1023; } =20 + if (InterruptId !=3D NULL) { + // InterruptId is required for the caller to know if a valid or spurio= us + // interrupt has been read + *InterruptId =3D IntId; + } + return Value; } =20 --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105248): https://edk2.groups.io/g/devel/message/105248 Mute This Topic: https://groups.io/mt/99108687/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-