Re: Host kernel crash at pci_find_upstream_pcie_bridge on VM exit

2013-03-19 Thread Alex Williamson
On Tue, 2013-03-19 at 13:30 -0700, Ganesh Narayanaswamy wrote: > Hi, > > I am running qemu with kvm and VT-d enabled and a couple of PCI > devices assigned to the guest VM. Both host and guest are running > linux 2.6 kernel. > > The passthrough works fine, but when I exit the VM, the host kerne

[GIT PULL] vfio fix for 3.9-rc4

2013-03-19 Thread Alex Williamson
Hi Linus, Please pull for the next rc. Thanks! The following changes since commit f6161aa153581da4a3867a2d1a7caf4be19b6ec9: Linux 3.9-rc2 (2013-03-10 16:54:19 -0700) are available in the git repository at: git://github.com/awilliam/linux-vfio.git tags/vfio-v3.9-rc4 for you to fetch chang

Re: [PATCH 2/3] VFIO: VFIO_DEVICE_SET_ADDR_MAPPING command

2013-03-20 Thread Alex Williamson
On Tue, 2013-03-19 at 05:45 +0100, Benjamin Herrenschmidt wrote: > On Mon, 2013-03-18 at 22:18 -0600, Alex Williamson wrote: > > > Yes, EEH firmware call needn't going through VFIO. However, EEH has > > > very close relationship with PCI and so VFIO-PCI does. Event

Re: [PATCH 2/3] VFIO: VFIO_DEVICE_SET_ADDR_MAPPING command

2013-03-20 Thread Alex Williamson
On Wed, 2013-03-20 at 20:31 +0100, Benjamin Herrenschmidt wrote: > On Wed, 2013-03-20 at 12:48 -0600, Alex Williamson wrote: > > Perhaps my problem is that I don't have a clear picture of where > > you're > > going with this like I do for AER. For AER we're

Re: [PATCH] vfio powerpc: implement IOMMU driver for VFIO

2013-03-20 Thread Alex Williamson
spapr"); > > return 0; > > diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c > b/drivers/vfio/vfio_iommu_spapr_tce.c > new file mode 100644 > index 000..22ba0b5 > --- /dev/null > +++ b/drivers/vfio/vfio_iommu_spapr_tce.c > @@ -0,0 +1,365 @@ &g

Re: [PATCH 3/3] VFIO: Direct access config reg without capability

2013-03-20 Thread Alex Williamson
On Fri, 2013-03-15 at 15:26 +0800, Gavin Shan wrote: > The config registers in [0, 0x40] is being supported by VFIO. Apart > from that, the other config registers should be coverred by PCI or > PCIe capability. However, there might have some PCI devices (be2net) > who has config registers (0x7c) ou

Re: [PATCH] vfio powerpc: implement IOMMU driver for VFIO

