From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A570606A32D for ; Tue, 1 Dec 2026 10:09:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=va/R2HU/ Received: from list by lists.xenproject.org with outflank-mailman.1508444.1701354 (Exim 4.92) (envelope-from ) id 1xYKn5-0000cZ-37; Tue, 01 Dec 2026 10:08:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1508444.1701354; Tue, 01 Dec 2026 10:08:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xYKn5-0000cS-08; Tue, 01 Dec 2026 10:08:51 +0000 Received: by outflank-mailman (input) for mailman id 1508444; Tue, 01 Dec 2026 10:08:49 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xYKn3-0000cL-B1 for xen-devel@lists.xenproject.org; Tue, 01 Dec 2026 10:08:49 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xYKn2-004fOp-Np for xen-devel@lists.xenproject.org; Tue, 01 Dec 2026 11:08:48 +0100 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6b0e9cab-2eae-0a2a0a5409dd-0a2a4502c8b0-14 for ; Tue, 01 Dec 2026 11:08:48 +0100 Received: from [52.101.43.56] (helo=SJ2PR03CU001.outbound.protection.outlook.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6b0e9cae-4900-0a2a45020019-34652b38ffcc-3 for ; Tue, 01 Dec 2026 11:08:47 +0100 Received: from BN9PR03CA0220.namprd03.prod.outlook.com (2603:10b6:408:f8::15) by CY8PR12MB8194.namprd12.prod.outlook.com (2603:10b6:930:76::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Tue, 1 Dec 2026 10:08:41 +0000 Received: from BN3PEPF00022BCD.namprd03.prod.outlook.com (2603:10b6:408:f8:cafe::58) by BN9PR03CA0220.outlook.office365.com (2603:10b6:408:f8::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Tue, 1 Dec 2026 10:08:39 +0000 Received: from satlexmb08.amd.com (165.204.84.17) by BN3PEPF00022BCD.mail.protection.outlook.com (10.167.248.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Tue, 1 Dec 2026 10:08:39 +0000 Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 04:08:39 -0600 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb09.amd.com (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Tue, 1 Dec 2026 04:08:37 -0600 Received: from [192.168.31.141] (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.57 via Frontend Transport; Tue, 1 Dec 2026 04:08:36 -0600 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Post: List-Help: List-Subscribe: , Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IWnfqVCR7jQqyBzUDDCyVrUdWiqJLsX7qVbyTEOvTTfUte8rSrikcVz978Yxr69ncq/po0O0XuNnFAnp4Ey7OLl4UILalreOseNyECXwXYNNBgQK0FZnkNfc68kJJHcAtv+Nsq4DwGrc6pXv5DabMlsl5PNG/WY9FmDFaWbPGxjo5MDtZMlL2I+EZLEf90diHT8UHGJfd3AHhIBgXED0yqKQ5qCEkX+TmOX+z5WDEvcTcmZP+vnantjzLcs+aTfI0+fh0mHwHS/M+cprOOoB52tbvvcQG5eXfvuEVKMZI7IMA5cAH8t48EBNFvxoul/1aGl8V1ncRKKLPdfoBr6rKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=BW/hOgvOt47R9yLKbSQcLynsuchwlCNF/HsFtRmAzA0=; b=vIyxMzhdr3Xdml2lDzAr0xUvHgJBPzCgO0UXv+kKtjKEftGh7SSukKaQJUHWelVKqlK5zB9XZ0VYxNLtLnCi+K/rBeUr2LNwhsAZ8n41d1x1EmIRCzQ7FiFp8hHroTjUDx3ImfjZsoF74gy5f5+5DvSZbb88WzhHLhbFvR4nSUNvmDKAwTIBoJZjp+oFDk/RiatJluh46s/V1FPaMNlkx9B2I4rAXaZHEzIVynzlKFkCeqdi6+PkbNeF0DBEHMIFp/ynb3IzYO29GUGxNAsyEi02k44B4Se5ZlfpstpOkb/X/QDNJteOvbTfTlV/3yyrEq1nu8eFVAh3qpS/p3imFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BW/hOgvOt47R9yLKbSQcLynsuchwlCNF/HsFtRmAzA0=; b=va/R2HU/ePInOfJCMaGqytzWg53x19eQVoS6oDe3DN5WW//N1S6otmZxM3wGxp5oKs84nwp6aAP76J3Dzl7BhC6ZqXCT2LHCpyJOWkmKyUoM8U0ABR+oJKvDrwcO8b2j+tUMUBdDuJYiRkx/NyiKlqTwuhPwUPXpm53FgzgP07w= X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C Message-ID: Date: Tue, 1 Dec 2026 11:08:35 +0100 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] xen/arm: ignore spurious interrupts from virtual timer To: Mykola Kvach , CC: Mykola Kvach , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk References: <436a0405a9482dadce7f7cdb1e9721ee461f26a7.1768219676.git.mykola_kvach@epam.com> From: "Orzel, Michal" Content-Language: en-US In-Reply-To: <436a0405a9482dadce7f7cdb1e9721ee461f26a7.1768219676.git.mykola_kvach@epam.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF00022BCD:EE_|CY8PR12MB8194:EE_ X-MS-Office365-Filtering-Correlation-Id: f6591221-e757-485b-79a1-08df4f931229 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|23010399003|36860700016|1800799024|82310400026|10067099003|56012099006|11063799006|261009223027099003|261022075727099003|261022105027099003|261102123227099003|261028144727099003|261026121527099003|261021123027099003|261021121427099003|261026140227099003|18002099003|22082099003|6133799003|3023799007; X-Microsoft-Antispam-Message-Info: pP4nH8/fcaknq5/JzGjb+akq4N8GChy8GMYWyxIrIT2K0lcmCJcuDLtYttrO2BhXKNly8j9uS4xyz+SEYVS3UvUzC4owJXX9cv7xvXQRR3Nlxwcq3LVKOSnju/x+7ab9TfOODmCMk4XKUDHwqgsvu+o1RXPgnoYpilgsEg0slphFGtlkhGewx2gO3lETCz3U7X2SWNAYWZZjE5UqinjVQQfgz1SCDNmzVOpr6Fv7FZAXFJAxbJkOPfsSjPRo7pd9y8gGzVwYe7DnYYk4GQljU+v875mzwaG9lc4InuHJ+EhrVGDsWJ9oO+2TAOON/3TOiYSbdDpnvB9TbQnovrBqMCr+kPD4ZbSiHuR367Mty4vKSSY/WNnzkgmV4Nlx5jWtCxOxikE/2GKsAbFLoWPa//CXSkLNzRbDKlCujd/MvIq+WQVoHadh7NmnQZdm+mkLa1cww7rW+6YLAe8Q/Zrew/bu8O49NnqEYurQjwisM782JImKfcxgfGYFP6UQINUsy+m0zNTujHWRMIvYwXYq3r4772gi0DV2Nv4npZloE9DcOSzF2N66YvgTxJnDKoks/T4HHndqmkDlnBnKbpquMNwZpmq3lU7Jj1P9mu/DJ7Lccr1MjTJmAmDJTM6NPkXwtB1AR0pL/H/te9uH8R8eg3D0Tl663VZlXSX7rlQ3KEFtyO3TEWe4HmZzwon9673O9TKEVWuDBRwO4z1g3kXBTw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(36860700016)(1800799024)(82310400026)(10067099003)(56012099006)(11063799006)(261009223027099003)(261022075727099003)(261022105027099003)(261102123227099003)(261028144727099003)(261026121527099003)(261021123027099003)(261021121427099003)(261026140227099003)(18002099003)(22082099003)(6133799003)(3023799007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MOBGnIbodBRjmvOlfEdM01HRdR8SAT6WBVNmwbrT3yKPO7rVTvyaF6diGuc8GQUm0IuqaFXR3VNLmTDm19M4nuryu33BzSWUj2O/UGvoFqvKYIcsnaSbRfiXEjjYh1jieNO2cjI1V5NfWYYmciin9PGYwI4eWIVP9ujqrrGl9KXpAP8hd2H3EK/XadL1SaL2MOTJth5Y6jX5UmUuxl6XeJc3xZMtdY6gf6vXQYWvrV6h6NTNjO5t4D01xpqRzwStYwG/mwxK7vNIZ5PyrXOY0MVcP65npwdeMGD+eElUSb+pdB/6xrhY+FLClBBv2ATIen8AQvnheyZ8gwK8HPpKU8n17eN2X3Yo5207jYA7nTGR3aN8Ogm3L2JPZZwFi/vfOWRhTvv0/APjjIr6E7lUUnPruUyQp0N2N5UVxiSA6QqpemaruWNU/aqUh6JHvmup X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 10:08:39.2946 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6591221-e757-485b-79a1-08df4f931229 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF00022BCD.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8194 X-purgate-ID: tlsNG-720697/1796119728-32B976C6-84692847/0/0 X-purgate-type: clean X-purgate-size: 3137 X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 12-Jan-26 13:50, Mykola Kvach wrote: > From: Mykola Kvach > > If a spurious virtual timer interrupt occurs (i.e. the interrupt fires > but CNTV_CTL_EL0 does not report it as pending), Xen masks the virtual How does this spurious vtimer IRQ comes about? As Julien suggested, please say `... pending i.e. ISTATUS bit clear` > timer and injects the vtimer IRQ into the guest. For Linux guests, the > timer interrupt is unmasked only after programming a new CVAL value from > the timer interrupt handler. When the interrupt is not reported as > pending, the handler can skip that programming step, leaving the timer > masked and stalling the affected CPU. > > This patch mirrors the Linux arm generic timer handler: if the interrupt > fires but the pending bit is not set, treat it as spurious and ignore it. > > This issue is reproducible under heavy load on the R-Car X5H board > (Cortex-A720AE r0p0). > > Signed-off-by: Mykola Kvach This needs a Fixes tag: Fixes: b765caf5101a ("xen/arm: support the ARM generic virtual timer") > --- > xen/arch/arm/include/asm/perfc_defn.h | 7 ++++--- > xen/arch/arm/time.c | 11 ++++++++++- > 2 files changed, 14 insertions(+), 4 deletions(-) > > diff --git a/xen/arch/arm/include/asm/perfc_defn.h b/xen/arch/arm/include/asm/perfc_defn.h > index effd25b69e..f83989d95a 100644 > --- a/xen/arch/arm/include/asm/perfc_defn.h > +++ b/xen/arch/arm/include/asm/perfc_defn.h > @@ -69,9 +69,10 @@ PERFCOUNTER(ppis, "#PPIs") > PERFCOUNTER(spis, "#SPIs") > PERFCOUNTER(guest_irqs, "#GUEST-IRQS") > > -PERFCOUNTER(hyp_timer_irqs, "Hypervisor timer interrupts") > -PERFCOUNTER(virt_timer_irqs, "Virtual timer interrupts") > -PERFCOUNTER(maintenance_irqs, "Maintenance interrupts") > +PERFCOUNTER(hyp_timer_irqs, "Hypervisor timer interrupts") > +PERFCOUNTER(virt_timer_irqs, "Virtual timer interrupts") > +PERFCOUNTER(virt_timer_spurious_irqs, "Virtual timer spurious interrupts") > +PERFCOUNTER(maintenance_irqs, "Maintenance interrupts") > > PERFCOUNTER(atomics_guest, "atomics: guest access") > PERFCOUNTER(atomics_guest_paused, "atomics: guest paused") > diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c > index cc3fcf47b6..d18d6568bb 100644 > --- a/xen/arch/arm/time.c > +++ b/xen/arch/arm/time.c > @@ -258,6 +258,8 @@ static void htimer_interrupt(int irq, void *dev_id) > > static void vtimer_interrupt(int irq, void *dev_id) > { > + register_t ctl; > + > /* > * Edge-triggered interrupts can be used for the virtual timer. Even > * if the timer output signal is masked in the context switch, the > @@ -271,9 +273,16 @@ static void vtimer_interrupt(int irq, void *dev_id) > if ( unlikely(is_idle_vcpu(current)) ) > return; > > + ctl = READ_SYSREG(CNTV_CTL_EL0); > + if ( unlikely(!(ctl & CNTx_CTL_PENDING)) ) I think this deserves a comment saying that we must not inject virq masked when not pending. ~Michal