From: Alex Williamson <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
Cc: kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
aik-sLpHqDYs0B2HXe+LvDLADg@public.gmane.org,
benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org,
qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org
Subject: Re: [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges
Date: Wed, 01 Feb 2012 12:15:21 -0700 [thread overview]
Message-ID: <1328123721.6937.225.camel@bling.home> (raw)
In-Reply-To: <1328122724.6937.216.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
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-sLpHqDYs0B2HXe+LvDLADg@public.gmane.org>
> > Signed-off-by: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
> > ---
> > 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 {
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Alex Williamson <alex.williamson@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: dwmw2@infradead.org, iommu@lists.linux-foundation.org,
aik@ozlabs.ru, benh@kernel.crashing.org, qemu-devel@nongnu.org,
joerg.roedel@amd.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges
Date: Wed, 01 Feb 2012 12:15:21 -0700 [thread overview]
Message-ID: <1328123721.6937.225.camel@bling.home> (raw)
In-Reply-To: <1328122724.6937.216.camel@bling.home>
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 {
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Alex Williamson <alex.williamson@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: kvm@vger.kernel.org, aik@ozlabs.ru, qemu-devel@nongnu.org,
linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
joerg.roedel@amd.com, dwmw2@infradead.org
Subject: Re: [Qemu-devel] [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges
Date: Wed, 01 Feb 2012 12:15:21 -0700 [thread overview]
Message-ID: <1328123721.6937.225.camel@bling.home> (raw)
In-Reply-To: <1328122724.6937.216.camel@bling.home>
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 {
>
>
next prev parent reply other threads:[~2012-02-01 19:15 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-01 4:46 RFC: Device isolation groups David Gibson
2012-02-01 4:46 ` [Qemu-devel] " David Gibson
2012-02-01 4:46 ` David Gibson
[not found] ` <1328071614-8320-1-git-send-email-david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
2012-02-01 4:46 ` [PATCH 1/3] Device isolation group infrastructure (v3) David Gibson
2012-02-01 4:46 ` [Qemu-devel] " David Gibson
2012-02-01 4:46 ` David Gibson
[not found] ` <1328071614-8320-2-git-send-email-david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
2012-02-08 15:27 ` Joerg Roedel
2012-02-08 15:27 ` [Qemu-devel] " Joerg Roedel
2012-02-08 15:27 ` Joerg Roedel
[not found] ` <20120208152748.GD22598-5C7GfCeVMHo@public.gmane.org>
2012-02-08 21:39 ` Benjamin Herrenschmidt
2012-02-08 21:39 ` [Qemu-devel] " Benjamin Herrenschmidt
2012-02-08 21:39 ` Benjamin Herrenschmidt
2012-02-09 11:28 ` Joerg Roedel
2012-02-09 11:28 ` [Qemu-devel] " Joerg Roedel
2012-02-09 11:28 ` Joerg Roedel
[not found] ` <20120209112805.GN22598-5C7GfCeVMHo@public.gmane.org>
2012-02-10 0:21 ` David Gibson
2012-02-10 0:21 ` [Qemu-devel] " David Gibson
2012-02-10 0:21 ` David Gibson
2012-02-08 21:43 ` Benjamin Herrenschmidt
2012-02-08 21:43 ` [Qemu-devel] " Benjamin Herrenschmidt
2012-02-08 21:43 ` Benjamin Herrenschmidt
2012-02-09 1:40 ` David Gibson
2012-02-09 1:40 ` [Qemu-devel] " David Gibson
2012-02-09 1:40 ` David Gibson
2012-02-01 4:46 ` [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges David Gibson
2012-02-01 4:46 ` [Qemu-devel] " David Gibson
2012-02-01 4:46 ` David Gibson
[not found] ` <1328071614-8320-3-git-send-email-david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
2012-02-01 18:58 ` Alex Williamson
2012-02-01 18:58 ` [Qemu-devel] " Alex Williamson
2012-02-01 18:58 ` Alex Williamson
[not found] ` <1328122724.6937.216.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2012-02-01 19:15 ` Alex Williamson [this message]
2012-02-01 19:15 ` [Qemu-devel] " Alex Williamson
2012-02-01 19:15 ` Alex Williamson
2012-02-01 4:46 ` [PATCH 3/3] device_isolation: Support isolation on POWER p7ioc (IODA) bridges David Gibson
2012-02-01 4:46 ` [Qemu-devel] " David Gibson
2012-02-01 4:46 ` David Gibson
[not found] ` <1328071614-8320-4-git-send-email-david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
2012-02-01 19:17 ` Alex Williamson
2012-02-01 19:17 ` [Qemu-devel] " Alex Williamson
2012-02-01 19:17 ` Alex Williamson
[not found] ` <1328123825.6937.227.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2012-02-02 0:23 ` David Gibson
2012-02-02 0:23 ` [Qemu-devel] " David Gibson
2012-02-02 0:23 ` David Gibson
2012-02-01 20:08 ` RFC: Device isolation groups Alex Williamson
2012-02-01 20:08 ` [Qemu-devel] " Alex Williamson
2012-02-01 20:08 ` Alex Williamson
[not found] ` <1328126919.6937.254.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2012-02-02 1:24 ` David Gibson
2012-02-02 1:24 ` [Qemu-devel] " David Gibson
2012-02-02 1:24 ` David Gibson
[not found] ` <20120202012414.GE8700-MK4v0fQdeXQXU02nzanrWNbf9cGiqdzd@public.gmane.org>
2012-02-29 19:30 ` Alex Williamson
2012-02-29 19:30 ` [Qemu-devel] " Alex Williamson
2012-02-29 19:30 ` Alex Williamson
[not found] ` <1330543855.29701.180.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2012-03-09 3:40 ` David Gibson
2012-03-09 3:40 ` [Qemu-devel] " David Gibson
2012-03-09 3:40 ` David Gibson
-- strict thread matches above, loose matches on Subject: below --
2011-12-15 6:25 [RFC] Device isolation infrastructure v2 David Gibson
2011-12-15 6:25 ` [PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges David Gibson
2011-12-15 6:09 David Gibson
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=1328123721.6937.225.camel@bling.home \
--to=alex.williamson-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=aik-sLpHqDYs0B2HXe+LvDLADg@public.gmane.org \
--cc=benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
--cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=qemu-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.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.