2013-03-20 Thread Alex Williamson
On Thu, 2013-03-21 at 11:57 +1100, Alexey Kardashevskiy wrote: > On 21/03/13 07:45, Alex Williamson wrote: > > On Tue, 2013-03-19 at 18:08 +1100, Alexey Kardashevskiy wrote: > >> VFIO implements platform independent stuff such as > >> a PCI driver, BAR access (via read

Re: Host kernel crash at pci_find_upstream_pcie_bridge on VM exit

2013-03-20 Thread Alex Williamson
[e0] Express Endpoint, MSI 00 If so, they're in violation of the PCI Express specification and likely the cause of this problem. Thanks, Alex > On Mar 19, 2013, at 3:28 PM, Alex Williamson wrote: > > > On Tue, 2013-03-19 at 13:30 -0700, Ganesh Narayanaswamy wrote: > >>

Re: [PATCH] vfio powerpc: implement IOMMU driver for VFIO

2013-03-20 Thread Alex Williamson
On Thu, 2013-03-21 at 12:55 +1100, David Gibson wrote: > On Wed, Mar 20, 2013 at 02:45:24PM -0600, Alex Williamson wrote: > > On Tue, 2013-03-19 at 18:08 +1100, Alexey Kardashevskiy wrote: > > > VFIO implements platform independent stuff such as > > > a PCI driver, BAR

Re: Host kernel crash at pci_find_upstream_pcie_bridge on VM exit

2013-03-21 Thread Alex Williamson
you're using -M q35? It's still a bit fragile for device assignment at this point. Have you tried vfio-pci for doing the assignment? Thanks, Alex > On Mar 20, 2013, at 7:41 PM, Alex Williamson wrote: > > > On Tue, 2013-03-19 at 17:09 -0700, Ganesh Narayanaswamy wrote: &

Re: [Bug 55421] igb VF can't work in KVM guest

2013-03-21 Thread Alex Williamson
Mitch, Bugzilla wouldn't let me add you to the CC, so FYI... Thanks, Alex On Thu, 2013-03-21 at 21:29 +, bugzilla-dae...@bugzilla.kernel.org wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=55421 > > > Alex Williamson changed: > >

Re: [Bug 55421] igb VF can't work in KVM guest

2013-03-21 Thread Alex Williamson
s every possible guest OS is all that practical. At least that explains why igbvf in the host is unaffected though. Should we expect a Code 10 (device cannot start) from the Windows igbvf driver when it finds a zero'd MAC? Thanks, Alex > > -Original Message- > > From: Alex W

Re: [PATCH] vfio: make local function vfio_pci_intx_unmask_handler() static

2013-03-25 Thread Alex Williamson
On Thu, 2013-03-21 at 15:45 +0800, Wei Yongjun wrote: > From: Wei Yongjun > > vfio_pci_intx_unmask_handler() was not declared. It should be static. > > Signed-off-by: Wei Yongjun > --- > drivers/vfio/pci/vfio_pci_intrs.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git

Re: [patch] vfio-pci: integer overflow in vfio_pci_ioctl()

2013-03-26 Thread Alex Williamson
return -EINVAL; > + > data = memdup_user((void __user *)(arg + minsz), > hdr.count * size); > if (IS_ERR(data)) Thanks Dan. Is this more like what you're looking for? commit 16dead

[PATCH 0/2] vfio-pci: Enable devices using unassigned config space

2013-03-26 Thread Alex Williamson
t the be2net to verify that it resolves the problem. Thanks, Alex --- Alex Williamson (2): vfio-pci: Use byte granularity in config map vfio-pci: Enable raw access to unassigned config space drivers/vfio/pci/vfio_pci_config.c | 166 1 f

[PATCH 1/2] vfio-pci: Use byte granularity in config map

2013-03-26 Thread Alex Williamson
ities. Unfortunately they do exactly that so we need byte granularity on our config space map. Increase the allocation of the config map and split accesses at capability region boundaries. Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci_config.c |

[PATCH 2/2] vfio-pci: Enable raw access to unassigned config space

2013-03-26 Thread Alex Williamson
than MMIO or I/O port space registers, which we don't attempt to regulate, so treat PCI config space in the same way. Reported-by: Gavin Shan Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci_config.c | 78 +--- 1 file changed, 46 insertions(+

Re: [PATCH 1/2] vfio-pci: Use byte granularity in config map

2013-03-26 Thread Alex Williamson
On Wed, 2013-03-27 at 10:35 +0800, Gavin Shan wrote: > On Tue, Mar 26, 2013 at 12:17:03PM -0600, Alex Williamson wrote: > >The config map previously used a byte per dword to map regions of > >config space to capabilities. Modulo a bug where we round the length > >of capabil

[PATCH 1/9] linux-headers: Update to v3.9-rc2

2013-04-01 Thread Alex Williamson
Unedited scripts/update-linux-headers.sh run against v3.9-rc2 tag Signed-off-by: Alex Williamson --- linux-headers/linux/vfio.h |9 + 1 file changed, 9 insertions(+) diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h index f787b72..e094121 100644 --- a/linux

[PATCH 2/9] vfio-pci: Generalize PCI config mangling

2013-04-01 Thread Alex Williamson
a bitmap of Qemu emulated bits. Signed-off-by: Alex Williamson --- hw/vfio_pci.c | 80 ++--- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index 288361d..a3bae7b 100644 --- a/hw/vfio_pci.c +++ b

[PATCH 3/9] vfio-pci: Add PCIe capability mangling based on bus type

2013-04-01 Thread Alex Williamson
tunity to explicitly limit supported devices to Endpoints, Legacy Endpoints, and Root Complex Integrated Endpoints. We don't currently have support for other types and users often cause themselves problems by assigning them. Signed-off-by: Alex Williamson --- hw/vfi

[PATCH 5/9] qemu vfio-pci: Graphics device quirks

2013-04-01 Thread Alex Williamson
effective. Nvidia devices are pretty good about being able to get the device to a working state through the VGA BIOS init, Radeon devices less so, and often require a host reboot. Work remains to be done here. Signed-off-by: Alex Williamson --- hw/vfio_pc

[PATCH 6/9] vfio-pci: Add extra debugging

2013-04-01 Thread Alex Williamson
o had redundant "vfio:" prefixes. Signed-off-by: Alex Williamson --- hw/vfio_pci.c | 40 ++-- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index e96f141..b913ec0 100644 --- a/hw/vfio_pci.c +++ b/hw/vfio

[PATCH 7/9] vfio-pci: Move devices to D0 on reset

2013-04-01 Thread Alex Williamson
Guests may leave devices in a low power state at reboot, but we expect devices to be woken up for the next boot. Make this happen. Signed-off-by: Alex Williamson --- hw/vfio_pci.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index

[GIT PULL 0/9] vfio-pci updates & VGA support

2013-04-01 Thread Alex Williamson
Alex Alex Williamson (9): linux-headers: Update to v3.9-rc2 vfio-pci: Generalize PCI config mangling vfio-pci: Add PCIe capability mangling based on bus type qemu vfio-pci: Add support for VGA MMIO and I/O port access

[PATCH 8/9] vfio: Add bootindex support

2013-04-01 Thread Alex Williamson
Signed-off-by: Alex Williamson --- hw/vfio_pci.c |5 + 1 file changed, 5 insertions(+) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index d310730..0d2a445 100644 --- a/hw/vfio_pci.c +++ b/hw/vfio_pci.c @@ -30,6 +30,7 @@ #include "qemu/event_notifier.h" #include "exec/a

[PATCH 9/9] vfio: cleanup includes

2013-04-01 Thread Alex Williamson
Starting to get messy, put the back in alphabetical order. Signed-off-by: Alex Williamson --- hw/vfio_pci.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index 0d2a445..693a9ff 100644 --- a/hw/vfio_pci.c +++ b/hw/vfio_pci.c

[PATCH 4/9] qemu vfio-pci: Add support for VGA MMIO and I/O port access

2013-04-01 Thread Alex Williamson
e, passing it to vfio-pci using the romfile= option. Signed-off-by: Alex Williamson --- hw/vfio_pci.c | 169 + 1 file changed, 169 insertions(+) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index 0f74dbb..ff415a6 100644 --- a/hw/vfio_pci.

Re: RFC: vfio API changes needed for powerpc

2013-04-02 Thread Alex Williamson
Hi Stuart, On Tue, 2013-04-02 at 17:32 +, Yoder Stuart-B08248 wrote: > Alex, > > We are in the process of implementing vfio-pci support for the Freescale > IOMMU (PAMU). It is an aperture/window-based IOMMU and is quite different > than x86, and will involve creating a 'type 2' vfio implemen

Re: RFC: vfio API changes needed for powerpc

2013-04-02 Thread Alex Williamson
On Tue, 2013-04-02 at 15:54 -0500, Stuart Yoder wrote: > On Tue, Apr 2, 2013 at 3:32 PM, Alex Williamson > wrote: > >> 2. MSI window mappings > >> > >>The more problematic question is how to deal with MSIs. We need to > >>create mappings for u

Re: RFC: vfio API changes needed for powerpc

2013-04-02 Thread Alex Williamson
On Tue, 2013-04-02 at 15:57 -0500, Scott Wood wrote: > On 04/02/2013 03:32:17 PM, Alex Williamson wrote: > > On Tue, 2013-04-02 at 17:32 +, Yoder Stuart-B08248 wrote: > > > 2. MSI window mappings > > > > > >The more problematic question is how

Re: RFC: vfio API changes needed for powerpc

2013-04-02 Thread Alex Williamson
On Tue, 2013-04-02 at 16:08 -0500, Stuart Yoder wrote: > On Tue, Apr 2, 2013 at 3:57 PM, Scott Wood wrote: > >> >C. Explicit mapping using normal DMA map. The last idea is that > >> >we would introduce a new ioctl to give user-space an fd to > >> >the MSI bank, which could be

Re: RFC: vfio API changes needed for powerpc

2013-04-02 Thread Alex Williamson
On Tue, 2013-04-02 at 17:13 -0500, Scott Wood wrote: > On 04/02/2013 04:16:11 PM, Alex Williamson wrote: > > On Tue, 2013-04-02 at 15:54 -0500, Stuart Yoder wrote: > > > The number of windows is always power of 2 (and max is 256). And > > to reduce > > > PAMU c

Re: RFC: vfio API changes needed for powerpc

2013-04-02 Thread Alex Williamson
On Tue, 2013-04-02 at 17:44 -0500, Scott Wood wrote: > On 04/02/2013 04:32:04 PM, Alex Williamson wrote: > > On Tue, 2013-04-02 at 15:57 -0500, Scott Wood wrote: > > > On 04/02/2013 03:32:17 PM, Alex Williamson wrote: > > > > On x86 the interrupt remapper handl

Re: RFC: vfio API changes needed for powerpc

2013-04-02 Thread Alex Williamson
On Tue, 2013-04-02 at 17:50 -0500, Scott Wood wrote: > On 04/02/2013 04:38:45 PM, Alex Williamson wrote: > > On Tue, 2013-04-02 at 16:08 -0500, Stuart Yoder wrote: > > > On Tue, Apr 2, 2013 at 3:57 PM, Scott Wood > > wrote: > > > >> >C. Explicit ma

Re: RFC: vfio API changes needed for powerpc

2013-04-03 Thread Alex Williamson
On Wed, 2013-04-03 at 14:09 -0500, Stuart Yoder wrote: > > Would is be possible for userspace to simply leave room for MSI bank > > mapping (how much room could be determined by something like > > VFIO_IOMMU_GET_MSI_BANK_COUNT) then document the API that userspace can > > DMA_MAP starting at the 0x

Re: RFC: vfio API changes needed for powerpc (v2)

2013-04-04 Thread Alex Williamson
On Thu, 2013-04-04 at 17:32 +, Yoder Stuart-B08248 wrote: > Based on the email thread over the last couple of days, I have > below an more concrete proposal (v2) for new ioctls supporting vfio-pci > on SoCs with the Freescale PAMU. > > Example usage is as described by Scott: > > count = VFIO_

Re: Monitoring MMIO to PCI Passthrough devices?

2013-04-08 Thread Alex Williamson
On Mon, 2013-04-08 at 14:34 +0200, Andre Richter wrote: > Hi all, > > I'm quite new to KVM/QEMU internals. > On recent x86 setups (Sandy/Ivy Bridge with vt-x and vt-d), if I > attach a PCI device via PCI-Passthrough to a VM, > I can directly do MMIO with the device's registers or whatsoever hides

Re: PCI-passthrough on AMD - OpenVox A400P

2013-04-09 Thread Alex Williamson
On Tue, 2013-04-09 at 14:58 -0300, Daniel Bareiro wrote: > Hi all! > > > I've a cluster (active/passive) with two KVM VM with Asterisk and > Pacemaker+Corosync. I wonder if anyone tried to use a OpenVox A400P > card from a virtual machine. > > My idea is to have both nodes accessing this card.

[GIT PULL] vfio fix for 3.9-rc7

2013-04-09 Thread Alex Williamson
- vfio overflow fix for v3.9-rc7 ---- Alex Williamson (1): vfio-pci: Fix possible integer overflow drivers/vfio/pci/vfio_pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- To unsubscribe from this list: sen

Re: [GIT PULL] vfio fix for 3.9-rc7

2013-04-09 Thread Alex Williamson
On Tue, 2013-04-09 at 21:40 +0200, richard -rw- weinberger wrote: > On Tue, Apr 9, 2013 at 9:05 PM, Alex Williamson > wrote: > > Hi Linus, > > > > Here's one small fix for vfio that I'd like to get in for 3.9; > > tightening the range checking ar

[PATCH] kvm: Allow build-time configuration of KVM device assignment

2013-04-16 Thread Alex Williamson
We hope to at some point deprecate KVM legacy device assignment in favor of VFIO-based assignment. Towards that end, allow legacy device assignment to be deconfigured. Signed-off-by: Alex Williamson --- This depends on Alex Graf's irqfd generalization series to remove IRQ routing code

[PATCH 2/2] vfio: Use down_reads to protect iommu disconnects

2013-04-25 Thread Alex Williamson
If a group or device is released or a container is unset from a group it can race against file ops on the container. Protect these with down_reads to allow concurrent users. Signed-off-by: Alex Williamson Reported-by: Michael S. Tsirkin --- drivers/vfio/vfio.c | 62

[PATCH 0/2] Protect against iommu driver disconnect

2013-04-25 Thread Alex Williamson
keeping the existing mutex critical sections as down_writes and add down_reads where these are used. Thanks, Alex --- Alex Williamson (2): vfio: Convert container->group_lock to rwsem vfio: Use down_reads to protect iommu disconnects drivers/vfio/vfio.c |

[PATCH 1/2] vfio: Convert container->group_lock to rwsem

2013-04-25 Thread Alex Williamson
All current users are writers, maintaining current mutual exclusion. This lets us add read users next. Signed-off-by: Alex Williamson --- drivers/vfio/vfio.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c

Re: linux-next: Tree for Apr 29 (kvm)

2013-04-29 Thread Alex Williamson
On Mon, 2013-04-29 at 19:31 +0300, Gleb Natapov wrote: > On Mon, Apr 29, 2013 at 08:52:56AM -0700, Randy Dunlap wrote: > > On 04/29/13 02:17, Stephen Rothwell wrote: > > > Hi all, > > > > > > Changes since 20130426: > > > > > > > > > on x86_64: > > > > arch/x86/kvm/x86.c: In function 'kvm_dev_

[PATCH] kvm: KVM_CAP_IOMMU only available with device assignment

2013-04-29 Thread Alex Williamson
Fix build with CONFIG_PCI unset by linking KVM_CAP_IOMMU to device assignment config option. It has no purpose otherwise. Signed-off-by: Alex Williamson --- arch/ia64/kvm/kvm-ia64.c |2 ++ arch/x86/kvm/x86.c |2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/ia64/kvm/kvm

Re: linux-next: Tree for Apr 29 (kvm)

2013-04-29 Thread Alex Williamson
On Mon, 2013-04-29 at 18:46 +0200, Paolo Bonzini wrote: > Il 29/04/2013 18:31, Gleb Natapov ha scritto: > >> > arch/x86/kvm/x86.c: In function 'kvm_dev_ioctl_check_extension': > >> > arch/x86/kvm/x86.c:2547:22: error: 'pci_bus_type' undeclared (first use > >> > in this function) > >> > > >> > >

[PATCH] vfio: Set container device mode

2013-04-30 Thread Alex Williamson
f the container to allow access. Signed-off-by: Alex Williamson --- drivers/vfio/vfio.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index ac7423b..acb7121 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -27,6 +27,7 @@ #in

[GIT PULL] VFIO for v3.10

2013-05-02 Thread Alex Williamson
extension to support PCI AER notification to userspace, byte granularity of PCI config space and access to unarchitected PCI config space, better protection around IOMMU driver accesses, default file mode fix, and a few misc cleanups. Alex

Re: PCI passthrough (shared IRQ) not working / contradicting information

2013-05-03 Thread Alex Williamson
On Fri, 2013-05-03 at 10:35 +0200, Jan Kiszka wrote: > On 2013-05-03 09:33, Binarus wrote: > > Hi all, > > > > a while ago, I have set up a KVM virtual machine with PCI passthrough. > > The device which is passed through is an AVM Fritz!card PCI v2.1. > > > > This works, but there is a drawback:

VFIO VGA test branches

2013-05-03 Thread Alex Williamson
Hi folks, A number of people have been trying VFIO's VGA support, a few have even been successful. Resetting devices has been a problem and makes it very, very difficult to really use VGA assignment effectively. The code in the branches below attempts to address this. Discrete graphics devices

Re: [PATCH 2/5] KVM: PPC: iommu: Add missing kvm_iommu_map_pages/kvm_iommu_unmap_pages

2013-05-06 Thread Alex Williamson
On Mon, 2013-05-06 at 17:21 +1000, a...@ozlabs.ru wrote: > From: Alexey Kardashevskiy > > The IOMMU API implements groups creating/deletion, device binding > and IOMMU map/unmap operations. > > The PowerPC implementation uses most of the API except map/unmap > operations, which are implemented o

Re: [PATCH 2/5] KVM: PPC: iommu: Add missing kvm_iommu_map_pages/kvm_iommu_unmap_pages

2013-05-06 Thread Alex Williamson
On Tue, 2013-05-07 at 10:49 +1000, Alexey Kardashevskiy wrote: > On 05/07/2013 07:07 AM, Alex Williamson wrote: > > On Mon, 2013-05-06 at 17:21 +1000, a...@ozlabs.ru wrote: > >> From: Alexey Kardashevskiy > >> > >> The IOMMU API implements groups creating/del

Re: VFIO VGA test branches

2013-05-08 Thread Alex Williamson
-device usb-host,hostbus=8,hostaddr=2 I think that's it. Feel free to reply with other best practices. Thanks, Alex On Fri, 2013-05-03 at 16:56 -0600, Alex Williamson wrote: > Hi folks, > > A number of people have been trying VFIO's VGA support, a few have even >

Re: VFIO VGA test branches

2013-05-13 Thread Alex Williamson
013-05-03 at 16:56 -0600, Alex Williamson wrote: > ... > > git://github.com/awilliam/linux-vfio.git vfio-vga-reset > > git://github.com/awilliam/qemu-vfio.git vfio-vga-reset > > System setup: > > - Fedora 18 on > - Gigabyte Z77X-UD5H motherboard > - Intel Core

Re: [Qemu-devel] VFIO VGA test branches

2013-05-19 Thread Alex Williamson
On Sun, 2013-05-19 at 23:26 +0400, Maik Broemme wrote: > Hi Knut, > > Knut Omang wrote: > > > > On Mon, 2013-05-13 at 16:23 -0600, Alex Williamson wrote: > > > On Mon, 2013-05-13 at 22:55 +0200, Knut Omang wrote: > > > > Hi all, > > > > &

Re: VFIO VGA test branches

2013-05-19 Thread Alex Williamson
On Sun, 2013-05-19 at 17:35 +0200, Knut Omang wrote: > On Mon, 2013-05-13 at 16:23 -0600, Alex Williamson wrote: > > On Mon, 2013-05-13 at 22:55 +0200, Knut Omang wrote: > > > Hi all, > > > > > > Perfect timing from my perspective, thanks Alex! > > >

Re: [PATCH 0/5 v2] VFIO PPC64: add VFIO support on POWERPC64

2013-05-23 Thread Alex Williamson
On Tue, 2013-05-21 at 13:33 +1000, Alexey Kardashevskiy wrote: > The series adds support for VFIO on POWERPC in user space (such as QEMU). > The in-kernel real mode IOMMU support is added by another series posted > separately. > > As the first and main aim of this series is the POWERNV platform su

Re: [PATCH 2/3] powerpc/vfio: Implement IOMMU driver for VFIO

2013-05-24 Thread Alex Williamson
u_spapr_tce.c > new file mode 100644 > index 000..bdae7a0 > --- /dev/null > +++ b/drivers/vfio/vfio_iommu_spapr_tce.c > @@ -0,0 +1,377 @@ > +/* > + * VFIO: IOMMU DMA mapping support for TCE on POWER > + * > + * Copyright (C) 2013 IBM Corp. All rights reserved. >

Re: [PATCH 3/3] powerpc/vfio: Enable on pSeries platform

2013-05-24 Thread Alex Williamson
On Tue, 2013-05-21 at 13:33 +1000, Alexey Kardashevskiy wrote: > The enables VFIO on the pSeries platform, enabling user space > programs to access PCI devices directly. > > Signed-off-by: Alexey Kardashevskiy > Cc: David Gibson > Signed-off-by: Paul Mackerras Acked-b

[PATCH 2/2] vfio: hugepage support for vfio_iommu_type1

2013-05-24 Thread Alex Williamson
e is updated to reflect this. Previously this was unmodified on mapping, always returning the the requested unmap size. This is now updated to return the actual unmap size on success, allowing userspace to appropriately track mappings. Signed-off-by: Alex Williamson --- drivers/vfio/vfio_iommu

[PATCH 1/2] vfio: Convert type1 iommu to use rbtree

2013-05-24 Thread Alex Williamson
more efficient and allows us to use common code instead of inventing our own. Signed-off-by: Alex Williamson --- drivers/vfio/vfio_iommu_type1.c | 190 --- 1 file changed, 96 insertions(+), 94 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers

[PATCH 0/2] vfio: type1 iommu hugepage support

2013-05-24 Thread Alex Williamson
the type1 iommu, but is compatible with known users and works with existing QEMU userspace supporting vfio. Thanks, Alex --- Alex Williamson (2): vfio: Convert type1 iommu to use rbtree vfio: hugepage support for vfio_iommu_type1 drivers/vfio/vfio_iommu

Re: [PATCH 2/2] vfio: hugepage support for vfio_iommu_type1

2013-05-25 Thread Alex Williamson
On Sat, 2013-05-25 at 07:20 -0400, Konrad Rzeszutek Wilk wrote: > > + * Turns out AMD IOMMU has a page table bug where it won't map large pages > > + * to a region that previously mapped smaller pages. This should be fixed > > + * soon, so this is just a temporary workaround to break mappings down

Re: [PATCH 0/2] vfio: type1 iommu hugepage support

2013-05-25 Thread Alex Williamson
On Sat, 2013-05-25 at 07:21 -0400, Konrad Rzeszutek Wilk wrote: > On Fri, May 24, 2013 at 11:24:26AM -0600, Alex Williamson wrote: > > This series let's the vfio type1 iommu backend take advantage of iommu > > large page support. See patch 2/2 for the details. This has bee

Re: [PATCH 2/2] vfio: hugepage support for vfio_iommu_type1

2013-05-27 Thread Alex Williamson
On Mon, 2013-05-27 at 08:41 +, Sethi Varun-B16395 wrote: > > > -Original Message- > > From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > > boun...@lists.linux-foundation.org] On Behalf Of Alex Williamson > > Sent: Friday, May 24, 2013 10

Re: [Qemu-devel] VFIO VGA test branches

2013-05-27 Thread Alex Williamson
On Tue, 2013-05-28 at 03:40 +0200, Maik Broemme wrote: > Hi Alex, > > Maik Broemme wrote: > > Hi Alex, > > > > Alex Williamson wrote: > > > > > > Good to hear. It looks like you have the same motherboard as my AMD > > > test system.

Re: [Qemu-devel] VFIO VGA test branches

2013-05-28 Thread Alex Williamson
On Tue, 2013-05-28 at 07:33 +0200, Knut Omang wrote: > > I noticed this warning in the host log - I suppose it is unrelated but > thought I'd mention it just in case there is some side effect I do not > understand here: > > [0.538124] IOMMU: Setting identity map for device :00:1f.0 [0x0 -

[PATCH 3/2] vfio: Provide module option to disable vfio_iommu_type1 hugepage support

2013-05-28 Thread Alex Williamson
cally through sysfs. If enabled dynamically, only new mappings are restricted. Signed-off-by: Alex Williamson --- As suggested by Konrad. This is cleaner to add as a follow-on drivers/vfio/vfio_iommu_type1.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/vfio/vfio_iommu_

Re: [Qemu-devel] VFIO VGA test branches

2013-05-28 Thread Alex Williamson
On Tue, 2013-05-28 at 20:45 +0200, Maik Broemme wrote: > Hi, > > Maik Broemme wrote: > > Hi Alex, > > > > Maik Broemme wrote: > > > Hi Alex, > > > > > > Alex Williamson wrote: > > > > > > > > Good to hear.

Re: [Qemu-devel] VFIO VGA test branches

2013-05-29 Thread Alex Williamson
On Wed, 2013-05-29 at 18:16 +0200, Maik Broemme wrote: > Hi, > > Maik Broemme wrote: > > > > > > > > Here is the DEBUG_VFIO output: > > > > > > > > vfio: vfio_initfn(:04:00.0) group 14 > > > > vfio: region_add 0 - afff [0x7f869800] > > > > vfio: SKIPPING region_add fec0 - fec00f

[PATCH] pci: Enable overrides for missing ACS capabilities

2013-05-30 Thread Alex Williamson
vices added and save your customers the hassle of this boot option. Signed-off-by: Alex Williamson --- Documentation/kernel-parameters.txt | 10 +++ drivers/pci/quirks.c| 102 +++ 2 files changed, 112 insertions(+) diff --git a/Documentation/ker

Re: [PATCH] vfio: fix crash on rmmod

2013-06-05 Thread Alex Williamson
On Wed, 2013-06-05 at 16:03 +1000, Alexey Kardashevskiy wrote: > devtmpfs_delete_node() calls devnode() callback with mode==NULL but > vfio still tries to write there. > > The patch fixes this. > > Signed-off-by: Alexey Kardashevskiy > > --- Oops. Applied. The mode change just went in for 3.

[GIT PULL] VFIO fix for v3.10-rc5

2013-06-07 Thread Alex Williamson
Hi Linus, The following changes since commit d683b96b072dc4680fc74964eca77e6a23d1fa6e: Linux 3.10-rc4 (2013-06-02 17:11:17 +0900) are available in the git repository at: git://github.com/awilliam/linux-vfio.git tags/vfio-v3.10-rc5 for you to fetch changes up to 9a6aa279d3d17af73a029fa40654

Re: [PATCH 2/2] add initial kvm dev passhtrough support

2013-06-11 Thread Alex Williamson
On Tue, 2013-06-11 at 16:13 +0200, Mario Smarduch wrote: > On 6/11/2013 10:28 AM, Alexander Graf wrote: > > > > > Is there any particular reason you're not going down that path for your ARM > > implementation? > > We see this as a good starting point to build on, we need baseline numbers > for

[PATCH 3/3] vfio-pci: Avoid deadlock on remove

2013-06-11 Thread Alex Williamson
acquire the locks ourselves and use the pre-locked version, __pci_reset_function_locked(). Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci.c | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci

[PATCH 1/3] vfio: Don't overreact to DEL_DEVICE

2013-06-11 Thread Alex Williamson
ove callbacks vs the DEL_DEVICE notification. Signed-off-by: Alex Williamson --- drivers/vfio/vfio.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 6d78736..1bed313 100644 --- a/drivers/vfio/vfio.c +++ b

[PATCH 2/3] vfio: Ignore sprurious notifies

2013-06-11 Thread Alex Williamson
Remove debugging WARN_ON if we get a spurious notify for a group that no longer exists. No reports of anyone hitting this, but it would likely be a race and not a bug if they did. Signed-off-by: Alex Williamson --- drivers/vfio/vfio.c |8 +++- 1 file changed, 3 insertions(+), 5

[PATCH 0/3] vfio: fixup notifiers and avoid possible deadlock

2013-06-11 Thread Alex Williamson
Cleanup a couple of the notifier paths to remove bogus WARN_ON calls. One is pretty easy to hit and neither really signifies a problems. Fix remove path to avoid potential deadlock with other device_lock holders. Thanks, Alex --- Alex Williamson (3): vfio: Don't overreact to DEL_D

Re: [PATCH] pci: Enable overrides for missing ACS capabilities

2013-06-14 Thread Alex Williamson
Bump. Comments? On Thu, 2013-05-30 at 12:40 -0600, Alex Williamson wrote: > PCIe ACS (Access Control Services) is the PCIe 2.0+ feature that > allows us to control whether transactions are allowed to be redirected > in various subnodes of a PCIe topology. For instance, if two > e

[PATCH] intel-iommu: Fix leaks in pagetable freeing

2013-06-15 Thread Alex Williamson
s the pagetable freeing function to use a recursive algorithm and manages to not only free all the pagetables, but does it without any apparent performance loss versus the current broken version. Signed-off-by: Alex Williamson Cc: sta...@vger.kernel.org --- Suggesting for stable, would like t

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-06-16 Thread Alex Williamson
On Mon, 2013-06-17 at 08:39 +1000, Benjamin Herrenschmidt wrote: > On Wed, 2013-06-05 at 16:11 +1000, Alexey Kardashevskiy wrote: > > +long kvm_vm_ioctl_create_spapr_tce_iommu(struct kvm *kvm, > > + struct kvm_create_spapr_tce_iommu *args) > > +{ > > + struct kvmppc_spapr_tce_ta

Re: access PCI card trouble from VM guest

2013-06-17 Thread Alex Williamson
On Mon, 2013-06-17 at 12:00 +0200, David Cure wrote: > Hello, > > I want to access this PCI card from one VM : > > 10:00.0 Serial controller: Moxa Technologies Co Ltd CP-132EL (2-port > RS-422/485 Smart PCI Express Serial Board) > > This card is not handle by driver on

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-06-17 Thread Alex Williamson
On Mon, 2013-06-17 at 13:56 +1000, Benjamin Herrenschmidt wrote: > On Sun, 2013-06-16 at 21:13 -0600, Alex Williamson wrote: > > > IOMMU groups themselves don't provide security, they're accessed by > > interfaces like VFIO, which provide the security. Given a brief l

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-06-18 Thread Alex Williamson
On Tue, 2013-06-18 at 14:38 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2013-06-17 at 20:32 -0600, Alex Williamson wrote: > > > Right, we don't want to create dependencies across modules. I don't > > have a vision for how this should work. This is effectively a co

Re: [PATCH] pci: Enable overrides for missing ACS capabilities

2013-06-18 Thread Alex Williamson
On Tue, 2013-06-18 at 11:28 -0600, Bjorn Helgaas wrote: > On Thu, May 30, 2013 at 12:40:19PM -0600, Alex Williamson wrote: > > PCIe ACS (Access Control Services) is the PCIe 2.0+ feature that > > allows us to control whether transactions are allowed to be redirected > > in

Re: [PATCH] pci: Enable overrides for missing ACS capabilities

2013-06-18 Thread Alex Williamson
On Tue, 2013-06-18 at 15:31 -0600, Bjorn Helgaas wrote: > On Tue, Jun 18, 2013 at 12:20 PM, Alex Williamson > wrote: > > On Tue, 2013-06-18 at 11:28 -0600, Bjorn Helgaas wrote: > >> On Thu, May 30, 2013 at 12:40:19PM -0600, Alex Williamson wrote: > >> > PCIe ACS

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-06-19 Thread Alex Williamson
On Thu, 2013-06-20 at 00:50 +1000, Benjamin Herrenschmidt wrote: > On Wed, 2013-06-19 at 11:58 +0200, Alexander Graf wrote: > > > > Alex, any objection ? > > > > Which Alex? :) > > Heh, mostly Williamson in this specific case but your input is still > welcome :-) > > > I think validate works, i

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-06-20 Thread Alex Williamson
On Thu, 2013-06-20 at 18:48 +1000, Alexey Kardashevskiy wrote: > On 06/20/2013 05:47 PM, Benjamin Herrenschmidt wrote: > > On Thu, 2013-06-20 at 15:28 +1000, David Gibson wrote: > >>> Just out of curiosity - would not get_file() and fput_atomic() on a > >> group's > >>> file* do the right job inste

Re: [PATCH] vfio: fix documentation

2013-06-21 Thread Alex Williamson
On Fri, 2013-06-21 at 12:51 +1000, Alexey Kardashevskiy wrote: > Signed-off-by: Alexey Kardashevskiy > --- > Documentation/vfio.txt |6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/Documentation/vfio.txt b/Documentation/vfio.txt > index c55533c..d7993dc 100644 >

[PATCH] vfio/type1: Fix missed frees and zero sized removes

2013-06-21 Thread Alex Williamson
return to userspace to handle this. This patch fixes a few places where we don't properly handle those cases, moves a memory allocation to a place where failure is an option and checks our loops to make sure we don't get into an infinite loop trying to remove an overlap. Signed-of

[PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
he group. But then it won't allow more to be opened. There's not much reason to have the group opened multiple times since most access is through devices or the container, so complete what the original code intended and only allow a single instance. Signed-off-by: Alex Williamson --- d

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
p, but that doesn't give you any guarantee that the group is protected by the IOMMU. Thanks, Alex > int vfio_group_iommu_id_from_file(struct file *filep) > ... > > > > On 06/22/2013 07:12 AM, Alex Williamson wrote: > > vfio_group_fops_open attempts to limit concurr

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
On Sat, 2013-06-22 at 12:44 +1000, Alexey Kardashevskiy wrote: > On 06/22/2013 11:26 AM, Alex Williamson wrote: > > On Sat, 2013-06-22 at 11:16 +1000, Alexey Kardashevskiy wrote: > >> Cool, thanks! > >> > >> So we will need only this (to be called from KV

Re: [PATCH] vfio: Limit group opens

2013-06-21 Thread Alex Williamson
On Sat, 2013-06-22 at 13:16 +1000, Alexey Kardashevskiy wrote: > On 06/22/2013 12:57 PM, Alex Williamson wrote: > > On Sat, 2013-06-22 at 12:44 +1000, Alexey Kardashevskiy wrote: > >> On 06/22/2013 11:26 AM, Alex Williamson wrote: > >>> On Sat, 2013-06-22 at 11:16 +10

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-06-22 Thread Alex Williamson
On Sat, 2013-06-22 at 22:03 +1000, David Gibson wrote: > On Thu, Jun 20, 2013 at 08:55:13AM -0600, Alex Williamson wrote: > > On Thu, 2013-06-20 at 18:48 +1000, Alexey Kardashevskiy wrote: > > > On 06/20/2013 05:47 PM, Benjamin Herrenschmidt wrote: > > > > On Thu, 20

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-06-23 Thread Alex Williamson
On Mon, 2013-06-24 at 13:52 +1000, David Gibson wrote: > On Sat, Jun 22, 2013 at 08:28:06AM -0600, Alex Williamson wrote: > > On Sat, 2013-06-22 at 22:03 +1000, David Gibson wrote: > > > On Thu, Jun 20, 2013 at 08:55:13AM -0600, Alex Williamson wrote: > > > > On

Re: [PATCH RFC] pci: ACS quirk for AMD southbridge

2013-06-26 Thread Alex Williamson
On Wed, 2013-06-26 at 17:14 +0200, Andreas Hartmann wrote: > Bjorn Helgaas wrote: > > [fix Joerg's email address] > > > > On Tue, Jun 25, 2013 at 10:15 PM, Bjorn Helgaas wrote: > >> On Wed, Jul 11, 2012 at 11:18 PM, Alex Williamson > >> wrote: >

Re: [PATCH RFC] pci: ACS quirk for AMD southbridge

2013-06-26 Thread Alex Williamson
On Wed, 2013-06-26 at 18:24 +0200, Andreas Hartmann wrote: > Alex Williamson wrote: > > On Wed, 2013-06-26 at 17:14 +0200, Andreas Hartmann wrote: > >> Bjorn Helgaas wrote: > >>> [fix Joerg's email address] > >>> > >>> On Tue, Jun 25, 2

<    5   6   7   8   9   10   11   12   13   14   >