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

Re: [XEN][PATCH v11 15/20] arm/asm/setup.h: Update struct map_range_data to add rangeset.


  • To: Vikram Garhwal <vikram.garhwal@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 4 Sep 2023 13:29:53 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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=jYYP8czLRtpn3KnDUAftby/fdRS1lsK3Pmv3fpWaVS8=; b=BkU4rTJudcxku+yhLsEy4pUd/D29U0ecCLXTVPbN3VAR2A6TnWphP77aGXdWjIAMrpKlqDgcFtA4tjV5TK6Lxi9cu6wG7GSUNc8N3v3SABNzojpd9Rex9reIQo5X2AW1ww2lqR2NRlHH2JoWRpc8sI9QD4lrARJKiqz+wL6qRYkYaGwVjsmmCWNo7+hMJF1lbmgjr//z0UDJRXG+l3Zo6zV1Sg3ck6DVQoR8dHdreO+5yu9E8LMHcpY1o+u2LfiN/kEsCsHJGhCkgjUi3JnMJw75iggk3x8SB1nEGa12CJJabMyLrrhO7nPUxCPp2N7oIJjrv0/olxxrHh1yQXekPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GC81OpH/MYEyGh5toYYr3n1dz1oYk9DEfT8crgOiRNN/Gv5C98h8awfkUXSKeFgCN5uCjTcHOdJb7ArP0YnPxDZv7pcbR8tF4JSTvCZmxgFf5/39StJmXG9e/fWI3b1BcHEtCTuZsqaXYknLCep8iMSuMUPq841Pj73eaEpU32rP36FiBA5c/kBSsxHa5A7SXyUPZH/dldrgMSkeLOUcYhBmTy6Whk+o+c5+/i7OWqvBQOURUGPsfSHsszKIlHBdPbN86mFsN74eMnjLvOQ1U0USQ899txbTR6Q6WFGkZGECy3dnZhTckQFu10m8b7kP2/I8bZE9LBxA1uAiFbDvkQ==
  • Cc: <julien@xxxxxxx>, <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 04 Sep 2023 11:30:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 01/09/2023 06:59, Vikram Garhwal wrote:
> Add rangesets for IRQs and IOMEMs. This was done to accommodate dynamic 
> overlay
> node addition/removal operations. With overlay operations, new IRQs and IOMEMs
> are added in dt_host and routed. While removing overlay nodes, nodes are 
> removed
> from dt_host and their IRQs and IOMEMs routing is also removed. Storing IRQs 
> and
> IOMEMs in the rangeset will avoid re-parsing the device tree nodes to get the
> IOMEM and IRQ ranges for overlay remove ops.
> 
> Dynamic overlay node add/remove will be introduced in follow-up patches.
> 
> Signed-off-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
> 
> ---
> Changes from v10:
>     Replace paddr_to_pfn(PAGE_ALIGN()) with paddr_to_pfn_aligned().
>     Change data type of irq.
>     fix function change for handle_device().
>     Remove unnecessary change .d = d in mr_data.
> ---
> ---
>  xen/arch/arm/device.c            | 43 +++++++++++++++++++++++++-------
>  xen/arch/arm/domain_build.c      |  4 +--
>  xen/arch/arm/include/asm/setup.h |  9 ++++---
>  3 files changed, 42 insertions(+), 14 deletions(-)
> 
> diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c
> index 327e4d24fb..1f631d3274 100644
> --- a/xen/arch/arm/device.c
> +++ b/xen/arch/arm/device.c
> @@ -165,6 +165,15 @@ int map_range_to_domain(const struct dt_device_node *dev,
>      dt_dprintk("  - MMIO: %010"PRIx64" - %010"PRIx64" P2MType=%x\n",
>                 addr, addr + len, mr_data->p2mt);
>  
> +    if ( mr_data->iomem_ranges )
> +    {
> +        res = rangeset_add_range(mr_data->iomem_ranges,
> +                                 paddr_to_pfn(addr),
> +                                 paddr_to_pfn_aligned(addr + len - 1));
> +        if ( res )
> +            return res;
> +    }
> +
>      return 0;
>  }
>  
> @@ -178,10 +187,11 @@ int map_range_to_domain(const struct dt_device_node 
> *dev,
>   */
>  int map_device_irqs_to_domain(struct domain *d,
>                                struct dt_device_node *dev,
> -                              bool need_mapping)
> +                              bool need_mapping,
> +                              struct rangeset *irq_ranges)
>  {
>      unsigned int i, nirq;
> -    int res;
> +    int res, irq;
You could make use of res to store irq just as it was done before without 
introducing new local var.
Anyway, if you think it improves readability:
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal



 


Rackspace

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