* [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges
@ 2011-12-15 6:09 David Gibson
2011-12-15 6:09 ` [Qemu-devel] [PATCH 3/3] device_isolation: Support isolation on POWER p7ioc (IODA) bridges David Gibson
0 siblings, 1 reply; 6+ messages in thread
From: David Gibson @ 2011-12-15 6:09 UTC (permalink / raw)
To: alex.williamson
Cc: chrisw, aik, agraf, qemu-devel, B08248, iommu, joerg.roedel,
scottwood, dwmw2, linux-kernel
This patch adds code to the code for the powernv platform to create
and populate isolation groups on hardware using the p5ioc2 PCI host
bridge used on some IBM POWER systems.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
arch/powerpc/platforms/powernv/pci-p5ioc2.c | 14 +++++++++++++-
arch/powerpc/platforms/powernv/pci.h | 3 +++
2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
index 4c80f7c..24847a9 100644
--- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
+++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
@@ -20,6 +20,7 @@
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/msi.h>
+#include <linux/device_isolation.h>
#include <asm/sections.h>
#include <asm/io.h>
@@ -88,10 +89,21 @@ static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb) { }
static void __devinit pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb,
struct pci_dev *pdev)
{
- if (phb->p5ioc2.iommu_table.it_map == NULL)
+ if (phb->p5ioc2.iommu_table.it_map == NULL) {
iommu_init_table(&phb->p5ioc2.iommu_table, phb->hose->node);
+#ifdef CONFIG_DEVICE_ISOLATION
+ phb->p5ioc2.di_group = kzalloc(sizeof(*(phb->p5ioc2.di_group)),
+ GFP_KERNEL);
+ BUG_ON(!phb->p5ioc2.di_group ||
+ (device_isolation_group_init(phb->p5ioc2.di_group,
+ "p5ioc2:%llx", phb->opal_id) < 0));
+#endif
+ }
set_iommu_table_base(&pdev->dev, &phb->p5ioc2.iommu_table);
+#ifdef CONFIG_DEVICE_ISOLATION
+ device_isolation_dev_add(phb->p5ioc2.di_group, &pdev->dev);
+#endif
}
static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np,
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
index 28ae4ca..a2dc071 100644
--- a/arch/powerpc/platforms/powernv/pci.h
+++ b/arch/powerpc/platforms/powernv/pci.h
@@ -77,6 +77,9 @@ struct pnv_phb {
union {
struct {
struct iommu_table iommu_table;
+#ifdef CONFIG_DEVICE_ISOLATION
+ struct device_isolation_group *di_group;
+#endif
} p5ioc2;
struct {
--
1.7.7.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH 3/3] device_isolation: Support isolation on POWER p7ioc (IODA) bridges
2011-12-15 6:09 [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges David Gibson
@ 2011-12-15 6:09 ` David Gibson
0 siblings, 0 replies; 6+ messages in thread
From: David Gibson @ 2011-12-15 6:09 UTC (permalink / raw)
To: alex.williamson
Cc: chrisw, aik, agraf, qemu-devel, B08248, iommu, joerg.roedel,
scottwood, dwmw2, linux-kernel
This patch adds code to the code for the powernv platform to create
and populate isolation groups on hardware using the p7ioc (aka IODA) PCI host
bridge used on some IBM POWER systems.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
arch/powerpc/platforms/powernv/pci-ioda.c | 18 ++++++++++++++++--
arch/powerpc/platforms/powernv/pci.h | 6 ++++++
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 0cdc8302..6df632e 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -20,6 +20,7 @@
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/msi.h>
+#include <linux/device_isolation.h>
#include <asm/sections.h>
#include <asm/io.h>
@@ -861,6 +862,9 @@ static void __devinit pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe,
set_iommu_table_base(&dev->dev, &pe->tce32_table);
if (dev->subordinate)
pnv_ioda_setup_bus_dma(pe, dev->subordinate);
+#ifdef CONFIG_DEVICE_ISOLATION
+ device_isolation_dev_add(&pe->di_group, &dev->dev);
+#endif
}
}
@@ -941,11 +945,21 @@ static void __devinit pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
}
iommu_init_table(tbl, phb->hose->node);
- if (pe->pdev)
+#ifdef CONFIG_DEVICE_ISOLATION
+ BUG_ON(device_isolation_group_init(&pe->di_group, "ioda:rid%x-pe%x",
+ pe->rid, pe->pe_number) < 0);
+#endif
+
+ if (pe->pdev) {
set_iommu_table_base(&pe->pdev->dev, tbl);
- else
+#ifdef CONFIG_DEVICE_ISOLATION
+ device_isolation_dev_add(&pe->di_group, &pe->pdev->dev);
+#endif
+ } else
pnv_ioda_setup_bus_dma(pe, pe->pbus);
+
+
return;
fail:
/* XXX Failure: Try to fallback to 64-bit only ? */
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
index a2dc071..d663a26 100644
--- a/arch/powerpc/platforms/powernv/pci.h
+++ b/arch/powerpc/platforms/powernv/pci.h
@@ -1,6 +1,8 @@
#ifndef __POWERNV_PCI_H
#define __POWERNV_PCI_H
+#include <linux/device_isolation.h>
+
struct pci_dn;
enum pnv_phb_type {
@@ -51,6 +53,10 @@ struct pnv_ioda_pe {
/* Link in list of PE#s */
struct list_head link;
+
+#ifdef CONFIG_DEVICE_ISOLATION
+ struct device_isolation_group di_group;
+#endif
};
struct pnv_phb {
--
1.7.7.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [RFC] Device isolation infrastructure v2
@ 2011-12-15 6:25 David Gibson
2011-12-15 6:25 ` [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges David Gibson
0 siblings, 1 reply; 6+ messages in thread
From: David Gibson @ 2011-12-15 6:25 UTC (permalink / raw)
To: alex.williamson
Cc: chrisw, aik, rusty, agraf, qemu-devel, B08248, iommu,
joerg.roedel, scottwood, dwmw2, linux-kernel
Here's the second spin of my preferred approach to handling grouping
of devices for safe assignment to guests.
Changes since v1:
* Many name changes and file moves for improved consistency
* Bugfixes and cleanups
* The interface to the next layer up is considerably fleshed out,
although it still needs work.
* Example initialization of groups for p5ioc2 and p7ioc.
TODO:
* Need sample initialization of groups for intel and/or amd iommus
* Use of sysfs attributes to control group permission is probably a
mistake. Although it seems a bit odd, registering a chardev for
each group is probably better, because perms can be set from udev
rules, just like everything else.
* Need more details of what the binder structure will need to
contain.
* Handle complete removal of groups.
* Clarify what will need to happen on the hot unplug path.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges
2011-12-15 6:25 [Qemu-devel] [RFC] Device isolation infrastructure v2 David Gibson
@ 2011-12-15 6:25 ` David Gibson
0 siblings, 0 replies; 6+ messages in thread
From: David Gibson @ 2011-12-15 6:25 UTC (permalink / raw)
To: alex.williamson
Cc: chrisw, aik, rusty, agraf, qemu-devel, B08248, iommu,
joerg.roedel, scottwood, dwmw2, linux-kernel
This patch adds code to the code for the powernv platform to create
and populate isolation groups on hardware using the p5ioc2 PCI host
bridge used on some IBM POWER systems.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
arch/powerpc/platforms/powernv/pci-p5ioc2.c | 14 +++++++++++++-
arch/powerpc/platforms/powernv/pci.h | 3 +++
2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
index 4c80f7c..24847a9 100644
--- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
+++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
@@ -20,6 +20,7 @@
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/msi.h>
+#include <linux/device_isolation.h>
#include <asm/sections.h>
#include <asm/io.h>
@@ -88,10 +89,21 @@ static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb) { }
static void __devinit pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb,
struct pci_dev *pdev)
{
- if (phb->p5ioc2.iommu_table.it_map == NULL)
+ if (phb->p5ioc2.iommu_table.it_map == NULL) {
iommu_init_table(&phb->p5ioc2.iommu_table, phb->hose->node);
+#ifdef CONFIG_DEVICE_ISOLATION
+ phb->p5ioc2.di_group = kzalloc(sizeof(*(phb->p5ioc2.di_group)),
+ GFP_KERNEL);
+ BUG_ON(!phb->p5ioc2.di_group ||
+ (device_isolation_group_init(phb->p5ioc2.di_group,
+ "p5ioc2:%llx", phb->opal_id) < 0));
+#endif
+ }
set_iommu_table_base(&pdev->dev, &phb->p5ioc2.iommu_table);
+#ifdef CONFIG_DEVICE_ISOLATION
+ device_isolation_dev_add(phb->p5ioc2.di_group, &pdev->dev);
+#endif
}
static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np,
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
index 28ae4ca..a2dc071 100644
--- a/arch/powerpc/platforms/powernv/pci.h
+++ b/arch/powerpc/platforms/powernv/pci.h
@@ -77,6 +77,9 @@ struct pnv_phb {
union {
struct {
struct iommu_table iommu_table;
+#ifdef CONFIG_DEVICE_ISOLATION
+ struct device_isolation_group *di_group;
+#endif
} p5ioc2;
struct {
--
1.7.7.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] RFC: Device isolation groups
@ 2012-02-01 4:46 David Gibson
2012-02-01 4:46 ` [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges David Gibson
0 siblings, 1 reply; 6+ messages in thread
From: David Gibson @ 2012-02-01 4:46 UTC (permalink / raw)
To: dwmw2, iommu
Cc: kvm, aik, qemu-devel, linux-kernel, alex.williamson, joerg.roedel
This patch series introduces a new infrastructure to the driver core
for representing "device isolation groups". That is, groups of
devices which can be "isolated" in such a way that the rest of the
system can be protected from them, even in the presence of userspace
or a guest OS directly driving the devices.
Isolation will typically be due to an IOMMU which can safely remap DMA
and interrupts coming from these devices. We need to represent whole
groups, rather than individual devices, because there are a number of
cases where the group can be isolated as a whole, but devices within
it cannot be safely isolated from each other - this usually occurs
because the IOMMU cannot reliably distinguish which device in the
group initiated a transaction. In other words, isolation groups
represent the minimum safe granularity for passthrough to guests or
userspace.
This series provides the core infraustrcture for tracking isolation
groups, and example implementations initializing the groups
appropriately for two PCI bridges (which include IOMMUs) found on IBM
POWER systems.
Actually using the group information is not included here, but David
Woodhouse has expressed an interest in using a structure like this to
represent operations in iommu_ops more correctly.
Some tracking of groups is a prerequisite for safe passthrough of
devices to guests or userspace, such as done by VFIO. Current VFIO
patches use the iommu_ops->device_group mechanism for this. However,
that mechanism is awkward, because without an in-kernel concrete
representation of groups, enumerating a group requires traversing
every device on a given bus type. It also fails to cover some very
plausible IOMMU topologies, because its groups cannot span devices on
multiple bus types.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges
2012-02-01 4:46 [Qemu-devel] RFC: Device isolation groups David Gibson
@ 2012-02-01 4:46 ` David Gibson
2012-02-01 18:58 ` Alex Williamson
0 siblings, 1 reply; 6+ messages in thread
From: David Gibson @ 2012-02-01 4:46 UTC (permalink / raw)
To: dwmw2, iommu
Cc: kvm, aik, qemu-devel, linux-kernel, alex.williamson, joerg.roedel
This patch adds code to the code for the powernv platform to create
and populate isolation groups on hardware using the p5ioc2 PCI host
bridge used on some IBM POWER systems.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
arch/powerpc/platforms/powernv/pci-p5ioc2.c | 14 +++++++++++++-
arch/powerpc/platforms/powernv/pci.h | 3 +++
2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
index 2649677..e5bb3a6 100644
--- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
+++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
@@ -20,6 +20,7 @@
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/msi.h>
+#include <linux/device_isolation.h>
#include <asm/sections.h>
#include <asm/io.h>
@@ -88,10 +89,21 @@ static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb) { }
static void __devinit pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb,
struct pci_dev *pdev)
{
- if (phb->p5ioc2.iommu_table.it_map == NULL)
+ if (phb->p5ioc2.iommu_table.it_map == NULL) {
iommu_init_table(&phb->p5ioc2.iommu_table, phb->hose->node);
+#ifdef CONFIG_DEVICE_ISOLATION
+ phb->p5ioc2.di_group = kzalloc(sizeof(*(phb->p5ioc2.di_group)),
+ GFP_KERNEL);
+ BUG_ON(!phb->p5ioc2.di_group ||
+ (device_isolation_group_init(phb->p5ioc2.di_group,
+ "p5ioc2:%llx", phb->opal_id) < 0));
+#endif
+ }
set_iommu_table_base(&pdev->dev, &phb->p5ioc2.iommu_table);
+#ifdef CONFIG_DEVICE_ISOLATION
+ device_isolation_dev_add(phb->p5ioc2.di_group, &pdev->dev);
+#endif
}
static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np,
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
index 8bc4796..64ede1e 100644
--- a/arch/powerpc/platforms/powernv/pci.h
+++ b/arch/powerpc/platforms/powernv/pci.h
@@ -87,6 +87,9 @@ struct pnv_phb {
union {
struct {
struct iommu_table iommu_table;
+#ifdef CONFIG_DEVICE_ISOLATION
+ struct device_isolation_group *di_group;
+#endif
} p5ioc2;
struct {
--
1.7.8.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges
2012-02-01 4:46 ` [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges David Gibson
@ 2012-02-01 18:58 ` Alex Williamson
2012-02-01 19:15 ` Alex Williamson
0 siblings, 1 reply; 6+ messages in thread
From: Alex Williamson @ 2012-02-01 18:58 UTC (permalink / raw)
To: David Gibson
Cc: kvm, aik, qemu-devel, linux-kernel, iommu, joerg.roedel, dwmw2
On Wed, 2012-02-01 at 15:46 +1100, David Gibson wrote:
> This patch adds code to the code for the powernv platform to create
> and populate isolation groups on hardware using the p5ioc2 PCI host
> bridge used on some IBM POWER systems.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> arch/powerpc/platforms/powernv/pci-p5ioc2.c | 14 +++++++++++++-
> arch/powerpc/platforms/powernv/pci.h | 3 +++
> 2 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> index 2649677..e5bb3a6 100644
> --- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> +++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> @@ -20,6 +20,7 @@
> #include <linux/irq.h>
> #include <linux/io.h>
> #include <linux/msi.h>
> +#include <linux/device_isolation.h>
>
> #include <asm/sections.h>
> #include <asm/io.h>
> @@ -88,10 +89,21 @@ static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb) { }
> static void __devinit pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb,
> struct pci_dev *pdev)
> {
> - if (phb->p5ioc2.iommu_table.it_map == NULL)
> + if (phb->p5ioc2.iommu_table.it_map == NULL) {
> iommu_init_table(&phb->p5ioc2.iommu_table, phb->hose->node);
> +#ifdef CONFIG_DEVICE_ISOLATION
> + phb->p5ioc2.di_group = kzalloc(sizeof(*(phb->p5ioc2.di_group)),
> + GFP_KERNEL);
> + BUG_ON(!phb->p5ioc2.di_group ||
> + (device_isolation_group_init(phb->p5ioc2.di_group,
> + "p5ioc2:%llx", phb->opal_id) < 0));
> +#endif
Hmm, it's really unfortunate that this is architected so we need to
surround everything in #ifdefs even though we have stub functions
defined.
> + }
>
> set_iommu_table_base(&pdev->dev, &phb->p5ioc2.iommu_table);
> +#ifdef CONFIG_DEVICE_ISOLATION
> + device_isolation_dev_add(phb->p5ioc2.di_group, &pdev->dev);
> +#endif
> }
>
> static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np,
> diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
> index 8bc4796..64ede1e 100644
> --- a/arch/powerpc/platforms/powernv/pci.h
> +++ b/arch/powerpc/platforms/powernv/pci.h
> @@ -87,6 +87,9 @@ struct pnv_phb {
> union {
> struct {
> struct iommu_table iommu_table;
> +#ifdef CONFIG_DEVICE_ISOLATION
> + struct device_isolation_group *di_group;
> +#endif
> } p5ioc2;
>
> struct {
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges
2012-02-01 18:58 ` Alex Williamson
@ 2012-02-01 19:15 ` Alex Williamson
0 siblings, 0 replies; 6+ messages in thread
From: Alex Williamson @ 2012-02-01 19:15 UTC (permalink / raw)
To: David Gibson
Cc: kvm, aik, qemu-devel, linux-kernel, iommu, joerg.roedel, dwmw2
On Wed, 2012-02-01 at 11:58 -0700, Alex Williamson wrote:
> On Wed, 2012-02-01 at 15:46 +1100, David Gibson wrote:
> > This patch adds code to the code for the powernv platform to create
> > and populate isolation groups on hardware using the p5ioc2 PCI host
> > bridge used on some IBM POWER systems.
> >
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > ---
> > arch/powerpc/platforms/powernv/pci-p5ioc2.c | 14 +++++++++++++-
> > arch/powerpc/platforms/powernv/pci.h | 3 +++
> > 2 files changed, 16 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> > index 2649677..e5bb3a6 100644
> > --- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> > +++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> > @@ -20,6 +20,7 @@
> > #include <linux/irq.h>
> > #include <linux/io.h>
> > #include <linux/msi.h>
> > +#include <linux/device_isolation.h>
> >
> > #include <asm/sections.h>
> > #include <asm/io.h>
> > @@ -88,10 +89,21 @@ static void pnv_pci_init_p5ioc2_msis(struct pnv_phb *phb) { }
> > static void __devinit pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb *phb,
> > struct pci_dev *pdev)
> > {
> > - if (phb->p5ioc2.iommu_table.it_map == NULL)
> > + if (phb->p5ioc2.iommu_table.it_map == NULL) {
> > iommu_init_table(&phb->p5ioc2.iommu_table, phb->hose->node);
> > +#ifdef CONFIG_DEVICE_ISOLATION
> > + phb->p5ioc2.di_group = kzalloc(sizeof(*(phb->p5ioc2.di_group)),
> > + GFP_KERNEL);
> > + BUG_ON(!phb->p5ioc2.di_group ||
> > + (device_isolation_group_init(phb->p5ioc2.di_group,
> > + "p5ioc2:%llx", phb->opal_id) < 0));
> > +#endif
>
> Hmm, it's really unfortunate that this is architected so we need to
> surround everything in #ifdefs even though we have stub functions
> defined.
I think maybe we want:
#ifdef CONFIG_DEVICE_ISOLATION
struct device_isolation_group *device_isolation_create_group(void)
{
struct device_isolation_group *di_group;
di_group = kzalloc(sizeof(*di_group), GFP_KERNEL);
if (!di_group)
return ERR_PTR(-ENOMEM);
return di_group;
}
#else
struct device_isolation_group *device_isolation_create_group(void)
{
return NULL;
}
#endif
Then we can do:
phb->p5ioc2.di_group = device_isolation_create_group();
BUG_ON(IS_ERR(phb->p5ioc2.di_group) || (device_isolation_group_init(phb->p5ioc2.di_group, ...
(We pass NULL to the stubs, but that's ok)
> > + }
> >
> > set_iommu_table_base(&pdev->dev, &phb->p5ioc2.iommu_table);
> > +#ifdef CONFIG_DEVICE_ISOLATION
> > + device_isolation_dev_add(phb->p5ioc2.di_group, &pdev->dev);
> > +#endif
> > }
> >
> > static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np,
> > diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h
> > index 8bc4796..64ede1e 100644
> > --- a/arch/powerpc/platforms/powernv/pci.h
> > +++ b/arch/powerpc/platforms/powernv/pci.h
> > @@ -87,6 +87,9 @@ struct pnv_phb {
> > union {
> > struct {
> > struct iommu_table iommu_table;
> > +#ifdef CONFIG_DEVICE_ISOLATION
> > + struct device_isolation_group *di_group;
> > +#endif
> > } p5ioc2;
> >
> > struct {
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-02-01 19:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-15 6:09 [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges David Gibson
2011-12-15 6:09 ` [Qemu-devel] [PATCH 3/3] device_isolation: Support isolation on POWER p7ioc (IODA) bridges David Gibson
-- strict thread matches above, loose matches on Subject: below --
2011-12-15 6:25 [Qemu-devel] [RFC] Device isolation infrastructure v2 David Gibson
2011-12-15 6:25 ` [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges David Gibson
2012-02-01 4:46 [Qemu-devel] RFC: Device isolation groups David Gibson
2012-02-01 4:46 ` [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges David Gibson
2012-02-01 18:58 ` Alex Williamson
2012-02-01 19:15 ` Alex Williamson
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).