Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB53ECAC5A0 for ; Thu, 18 Sep 2025 13:28:46 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1126095.1467773 (Exim 4.92) (envelope-from ) id 1uzEgR-00044u-Uc; Thu, 18 Sep 2025 13:28:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1126095.1467773; Thu, 18 Sep 2025 13:28:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uzEgR-00044k-R1; Thu, 18 Sep 2025 13:28:23 +0000 Received: by outflank-mailman (input) for mailman id 1126095; Thu, 18 Sep 2025 13:28:23 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uzEgR-00044e-1t for xen-devel@lists.xenproject.org; Thu, 18 Sep 2025 13:28:23 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1uzEgQ-00Fy4w-24; Thu, 18 Sep 2025 13:28:22 +0000 Received: from [15.248.2.235] (helo=[10.24.67.203]) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uzEgQ-00GJyV-29; Thu, 18 Sep 2025 13:28:22 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=p0d+DH9Rwrr8mSaj8F4PvpwqI1NpdM2LwEMPJA8zEgs=; b=4/+Zhd70mPi2CdCTwLof0C0N6l vQ7LshE8euPJvDZR2fglwJs5jan9FBnIyVX7IAWmzxIwOZl54+qAPlHN6qfO8l2omGdXS6UBwTIZF aSMTCLTdC+xFDwx6qVmtnUSCOV58h6fJt8VMDNIRiwLfhXHvSwvyeUWTqxaLEyiOYKGw=; Message-ID: <65fb96d3-3f5e-42fc-8330-e289bf029246@xen.org> Date: Thu, 18 Sep 2025 14:28:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/4] arm/time: Use static irqaction Content-Language: en-GB To: Mykyta Poturai , "xen-devel@lists.xenproject.org" Cc: Stefano Stabellini , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk References: <9d10949d60aa930d6b281824f5879e804ff18918.1758197507.git.mykyta_poturai@epam.com> From: Julien Grall In-Reply-To: <9d10949d60aa930d6b281824f5879e804ff18918.1758197507.git.mykyta_poturai@epam.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Mykyta, On 18/09/2025 13:16, Mykyta Poturai wrote: > 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 > --- > 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, > +}; setup_irq() will update the field "next" in irqaction. So we need one instance per call. Effectively, this means one per CPU. Therefore, we want to use DEFINE_PER_CPU. This applies to the rest of the series. Cheers, -- Julien Grall