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

Re: [XEN][PATCH v9 03/19] xen/arm/device: Remove __init from function type


  • To: Julien Grall <julien@xxxxxxx>
  • From: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • Date: Thu, 24 Aug 2023 17:52:39 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=6jhyM1bjKLWn9N8gd5GhyxsvdLsPSzVKS4kxSTT2FU0=; b=f14TNcTl9aCR+Zko+vWikdJJP/PknQsolExgGi/M1FOc947GWz4hMjv+HHHxenNR9oHlu4JZrv/IM0JrwBoOHq7J0fgxVhI7FXg3GLbvHt8hASWhdmaxTEsDvBF/2+W0J0WAUupWb2AKnVDfikMsae2uZyByTNNbazCC9WQD0/3wVgnlGBDgKs8rY3Zxny5mL6rfLEiT7IJyK5SwCKDI7d0Fj4sDjo8aRntcyjMTKg10A/Dv/DVhGdEa+P3PgKIY69BeGfvp/AMNQX9+6ylphbKsomCWmfbrI3VJehojchYOVcaL+bWO+tydTIU8Zq0IScXi+4jTQaSlObNqf9bUKw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fLdtO3pPfY7/Mrdy3YHlzXH9hBWeaa8cuAH8UUg5KELHUb4bb8nawvbjXctUpJn4XD2HtGxAv6ULP+fdA18yIT0s1PruzDnL1/qiqjhDX36PydmvjZudFbgQlNr0Ielj92t6X3e6oKFZWn5eavJgfHP4eMdI5l2Ml/ZbCtC56jl7JoKn8ZZXJc7pTQOZ2En4djZMxqBbcHiTUI75KxLsKle6CwihLh1YxVNJKri0Ymmbt6iRjuJH99szEG5KEKDdmp0CHQvLurmfimjRhQWYioOepjBL6vuWfZXJh2rRbCMh6kpuUD5M9HVPq3zj0IWfY5K8UnCFSbhFWDCPDXY89w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, michal.orzel@xxxxxxx, sstabellini@xxxxxxxxxx, jbeulich@xxxxxxxx, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 25 Aug 2023 00:53:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,
On Tue, Aug 22, 2023 at 07:59:13PM +0100, Julien Grall wrote:
> Hi Vikram,
> 
> On 19/08/2023 01:28, Vikram Garhwal wrote:
> > Remove __init from following function to access during runtime:
> >      1. map_irq_to_domain()
> >      2. handle_device_interrupts()
> >      3. map_range_to_domain()
> >      4. unflatten_dt_node()
> 
> We are at v9 now, so this is more a remark for the future. In general we are
> trying to avoid modifying the same code multiple time within the series
> because this makes it more difficult to review. In this case, you could have
> removed the __init in patch #4 where you also export it.
> 
> > 
> > Move map_irq_to_domain() prototype from domain_build.h to setup.h.
> > 
> > To avoid breaking the build, following changes are also done:
> 
> I am guessing by "breaking the build", you mean that you will get an error
> because an non-init function is implemented in domain_build.c. Right? If so,
> I think this should be spelled out.
Yeah, i will change the commit with right reasoning.
> 
> > 1. Move map_irq_to_domain(), handle_device_interrupts() and 
> > map_range_to_domain()
> >      to device.c. After removing __init type,  these functions are not 
> > specific
> >      to domain building, so moving them out of domain_build.c to device.c.
> > 2. Remove static type from handle_device_interrupt().
> 
> Typo: s/interrupt/interrupts/ to match the function name. But I don't link
> the name when it is exported as it leads to think this is dealing with real
> interrupt.
With using handle_device() in overlay as your below suggestion will anyway need
this handle_device_interrupts() function here.
> 
> Looking at the overlay code, the caller (i.e. add_resources()) is very
> similar to handle_device(). AFAICT the only differences are:
>    1/ add_resources() doesn't deal with mapping (you said it will in the
> future)
>    2/ You need to update some rangeset
> 
> For 1/ it means this is a superset. For 2/, I think this could be abstracted
> by adding a pointer to the rangesets in map_range_data. They could be NULL
> for the domain build case.
> 
> So can you look at abstracting? This will make easier to maintain a single
> place to parse a device node and map it.
> 
> A possible name for the function would be dt_map_resources_to_domain().
For this part of dynamic overlay programming this function can be used.
I updated the overlay code to use handle_device() as per your suggestions. Moved
handle_device() and other relevant function out of domain_build.
About renaming the function name to dt_map_resource_to_domain(): I will see if
i can come with better name else will keep your suggestion.
Now with this case, overlay device tree needs to have "xen,passthrough" enabled
else it will try to map and fail as Xen supports irq_route and mapping only at
the domain creation. In earlier patches this worked fine as we were always skip
the routing and map. Anyway, I will add this in overlay commit message.

I will send v10 tonight. Testing a few things.
> 
> Cheers,
> 
> -- 
> Julien Grall



 


Rackspace

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