[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 1/4] arm/time: Use static irqaction
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
- Date: Thu, 18 Sep 2025 12:16:33 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
- 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=NjOMxcbZy0hyh0dIObKoLQ2p0jnzV1Yb02lrehaU3Hw=; b=wwAX46GDFuCrUJNGrHOckVW/We5/zneoZp4xUGeB45mIvNDUe0YdoMIg1Z8VfKZeneLCL04EgnWI413m/zb/WTgV5w6vzXC7edB30TTH/vwkG9QWYXV1kSiX5jIjund6hp9f187wubA/TEwGx33BB97yH+yig+41Miwar4kAgZXtK5jYH8NiEaTZNNVkJuuibhXvZfdPYgKh3SrBS+RWHZC/8btzG/bRPZrxHLrTNL16UQTp2e9I54UT1/TEGw41hwz32XHl/kBGdc0JYsuTPC2k1tsMT+FiMElRH4aGfQ8kfcaaXiiHY4HCaPNvkeeeDEwfdv9xI7x8BskdMEVoGQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=km6aThQ7Mhvz2C04B/mdxpNvaW/XS8Got8rK1+f1sosjSvenkCLNOX1Sge1jWAIaVAtoLFhQJ3o9l8YYdv0cMU5k1umQcfPrhFQv3Plu7tR0vX4B46lm0AU3SqSazA3shSjufqsqPRs85fVvw66UwQQXl61oUqR2MMpO9s6XNiUrNTEYxtMpbuz+vTYEs6DjgnFrjh8iHrCRAWKZvGbawJDcon4AFPi7nDgeB2/eilUWtjlpQh5cb/D1s0aNZprB5RyqOtfvnsQibNqgai9UdHkqpsTZ6WS3RZWPa77c6s4E9sw38zOrvsm1vRhyBz3ukbQ0CYvcznrD/0q8ghBtwQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Thu, 18 Sep 2025 12:16:49 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHcKJYSTyRyVCV94k2TjQUv8/ENTA==
- Thread-topic: [PATCH v1 1/4] arm/time: Use static irqaction
When stopping a core deinit_timer_interrupt is called in non-alloc
context, which causes xfree in release_irq to fail an assert.
To fix this, switch to a statically allocated irqaction that does not
need to be freed in release_irq.
Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
---
xen/arch/arm/time.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index e74d30d258..6f215de210 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -303,6 +303,20 @@ static void check_timer_irq_cfg(unsigned int irq, const
char *which)
"WARNING: %s-timer IRQ%u is not level triggered.\n", which, irq);
}
+static struct irqaction __read_mostly irq_hyp = {
+ .name = "hyptimer",
+ .handler = htimer_interrupt,
+ .dev_id = NULL,
+ .free_on_release = 0,
+};
+
+static struct irqaction __read_mostly irq_virt = {
+ .name = "virtimer",
+ .handler = vtimer_interrupt,
+ .dev_id = NULL,
+ .free_on_release = 0,
+};
+
/* Set up the timer interrupt on this CPU */
void init_timer_interrupt(void)
{
@@ -314,10 +328,8 @@ void init_timer_interrupt(void)
WRITE_SYSREG(0, CNTHP_CTL_EL2); /* Hypervisor's timer disabled */
isb();
- request_irq(timer_irq[TIMER_HYP_PPI], 0, htimer_interrupt,
- "hyptimer", NULL);
- request_irq(timer_irq[TIMER_VIRT_PPI], 0, vtimer_interrupt,
- "virtimer", NULL);
+ setup_irq(timer_irq[TIMER_HYP_PPI], 0, &irq_hyp);
+ setup_irq(timer_irq[TIMER_VIRT_PPI], 0, &irq_virt);
check_timer_irq_cfg(timer_irq[TIMER_HYP_PPI], "hypervisor");
check_timer_irq_cfg(timer_irq[TIMER_VIRT_PPI], "virtual");
--
2.34.1
|