From: Manish Jaggi <mjaggi@caviumnetworks.com>
To: Xen Devel <xen-devel@lists.xen.org>,
"Prasun.kapoor@cavium.com" <Prasun.kapoor@cavium.com>,
"Kumar, Vijaya" <Vijaya.Kumar@caviumnetworks.com>,
Julien Grall <julien.grall@linaro.org>,
Ian Campbell <Ian.Campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH v1 2/3] xen/arm: smmu: Renaming arm_smmu_xen_domain with, domain_iommu_info
Date: Fri, 27 Mar 2015 12:52:58 +0530 [thread overview]
Message-ID: <55150552.8060402@caviumnetworks.com> (raw)
The name arm_smmu_xen_domain was mapped to domain_hvm_iommu(d)->arch.priv.
Also there are a lot of datastructre in smmu.c with name ending in domain
it is not intuitive and code is hard to understand.
domain_iommu_info is easy to understand that it refers to
domain_hvm_iommu(d)->arch.priv.
The instances of arm_smmu_xen_domain were name smmu_domain or xen_domain
in different functions which is also cleaned up in this patch.
Signed-off-by: Manish Jaggi <manish.jaggi@caviumnetworks.com>
---
xen/drivers/passthrough/arm/smmu.c | 46 +++++++++++++++++++-------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index ab4f7a4..fe0549e 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -230,7 +230,7 @@ struct iommu_domain
};
/* Xen: Describes informations required for a Xen domain */
-struct arm_smmu_xen_domain {
+struct domain_iommu_info {
spinlock_t lock;
/* List of context (i.e iommu_domain) associated to this domain */
struct list_head contexts;
@@ -2540,11 +2540,11 @@ static u32 platform_features = ARM_SMMU_FEAT_COHERENT_WALK;
static void arm_smmu_iotlb_flush_all(struct domain *d)
{
- struct arm_smmu_xen_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+ struct domain_iommu_info *domain_iommu_info = domain_hvm_iommu(d)->arch.priv;
struct iommu_domain *cfg;
- spin_lock(&smmu_domain->lock);
- list_for_each_entry(cfg, &smmu_domain->contexts, list) {
+ spin_lock(&domain_iommu_info->lock);
+ list_for_each_entry(cfg, &domain_iommu_info->contexts, list) {
/*
* Only invalidate the context when SMMU is present.
* This is because the context initialization is delayed
@@ -2554,7 +2554,7 @@ static void arm_smmu_iotlb_flush_all(struct domain *d)
continue;
arm_smmu_tlb_inv_context(cfg->priv);
}
- spin_unlock(&smmu_domain->lock);
+ spin_unlock(&domain_iommu_info->lock);
}
static void arm_smmu_iotlb_flush(struct domain *d, unsigned long gfn,
@@ -2568,10 +2568,10 @@ static int arm_smmu_assign_dev(struct domain *d, u8 devfn,
struct device *dev)
{
struct iommu_domain *domain;
- struct arm_smmu_xen_domain *xen_domain;
+ struct domain_iommu_info *domain_iommu_info;
int ret;
- xen_domain = domain_hvm_iommu(d)->arch.priv;
+ domain_iommu_info = domain_hvm_iommu(d)->arch.priv;
if (!dev->archdata.iommu) {
dev->archdata.iommu = xzalloc(struct device_iommu_info);
@@ -2604,10 +2604,10 @@ static int arm_smmu_assign_dev(struct domain *d, u8 devfn,
if (ret)
goto err_attach_dev;
- spin_lock(&xen_domain->lock);
+ spin_lock(&domain_iommu_info->lock);
/* Chain the new context to the domain */
- list_add(&domain->list, &xen_domain->contexts);
- spin_unlock(&xen_domain->lock);
+ list_add(&domain->list, &domain_iommu_info->contexts);
+ spin_unlock(&domain_iommu_info->lock);
return 0;
@@ -2622,9 +2622,9 @@ err_dom_init:
static int arm_smmu_deassign_dev(struct domain *d, struct device *dev)
{
struct iommu_domain *domain = dev_iommu_domain(dev);
- struct arm_smmu_xen_domain *xen_domain;
+ struct domain_iommu_info *domain_iommu_info;
- xen_domain = domain_hvm_iommu(d)->arch.priv;
+ domain_iommu_info = domain_hvm_iommu(d)->arch.priv;
if (!domain || domain->priv->cfg.domain != d) {
dev_err(dev, " not attached to domain %d\n", d->domain_id);
@@ -2633,9 +2633,9 @@ static int arm_smmu_deassign_dev(struct domain *d, struct device *dev)
arm_smmu_detach_dev(domain, dev);
- spin_lock(&xen_domain->lock);
+ spin_lock(&domain_iommu_info->lock);
list_del(&domain->list);
- spin_unlock(&xen_domain->lock);
+ spin_unlock(&domain_iommu_info->lock);
arm_smmu_domain_destroy(domain);
xfree(domain);
@@ -2664,16 +2664,16 @@ static int arm_smmu_reassign_dev(struct domain *s, struct domain *t,
static int arm_smmu_iommu_domain_init(struct domain *d)
{
- struct arm_smmu_xen_domain *xen_domain;
+ struct domain_iommu_info *domain_iommu_info;
- xen_domain = xzalloc(struct arm_smmu_xen_domain);
- if ( !xen_domain )
+ domain_iommu_info = xzalloc(struct domain_iommu_info);
+ if ( !domain_iommu_info )
return -ENOMEM;
- spin_lock_init(&xen_domain->lock);
- INIT_LIST_HEAD(&xen_domain->contexts);
+ spin_lock_init(&domain_iommu_info->lock);
+ INIT_LIST_HEAD(&domain_iommu_info->contexts);
- domain_hvm_iommu(d)->arch.priv = xen_domain;
+ domain_hvm_iommu(d)->arch.priv = domain_iommu_info;
/* Coherent walk can be enabled only when all SMMUs support it. */
if (platform_features & ARM_SMMU_FEAT_COHERENT_WALK)
@@ -2688,10 +2688,10 @@ static void __hwdom_init arm_smmu_iommu_hwdom_init(struct domain *d)
static void arm_smmu_iommu_domain_teardown(struct domain *d)
{
- struct arm_smmu_xen_domain *xen_domain = domain_hvm_iommu(d)->arch.priv;
+ struct domain_iommu_info *domain_iommu_info = domain_hvm_iommu(d)->arch.priv;
- ASSERT(list_empty(&xen_domain->contexts));
- xfree(xen_domain);
+ ASSERT(list_empty(&domain_iommu_info->contexts));
+ xfree(domain_iommu_info);
}
static int arm_smmu_map_page(struct domain *d, unsigned long gfn,
--
1.9.1
next reply other threads:[~2015-03-27 7:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 7:22 Manish Jaggi [this message]
2015-03-27 13:02 ` [PATCH v1 2/3] xen/arm: smmu: Renaming arm_smmu_xen_domain with, domain_iommu_info Julien Grall
2015-03-27 13:24 ` Jaggi, Manish
2015-03-27 13:36 ` Julien Grall
2015-03-27 17:58 ` Jaggi, Manish
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=55150552.8060402@caviumnetworks.com \
--to=mjaggi@caviumnetworks.com \
--cc=Ian.Campbell@citrix.com \
--cc=Prasun.kapoor@cavium.com \
--cc=Vijaya.Kumar@caviumnetworks.com \
--cc=julien.grall@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.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.