All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Manish <mjaggi@caviumnetworks.com>, xen-devel@lists.xenproject.org
Cc: tim@xen.org, manish.jaggi@caviumnetworks.com,
	will.daecon@arm.com, ian.campbell@citrix.com,
	stefano.stabellini@citrix.com
Subject: Re: [PATCH for 4.6 13/13] xen/iommu: smmu: Add Xen specific code to be able to use the driver
Date: Wed, 18 Feb 2015 11:47:46 +0000	[thread overview]
Message-ID: <54E47BE2.5030908@linaro.org> (raw)
In-Reply-To: <54E3E49D.7000109@caviumnetworks.com>

Hi Manish,

On 18/02/2015 01:02, Manish wrote:
>
> On 17/12/14 1:38 am, Julien Grall wrote:
>> The main goal is to modify as little the Linux code to be able to port
>> easily new feature added in Linux repo for the driver.
>>
>> To achieve that we:
>>      - Add helpers to Linux function not implemented on Xen
>>      - Add callbacks used by Xen to do our own stuff and call Linux ones
>>      - Only modify when required the code which comes from Linux. If so a
>>      comment has been added with /* Xen: ... */ explaining why it's
>>      necessary.
>>
>> The support for PCI has been commented because it's not yet supported by
>> Xen ARM and therefore won't compile.
>>
>> Signed-off-by: Julien Grall <julien.grall@linaro.org>
>> ---
>>   xen/drivers/passthrough/arm/Makefile |   1 +
>>   xen/drivers/passthrough/arm/smmu.c   | 668
>> +++++++++++++++++++++++++++++++----
>>   2 files changed, 602 insertions(+), 67 deletions(-)
>>
>> diff --git a/xen/drivers/passthrough/arm/Makefile
>> b/xen/drivers/passthrough/arm/Makefile
>> index 0484b79..f4cd26e 100644
>> --- a/xen/drivers/passthrough/arm/Makefile
>> +++ b/xen/drivers/passthrough/arm/Makefile
>> @@ -1 +1,2 @@
>>   obj-y += iommu.o
>> +obj-y += smmu.o
>> diff --git a/xen/drivers/passthrough/arm/smmu.c
>> b/xen/drivers/passthrough/arm/smmu.c
>> index 8a6514f..3cf1773 100644
>> --- a/xen/drivers/passthrough/arm/smmu.c
>> +++ b/xen/drivers/passthrough/arm/smmu.c
>> @@ -18,6 +18,13 @@
>>    *
>>    * Author: Will Deacon <will.deacon@arm.com>
>>    *
>> + * Based on Linux drivers/iommu/arm-smmu.c
>> + *    => commit e6b5be2be4e30037eb551e0ed09dd97bd00d85d3
>> + *
>> + * Xen modification:
>> + * Julien Grall <julien.grall@linaro.org>
>> + * Copyright (C) 2014 Linaro Limited.
>> + *
>>    * This driver currently supports:
>>    *    - SMMUv1 and v2 implementations
>>    *    - Stream-matching and stream-indexing
>> @@ -28,26 +35,154 @@
>>    *    - Context fault reporting
>>    */
>
> <<<snip >>>
>
>> +/* Xen: Dummy iommu_domain */
>> +struct iommu_domain
>> +{
>> +    struct arm_smmu_domain        *priv;
>> +
>> +    /* Used to link domain contexts for a same domain */
>> +    struct list_head        list;
>> +};
>> +
>> +/* Xen: Describes informations required for a Xen domain */
>> +struct arm_smmu_xen_domain {
>> +    spinlock_t            lock;
>> +    /* List of context (i.e iommu_domain) associated to this domain */
>> +    struct list_head        contexts;
>> +};
>> +
>> +/* Xen: Information about each device stored in dev->archdata.iommu */
>> +struct arm_smmu_xen_device {
>> +    struct iommu_domain *domain;
>> +    struct iommu_group *group;
>> +};
>> +
>> +#define dev_archdata(dev) ((struct arm_smmu_xen_device
>> *)dev->archdata.iommu)
>> +#define dev_iommu_domain(dev) (dev_archdata(dev)->domain)
>> +#define dev_iommu_group(dev) (dev_archdata(dev)->group)
>> +
>> +/* Xen: Dummy iommu_group */
>> +struct iommu_group
>> +{
>> +    struct arm_smmu_master_cfg *cfg;
>> +
>> +    atomic_t ref;
>> +};
>> +
> The naming needs to be revisited in this patch. Original driver from
> Will has arm_smmu_domain. This patch adds  iommu_domain,
> arm_smmu_xen_domain, iommu_group.

I can't change the naming of the structure. iommu_domain and iommu_group 
are from Linux. As we don't have it on Xen, I have to add dummy 
structure for it.

> Could you please add some description about the relation and hierarchy
> of these data structures.

Good point, I will try to add more comment and explain why we have to do it.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-02-18 11:47 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16 20:08 [PATCH for 4.6 00/13] xen/arm: Resync the SMMU driver with the Linux one Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 01/13] xen/arm: gic-v2: Change the device name in DT_DEVICE_START Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 02/13] xen/arm: vgic: Drop unecessary include asm/device.h Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 03/13] xen: Introduce ACCESS_ONCE macro Julien Grall
2014-12-17 10:05   ` Jan Beulich
2014-12-17 12:54     ` Julien Grall
2014-12-17 17:10       ` Jan Beulich
2014-12-17 17:52         ` Andrew Cooper
2014-12-18 15:58           ` Julien Grall
2014-12-18 15:58           ` Julien Grall
2015-01-15 13:39           ` Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 04/13] xen/dt: Extend dt_device_match to possibly store data Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 05/13] xen/arm: device: Rename device_type into device_match Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 06/13] xen/iommu: arm: Remove temporary the SMMU driver Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 07/13] xen: Introduce a generic way to describe device Julien Grall
2014-12-17 10:16   ` Jan Beulich
2014-12-17 10:30     ` Julien Grall
2014-12-17 10:46       ` Jan Beulich
2014-12-17 13:03         ` Julien Grall
2014-12-17 17:17           ` Jan Beulich
2014-12-18 15:56             ` Julien Grall
2014-12-18 16:02               ` Jan Beulich
2014-12-18 16:07                 ` Julien Grall
2014-12-18  1:12   ` Zhang, Yang Z
2014-12-18  8:52     ` Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 08/13] xen/iommu: Consolidate device assignment ops into a single set Julien Grall
2014-12-17 10:20   ` Jan Beulich
2014-12-16 20:08 ` [PATCH for 4.6 09/13] xen/arm: Describe device supported by a driver with dt_match_node Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 10/13] xen/iommu: arm: Import the SMMU driver from Linux Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 11/13] xen/iommu: smmu: Check for duplicate stream IDs when registering master devices Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 12/13] xen/iommu: smmu: Introduce automatic stream-id-masking Julien Grall
2014-12-16 20:08 ` [PATCH for 4.6 13/13] xen/iommu: smmu: Add Xen specific code to be able to use the driver Julien Grall
2015-02-18  1:02   ` Manish
2015-02-18 11:47     ` Julien Grall [this message]
2015-02-18 11:54       ` Julien Grall
2015-02-18 17:30         ` Jaggi, Manish
2015-02-18 18:22           ` Julien Grall
2015-02-19  2:55             ` Manish
2015-02-19  6:01               ` Julien Grall
2015-02-19  7:16                 ` Manish
2015-02-19 10:34               ` Andrew Cooper

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=54E47BE2.5030908@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=manish.jaggi@caviumnetworks.com \
    --cc=mjaggi@caviumnetworks.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=will.daecon@arm.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 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.