From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Scott Wood <scottwood@freescale.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Bharat Bhushan <bharat.bhushan@freescale.com>,
Alex Williamson <alex.williamson@redhat.com>,
Paul Mackerras <paulus@samba.org>,
Varun Sethi <Varun.Sethi@freescale.com>,
linuxppc-dev@lists.ozlabs.org,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [1/3] powerpc/vfio: Enable on POWERNV platform
Date: Fri, 13 Dec 2013 14:02:06 +1100 [thread overview]
Message-ID: <52AA78AE.2050800@ozlabs.ru> (raw)
In-Reply-To: <20131212233527.GA16929@home.buserror.net>
On 12/13/2013 10:35 AM, Scott Wood wrote:
> On Tue, May 21, 2013 at 01:33:09PM +1000, Alexey Kardashevskiy wrote:
>> +static int iommu_add_device(struct device *dev)
>> +{
>> + struct iommu_table *tbl;
>> + int ret = 0;
>> +
>> + if (WARN_ON(dev->iommu_group)) {
>> + pr_warn("iommu_tce: device %s is already in iommu group %d, skipping\n",
>> + dev_name(dev),
>> + iommu_group_id(dev->iommu_group));
>> + return -EBUSY;
>> + }
> [snip]
>> +static int __init tce_iommu_init(void)
>> +{
>> + struct pci_dev *pdev = NULL;
>> +
>> + BUILD_BUG_ON(PAGE_SIZE < IOMMU_PAGE_SIZE);
>> +
>> + for_each_pci_dev(pdev)
>> + iommu_add_device(&pdev->dev);
>> +
>> + bus_register_notifier(&pci_bus_type, &tce_iommu_bus_nb);
>> + return 0;
>> +}
>> +
>> +subsys_initcall_sync(tce_iommu_init);
>
> This is missing a check to see whether the appropriate hardware is
> present. This file should also be renamed to something less generic, and
> depend on a kconfig symbol more specific than CONFIG_PPC64.
>
> When this is combined with CONFIG_FSL_PAMU on hardware with a PAMU, I get
> a bunch of those "WARN_ON(dev->iommu_group)" dumps because PAMU already
> got to them. Presumably without PAMU it silently (or with just pr_debug)
> bails out at some other point.
I posted (yet again) yesterday "[PATCH v11] PPC: POWERNV: move
iommu_add_device earlier" which should fix this. And Bharat asked many
times for this to get accepted :)
--
Alexey
WARNING: multiple messages have this Message-ID (diff)
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Alex Williamson <alex.williamson@redhat.com>,
Paul Mackerras <paulus@samba.org>,
David Gibson <david@gibson.dropbear.id.au>,
Varun Sethi <Varun.Sethi@freescale.com>,
Bharat Bhushan <bharat.bhushan@freescale.com>
Subject: Re: [1/3] powerpc/vfio: Enable on POWERNV platform
Date: Fri, 13 Dec 2013 14:02:06 +1100 [thread overview]
Message-ID: <52AA78AE.2050800@ozlabs.ru> (raw)
In-Reply-To: <20131212233527.GA16929@home.buserror.net>
On 12/13/2013 10:35 AM, Scott Wood wrote:
> On Tue, May 21, 2013 at 01:33:09PM +1000, Alexey Kardashevskiy wrote:
>> +static int iommu_add_device(struct device *dev)
>> +{
>> + struct iommu_table *tbl;
>> + int ret = 0;
>> +
>> + if (WARN_ON(dev->iommu_group)) {
>> + pr_warn("iommu_tce: device %s is already in iommu group %d, skipping\n",
>> + dev_name(dev),
>> + iommu_group_id(dev->iommu_group));
>> + return -EBUSY;
>> + }
> [snip]
>> +static int __init tce_iommu_init(void)
>> +{
>> + struct pci_dev *pdev = NULL;
>> +
>> + BUILD_BUG_ON(PAGE_SIZE < IOMMU_PAGE_SIZE);
>> +
>> + for_each_pci_dev(pdev)
>> + iommu_add_device(&pdev->dev);
>> +
>> + bus_register_notifier(&pci_bus_type, &tce_iommu_bus_nb);
>> + return 0;
>> +}
>> +
>> +subsys_initcall_sync(tce_iommu_init);
>
> This is missing a check to see whether the appropriate hardware is
> present. This file should also be renamed to something less generic, and
> depend on a kconfig symbol more specific than CONFIG_PPC64.
>
> When this is combined with CONFIG_FSL_PAMU on hardware with a PAMU, I get
> a bunch of those "WARN_ON(dev->iommu_group)" dumps because PAMU already
> got to them. Presumably without PAMU it silently (or with just pr_debug)
> bails out at some other point.
I posted (yet again) yesterday "[PATCH v11] PPC: POWERNV: move
iommu_add_device earlier" which should fix this. And Bharat asked many
times for this to get accepted :)
--
Alexey
next prev parent reply other threads:[~2013-12-13 3:02 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-21 3:33 [PATCH 0/5 v2] VFIO PPC64: add VFIO support on POWERPC64 Alexey Kardashevskiy
2013-05-21 3:33 ` Alexey Kardashevskiy
2013-05-21 3:33 ` [PATCH 1/3] powerpc/vfio: Enable on POWERNV platform Alexey Kardashevskiy
2013-05-21 3:33 ` Alexey Kardashevskiy
2013-12-12 23:35 ` [1/3] " Scott Wood
2013-12-12 23:35 ` Scott Wood
2013-12-13 3:02 ` Alexey Kardashevskiy [this message]
2013-12-13 3:02 ` Alexey Kardashevskiy
2013-12-13 21:02 ` Scott Wood
2013-12-13 21:02 ` Scott Wood
2013-12-14 4:56 ` Bharat.Bhushan
2013-12-14 4:56 ` Bharat.Bhushan
2013-12-14 4:56 ` Bharat.Bhushan
2013-05-21 3:33 ` [PATCH 2/3] powerpc/vfio: Implement IOMMU driver for VFIO Alexey Kardashevskiy
2013-05-21 3:33 ` Alexey Kardashevskiy
2013-05-24 14:03 ` Alex Williamson
2013-05-24 14:03 ` Alex Williamson
2013-05-21 3:33 ` [PATCH 3/3] powerpc/vfio: Enable on pSeries platform Alexey Kardashevskiy
2013-05-21 3:33 ` Alexey Kardashevskiy
2013-05-24 14:03 ` Alex Williamson
2013-05-24 14:03 ` Alex Williamson
2013-05-21 3:34 ` [PATCH 0/5 v2] VFIO PPC64: add VFIO support on POWERPC64 Alexey Kardashevskiy
2013-05-21 3:34 ` Alexey Kardashevskiy
2013-05-23 14:56 ` Alex Williamson
2013-05-23 14:56 ` Alex Williamson
2013-05-24 3:14 ` Alexey Kardashevskiy
2013-05-24 3:14 ` Alexey Kardashevskiy
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=52AA78AE.2050800@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=Varun.Sethi@freescale.com \
--cc=alex.williamson@redhat.com \
--cc=bharat.bhushan@freescale.com \
--cc=david@gibson.dropbear.id.au \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=scottwood@freescale.com \
/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.