From nobody Mon Nov 25 02:13:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=provenrun.com); dmarc=pass(p=none dis=none) header.from=provenrun.com ARC-Seal: i=2; a=rsa-sha256; t=1718477867; cv=pass; d=zohomail.com; s=zohoarc; b=A4/k1usoTizA9C95cb/XRVxBBbHlsMu1c6/9yMvMfaWuIvRoLgaVOVNcBQmyB+y58ctntIBV1EZxBikd1iempcaOK+zkczH/f0pmL1DJviX8aW6aD6MRWQOpXgjufcGDI4TDzkiKzYps7AVpb4x9iBsguEaN1ajPdsppVgoabV8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718477867; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dlJSt41gKHiEWb27Af6G6WBrPYOCMEPeGXr67enevB4=; b=TB/CDAqD/hNbV+lWMh6z0i7ZsJXBTxAjpDzCBU7cr0YteigezEQ6das3WYd8jCrF9CvFLNJVFvvKpl0ZE0sbBQOXqXIB15DLl58jqeCMiTcmvQcNazPrqU/mkYslKDgcZqm5pJKN9Swt/k8DbYfeVpq2Qub9sxAX8SJrGq4SYBw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=provenrun.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17184778669081016.4846076638592; Sat, 15 Jun 2024 11:57:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIYZV-00019n-3C; Sat, 15 Jun 2024 14:56:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sIYZR-00014s-Th; Sat, 15 Jun 2024 14:56:14 -0400 Received: from mail-mr2fra01on20715.outbound.protection.outlook.com ([2a01:111:f403:261c::715] helo=FRA01-MR2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sIYZQ-00076c-Ac; Sat, 15 Jun 2024 14:56:13 -0400 Received: from PAZP264MB2990.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1f2::18) by MR1P264MB2210.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:15::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.29; Sat, 15 Jun 2024 18:56:06 +0000 Received: from PAZP264MB2990.FRAP264.PROD.OUTLOOK.COM ([fe80::ef1:e8a1:244f:3ca7]) by PAZP264MB2990.FRAP264.PROD.OUTLOOK.COM ([fe80::ef1:e8a1:244f:3ca7%3]) with mapi id 15.20.7677.029; Sat, 15 Jun 2024 18:56:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b9bDZVZsukwDycHc0WTXcrcUWkOpo4xau2KgBAeibwPhvunOYZ+NDTljRLECIO1mByQT74J1oGfPJQMLmVfr3A3AF1DyzK6fpHoeaBEbqe9+YnqFJOEZkamOt3oOEtXEj0eXJdhCk3htEzTruNYMJOELONCUZkCy1QvKKvuYLRVkJtuozXC5IqjIE1hZmyBkyL/LKcDZOhB9YEbZ8jsUeXaWFi1vkfvF9RU/IuO5I7cslpmji0Rkb5P9BuvDTo9CtUziv3y6+1Z3Ogy4XdGlx7oLGZS7f9NTMTvF8mLF12PPO/L4LT30zjGPLsv7CIC1/BGtGzoiKz86NCGZxu7Fvw== 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=dlJSt41gKHiEWb27Af6G6WBrPYOCMEPeGXr67enevB4=; b=alJDlejTxtTbm0MKQ+6vx+LFUHpt4/kw3x6VJenZycVzWiRWIKzIfriyDHo+Esqs+n3Kr2u6DrapRUphqGxOE9IQi08FqS1SIow6jfEZAJ6sTihZa0wKnArksfofrHqNMPaUQwe3TKAheT6taK+brpNcOeGuCnuDROpT8kpaO0fk+uJwRAnfNIhyuocLNXhWQhBLznONzoriVfY6RSuxLISU/KQ0+Sd2IQMlEre5fEyx0aPnf8aLN163ytAYQc14OYzKRhj53ulD4+TYxGecwm8zL70o2BW+ZYkxtVvBYS6ROpv3kouvE0ogcjVtJgKMNhwfQigqzkL3UfhTc9G3XQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=provenrun.com; dmarc=pass action=none header.from=provenrun.com; dkim=pass header.d=provenrun.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=provenrun.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dlJSt41gKHiEWb27Af6G6WBrPYOCMEPeGXr67enevB4=; b=eqBSdkPTlAU6MwFyC2GQRACERg1VPvC8JBBksMjXXtjcFszoNifrD1IdTmukjwhq986fyPOrmmp1EXtuhOGTvAaRby1r8pURfUvcirThTrsoPzZ9zaE/OewMUvvpMYq/x6GGjSlEbUvKwTLkNrLyy21mQvSbDRrZtZrxcb5dxsATa7LE3yEJLpshFHZg2Nn84rjmPkq5iZv/Zs/ScrC5qXswfXetqaHCn1b0YPDD8c3ylhW7CuQk/PAhXinmYyyBy8zRnsZbRyrGM4VZSFMT7FDoJLvcvxcjTCFLRCZPyRs73sfif7eiVXQl9A1Rg6woQH9DQ1Y+VGRycb7SFFJwAg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=provenrun.com; From: Florian Lugou To: qemu-devel@nongnu.org Cc: Florian Lugou , Peter Maydell , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PATCH] target/arm/helper: Fix timer interrupt masking when HCR_EL2.E2H == 0 Date: Sat, 15 Jun 2024 20:54:23 +0200 Message-Id: <20240615185423.49474-1-florian.lugou@provenrun.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: LO4P123CA0599.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:295::11) To PAZP264MB2990.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1f2::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAZP264MB2990:EE_|MR1P264MB2210:EE_ X-MS-Office365-Filtering-Correlation-Id: 4203f982-1c07-44bd-3a47-08dc8d6ccfe5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|52116011|376011|1800799021; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?R43vBvovqQppDXiUGnsWH8ebQgqf68CYyUZW0dGuhV6+3zqF+G5HMHaWVnzi?= =?us-ascii?Q?2Rd3QoeF/W5IXWTR0k3JiAQrgVmz7lM7ru6t/lG6DnJnEe4MDG7IRvX2zd5n?= =?us-ascii?Q?RhUhRauE558ou9+jNnSyvMdHDqwD3ESikC4VDtzW2XmBcS+y7OSAPHaKi5sj?= =?us-ascii?Q?Ha98uI2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0TegvJLgqBm?= =?us-ascii?Q?4ybeQan88KgxWL3qQdYi1i4nOTkCGxHQ5j/mHf1L0hPmA6yy7Sj3M+oe/p7k?= =?us-ascii?Q?k0zcayQVAxoUM7hPPoDGFjuhKhGzWkXGBrG83gtHSSvRZyqlGfRCttNZm+lR?= =?us-ascii?Q?nn7D4fNmBbwxIp49os38mY7KbxDa8cIDzHD9yqC6ydKd2Q4ENgFeYYinGe/t?= =?us-ascii?Q?fny/6sQXm09Y2oBer184yLkFjNdcdIPkAgtuPeKoZ/Gy/vIFtYeMHkIa6e7y?= =?us-ascii?Q?ub8NxREcfpw5jkpLsYtNe1wB?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAZP264MB2990.FRAP264.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230037)(366013)(52116011)(376011)(1800799021); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?oCP6CVuiDkZ6sjCvF2Sa//DtjBEY2voWHwNdywi8w2iI7NZBMPX49uumtgVZ?= =?us-ascii?Q?VGDJOudzj2pHiuiH+sIitQJt4jH9XFY+sibFwUT7MSjopY1WGDHB1aaJOzgh?= =?us-ascii?Q?LeuL6KvAxtN/vE3QmRmhITVdDbOhY7ij1WNM93/HNN8B8vF5m+4CjhKOvo86?= =?us-ascii?Q?LrszQ3C/PBdzemfU0EDqucvbSuYfMNRPgMbcssbVfR0fdhLUBvA68r1GTB9e?= =?us-ascii?Q?dhlWFFwYTdkVJ79KsRU61/1RnHvqzwHA3M3BFGUKGjB2O3Ln/ADv2zEQ4UQx?= =?us-ascii?Q?LuvyL+qTlfxUeOwdAV5wavygaNnKIbTzP+GKukHupCzWStXkMIxjvtSd4i64?= =?us-ascii?Q?muLioSCncm1YW7+bZZqh8gGUZqvpCJMsB8bHT3Fz0HXPLD/MsOSg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UWSGW/po3wp619HECfO14StBGuaVXfTVtb6g6x4KnR?= =?us-ascii?Q?0qpI6JIncsEI32fIJ+lxFfU37V0fxrlge1Ppv4f1QS07J0Nvze0/xT6b1Oga?= =?us-ascii?Q?x7byoeWRNK/8Ah1ela1kkfkc2sef17zLByoIxOTTiQmHcDjFzkmuGCOj8NZL?= =?us-ascii?Q?iGMblpC+cIrtB9gvdwxLNg7GICCjEA/vlfQiayBFRUhyiGKCWdv6gx3uEehN?= =?us-ascii?Q?tzePSkdi+QicXHe8PuMcmeu4GRPnFey9jI4aAi4sNDbfH63sbZtUaGhEE7Rb?= =?us-ascii?Q?9rfvHdna0GgVKtuE57/fb+BuGt+YP/naDIB5Eagtf5XcC+k6iQZvHMt12x1e?= =?us-ascii?Q?OZCELr047Jb3WCpPbuTMTwt6iCBtO50yOUX6C7oHKqCASG79rE3XaVY1th16?= =?us-ascii?Q?wyJ1QA=3D=3D?= X-OriginatorOrg: provenrun.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4203f982-1c07-44bd-3a47-08dc8d6ccfe5 X-MS-Exchange-CrossTenant-AuthSource: PAZP264MB2990.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2024 18:56:06.4979 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: ff654c30-3eb4-4445-b89f-a54a92b1f03d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: s6xWJ3fnLKEPmSyHMkki5rJazIhRi7ay2rwMWJv4kitQMRBycuQxgIc39JWwxQeQ08ErLidmNbb/hxgJhK0JF5XJFlYZrpKD2NNHeqdq47c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR1P264MB2210 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a01:111:f403:261c::715; envelope-from=florian.lugou@provenrun.com; helo=FRA01-MR2-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @provenrun.com) X-ZM-MESSAGEID: 1718477867380100001 Content-Type: text/plain; charset="utf-8" CNTHCTL_EL2 based masking of timer interrupts was introduced in f6fc36deef6abcee406211f3e2f11ff894b87fa4. This masking was however effective no matter whether EL2 was enabled in the current security state or not, contrary to arm specification. Signed-off-by: Florian Lugou --- target/arm/helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index ce31957235..60e2344c68 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -2684,7 +2684,8 @@ static void gt_update_irq(ARMCPU *cpu, int timeridx) * If bit CNTHCTL_EL2.CNT[VP]MASK is set, it overrides IMASK. * It is RES0 in Secure and NonSecure state. */ - if ((ss =3D=3D ARMSS_Root || ss =3D=3D ARMSS_Realm) && + if ((arm_hcr_el2_eff(env) & HCR_E2H) && + (ss =3D=3D ARMSS_Root || ss =3D=3D ARMSS_Realm) && ((timeridx =3D=3D GTIMER_VIRT && (cnthctl & R_CNTHCTL_CNTVMASK_MAS= K)) || (timeridx =3D=3D GTIMER_PHYS && (cnthctl & R_CNTHCTL_CNTPMASK_MAS= K)))) { irqstate =3D 0; --=20 2.34.1