xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Sameer Goel <sameer.goel@linaro.org>
To: Manish Jaggi <mjaggi@caviumnetworks.com>,
	xen-devel@lists.xenproject.org, julien.grall@arm.com
Cc: sstabellini@kernel.org, shankerd@codeaurora.org, roger.pau@citrix.com
Subject: Re: [v2 4/6] xen/iommu: smmu-v3: Add Xen specific code to enable the ported driver
Date: Fri, 1 Jun 2018 12:58:15 -0600	[thread overview]
Message-ID: <21f65c87-aac5-2079-c511-c165f09fec2c@linaro.org> (raw)
In-Reply-To: <8f4b349b-6be4-919a-9de3-4faa07892f22@caviumnetworks.com>



On 5/31/2018 11:16 PM, Manish Jaggi wrote:
>
>
> On 05/31/2018 09:27 PM, Sameer Goel wrote:
>>
>> On 5/30/2018 10:13 PM, Manish Jaggi wrote:
>>>
>>> On 05/31/2018 04:31 AM, Sameer Goel wrote:
>>>>>>>> +
>>>>>>>> +static int arm_smmu_iommu_domain_init(struct domain *d)
>>>>>>> Where is iommu_domain initialized?
>>>>>>> The function does not use a iommu_domain * variable
>>>> Please check iommu.c 2 levels up.
>>> In this function do you see iommu_domain getting allocated or initialized?
>>> As per the name of function arm_smmu iommu_domain_init.
>>> Where is init of iommu_domain in this function?
>> Well without the xen_domain the iommu_domain is not initialized. It is just the default value. This generic iommu code makes an .init call to our code for whatever initialization is needed. So the name here seemed absolutely fine to me.
>>
>> Initialization does not always refer to allocation. In this case this is driver specific initialization. Since, the iommu code is making an init call to the smmu code hence the name arm_smmu_iommu_domain_init. So, again I agree with your comments on the domain variable names and I'm making these changes as they would make the code cleaner. This function name change probably will not do much but the move along the discussion, let me know what you were thinking.
> Sameer, few points
> a. all the functions are prefixed with arm_smmu_ , so what the function is doing can be understood by the rest part of the name
> In this case it is iommu_domain_init.
>
> b. By the name it seems to suggest that you are  doing some kind of init for iommu_domain
>
> c. But in this complete function, iommu_domain pointer is never used.
>
> If I take your point, the appropriate name of the function should be arm_smmu_xen_domain_init().
Its not the iommu domain defined within the current driver.  I'll change the name to arm_smmu_xen_iommu_init().

arm_smmu for just keeping the prefixes as needed. Sounds good?

Thanks,
Sameer
>
> -Manish
>>> +static int arm_smmu_iommu_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;
>>> +}
>>> +
>>>
>>>
>>>
>>>> Thanks,
>>>> Sameer
>>>>> _______________________________________________
>>>>> Xen-devel mailing list
>>>>> Xen-devel@lists.xenproject.org
>>>>> https://lists.xenproject.org/mailman/listinfo/xen-devel
>>>
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xenproject.org
>>> https://lists.xenproject.org/mailman/listinfo/xen-devel
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-devel


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

  reply	other threads:[~2018-06-01 18:58 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24  0:46 [v2 0/6] SMMUv3 driver Sameer Goel
2018-05-24  0:46 ` [v2 1/6] Port WARN_ON_ONCE() from Linux Sameer Goel
2018-05-24  7:53   ` Jan Beulich
2018-05-24 20:23     ` Sameer Goel
2018-05-25  7:07       ` Jan Beulich
2018-06-07  1:21         ` Sameer Goel
2018-05-24  0:46 ` [v2 2/6] passthrough/arm: Modify SMMU driver to use generic device definition Sameer Goel
2018-05-24  0:46 ` [v2 3/6] Add verbatim copy of arm-smmu-v3.c from Linux Sameer Goel
2018-05-24  0:46 ` [v2 4/6] xen/iommu: smmu-v3: Add Xen specific code to enable the ported driver Sameer Goel
2018-05-24  4:48   ` Manish Jaggi
2018-05-24 20:18     ` Sameer Goel
2018-05-24 20:29     ` Sameer Goel
2018-05-25  4:41       ` Manish Jaggi
2018-05-25  8:45         ` Julien Grall
2018-05-30 19:46         ` Sameer Goel
2018-05-31  4:10           ` Manish Jaggi
2018-05-31 16:06             ` Goel, Sameer
2018-05-30 23:01         ` Sameer Goel
2018-05-31  4:13           ` Manish Jaggi
2018-05-31 15:57             ` Sameer Goel
2018-06-01  5:16               ` Manish Jaggi
2018-06-01 18:58                 ` Sameer Goel [this message]
2018-06-02 21:26                   ` Manish Jaggi
2018-05-24  7:57   ` Jan Beulich
2018-05-24 20:26     ` Sameer Goel
2018-05-25  7:10       ` Jan Beulich
2018-05-30 19:30         ` Sameer Goel
2018-05-24  0:46 ` [v2 5/6] drivers/passthrough/arm: Refactor code for arm smmu drivers Sameer Goel
2018-05-24  7:58   ` Jan Beulich
2018-05-24 20:30     ` Sameer Goel
2018-05-24  0:46 ` [v2 6/6] xen/smmu: Add a new config define for legacy SMMU Sameer Goel
2018-05-24  7:59   ` Jan Beulich
2018-05-24  8:52     ` 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=21f65c87-aac5-2079-c511-c165f09fec2c@linaro.org \
    --to=sameer.goel@linaro.org \
    --cc=julien.grall@arm.com \
    --cc=mjaggi@caviumnetworks.com \
    --cc=roger.pau@citrix.com \
    --cc=shankerd@codeaurora.org \
    --cc=sstabellini@kernel.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 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).