From: Andrii Anisov <andrii.anisov@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
Julien Grall <julien.grall@arm.com>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 1/2] iommu/arm: Misc fixes for arch specific part
Date: Mon, 21 Jan 2019 19:04:06 +0200 [thread overview]
Message-ID: <1548090247-20078-2-git-send-email-andrii.anisov@gmail.com> (raw)
In-Reply-To: <1548090247-20078-1-git-send-email-andrii.anisov@gmail.com>
From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
1. Add missing return in case if IOMMU ops have been already set.
2. Add check for shared IOMMU before returning an error.
Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
---
xen/drivers/passthrough/arm/iommu.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/xen/drivers/passthrough/arm/iommu.c b/xen/drivers/passthrough/arm/iommu.c
index 325997b..cbf9b82 100644
--- a/xen/drivers/passthrough/arm/iommu.c
+++ b/xen/drivers/passthrough/arm/iommu.c
@@ -32,7 +32,10 @@ void __init iommu_set_ops(const struct iommu_ops *ops)
BUG_ON(ops == NULL);
if ( iommu_ops && iommu_ops != ops )
+ {
printk("WARNING: Cannot set IOMMU ops, already set to a different value\n");
+ return;
+ }
iommu_ops = ops;
}
@@ -70,8 +73,8 @@ void arch_iommu_domain_destroy(struct domain *d)
int arch_iommu_populate_page_table(struct domain *d)
{
- /* The IOMMU shares the p2m with the CPU */
- return -ENOSYS;
+ /* Return an error if the IOMMU shares the p2m with the CPU */
+ return iommu_use_hap_pt(d) ? -ENOSYS : 0;
}
void __hwdom_init arch_iommu_hwdom_init(struct domain *d)
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-01-21 17:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-21 17:04 [PATCH 0/2] Dangling fixes for ARM iommu Andrii Anisov
2019-01-21 17:04 ` Andrii Anisov [this message]
2019-01-21 17:04 ` [PATCH 2/2] xen/arm: domain_build: Don't expose IOMMU specific properties to the guest Andrii Anisov
2019-10-01 15:04 ` [Xen-devel] " Julien Grall
2019-10-01 15:25 ` Oleksandr
2019-10-01 15:36 ` Julien Grall
2019-10-01 16:07 ` Oleksandr
2019-10-01 19:07 ` Julien Grall
2019-10-03 12:18 ` Oleksandr
2019-10-07 21:02 ` Julien Grall
2019-10-08 15:34 ` Oleksandr
2019-01-21 17:29 ` [PATCH 0/2] Dangling fixes for ARM iommu Julien Grall
2019-01-22 13:48 ` Andrii Anisov
2019-01-22 14:31 ` Julien Grall
2019-01-23 17:53 ` Andrii Anisov
2019-01-23 18:14 ` Julien Grall
2019-01-23 18:29 ` Andrii Anisov
2019-01-23 18:34 ` 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=1548090247-20078-2-git-send-email-andrii.anisov@gmail.com \
--to=andrii.anisov@gmail.com \
--cc=julien.grall@arm.com \
--cc=oleksandr_tyshchenko@epam.com \
--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).