From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (EUR03-AM7-obe.outbound.protection.outlook.com [40.107.105.65]) by mx.groups.io with SMTP id smtpd.web11.21717.1684847093063792406 for ; Tue, 23 May 2023 06:04:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=AIK3uKe+; spf=pass (domain: arm.com, ip: 40.107.105.65, 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=PLinzapPJysSxrfPlPPA5lCdBv2fakLFiQ6J5iu44uE=; b=AIK3uKe+K+UNgRhwt3/nY0gAAlzNhkZzSU7uU8/G1QDoGNv73beYHvcEGuXM3WVhwEILo0yLUNBY2MoWqpKhYyK8zzC0RAzH/CG7yaRii97TeIZp8Ryrumj/Bkr9FPPeTBc0KpYOz+jKWd9ibni+l4V1oGNorB6Avv5ljYhZ31I= Received: from AM0PR03CA0066.eurprd03.prod.outlook.com (2603:10a6:208::43) by DU0PR08MB7392.eurprd08.prod.outlook.com (2603:10a6:10:353::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.29; Tue, 23 May 2023 13:04:49 +0000 Received: from AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:0:cafe::a4) by AM0PR03CA0066.outlook.office365.com (2603:10a6:208::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.29 via Frontend Transport; Tue, 23 May 2023 13:04:48 +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 AM7EUR03FT048.mail.protection.outlook.com (100.127.140.86) 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 13:04:48 +0000 Received: ("Tessian outbound e13c2446394c:v136"); Tue, 23 May 2023 13:04:48 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 586c460c4527615d X-CR-MTA-TID: 64aa7808 Received: from 113e4eba5dfc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id FA9810DC-5B8C-45A8-9652-9C678EA55CA7.1; Tue, 23 May 2023 13:04:37 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 113e4eba5dfc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 May 2023 13:04:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GDVUl1+mrc1Q0TrkMf+auN6Q1CK8iqITFVAO1L1+yFOdbcQzmXbMyXEFSiA/6vnz8qIZLO2wo9Yb4BtC8f3h7UQcEQZAiAlgb5jjNdb9KJF8E4w8rPi4puBGuDV243/5I9k0AIc6BUOzSOhOP7XycBKyC8TaxwvDl4hRb9HSnyRXcCpqGpxvMyuqFfDM2aw/PYKLh3qIXuU7TXSyBjXDc/0EYPOO+erRKfAGSGSVn46uPlhEcmdi/BKG8BjgVVRg5BD2M3U8MT7DB0be0QVwZ10p8tOFWgH5QdKM3vF4YJR4I3ZV2KFFoK0lJiA0aCoVROfCrn6VKC33vGuQ3jRhrg== 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=PLinzapPJysSxrfPlPPA5lCdBv2fakLFiQ6J5iu44uE=; b=Z1ULxdNJryq3LnO1heKlfCZ32EyQ2TKyCJjbjG4XU/8qH1+CbJgqS9TNeA3YfuNgkiRYV+3t/cJTr5HPGCUAQbc/9GhfvuNiGdM491J/Oap9BdLMOGYsf78PPBoDj06KlQxASnikKo/dvawFrCWlnMPzeKRxxFYAtluAQscdzHiqJgWkoPQKha+ydgQHI7z+v6UCY4Y2ilDHThJr7wNRZj3cQ2ZSk1pYsIVFR7zXymMdoAuZGqcvr0AOYHxqxVqFA11wVHXSMEKtT4rk7ZL4vOozz5CAMbnOoIgdaNBYK5r3MK+Qo3xXSVqRvgDeXhlw7GN1Qw2JSC8oA5L0u86LKw== 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 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=PLinzapPJysSxrfPlPPA5lCdBv2fakLFiQ6J5iu44uE=; b=AIK3uKe+K+UNgRhwt3/nY0gAAlzNhkZzSU7uU8/G1QDoGNv73beYHvcEGuXM3WVhwEILo0yLUNBY2MoWqpKhYyK8zzC0RAzH/CG7yaRii97TeIZp8Ryrumj/Bkr9FPPeTBc0KpYOz+jKWd9ibni+l4V1oGNorB6Avv5ljYhZ31I= Received: from AM6PR10CA0025.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:89::38) by GV1PR08MB7377.eurprd08.prod.outlook.com (2603:10a6:150:21::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.29; Tue, 23 May 2023 13:04:33 +0000 Received: from AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:89:cafe::fc) by AM6PR10CA0025.outlook.office365.com (2603:10a6:209:89::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.29 via Frontend Transport; Tue, 23 May 2023 13:04:33 +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 Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT059.mail.protection.outlook.com (100.127.140.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6433.14 via Frontend Transport; Tue, 23 May 2023 13:04:33 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 23 May 2023 13:04:28 +0000 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; Tue, 23 May 2023 13:04:28 +0000 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; Tue, 23 May 2023 13:04:28 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [PATCH v1 10/12] ArmPkg: Prevent SgiId from setting RES0 bits of GICD_SGIR Date: Tue, 23 May 2023 14:04:19 +0100 Message-ID: <20230523130421.10804-11-sami.mujawar@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20230523130421.10804-1-sami.mujawar@arm.com> References: <20230523130421.10804-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT059:EE_|GV1PR08MB7377:EE_|AM7EUR03FT048:EE_|DU0PR08MB7392:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bfd94aa-1c7a-4e86-85b5-08db5b8e49ed 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: RVTDUUHkQ0AyPNvDHgcwQE/HFeDtmENCpI2pvYqg6hAyKlkdB9qqowj6ZT1W4A8HFOTyZmbe74pN4c2y0tIcFuzLpHqeu003lzuwMSIZ5jnteCKlKnueKF4oN18MJtBXbRJRpEgL99//hyeH2qkUAmyACfrE9ePXF2RIj3HCDcL0aXh9zMFFgTWDsN72KKkkmpEQbzN1o8x7xkVo/ZedN9V3dHUfr7Ud0xE5ev/a7BMW7AxkqS26TczPZXX18zFvAqY9ps50JfIODBaUc9NRmgHFQIPX4wBd79oLQ4UBpFSaiMhQ0TFrxi9SYTdMPdzIXU+8LBHRsaDrwtiMCwD+fUab7G+3zbmq52kaylSvIqOoS2LtcQ/Ofuw3R4dBtfizXg6qK12V+dMZB94B8aZQGH47ulCStvnR0kQotVb6Md2aAYXaTRKUkrrpiGKnU44zH0DNJK5a6XayVf93p7ncaBmWsWeqVZldLnT+g/N/N2XKFQy8Eody/C7c6FmIp7BIaHp0fS9tkqEd5mR3CkThvjLSUyGbBsR9nAVFzn6POFFAq36Eb6aBgtVn0KtTdxzXPtNMYb0xP7CIliZAz6xSpIxhO6aa0wzSOrjKtN8+8KHS6d2bQyUTY3fifQZdBqlTz9yRvnpC4ZFvvgMF+HRyiijy2ELKoVUdR3VrHmMg+rHsRIB+nSiRcMJDb55fXfGL6jOPSrlXKq3CPFSVagLleyWOIfppdCS3sBK89wT2mXEe5K2iIIzn078rPr3FPP6U52jE8ePO8TDXh4nBs8uDsQ== 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)(346002)(39860400002)(136003)(396003)(376002)(451199021)(36840700001)(46966006)(40470700004)(82740400003)(186003)(1076003)(26005)(356005)(81166007)(40460700003)(44832011)(2616005)(36860700001)(47076005)(36756003)(83380400001)(426003)(336012)(2906002)(40480700001)(316002)(6666004)(70586007)(70206006)(4326008)(6916009)(41300700001)(7696005)(86362001)(54906003)(478600001)(82310400005)(8676002)(8936002)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7377 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 346ada08-765c-4c97-1811-08db5b8e40a5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MdE887o2krNhrvD/EkW1VlyTgsWw305Tdb5V+sQOwoMSjJ5EPsqU20+yd6A6HevclrKKqKJGZBmsrzbVGstB7UjlHiudYV8s40IPaQDmk03MT2ejuyS9O9AbUitw82GdfHkBXQT4jafyhHtPiQJNd8B2dF3qFTG/9kz1nOkos1F4v+Ig/qgJIUuUFJpqfnxg09PiBlIBa3+xa3ZpINdQPJpFs2gnPLoNsmIaJnKYBl3rH58x0Nrnjy/s3QbjzWzMHQvX7xPnxJImZkI6139KinSrG+DGggiA3/Ql24v4jkrWIfs2RKl6o4NufKNk46WahLgb4VdNfkY8EbeCxik7sDIyPiwILI2n2vnXRXxys2/QG3nX6lG90KuRYnCw4S9hiXyDlp6Vr3FBvSnVW2apGhfSyINPSpugj7ikApU/aMo33HDu6t3yBMOL3oHqzt1OGrovGk1b0K6gLSI9nSk24K7huBobP6EJEEUUJQKSyg6Lc42/H2/0vaolQOt3w8a0HCmMWMr4+IV50oTK92nCjKpRyQp+D8Mn+ibwvDoUEn39BPmuibRwf1UxydLGNELOLWLQ8qMhldMMif21Teh23SZvAjJjaSgqs9LwWkiGj7sMhmVFDYR4x13VQJ1kaTKfEtCokkkZTkVEeaJ0nooRQdiLb4PjYlUVy0m1uwEIyV/z2zYMjqOrJqoDMfC5zrY4HCPyIZwk1zGR47cug9qVEMDdt8sj22+MckAFbPVR9SzZtWElSIy/k0IYwSO9UGea 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)(4636009)(376002)(39860400002)(136003)(396003)(346002)(451199021)(36840700001)(40470700004)(46966006)(6666004)(26005)(1076003)(316002)(186003)(5660300002)(41300700001)(44832011)(7696005)(82740400003)(40480700001)(40460700003)(36756003)(82310400005)(86362001)(2616005)(36860700001)(478600001)(83380400001)(54906003)(336012)(426003)(47076005)(2906002)(81166007)(8936002)(6916009)(70206006)(8676002)(70586007)(4326008);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 13:04:48.6218 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bfd94aa-1c7a-4e86-85b5-08db5b8e49ed 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: AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7392 Content-Type: text/plain GICD_SGIR is a 32-bit register, of which INTID is bits [3:0] and Bits [14:4] is RES0. Since SgiId parameter in the function ArmGicSendSgiTo () is UINT8, mask unused bits of SgiId before writing to the GICD_SGIR register to prevent accidental setting of the RES0 bits. Signed-off-by: Sami Mujawar --- ArmPkg/Drivers/ArmGic/ArmGicLib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmGicLib.c index df61e3aad4a7899eaa888cb248ad2a285c7f317d..0127cca3bf0567bc80702f415e9cbb9bd2709fbc 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011-2021, Arm Limited. All rights reserved. +* Copyright (c) 2011-2023, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -148,7 +148,9 @@ ArmGicSendSgiTo ( { MmioWrite32 ( GicDistributorBase + ARM_GIC_ICDSGIR, - ((TargetListFilter & 0x3) << 24) | ((CPUTargetList & 0xFF) << 16) | SgiId + ((TargetListFilter & 0x3) << 24) | + ((CPUTargetList & 0xFF) << 16) | + (SgiId & 0xF) ); } -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'