All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rahul Singh <Rahul.Singh@arm.com>
To: Oleksandr <olekstysh@gmail.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Ian Jackson <iwj@xenproject.org>, Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Paul Durrant <paul@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v4 11/11] xen/arm: smmuv3: Add support for SMMUv3 driver
Date: Fri, 15 Jan 2021 12:38:29 +0000	[thread overview]
Message-ID: <2AAC732A-5407-4B6B-ABFC-BA3914FB1DA1@arm.com> (raw)
In-Reply-To: <3485d705-9063-59b9-f282-9661883265f3@gmail.com>

Hello Oleksandr,

> On 12 Jan 2021, at 8:59 pm, Oleksandr <olekstysh@gmail.com> wrote:
> 
> 
> On 12.01.21 11:41, Rahul Singh wrote:
> 
> Hi Rahul
> 
> 
>> 
>>>>  -static int arm_smmu_of_xlate(struct device *dev, struct of_phandle_args *args)
>>>> +static int arm_smmu_dt_xlate(struct device *dev,
>>>> +				const struct dt_phandle_args *args)
>>>>  {
>>>> -	return iommu_fwspec_add_ids(dev, args->args, 1);
>>>> +	int ret;
>>>> +	struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
>>> Please bear in mind I am not familiar with the SMMU, but don't we need to perform a some kind
>>> of sanity check of passed DT IOMMU specifier here?
>> I checked the code follow we will never hit the dt_xlate without IOMMU specifier but anyway I will add the sanity check.
> By sanity check I meant to make sure that device ID (stream ID) is in allowed range (of course, if this is relevant for SMMU).
> For example, for IPMMU-VMSA we have a check that device ID (uTLB) is less than max uTLB number.

Sorry I misunderstood your previous comments. Yes SMMUv3 driver is performing the sanity check for Stream Id before configuring the hardware in function arm_smmu_sid_in_range(). 
> 
>>  
>> 
>>>> +
>>>> +static int arm_smmu_iommu_xen_domain_init(struct domain *d)
>>>> +{
>>>> +	struct arm_smmu_xen_domain *xen_domain;
>>>> +
>>>> +	xen_domain = xzalloc(struct arm_smmu_xen_domain);
>>>> +	if (!xen_domain)
>>>> +		return -ENOMEM;
>>>> +
>>>> +	spin_lock_init(&xen_domain->lock);
>>>> +	INIT_LIST_HEAD(&xen_domain->contexts);
>>>> +
>>>> +	dom_iommu(d)->arch.priv = xen_domain;
>>>> +	return 0;
>>>> +
>>>> +}
>>>> +
>>>> +static void __hwdom_init arm_smmu_iommu_hwdom_init(struct domain *d)
>>>> +{
>>> Both SMMUv2 and IPMMU perform some actions here. Any reason we don't need to do the same here?
>>> 
>>>     /* Set to false options not supported on ARM. */
>>>     if ( iommu_hwdom_inclusive )
>>>         printk(XENLOG_WARNING
>>>         "map-inclusive dom0-iommu option is not supported on ARM\n");
>>>     iommu_hwdom_inclusive = false;
>>>     if ( iommu_hwdom_reserved == 1 )
>>>         printk(XENLOG_WARNING
>>>         "map-reserved dom0-iommu option is not supported on ARM\n");
>>>     iommu_hwdom_reserved = 0;
>>> 
>>>     arch_iommu_hwdom_init(d);
>> I will add the above code for SMMUv3 also.
> 
> Great.
> 
> I was thinking about it, this is the third IOMMU driver on Arm which has to disable the _same_ unsupported options, probably this code wants to be folded in arch_iommu_hwdom_init() to avoid duplication?

Yes I also agree with you to avoid duplication we can move the come code to the function arch_iommu_hwdom_init().
I will submit the patch(not part of this series)  if everyone is ok to move the common code to arch_iommu_hwdom_init().

Regards,
Rahul
 
> 
> -- 
> Regards,
> 
> Oleksandr Tyshchenko
> 



  reply	other threads:[~2021-01-15 12:38 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 14:46 [PATCH v4 00/11] xen/arm: Add support for SMMUv3 driver Rahul Singh
2021-01-08 14:46 ` [PATCH v4 01/11] xen/arm: smmuv3: Import the SMMUv3 driver from Linux Rahul Singh
2021-01-08 23:42   ` Stefano Stabellini
2021-01-15 11:55   ` Julien Grall
2021-01-08 14:46 ` [PATCH v4 02/11] xen/arm: Revert atomic operation related command-queue insertion patch Rahul Singh
2021-01-08 23:43   ` Stefano Stabellini
2021-01-08 14:46 ` [PATCH v4 03/11] xen/arm: smmuv3: Revert patch related to XArray Rahul Singh
2021-01-08 23:43   ` Stefano Stabellini
2021-01-08 14:46 ` [PATCH v4 04/11] xen/arm: smmuv3: Remove support for Stage-1 translation on SMMUv3 Rahul Singh
2021-01-08 23:52   ` Stefano Stabellini
2021-01-08 14:46 ` [PATCH v4 05/11] xen/arm: smmuv3: Remove Linux specific code that is not usable in XEN Rahul Singh
2021-01-08 23:56   ` Stefano Stabellini
2021-01-12 11:38   ` Bertrand Marquis
2021-01-08 14:46 ` [PATCH v4 06/11] xen/device-tree: Add dt_property_match_string helper Rahul Singh
2021-01-08 23:57   ` Stefano Stabellini
2021-01-12 11:38   ` Bertrand Marquis
2021-01-08 14:46 ` [PATCH v4 07/11] xen/arm: bitops: Implement a ffsll function Rahul Singh
2021-01-09  1:44   ` Stefano Stabellini
2021-01-12 11:35   ` Bertrand Marquis
2021-01-15 12:16   ` Julien Grall
2021-01-18 15:32     ` Rahul Singh
2021-01-08 14:46 ` [PATCH v4 08/11] xen/compiler: import 'fallthrough' keyword from linux Rahul Singh
2021-01-09  1:44   ` Stefano Stabellini
2021-01-12 11:36   ` Bertrand Marquis
2021-01-12 11:41   ` Jan Beulich
2021-01-12 23:30     ` Stefano Stabellini
2021-01-12 23:40       ` Stefano Stabellini
2021-01-14  9:04       ` Jan Beulich
2021-01-14 23:47         ` Stefano Stabellini
2021-01-15 12:14           ` Rahul Singh
2021-01-15 13:09             ` Jan Beulich
2021-01-15 17:56               ` Stefano Stabellini
2021-01-08 14:46 ` [PATCH v4 09/11] xen/arm: smmuv3: Use fallthrough pseudo-keyword Rahul Singh
2021-01-09  1:44   ` Stefano Stabellini
2021-01-09 18:57     ` Rahul Singh
2021-01-12 11:34   ` Bertrand Marquis
2021-01-15 12:18   ` Julien Grall
2021-01-18 15:33     ` Rahul Singh
2021-01-08 14:46 ` [PATCH v4 10/11] xen/arm: smmuv3: Replace linux functions with xen functions Rahul Singh
2021-01-09  1:44   ` Stefano Stabellini
2021-01-12 11:35   ` Bertrand Marquis
2021-01-08 14:46 ` [PATCH v4 11/11] xen/arm: smmuv3: Add support for SMMUv3 driver Rahul Singh
2021-01-09  1:45   ` Stefano Stabellini
2021-01-11 16:09   ` Oleksandr
2021-01-11 16:39     ` Oleksandr
2021-01-18 15:33       ` Rahul Singh
2021-01-18 16:20         ` Oleksandr
2021-01-18 16:57           ` Rahul Singh
2021-01-19 14:43             ` Oleksandr
2021-01-19 14:53               ` Rahul Singh
2021-01-12  9:41     ` Rahul Singh
2021-01-12 20:59       ` Oleksandr
2021-01-15 12:38         ` Rahul Singh [this message]
2021-01-15 12:40           ` Julien Grall
2021-01-15 12:37   ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2AAC732A-5407-4B6B-ABFC-BA3914FB1DA1@arm.com \
    --to=rahul.singh@arm.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=olekstysh@gmail.com \
    --cc=paul@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.