Re: [PATCH v2] vfio: add external user support

2013-06-27 Thread Alex Williamson
On Fri, 2013-06-28 at 08:57 +1000, Alexey Kardashevskiy wrote: > On 06/28/2013 01:44 AM, Alex Williamson wrote: > > On Thu, 2013-06-27 at 17:14 +1000, Alexey Kardashevskiy wrote: > >> VFIO is designed to be used via ioctls on file descriptors > >> returned by VFIO

Re: [PATCH v2] vfio: add external user support

2013-06-27 Thread Alex Williamson
On Fri, 2013-06-28 at 11:38 +1000, Alexey Kardashevskiy wrote: > On 06/28/2013 10:41 AM, Alex Williamson wrote: > > On Fri, 2013-06-28 at 08:57 +1000, Alexey Kardashevskiy wrote: > >> On 06/28/2013 01:44 AM, Alex Williamson wrote: > >>> On Thu, 2013-06-27 at 17:14 +10

Re: [ 102/127] iommu/amd: Workaround for ERBT1312

2013-06-28 Thread Alex Williamson
On Fri, 2013-06-28 at 18:11 +0200, Andreas Hartmann wrote: > Hello Joerg, hello Alex, > > the subsequent patch and the patch "iommu/amd: Re-enable IOMMU event log > interrupt after handling." 925fe08bce38d1ff052fe2209b9e2b8d5fbb7f98 > spread /var/log/messages with the following line (> 700 lines/s

Re: [PATCH 3/3 v17] iommu/fsl: Freescale PAMU driver and iommu implementation.

2013-06-28 Thread Alex Williamson
On Fri, 2013-06-28 at 13:08 +0530, Varun Sethi wrote: > Following is a brief description of the PAMU hardware: > PAMU determines what action to take and whether to authorize the action on > the basis of the memory address, a Logical IO Device Number (LIODN), and > PAACT table (logically) indexed by

Re: [ 102/127] iommu/amd: Workaround for ERBT1312

2013-06-28 Thread Alex Williamson
On Fri, 2013-06-28 at 20:29 +0200, Joerg Roedel wrote: > Hi Alex, > > On Fri, Jun 28, 2013 at 11:49:04AM -0600, Alex Williamson wrote: > > That's interesting, I PXE boot my system from one NIC then use a > > different NIC for the iSCSI root. The PXE boot NIC now scream

Re: [ 102/127] iommu/amd: Workaround for ERBT1312

2013-06-28 Thread Alex Williamson
On Fri, 2013-06-28 at 21:23 +0200, Joerg Roedel wrote: > Alex, Andreas, > > On Fri, Jun 28, 2013 at 08:42:05PM +0200, Andreas Hartmann wrote: > > You're right, there is exactly one entry directly after loading of vfio. > > I can see this message, too, with linux 3.4.43. > > Can you please test th

Re: [PATCH] iommu: add a function to find an iommu group by id

2013-03-22 Thread Alex Williamson
On Fri, 2013-03-22 at 17:49 +1100, Alexey Kardashevskiy wrote: > As IOMMU groups are exposed to the user space by their numbers, > the user space can use them in various kernel APIs so the kernel > might need an API to find a group by its ID. > > As an example, QEMU VFIO on PPC64 platform needs it

Re: [PATCH] pciehp: Add pciehp_surprise module option

2013-03-22 Thread Alex Williamson
On Fri, 2013-03-22 at 17:15 +0100, Michal Marek wrote: > On 20.3.2013 20:08, Takashi Iwai wrote: > > At Wed, 20 Mar 2013 12:09:13 -0600, > > Alex Williamson wrote: > >> > >> On Wed, 2013-03-20 at 15:02 +0100, Takashi Iwai wrote: > >>> We encountered a

Re: [PATCH] iommu: add a function to find an iommu group by id

2013-03-25 Thread Alex Williamson
ast one, where's the changelog for v3? > v2: fixed reference counting. > > Signed-off-by: Alexey Kardashevskiy > --- Acked-by: Alex Williamson > drivers/iommu/iommu.c | 29 + > include/linux/iommu.h |1 + > 2 files changed, 30 inserti

[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(+

[PATCH] pci: Add probe functions for bus and slot reset

2013-08-14 Thread Alex Williamson
Users of pci_reset_bus() and pci_reset_slot() need a way to probe whether the bus or slot supports reset. Add trivial helper functions and export them as vfio-pci will make use of these. Signed-off-by: Alex Williamson --- This is logically patch 10/9 for v5 pci: bus and slot reset interfaces

[PATCH] vfio-pci: PCI hot reset interface

2013-08-14 Thread Alex Williamson
ach group must have IOMMU protection established for the ioctl to succeed. Signed-off-by: Alex Williamson --- This patch is dependent on v5 "pci: bus and slot reset interfaces" as well as "pci: Add probe functions for bus and slot reset". drivers/vfi

Re: [PATCH v5 6/9] pci: Add slot and bus reset interfaces

2013-08-14 Thread Alex Williamson
On Wed, 2013-08-14 at 15:24 -0600, Bjorn Helgaas wrote: > On Thu, Aug 8, 2013 at 2:09 PM, Alex Williamson > wrote: > > Sometimes pci_reset_function is not sufficient. We have cases where > > devices do not support any kind of reset, but there might be multiple > > functio

Re: [PATCH] pci: Add probe functions for bus and slot reset

2013-08-14 Thread Alex Williamson
On Wed, 2013-08-14 at 14:24 -0600, Bjorn Helgaas wrote: > On Wed, Aug 14, 2013 at 2:06 PM, Alex Williamson > wrote: > > Users of pci_reset_bus() and pci_reset_slot() need a way to probe > > whether the bus or slot supports reset. Add trivial helper functions > > and expo

Re: [PATCH] vfio-pci: PCI hot reset interface

2013-08-14 Thread Alex Williamson
On Wed, 2013-08-14 at 16:42 -0600, Bjorn Helgaas wrote: > [+cc Al, linux-fsdevel for fdget/fdput usage] > > On Wed, Aug 14, 2013 at 2:10 PM, Alex Williamson > wrote: > > The current VFIO_DEVICE_RESET interface only maps to PCI use cases > > where we can isolate the res

[PATCH 0/2] vgaarb: Fixes for partial VGA opt-out

2013-08-15 Thread Alex Williamson
eries attempts to fix both of those. Thanks, Alex --- Alex Williamson (2): vgaarb: Don't disable resources that are not owned vgaarb: Fix VGA decodes changes drivers/gpu/vga/vgaarb.c | 50 -- 1 file changed, 22 insertions(+), 28

[PATCH 1/2] vgaarb: Don't disable resources that are not owned

2013-08-15 Thread Alex Williamson
ld be disabled since VGA memory does not require arbitration on this device. Signed-off-by: Alex Williamson Cc: Dave Airlie --- drivers/gpu/vga/vgaarb.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index e8

[PATCH 2/2] vgaarb: Fix VGA decodes changes

2013-08-15 Thread Alex Williamson
phics without actually disabling legacy VGA IO from the IGD. As a bonus, we bumped up the count of VGA arbitration participants for no good reason. Signed-off-by: Alex Williamson Cc: Dave Airlie --- drivers/gpu/vga/vgaarb.c | 40 +--- 1 file change

[PATCH] i915: Update VGA arbiter support for newer devices

2013-08-15 Thread Alex Williamson
t we don't participate in VGA memory arbitration. We also add a hook on unload to re-enable memory and reinstate VGA memory arbitration. Signed-off-by: Alex Williamson --- This patch depends on series "vgaarb: Fixes for partial VGA opt-out". Is HAS_PCH_SPLIT() the right test t

Re: [PATCH] i915: Update VGA arbiter support for newer devices

2013-08-15 Thread Alex Williamson
On Fri, 2013-08-16 at 08:49 +1000, Dave Airlie wrote: > On Fri, Aug 16, 2013 at 8:43 AM, Alex Williamson > wrote: > > This is intended to add VGA arbiter support for Intel HD graphics on > > Core processors. The old GMCH registers no longer exist, so even > > tho

Re: [PATCH] i915: Update VGA arbiter support for newer devices

2013-08-16 Thread Alex Williamson
On Fri, 2013-08-16 at 13:20 +0300, Ville Syrjälä wrote: > On Thu, Aug 15, 2013 at 04:54:15PM -0600, Alex Williamson wrote: > > On Fri, 2013-08-16 at 08:49 +1000, Dave Airlie wrote: > > > On Fri, Aug 16, 2013 at 8:43 AM, Alex Williamson > > > wrote: > > > &

Re: [PATCH] vfio-pci: PCI hot reset interface

2013-08-19 Thread Alex Williamson
On Wed, 2013-08-14 at 17:06 -0600, Alex Williamson wrote: > On Wed, 2013-08-14 at 16:42 -0600, Bjorn Helgaas wrote: > > [+cc Al, linux-fsdevel for fdget/fdput usage] > > > > On Wed, Aug 14, 2013 at 2:10 PM, Alex Williamson > > wrote: > > > The current VFIO_DEV

[PATCH v2] vfio-pci: PCI hot reset interface

2013-08-19 Thread Alex Williamson
ach group must have IOMMU protection established for the ioctl to succeed. Signed-off-by: Alex Williamson --- v2: Use PCI bus iterators. Depends on pci_walk_slot() patch drivers/vfio/pci/vfio_pci.c | 279 +++ include/uapi/linux/vfio.h | 38 ++ 2 fi

[PATCH] pci: Add pci_walk_slot() interface

2013-08-19 Thread Alex Williamson
We have a pci_walk_bus() interface, but it's exceptionally cumbersome for the callback function to figure out if the device is relevant if the caller is trying to walk all the devices in or below a slot. Add a variant to walk only slot devices. Signed-off-by: Alex Williamson --- This allo

Re: [PATCH] vfio-pci: PCI hot reset interface

2013-08-19 Thread Alex Williamson
On Mon, 2013-08-19 at 14:02 -0600, Bjorn Helgaas wrote: > On Mon, Aug 19, 2013 at 12:41 PM, Alex Williamson > wrote: > > On Wed, 2013-08-14 at 17:06 -0600, Alex Williamson wrote: > >> On Wed, 2013-08-14 at 16:42 -0600, Bjorn Helgaas wrote: > >> > On Wed, Aug 14,

Re: [PATCH] vfio-pci: PCI hot reset interface

2013-08-19 Thread Alex Williamson
On Tue, 2013-08-20 at 08:42 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2013-08-19 at 14:02 -0600, Bjorn Helgaas wrote: > > I guess. And supply the pci_slot rather than the pci_dev? I'm a > > little bit worried because the idea of a "slot" is not well-defined in > > the spec, and we have sort

Re: [PATCH] vfio-pci: PCI hot reset interface

2013-08-19 Thread Alex Williamson
On Tue, 2013-08-20 at 08:44 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2013-08-19 at 14:20 -0600, Alex Williamson wrote: > > I try to handle the slot as opaque, only caring that the slot pointer > > matches, so I think our implementation is ok... so long as we only get > >

Re: [PATCH] vfio-pci: PCI hot reset interface

2013-08-19 Thread Alex Williamson
On Tue, 2013-08-20 at 04:18 +0100, Al Viro wrote: > On Wed, Aug 14, 2013 at 04:42:14PM -0600, Bjorn Helgaas wrote: > > [+cc Al, linux-fsdevel for fdget/fdput usage] > > fdget/fdput use looks sane, the only thing is that I would rather > have an explicit include of linux/file.h instead of relying u

ahci_host_activate NULL pointer (was Re: Linux 3.11-rc1)

2013-07-15 Thread Alex Williamson
On Sun, 2013-07-14 at 16:57 -0700, Linus Torvalds wrote: > It's been two weeks, and the merge window has closed. If I missed > anything, holler, but I don't have anything pending that I am aware > of. > > This merge window was smaller in terms of number of commits than the > 3.10 merge window, but

Re: ahci_host_activate NULL pointer (was Re: Linux 3.11-rc1)

2013-07-15 Thread Alex Williamson
On Mon, 2013-07-15 at 10:49 -0600, Alex Williamson wrote: > On Sun, 2013-07-14 at 16:57 -0700, Linus Torvalds wrote: > > It's been two weeks, and the merge window has closed. If I missed > > anything, holler, but I don't have anything pending that I am aware > > of.

Re: ahci_host_activate NULL pointer (was Re: Linux 3.11-rc1)

2013-07-15 Thread Alex Williamson
On Mon, 2013-07-15 at 14:46 -0400, Xiaotian Feng wrote: > On Tue, Jul 16, 2013 at 1:38 AM, Alex Williamson > wrote: > > > On Mon, 2013-07-15 at 10:49 -0600, Alex Williamson wrote: > > > On Sun, 2013-07-14 at 16:57 -0700, Linus Torvalds wrote: > > > > It's

Re: ahci_host_activate NULL pointer (was Re: Linux 3.11-rc1)

2013-07-15 Thread Alex Williamson
On Mon, 2013-07-15 at 13:23 -0600, Alex Williamson wrote: > On Mon, 2013-07-15 at 14:46 -0400, Xiaotian Feng wrote: > > On Tue, Jul 16, 2013 at 1:38 AM, Alex Williamson > > wrote: > > > > > On Mon, 2013-07-15 at 10:49 -0600, Alex Williamson wrote: > > > >

Re: [Qemu-devel] [PATCH] QEMU-AER: Qemu changes to support AER for VFIO-PCI devices

2013-07-15 Thread Alex Williamson
On Sun, 2013-07-14 at 01:48 -0600, Vijay Mohan Pandarathil wrote: > Add support for error containment when a VFIO device assigned to a KVM > guest encounters an error. This is for PCIe devices/drivers that support AER > functionality. When the host OS is notified of an error in a device either > th

Re: ahci_host_activate NULL pointer (was Re: Linux 3.11-rc1)

2013-07-15 Thread Alex Williamson
On Mon, 2013-07-15 at 21:02 -0400, Xiaotian Feng wrote: > On Mon, Jul 15, 2013 at 3:44 PM, Alex Williamson > wrote: > > On Mon, 2013-07-15 at 13:23 -0600, Alex Williamson wrote: > >> On Mon, 2013-07-15 at 14:46 -0400, Xiaotian Feng wrote: > >> > On Tue, Jul 16,

[GIT PULL] VFIO fixes for v3.11-rc4

2013-07-30 Thread Alex Williamson
. Alex Williamson (3): vfio: Don't overreact to DEL_DEVICE vfio: Ignore sprurious notifies vfio-pci: Avoid deadlock on remove drivers/vfio/pci/vfio_pci.c | 23 +-- drivers/vfio/vfio.c

Re: Linux Plumbers ACPI/PM, PCI Microconference

2013-07-30 Thread Alex Williamson
On Wed, 2013-07-31 at 00:02 +, Shuah Khan wrote: > On 07/30/2013 05:38 PM, Rafael J. Wysocki wrote: > > On Wednesday, July 17, 2013 08:31:55 AM Shuah Khan wrote: > >> Myron, > >> > >> On Tue, Jul 16, 2013 at 8:21 PM, Myron Stowe wrote: > >> > >>> > >>> Shuah - You brought up the idea about "Co

Re: [PATCH v2] PCI: Reset PCIe devices to stop ongoing DMA

2013-07-30 Thread Alex Williamson
On Wed, 2013-07-31 at 09:35 +0900, Takao Indoh wrote: > (2013/07/31 0:59), Bjorn Helgaas wrote: > > On Tue, Jul 30, 2013 at 12:09 AM, Takao Indoh > > wrote: > >> (2013/07/29 23:17), Bjorn Helgaas wrote: > >>> On Sun, Jul 28, 2013 at 6:37 PM, Takao Indoh > >>> wrote: > (2013/07/26 2:00), Bjo

Re: [PATCH v2] PCI: Reset PCIe devices to stop ongoing DMA

2013-08-01 Thread Alex Williamson
On Thu, 2013-08-01 at 15:34 +0900, Takao Indoh wrote: > (2013/08/01 6:23), Rafael J. Wysocki wrote: > > On Wednesday, July 31, 2013 03:08:03 PM Bjorn Helgaas wrote: > >> [+cc Rafael, linux-acpi] > >> > >> On Tue, Jul 30, 2013 at 6:35 PM, Takao Indoh > >> wrote: > >> > >>> On x86, currently IOMMU

[PATCH v3 0/9] pci: bus and slot reset interfaces

2013-08-01 Thread Alex Williamson
bus reset can trigger a presence detection change, which results in an attempt to remove the struct device. By having a slot reset interface, we can involve the hotplug controllers to allow for a controlled bus reset and avoid this spurious removal attempt. --- Alex Williamson

[PATCH v3 6/9] pci: Add slot and bus reset interfaces

2013-08-01 Thread Alex Williamson
eset and therefore should be under control of the caller. PCI state of all the affected devices is saved and restored around these resets, but internal state of all of the affected devices is reset (which should be the intention). Signed-off-by: Alex Williamson --- drivers/

[PATCH v3 1/9] pci: Create pci_reset_bridge_secondary_bus()

2013-08-01 Thread Alex Williamson
Move the secondary bus reset code from pci_parent_bus_reset() into its own function. Export it as we'll later be calling it from hotplug controllers and elsewhere. Signed-off-by: Alex Williamson --- drivers/pci/pci.c | 32 +++- include/linux/pci.h |1

[PATCH v3 4/9] pci: Add slot reset option to pci_dev_reset

2013-08-01 Thread Alex Williamson
If the hotplug controller provides a way to reset a slot, use that before a direct parent bus reset. Like the bus reset option, this is only available when a single pci_dev occupies the slot. Signed-off-by: Alex Williamson --- drivers/pci/pci.c | 34 ++ 1 file

[PATCH v3 9/9] pci: Remove aer_do_secondary_bus_reset()

2013-08-01 Thread Alex Williamson
One PCI bus reset function to rule them all. Signed-off-by: Alex Williamson --- drivers/pci/pcie/aer/aerdrv.c |2 +- drivers/pci/pcie/aer/aerdrv.h |1 - drivers/pci/pcie/aer/aerdrv_core.c | 35 +-- 3 files changed, 2 insertions(+), 36

[PATCH v3 7/9] pci: Wake-up devices before save for reset

2013-08-01 Thread Alex Williamson
to D3, then the actual state of the device and dev->current_state are contradictory. Put everything in D0 going into the reset, then we don't need to do anything special on the way out. Signed-off-by: Alex Williamson --- drivers/pci/pci.c |7 +++ 1 file changed, 7 insertions(+)

[PATCH v3 3/9] pci: Implement reset_slot for pciehp

2013-08-01 Thread Alex Williamson
being polled around the bus reset. Signed-off-by: Alex Williamson --- drivers/pci/hotplug/pciehp.h |1 + drivers/pci/hotplug/pciehp_core.c | 12 drivers/pci/hotplug/pciehp_hpc.c | 31 +++ 3 files changed, 44 insertions(+) diff --git a/drivers

[PATCH v3 8/9] pci: Tune secondary bus reset timing

2013-08-01 Thread Alex Williamson
come to 1s. PCIe "softens" this requirement with the Configuration Request Retry Status (CRS) completion status. Theoretically we could use CRS to shorten the wait time. We don't make use of that here, using a fixed 1s delay to allow devices to re-initialize. Signed-off-by: Alex Wil

[PATCH v3 5/9] pci: Split out pci_dev lock/unlock and save/restore

2013-08-01 Thread Alex Williamson
Only cosmetic changes to existing paths. Signed-off-by: Alex Williamson --- drivers/pci/pci.c | 52 +++- 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index db90692..f6c757a 100644 --- a

[PATCH v3 2/9] pci: Add hotplug_slot_ops.reset_slot()

2013-08-01 Thread Alex Williamson
This optional callback allows htoplug controllers to perform slot specific resets. These may be necessary in cases where a normal secondary bus reset can interact with controller logic and expose spurious hotplugs. Signed-off-by: Alex Williamson --- include/linux/pci_hotplug.h |4 1

Re: [PATCH v3 5/9] pci: Split out pci_dev lock/unlock and save/restore

2013-08-01 Thread Alex Williamson
On Thu, 2013-08-01 at 16:59 -0400, Don Dutile wrote: > On 08/01/2013 12:55 PM, Alex Williamson wrote: > > Only cosmetic changes to existing paths. > > > > Signed-off-by: Alex Williamson > > --- > > drivers/pci/pci.c | 52 > > ++

Re: [PATCH v3 6/9] pci: Add slot and bus reset interfaces

2013-08-01 Thread Alex Williamson
On Thu, 2013-08-01 at 17:22 -0400, Don Dutile wrote: > On 08/01/2013 12:55 PM, Alex Williamson wrote: > > Sometimes pci_reset_function is not sufficient. We have cases where > > devices do not support any kind of reset, but there might be multiple > > functions

Re: [PATCH v3 8/9] pci: Tune secondary bus reset timing

2013-08-01 Thread Alex Williamson
On Thu, 2013-08-01 at 17:29 -0400, Don Dutile wrote: > On 08/01/2013 12:55 PM, Alex Williamson wrote: > > The PCI spec indicates that with stable power, reset needs to be > > asserted for a minimum of 1ms (Trst). Seems like we should be able > > to assume power is stable fo

RFC: vfio-pci API for PCI bus/slot (hot) resets

2013-08-01 Thread Alex Williamson
vfio-pci needs to support an interface to do hot resets (PCI parent bridge secondary bus reset). We need this to support reset of co-assigned devices where one or more of the devices does not support function level reset. In particular, discrete graphics cards typically have no reset options oth

Re: RFC: vfio-pci API for PCI bus/slot (hot) resets

2013-08-02 Thread Alex Williamson
On Fri, 2013-08-02 at 15:10 +1000, Benjamin Herrenschmidt wrote: > On Thu, 2013-08-01 at 16:18 -0600, Alex Williamson wrote: > > vfio-pci needs to support an interface to do hot resets (PCI parent > > bridge secondary bus reset). We need this to support reset of > > co-assig

Re: RFC: vfio-pci API for PCI bus/slot (hot) resets

2013-08-02 Thread Alex Williamson
On Sat, 2013-08-03 at 09:15 +1000, Benjamin Herrenschmidt wrote: > On Fri, 2013-08-02 at 16:49 -0600, Bjorn Helgaas wrote: > > [+cc linux-pci] > > > > On Fri, Aug 2, 2013 at 3:28 PM, Benjamin Herrenschmidt > > wrote: > > > > > Right. Another use case is, I know of devices that need a fundamental

Re: [PATCH 03/10] vfio: add external user support

2013-08-05 Thread Alex Williamson
On Tue, 2013-07-23 at 19:07 +1000, Alexey Kardashevskiy wrote: > On 07/23/2013 12:23 PM, Alex Williamson wrote: > > On Tue, 2013-07-16 at 10:53 +1000, Alexey Kardashevskiy wrote: > >> VFIO is designed to be used via ioctls on file descriptors > >> returned by VFIO

[PATCH v3] vfio-pci: PCI hot reset interface

2013-08-20 Thread Alex Williamson
ach group must have IOMMU protection established for the ioctl to succeed. Signed-off-by: Alex Williamson --- v2: Use PCI bus iterators. Depends on pci_walk_slot() patch v3: #include per Al Viro drivers/vfio/pci/vfio_pci.c | 280 +++ include/uapi/linux/vfi

[PATCH] vfio-pci: Use fdget() rather than eventfd_fget()

2013-08-20 Thread Alex Williamson
used, but fdget() makes use of fget_light() for another slight optimization. Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci_intrs.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfi

[PATCH v2] vfio-pci: Use fdget() rather than eventfd_fget()

2013-08-21 Thread Alex Williamson
used, but fdget() makes use of fget_light() for another slight optimization. Signed-off-by: Alex Williamson --- v2: Use direct gotos in error path per Al Viro's comment drivers/vfio/pci/vfio_pci_intrs.c | 35 --- 1 file changed, 16 insertions(+), 19

Re: [PATCH 2/2] powerpc/iommu: check dev->iommu_group before remove a device from iommu_group

2013-08-22 Thread Alex Williamson
On Thu, 2013-08-22 at 15:52 +0800, Wei Yang wrote: > On Thu, Aug 22, 2013 at 05:23:34PM +1000, Alexey Kardashevskiy wrote: > >On 08/19/2013 11:55 AM, Wei Yang wrote: > >> On Mon, Aug 19, 2013 at 11:39:49AM +1000, Alexey Kardashevskiy wrote: > >>> On 08/19/2013 11:29 AM, Wei Yang wrote: > On Fr

Re: [PATCH v2 05/10] vfio: use get_unused_fd_flags(0) instead of get_unused_fd()

2013-08-22 Thread Alex Williamson
On Thu, 2013-08-15 at 15:10 +0200, Yann Droneaud wrote: > Macro get_unused_fd() is used to allocate a file descriptor with > default flags. Those default flags (0) can be "unsafe": > O_CLOEXEC must be used by default to not leak file descriptor > across exec(). > > Instead of macro get_unused_fd()

Re: [PATCH 2/2] powerpc/iommu: check dev->iommu_group before remove a device from iommu_group

2013-08-22 Thread Alex Williamson
On Thu, 2013-08-22 at 23:41 +0800, Wei Yang wrote: > On Thu, Aug 22, 2013 at 09:28:23AM -0600, Alex Williamson wrote: > >On Thu, 2013-08-22 at 15:52 +0800, Wei Yang wrote: > >> On Thu, Aug 22, 2013 at 05:23:34PM +1000, Alexey Kardashevskiy wrote: > >> >On 08/19

[PATCH] vfio: Add O_CLOEXEC flag to vfio device fd

2013-08-22 Thread Alex Williamson
-by: Alex Williamson --- drivers/vfio/vfio.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 75c16cc..1eab4ac 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -1109,7 +1109,7 @@ static int vfio_group_get_device_fd

Re: [PATCH] pci: Add pci_walk_slot() interface

2013-08-22 Thread Alex Williamson
On Thu, 2013-08-22 at 15:34 -0600, Bjorn Helgaas wrote: > On Mon, Aug 19, 2013 at 2:04 PM, Alex Williamson > wrote: > > We have a pci_walk_bus() interface, but it's exceptionally cumbersome > > for the callback function to figure out if the device is relevant if > >

Re: [PATCH] iommu: WARN_ON when removing a device with no iommu_group associated

2013-08-22 Thread Alex Williamson
set to NULL, kernel will crash. > > This patch gives a warning and return when trying to remove a device from an > iommu_group with dev->iommu_group set to NULL. This helps to indicate some bad > behavior and also guard the kernel. > > Signed-off-by: Wei Yang Acked-by: Alex Williams

[PATCH v4] vfio-pci: PCI hot reset interface

2013-08-23 Thread Alex Williamson
ach group must have IOMMU protection established for the ioctl to succeed. Signed-off-by: Alex Williamson --- v2: Use PCI bus iterators. Depends on pci_walk_slot() patch v3: #include per Al Viro v4: Remove dependency on pci_walk_slot() per Bjorn drivers/vfio/pci/vfio_pci.c |

Re: [Intel-gfx] [PATCH] i915: Update VGA arbiter support for newer devices

2013-08-23 Thread Alex Williamson
On Fri, 2013-08-23 at 21:21 +0300, Ville Syrjälä wrote: > On Tue, Aug 20, 2013 at 10:46:45PM +0300, Ville Syrjälä wrote: > > On Fri, Aug 16, 2013 at 12:22:14PM -0600, Alex Williamson wrote: > > > On Fri, 2013-08-16 at 13:20 +0300, Ville Syrjälä wrote: > > > > On T

Re: [Intel-gfx] [PATCH] i915: Update VGA arbiter support for newer devices

2013-08-23 Thread Alex Williamson
On Fri, 2013-08-23 at 15:18 -0600, Alex Williamson wrote: > On Fri, 2013-08-23 at 21:21 +0300, Ville Syrjälä wrote: > > On Tue, Aug 20, 2013 at 10:46:45PM +0300, Ville Syrjälä wrote: > > > On Fri, Aug 16, 2013 at 12:22:14PM -0600, Alex Williamson wrote: > > > > On

[PATCH v2] i915: Update VGA arbiter support for newer devices

2013-08-24 Thread Alex Williamson
ow that we don't participate in VGA memory arbitration. We also add a hook on unload to re-enable memory and reinstate VGA memory arbitration. Signed-off-by: Alex Williamson --- v2: I915_READ/WRITE accessors don't work in i915_disable_vga, use inb/outb directly. Also, on the driver un

[PATCH v4 0/9] pci: bus and slot reset interfaces

2013-08-05 Thread Alex Williamson
e, which results in an attempt to remove the struct device. By having a slot reset interface, we can involve the hotplug controllers to allow for a controlled bus reset and avoid this spurious removal attempt. --- Alex Williamson (9): pci: Create pci_reset_bridge_secondary_bus()

[PATCH v4 8/9] pci: Tune secondary bus reset timing

2013-08-05 Thread Alex Williamson
come to 1s. PCIe "softens" this requirement with the Configuration Request Retry Status (CRS) completion status. Theoretically we could use CRS to shorten the wait time. We don't make use of that here, using a fixed 1s delay to allow devices to re-initialize. Signed-off-by: Alex Wil

[PATCH v4 4/9] pci: Add slot reset option to pci_dev_reset

2013-08-05 Thread Alex Williamson
If the hotplug controller provides a way to reset a slot, use that before a direct parent bus reset. Like the bus reset option, this is only available when a single pci_dev occupies the slot. Signed-off-by: Alex Williamson --- drivers/pci/pci.c | 34 ++ 1 file

[PATCH v4 6/9] pci: Add slot and bus reset interfaces

2013-08-05 Thread Alex Williamson
eset and therefore should be under control of the caller. PCI state of all the affected devices is saved and restored around these resets, but internal state of all of the affected devices is reset (which should be the intention). Signed-off-by: Alex Williamson --- drivers/

[PATCH v4 5/9] pci: Split out pci_dev lock/unlock and save/restore

2013-08-05 Thread Alex Williamson
Only cosmetic code changes to existing paths. Expand the comment in the new pci_dev_save_and_disable() function since there's a lot hidden in that Command register write. Signed-off-by: Alex Williamson --- drivers/pci/pci.c | 55 + 1

[PATCH v4 1/9] pci: Create pci_reset_bridge_secondary_bus()

2013-08-05 Thread Alex Williamson
Move the secondary bus reset code from pci_parent_bus_reset() into its own function. Export it as we'll later be calling it from hotplug controllers and elsewhere. Signed-off-by: Alex Williamson --- drivers/pci/pci.c | 32 +++- include/linux/pci.h |1

[PATCH v4 7/9] pci: Wake-up devices before save for reset

2013-08-05 Thread Alex Williamson
to D3, then the actual state of the device and dev->current_state are contradictory. Put everything in D0 going into the reset, then we don't need to do anything special on the way out. Signed-off-by: Alex Williamson --- drivers/pci/pci.c |7 +++ 1 file changed, 7 insertions(+)

[PATCH v4 9/9] pci: Remove aer_do_secondary_bus_reset()

2013-08-05 Thread Alex Williamson
One PCI bus reset function to rule them all. Signed-off-by: Alex Williamson --- drivers/pci/pcie/aer/aerdrv.c |2 +- drivers/pci/pcie/aer/aerdrv.h |1 - drivers/pci/pcie/aer/aerdrv_core.c | 35 +-- 3 files changed, 2 insertions(+), 36

[PATCH v4 2/9] pci: Add hotplug_slot_ops.reset_slot()

2013-08-05 Thread Alex Williamson
This optional callback allows htoplug controllers to perform slot specific resets. These may be necessary in cases where a normal secondary bus reset can interact with controller logic and expose spurious hotplugs. Signed-off-by: Alex Williamson --- include/linux/pci_hotplug.h |4 1

[PATCH v4 3/9] pci: Implement reset_slot for pciehp

2013-08-05 Thread Alex Williamson
being polled around the bus reset. Signed-off-by: Alex Williamson --- drivers/pci/hotplug/pciehp.h |1 + drivers/pci/hotplug/pciehp_core.c | 12 drivers/pci/hotplug/pciehp_hpc.c | 31 +++ 3 files changed, 44 insertions(+) diff --git a/drivers

Re: [PATCH v4 8/9] pci: Tune secondary bus reset timing

2013-08-06 Thread Alex Williamson
On Tue, 2013-08-06 at 16:27 -0700, Alexander Duyck wrote: > On 08/05/2013 12:37 PM, Alex Williamson wrote: > > The PCI spec indicates that with stable power, reset needs to be > > asserted for a minimum of 1ms (Trst). Seems like we should be able > > to assume power is

Re: [PATCH v4 8/9] pci: Tune secondary bus reset timing

2013-08-07 Thread Alex Williamson
On Wed, 2013-08-07 at 11:30 -0700, Alexander Duyck wrote: > On 08/06/2013 07:56 PM, Alex Williamson wrote: > > On Tue, 2013-08-06 at 16:27 -0700, Alexander Duyck wrote: > >> On 08/05/2013 12:37 PM, Alex Williamson wrote: > >>> The PCI spec indicates that with s

Re: [PATCH v4 8/9] pci: Tune secondary bus reset timing

2013-08-08 Thread Alex Williamson
On Thu, 2013-08-08 at 09:46 -0700, Alexander Duyck wrote: > On 08/07/2013 10:23 PM, Alex Williamson wrote: > > On Wed, 2013-08-07 at 11:30 -0700, Alexander Duyck wrote: > >> On 08/06/2013 07:56 PM, Alex Williamson wrote: > >>> On Tue, 2013-08-06 at 16:27 -0700, Alexa

[PATCH v5 0/9] pci: bus and slot reset interfaces

2013-08-08 Thread Alex Williamson
attempt. --- Alex Williamson (9): pci: Create pci_reset_bridge_secondary_bus() pci: Add hotplug_slot_ops.reset_slot() pci: Implement reset_slot for pciehp pci: Add slot reset option to pci_dev_reset pci: Split out pci_dev lock/unlock and save/restore pci: Add slot and b

[PATCH v5 1/9] pci: Create pci_reset_bridge_secondary_bus()

2013-08-08 Thread Alex Williamson
Move the secondary bus reset code from pci_parent_bus_reset() into its own function. Export it as we'll later be calling it from hotplug controllers and elsewhere. Signed-off-by: Alex Williamson --- drivers/pci/pci.c | 32 +++- include/linux/pci.h |1

[PATCH v5 5/9] pci: Split out pci_dev lock/unlock and save/restore

2013-08-08 Thread Alex Williamson
Only cosmetic code changes to existing paths. Expand the comment in the new pci_dev_save_and_disable() function since there's a lot hidden in that Command register write. Signed-off-by: Alex Williamson --- drivers/pci/pci.c | 55 + 1

[PATCH v5 6/9] pci: Add slot and bus reset interfaces

2013-08-08 Thread Alex Williamson
eset and therefore should be under control of the caller. PCI state of all the affected devices is saved and restored around these resets, but internal state of all of the affected devices is reset (which should be the intention). Signed-off-by: Alex Williamson --- drivers/

[PATCH v5 4/9] pci: Add slot reset option to pci_dev_reset

2013-08-08 Thread Alex Williamson
If the hotplug controller provides a way to reset a slot, use that before a direct parent bus reset. Like the bus reset option, this is only available when a single pci_dev occupies the slot. Signed-off-by: Alex Williamson --- drivers/pci/pci.c | 34 ++ 1 file

[PATCH v5 8/9] pci: Tune secondary bus reset timing

2013-08-08 Thread Alex Williamson
st Retry Status (CRS) completion status. Theoretically we could use CRS to shorten the wait time. We don't make use of that here, using a fixed 1s delay to allow devices to re-initialize. Signed-off-by: Alex Williamson --- drivers/pci/pci.c | 16 ++-- 1 file changed, 14 i

[PATCH v5 2/9] pci: Add hotplug_slot_ops.reset_slot()

2013-08-08 Thread Alex Williamson
This optional callback allows htoplug controllers to perform slot specific resets. These may be necessary in cases where a normal secondary bus reset can interact with controller logic and expose spurious hotplugs. Signed-off-by: Alex Williamson --- include/linux/pci_hotplug.h |4 1

[PATCH v5 3/9] pci: Implement reset_slot for pciehp

2013-08-08 Thread Alex Williamson
being polled around the bus reset. Signed-off-by: Alex Williamson --- drivers/pci/hotplug/pciehp.h |1 + drivers/pci/hotplug/pciehp_core.c | 12 drivers/pci/hotplug/pciehp_hpc.c | 31 +++ 3 files changed, 44 insertions(+) diff --git a/drivers

[PATCH v5 7/9] pci: Wake-up devices before save for reset

2013-08-08 Thread Alex Williamson
to D3, then the actual state of the device and dev->current_state are contradictory. Put everything in D0 going into the reset, then we don't need to do anything special on the way out. Signed-off-by: Alex Williamson --- drivers/pci/pci.c |7 +++ 1 file changed, 7 insertions(+)

[PATCH v5 9/9] pci: Remove aer_do_secondary_bus_reset()

2013-08-08 Thread Alex Williamson
One PCI bus reset function to rule them all. Signed-off-by: Alex Williamson --- drivers/pci/pcie/aer/aerdrv.c |2 +- drivers/pci/pcie/aer/aerdrv.h |1 - drivers/pci/pcie/aer/aerdrv_core.c | 35 +-- 3 files changed, 2 insertions(+), 36

Re: [PATCH 03/10] vfio: add external user support

2013-07-22 Thread Alex Williamson
On Tue, 2013-07-16 at 10:53 +1000, Alexey Kardashevskiy wrote: > VFIO is designed to be used via ioctls on file descriptors > returned by VFIO. > > However in some situations support for an external user is required. > The first user is KVM on PPC64 (SPAPR TCE protocol) which is going to > use the

Re: [PATCH v2 0/3] pci: ACS fixes & quirks

2013-07-23 Thread Alex Williamson
This series was ack'd by Don. I haven't heard reports of any problems. What more needs to be done here? Bjorn? Thanks, Alex On Mon, 2013-07-08 at 10:17 -0600, Alex Williamson wrote: > Ping. Comments? > > On Thu, 2013-06-27 at 16:39 -0600, Alex Williamson wrote: >

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

2013-07-24 Thread Alex Williamson
This is a pretty massive memory leak, anyone @Intel care? Thanks, Alex On Sat, 2013-06-15 at 10:27 -0600, Alex Williamson wrote: > At best the current code only seems to free the leaf pagetables and > the root. If you're unlucky enough to have a large gap (like any > QEMU guest

Re: [PATCH v6 1/3] VFIO: Wrapper for getting reference to vfio_device from device

2013-03-04 Thread Alex Williamson
On Sat, 2013-03-02 at 01:16 -0600, Vijay Mohan Pandarathil wrote: > - Added vfio_device_get_from_dev() as wrapper to get > reference to vfio_device from struct device. > > - Added vfio_device_data() as a wrapper to get device_data from > vfio_device. > > Signed-off

Re: [PATCH v6 2/3] VFIO-AER: Vfio-pci driver changes for supporting AER

2013-03-04 Thread Alex Williamson
On Sat, 2013-03-02 at 01:16 -0600, Vijay Mohan Pandarathil wrote: > - New VFIO_SET_IRQ ioctl option to pass the eventfd that is signaled > when > an error occurs in the vfio_pci_device > > - Register pci_error_handler for the vfio_pci driver > > - When the device enco

Re: Marvell 88NV9143 in mini-PCIe not working with intel_iommu=on

2013-03-05 Thread Alex Williamson
> ... > > Kernel driver in use: mvumi > > > > 02:00.2 Non-Volatile memory controller [0108]: Marvell Technology Group > > Ltd. Device [1b4b:91e3] (prog-if 01) > > Subsystem: Marvell Technology Group Ltd. Device [1b4b:9143] > >... > > I

Re: [PATCH] Quirk to support Marvell 88SE91xx SATA controllers with Intel IOMMU.

2013-03-05 Thread Alex Williamson
On Fri, 2013-03-01 at 16:26 +0800, Andrew Cooks wrote: > This is my third submitted patch to make Marvell 88SE91xx SATA controllers > work when IOMMU is enabled.[1][2] > > What's changed: > * Adopt David Woodhouse's terminology by referring to the quirky functions as > 'ghost' functions. > * Unm

<    1   2   3   4   5   6   7   8   9   10   >