xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Oleksandr <olekstysh@gmail.com>, xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	sstabellini@kernel.org, volodymyr_babchuk@epam.com
Subject: Re: [Xen-devel] [PATCH for-4.13 v2] xen/arm: domain_build: Don't expose IOMMU specific properties to hwdom
Date: Thu, 10 Oct 2019 16:32:55 +0100	[thread overview]
Message-ID: <71e64847-2ce7-0954-4ab9-72f678d5dc93@arm.com> (raw)
In-Reply-To: <94356055-721d-91bf-ac16-462da510007f@gmail.com>

Hi,

On 10/10/19 4:27 PM, Oleksandr wrote:
> 
> On 10.10.19 18:18, Julien Grall wrote:
>> Hi,
> 
> Hi Julien
> 
> 
>>
>> On 10/8/19 4:25 PM, Oleksandr Tyshchenko wrote:
>>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>>
>>> We don't passthrough IOMMU device to hwdom even if it is not used by 
>>> Xen.
>>> Therefore exposing the properties that describe relationship between
>>> master devices and IOMMUs does not make any sense.
>>>
>>> According to the:
>>> 1. Documentation/devicetree/bindings/iommu/iommu.txt
>>> 2. Documentation/devicetree/bindings/pci/pci-iommu.txt
>>
>> It is not entirely clear that documentation is from Linux.
> 
> Will clarify.
> 
> 
>>
>>>
>>> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>>
>>> ---
>>> Changes V1 [1] -> V2:
>>>     - Only skip IOMMU specific properties of the master device if we
>>>       skip the corresponding IOMMU device
>>>     - Use "hwdom" over "Dom0"
>>>
>>> [1] 
>>> https://lists.xenproject.org/archives/html/xen-devel/2019-10/msg00104.html 
>>>
>>> ---
>>>   xen/arch/arm/domain_build.c | 29 +++++++++++++++++++++++++++++
>>>   1 file changed, 29 insertions(+)
>>>
>>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>>> index 6d6dd52..a7321b8 100644
>>> --- a/xen/arch/arm/domain_build.c
>>> +++ b/xen/arch/arm/domain_build.c
>>> @@ -480,10 +480,26 @@ static int __init write_properties(struct 
>>> domain *d, struct kernel_info *kinfo,
>>>       const struct dt_property *prop, *status = NULL;
>>>       int res = 0;
>>>       int had_dom0_bootargs = 0;
>>> +    struct dt_device_node *iommu_node;
>>>         if ( kinfo->cmdline && kinfo->cmdline[0] )
>>>           bootargs = &kinfo->cmdline[0];
>>>   +    /*
>>> +     * If we skip the IOMMU device when creating DT for hwdom (even if
>>> +     * the IOMMU device is not used by Xen), we should also skip the 
>>> IOMMU
>>> +     * specific properties of the master device behind it in order 
>>> to avoid
>>> +     * exposing an half complete IOMMU bindings to hwdom.
>>> +     * Use "iommu_node" as an indicator of the master device which 
>>> properties
>>> +     * should be skipped.
>>> +     */
>>> +    iommu_node = dt_parse_phandle(node, "iommus", 0);
>>
>> The code is slightly confusing to read. I don't think we should care 
>> of invalid DT here, so let's only consider valid one.
> 
> Do you mean "the comment" is confusing to read?

The code is confusing because "iommus" should always point to a IOMMU 
node, but then you check whether this is an IOMMU. So it is not clear if 
this is done for sanity check (or for a different reason).

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-10-10 15:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08 15:25 [Xen-devel] [PATCH for-4.13 v2] xen/arm: domain_build: Don't expose IOMMU specific properties to hwdom Oleksandr Tyshchenko
2019-10-10 15:18 ` Julien Grall
2019-10-10 15:27   ` Oleksandr
2019-10-10 15:32     ` Julien Grall [this message]
2019-10-10 15:42       ` Oleksandr

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=71e64847-2ce7-0954-4ab9-72f678d5dc93@arm.com \
    --to=julien.grall@arm.com \
    --cc=jgross@suse.com \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=olekstysh@gmail.com \
    --cc=sstabellini@kernel.org \
    --cc=volodymyr_babchuk@epam.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).