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

Re: [PATCH v5 2/9] iommu/arm: Add iommu_dt_xlate()


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Fri, 3 Nov 2023 14:57:03 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.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 (0)
  • 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=R+oasChRSyY8L4lzZUNHygl3p+RdmafvD9eLNDlUNPU=; b=cbUWSQrVBDm8AlcIocXEJLkhG+TEMLVQEZm7jTzCOtZSbcKrzsnQDqBPdulayxhHtKPVzPNsLDhD7en53ZtF61aT4yRswH+x8JygjoZMOrWqYFNWQWrtjb+Z//sk+EItYRrQfXWR/su9md6e/YgLCr+gtbJ5PXTX5iRVCNFzXrMcC88p1crB8eNWCL5KEtlslByg+SBGxCd4K4pXcOTiB+1QEdJDx4e7o1RpiW/21L06KAGwv14iBex1sAg0Av7cIWvUnMQM8WDenQ2wof69YyGO1pHOJxNOYj/X/7vhCbwC5z56a+Ld1ci4Pr37mO7JcB9WOusp6b0FSISDOQVr7g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LCgXwkm1x1SbnSUxQlUE5m6i2X/XpIkTRbncLLiVF6B0n6uhPcUK/WVdwNKp/cweMQ/6xn2iRD+IUFbzyzz7Lp0MCicE4nu94pjN6hosqbnrri3nc/YBsqt+FtpH4dvhcNs5bNWSVY6UHWE1JHD4WfQHq2X2KDTGJIH8GEBGXxHmP5Cr7vmBY1KJOH8VnX3dc1wAqY82HpBY5XGBQbn7uNuX9paeOjR9liwnRTs4h0/G+gGPVhl9juPCauvXwh4lsz0DNMsXGkBt/wpiDmZaxfB8hIa30Y+U9wEO6QLsxEkUvXFycT8B9tbeAqNKpW/i+RpLiVvyEx79yjFz5/7sKg==
  • Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 03 Nov 2023 18:57:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10/24/23 14:39, Julien Grall wrote:
> Hi Stewart,
> 
> On 04/10/2023 15:55, Stewart Hildebrand wrote:
>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
>>
>> Move code for processing DT IOMMU specifier to a separate helper.
>> This helper will be re-used for adding PCI devices by the subsequent
>> patches as we will need exact the same actions for processing
>> DT PCI-IOMMU specifier.
>>
>> While at it introduce NO_IOMMU to avoid magic "1".
>>
>> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
>> ---
>> v4->v5:
>> * rebase on top of "dynamic node programming using overlay dtbo" series
>> * move #define NO_IOMMU 1 to header
>> * s/these/this/ inside comment
>>
>> v3->v4:
>> * make dt_phandle_args *iommu_spec const
>> * move !ops->add_device check to helper
>>
>> v2->v3:
>> * no change
>>
>> v1->v2:
>> * no change
>>
>> downstream->v1:
>> * trivial rebase
>> * s/dt_iommu_xlate/iommu_dt_xlate/
>>
>> (cherry picked from commit c26bab0415ca303df86aba1d06ef8edc713734d3 from
>>   the downstream branch poc/pci-passthrough from
>>   https://gitlab.com/xen-project/people/bmarquis/xen-arm-poc.git)
>> ---
>>   xen/drivers/passthrough/device_tree.c | 48 +++++++++++++++++----------
>>   xen/include/xen/iommu.h               |  2 ++
>>   2 files changed, 32 insertions(+), 18 deletions(-)
>>
>> diff --git a/xen/drivers/passthrough/device_tree.c 
>> b/xen/drivers/passthrough/device_tree.c
>> index 075fb25a3706..159ace9856c9 100644
>> --- a/xen/drivers/passthrough/device_tree.c
>> +++ b/xen/drivers/passthrough/device_tree.c
>> @@ -137,6 +137,30 @@ int iommu_release_dt_devices(struct domain *d)
>>       return 0;
>>   }
>>
>> +static int iommu_dt_xlate(struct device *dev,
>> +                          const struct dt_phandle_args *iommu_spec)
>> +{
>> +    const struct iommu_ops *ops = iommu_get_ops();
> 
> NIT: Rather than calling iommu_get_ops(), how about passing the ops as a
> parameter of iommu_dt_xlate()?

Yes, will do.

> 
> Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>

Thanks!

> 
> Cheers,
> 
> -- 
> Julien Grall



 


Rackspace

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