[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] arch/arm: time: Add support for parsing interrupts by names


  • To: "Andrei Cherechesu (OSS)" <andrei.cherechesu@xxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 10 Mar 2023 14:23:20 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=oss.nxp.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
  • 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=J0JihwpdVKh+75YoCU+4CiPQfiFiQ1GqJXVed1TfyBA=; b=DpAhZz7jMC+AF3KuZW9yRUw27/ndZMJ3L/YcI6t2+5tkus6YMRQswNUxuZa4fFI5vT7tlWndf1YwFYPpoS8fdq44jUp9bbuSs3itA2LaUd8LeSXHRJSWjQcGLi/ykJedjSv362OeaWLS8SXDKAT2DAasgqbOAQykMaZ27Kfs096UUVYW1u5VYZwnByX8QpfOXl2mPaxqie11r6dB+/Zu9SBXZbOBE4uRVdJKSZUKzd2CyiNiXlQOWpFARp8Mm/I5hP4lhlCd9AOfrpcnzNVX3D8o07dMVotP9u6JQCNVBQkFuYedXwmr89M5f5IGxjROnw1pszJZHp63TXZo9dol/w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MQw7EzLhKDCnX9yIqlE2Bw26jd9dtGxUsHWiKzrV3Yz1pNVvf5TYwz8fqKdmrFT/cLrZIpg4aXER1M+P79kKAIkn8m0aQo0FKNb0l5Tw+SQ8DyWFBzbnb71kRlwZ3D2TYoiFdD2kD0y1U/7fmfYX6/EfS9q3lncO37LAqobsVVcsX/HmqkQW5eH+4566CI9E7+hrIeJAfzGU5PcFoy7MJY/hkfMGWRpkFySJqMqaddfxJ6qKedfYTsBtOEFLOw16z2LLJBAfXJZHeIDXMAVU7fhdlKJp9ju0/v/kLX5zOgf/AGvchw4FE3xvH0QKLxFd54D84ULSupFAgB3xLdGrQQ==
  • Cc: <Bertrand.Marquis@xxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <rahul.singh@xxxxxxx>, Andrei Cherechesu <andrei.cherechesu@xxxxxxx>
  • Delivery-date: Fri, 10 Mar 2023 13:23:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Andrei,

On 09/03/2023 17:19, Andrei Cherechesu (OSS) wrote:
> 
> 
> From: Andrei Cherechesu <andrei.cherechesu@xxxxxxx>
> 
> Added support for parsing the ARM generic timer interrupts DT
> node by the "interrupt-names" property, if it is available.
> 
> If not available, the usual parsing based on the expected
> IRQ order is performed.
> 
> Also changed to treating returning 0 as an error case for the
> platform_get_irq() calls, since it is not a valid PPI ID and
> treating it as a valid case would only cause Xen to BUG() later,
> during vgic_reserve_virq().
vgic_reserve_virq() itself does not call BUG(), so to be more precise,
instead of "during vgic_reserve_virq()", how about:
"when trying to reserve vIRQ being SGI."

> 
> Added the "hyp-virt" PPI to the timer PPI list, even
> though it's currently not in use. If the "hyp-virt" PPI is
> not found, the hypervisor won't panic.
> 
> Signed-off-by: Andrei Cherechesu <andrei.cherechesu@xxxxxxx>
> ---
>  xen/arch/arm/include/asm/time.h |  3 ++-
>  xen/arch/arm/time.c             | 27 +++++++++++++++++++++++----
>  2 files changed, 25 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/time.h b/xen/arch/arm/include/asm/time.h
> index 4b401c1110..49ad8c1a6d 100644
> --- a/xen/arch/arm/include/asm/time.h
> +++ b/xen/arch/arm/include/asm/time.h
> @@ -82,7 +82,8 @@ enum timer_ppi
>      TIMER_PHYS_NONSECURE_PPI = 1,
>      TIMER_VIRT_PPI = 2,
>      TIMER_HYP_PPI = 3,
> -    MAX_TIMER_PPI = 4,
> +    TIMER_HYP_VIRT_PPI = 4,
> +    MAX_TIMER_PPI = 5,
>  };
> 
>  /*
> diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
> index 433d7be909..868e03ecf6 100644
> --- a/xen/arch/arm/time.c
> +++ b/xen/arch/arm/time.c
> @@ -38,6 +38,14 @@ uint32_t __read_mostly timer_dt_clock_frequency;
> 
>  static unsigned int timer_irq[MAX_TIMER_PPI];
> 
> +static const char *timer_irq_names[MAX_TIMER_PPI] = {
This wants to be marked as __initconst as it is const and only used in init 
code.
So it would be:
static const char *const timer_irq_names[...

Furthermore, as the only user of this array is init_dt_xen_time(), you could 
move the
definition to the function itself.

~Michal



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.