Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1314771 > unrolled thread

[PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is selected

Started byAlexey Kardashevskiy <aik@ozlabs.ru>
First post2016-01-22 07:40 +0100
Last post2016-01-22 18:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is selected Alexey Kardashevskiy <aik@ozlabs.ru> - 2016-01-22 07:40 +0100
    Re: [PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is  selected Alexey Kardashevskiy <aik@ozlabs.ru> - 2016-01-22 07:50 +0100
    Re: [PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is  selected Alex Williamson <alex.williamson@redhat.com> - 2016-01-22 18:30 +0100

#1314771 — [PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is selected

FromAlexey Kardashevskiy <aik@ozlabs.ru>
Date2016-01-22 07:40 +0100
Subject[PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is selected
Message-ID<qTDy2-9O-1@gated-at.bofh.it>
Recent change 03a76b60 "vfio: Include No-IOMMU mode" disabled VFIO
on systems which do not implement iommu_ops for the PCI bus even though
there is an VFIO IOMMU driver for it such as SPAPR TCE driver for
PPC64/powernv platform.

This moves iommu_present() call under #ifdef CONFIG_VFIO_NOIOMMU as
it is done in the rest of the file to re-enable VFIO on powernv.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 drivers/vfio/vfio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 82f25cc..3f8060e 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -343,7 +343,6 @@ static struct vfio_group *vfio_create_group(struct iommu_group *iommu_group,
 	atomic_set(&group->opened, 0);
 	group->iommu_group = iommu_group;
 	group->noiommu = !iommu_present;
-
 	group->nb.notifier_call = vfio_iommu_group_notifier;
 
 	/*
@@ -767,7 +766,11 @@ int vfio_add_group_dev(struct device *dev,
 
 	group = vfio_group_get_from_iommu(iommu_group);
 	if (!group) {
+#ifdef CONFIG_VFIO_NOIOMMU
 		group = vfio_create_group(iommu_group, iommu_present(dev->bus));
+#else
+		group = vfio_create_group(iommu_group, true);
+#endif
 		if (IS_ERR(group)) {
 			iommu_group_put(iommu_group);
 			return PTR_ERR(group);
-- 
2.5.0.rc3

[toc] | [next] | [standalone]


#1314777 — Re: [PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is selected

FromAlexey Kardashevskiy <aik@ozlabs.ru>
Date2016-01-22 07:50 +0100
SubjectRe: [PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is selected
Message-ID<qTDHH-e4-13@gated-at.bofh.it>
In reply to#1314771
On 01/22/2016 05:34 PM, Alexey Kardashevskiy wrote:
> Recent change 03a76b60 "vfio: Include No-IOMMU mode" disabled VFIO
> on systems which do not implement iommu_ops for the PCI bus even though
> there is an VFIO IOMMU driver for it such as SPAPR TCE driver for
> PPC64/powernv platform.
>
> This moves iommu_present() call under #ifdef CONFIG_VFIO_NOIOMMU as
> it is done in the rest of the file to re-enable VFIO on powernv.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>   drivers/vfio/vfio.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
> index 82f25cc..3f8060e 100644
> --- a/drivers/vfio/vfio.c
> +++ b/drivers/vfio/vfio.c
> @@ -343,7 +343,6 @@ static struct vfio_group *vfio_create_group(struct iommu_group *iommu_group,
>   	atomic_set(&group->opened, 0);
>   	group->iommu_group = iommu_group;
>   	group->noiommu = !iommu_present;
> -


Agrh. Unrelated change, repost?


>   	group->nb.notifier_call = vfio_iommu_group_notifier;
>
>   	/*
> @@ -767,7 +766,11 @@ int vfio_add_group_dev(struct device *dev,
>
>   	group = vfio_group_get_from_iommu(iommu_group);
>   	if (!group) {
> +#ifdef CONFIG_VFIO_NOIOMMU
>   		group = vfio_create_group(iommu_group, iommu_present(dev->bus));
> +#else
> +		group = vfio_create_group(iommu_group, true);
> +#endif
>   		if (IS_ERR(group)) {
>   			iommu_group_put(iommu_group);
>   			return PTR_ERR(group);
>


-- 
Alexey

[toc] | [prev] | [next] | [standalone]


#1315158 — Re: [PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is selected

FromAlex Williamson <alex.williamson@redhat.com>
Date2016-01-22 18:30 +0100
SubjectRe: [PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is selected
Message-ID<qTNH5-7bM-21@gated-at.bofh.it>
In reply to#1314771
On Fri, 2016-01-22 at 17:34 +1100, Alexey Kardashevskiy wrote:
> Recent change 03a76b60 "vfio: Include No-IOMMU mode" disabled VFIO
> on systems which do not implement iommu_ops for the PCI bus even
> though
> there is an VFIO IOMMU driver for it such as SPAPR TCE driver for
> PPC64/powernv platform.
> 
> This moves iommu_present() call under #ifdef CONFIG_VFIO_NOIOMMU as
> it is done in the rest of the file to re-enable VFIO on powernv.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  drivers/vfio/vfio.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
> index 82f25cc..3f8060e 100644
> --- a/drivers/vfio/vfio.c
> +++ b/drivers/vfio/vfio.c
> @@ -343,7 +343,6 @@ static struct vfio_group
> *vfio_create_group(struct iommu_group *iommu_group,
>  	atomic_set(&group->opened, 0);
>  	group->iommu_group = iommu_group;
>  	group->noiommu = !iommu_present;
> -
>  	group->nb.notifier_call = vfio_iommu_group_notifier;
>  
>  	/*
> @@ -767,7 +766,11 @@ int vfio_add_group_dev(struct device *dev,
>  
>  	group = vfio_group_get_from_iommu(iommu_group);
>  	if (!group) {
> +#ifdef CONFIG_VFIO_NOIOMMU
>  		group = vfio_create_group(iommu_group,
> iommu_present(dev->bus));
> +#else
> +		group = vfio_create_group(iommu_group, true);
> +#endif
>  		if (IS_ERR(group)) {
>  			iommu_group_put(iommu_group);
>  			return PTR_ERR(group);


A serious problem indeed, but this isn't the right solution.  I've
copied you on a patch that I think fixes it.  Please verify.  Thanks,

Alex

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web