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

2013-03-20 Thread David Gibson
dow (required by a POWERPC > > guest). > > > > The counterpart in QEMU is required to support this functionality. > > > > Changelog: > > * documentation updated > > * containter enable/disable ioctls added > > * request_module(spapr_iommu)

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

2013-03-24 Thread David Gibson
On Wed, Mar 20, 2013 at 09:16:24PM -0600, Alex Williamson wrote: > 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: > > >

Re: KVM: PPC: Book3S: Add API for in-kernel XICS emulation

2013-05-01 Thread David Gibson
urce. The attribute number is the same as the interrupt > source number. > > This does not support irq routing or irqfd yet. > > Signed-off-by: Paul Mackerras Acked-by: David Gibson -- David Gibson| I'll have my music baroque, and my code david AT

Re: [PATCH 2/6] KVM: PPC: Add support for multiple-TCE hcalls

2013-05-06 Thread David Gibson
t; > This also implements the KVM_CAP_PPC_MULTITCE capability, > so in order to support the functionality of this patch, QEMU > needs to query for this capability and set the "hcall-multi-tce" > hypertas property only if the capability is present, otherwise > there will be

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

2013-05-06 Thread David Gibson
poses. > > Tests show that this patch increases transmission speed from 220MB/s > to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card). > > Cc: David Gibson > Signed-off-by: Alexey Kardashevskiy > Signed-off-by: Paul Mackerras > --- > Documentation/

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

2013-05-06 Thread David Gibson
On Tue, May 07, 2013 at 03:51:31PM +1000, Alexey Kardashevskiy wrote: > On 05/07/2013 03:29 PM, David Gibson wrote: > > On Mon, May 06, 2013 at 05:25:56PM +1000, Alexey Kardashevskiy wrote: > >> This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT > >&g

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

2013-05-06 Thread David Gibson
On Tue, May 07, 2013 at 04:27:49PM +1000, Alexey Kardashevskiy wrote: > On 05/07/2013 04:02 PM, David Gibson wrote: > > On Tue, May 07, 2013 at 03:51:31PM +1000, Alexey Kardashevskiy wrote: > >> On 05/07/2013 03:29 PM, David Gibson wrote: > >>> On Mon, May 06, 20

Re: [PATCH 2/6] KVM: PPC: Add support for multiple-TCE hcalls

2013-05-09 Thread David Gibson
ook3s_64_vio.c > +++ b/arch/powerpc/kvm/book3s_64_vio.c > @@ -14,6 +14,7 @@ > * > * Copyright 2010 Paul Mackerras, IBM Corp. > * Copyright 2011 David Gibson, IBM Corporation > + * Copyright 2013 Alexey Kardashevskiy, IBM Corporation > */ > > #include &g

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-05 Thread David Gibson
5,6 +545,7 @@ static target_ulong h_cede(CPUPPCState *env, > sPAPREnvironmen > hreg_compute_hflags(env); > if (!cpu_has_work(env)) { > env->halted = 1; > +env->exit_request = 1; > } > return H_SUCCESS; > } > > Though I don'

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-06 Thread David Gibson
On Tue, Aug 07, 2012 at 06:57:57AM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2012-08-06 at 13:13 +1000, David Gibson wrote: > > So, I'm still trying to nut out the implications for H_CEDE, and think > > if there are any other hypercalls that might want to block the guest

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-07 Thread David Gibson
On Tue, Aug 07, 2012 at 11:46:35AM +0300, Avi Kivity wrote: > On 08/07/2012 04:32 AM, David Gibson wrote: > > On Tue, Aug 07, 2012 at 06:57:57AM +1000, Benjamin Herrenschmidt wrote: > >> On Mon, 2012-08-06 at 13:13 +1000, David Gibson wrote: > >> > So, I'm still

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-07 Thread David Gibson
On Tue, Aug 07, 2012 at 04:13:49PM +0300, Avi Kivity wrote: > On 08/07/2012 03:14 PM, David Gibson wrote: > > On Tue, Aug 07, 2012 at 11:46:35AM +0300, Avi Kivity wrote: > >> On 08/07/2012 04:32 AM, David Gibson wrote: > >> > On Tue, Aug 07, 2012 at 06:57:57AM +1000

Re: Reset problem vs. MMIO emulation, hypercalls, etc...

2012-08-08 Thread David Gibson
On Wed, Aug 08, 2012 at 11:58:58AM +0300, Avi Kivity wrote: > On 08/08/2012 03:49 AM, David Gibson wrote: > >> > We never have irqchip in kernel (because we haven't written that yet) > >> > but we still sleep in-kernel for CEDE. I haven't spotted any

Re: [PATCH 1/2] vfio powerpc: implemented IOMMU driver for VFIO

2012-11-26 Thread David Gibson
platform dependent part includes IOMMU initialization > >>>>and handling. This patch implements an IOMMU driver for VFIO > >>>>which does mapping/unmapping pages for the guest IO and > >>>>provides information about DMA window (required by a POWERPC &g

Re: [Qemu-devel] [RFC PATCH 01/13] Generic DMA memory access interface

2011-06-02 Thread David Gibson
ss in. Uh, if that's true, that's a bug in the container_of implementation. The ccan container_of implementation, for example, certainly does check that the given field has type matching the pointer. -- David Gibson| I'll have my music baroque, and my code

Re: [Qemu-devel] [RFC PATCH 01/13] Generic DMA memory access interface

2011-06-02 Thread David Gibson
managed IOMMU. I have also significantly reworked how the structure lookup works, partly because in my case I'l looking at IOMMU translation for non-PCI devices, but I think it may also address your concerns. I'm still using upcasts, but there are less steps from the device to the IOMMU

Re: kvm PCI assignment & VFIO ramblings

2011-07-31 Thread David Gibson
ferent, and in any case would require considerable extra abstraction work on the qemu guest iommu code. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _

Re: kvm PCI assignment & VFIO ramblings

2011-08-02 Thread David Gibson
eally see how this differs from the groups proposal except in the details of how you inform qemu of the group^H^H^H^H^Hiommu domain. [snip] > Today we do DMA mapping via the VFIO device because the capabilities of > the IOMMU domains change depending on which devices are connected (for >

Re: kvm PCI assignment & VFIO ramblings

2011-08-02 Thread David Gibson
On Tue, Aug 02, 2011 at 12:35:19PM -0600, Alex Williamson wrote: > On Tue, 2011-08-02 at 12:14 -0600, Alex Williamson wrote: > > On Tue, 2011-08-02 at 18:28 +1000, David Gibson wrote: > > > On Sat, Jul 30, 2011 at 12:20:08PM -0600, Alex Williamson wrote: > > > > On

Re: kvm PCI assignment & VFIO ramblings

2011-08-03 Thread David Gibson
On Tue, Aug 02, 2011 at 09:44:49PM -0600, Alex Williamson wrote: > On Wed, 2011-08-03 at 12:04 +1000, David Gibson wrote: > > On Tue, Aug 02, 2011 at 12:35:19PM -0600, Alex Williamson wrote: > > > On Tue, 2011-08-02 at 12:14 -0600, Alex Williamson wrote: > > > > On

Re: [PATCH] Permit -mem-path without sync mmu

2011-08-07 Thread David Gibson
On Fri, Aug 05, 2011 at 12:30:53PM -0300, Marcelo Tosatti wrote: > On Fri, Aug 05, 2011 at 08:16:42AM +0200, Jan Kiszka wrote: > > On 2011-08-05 06:02, David Gibson wrote: > > > At present, an explicit test disallows use of -mem-path when kvm is > > > enabled > >

Re: kvm PCI assignment & VFIO ramblings

2011-08-07 Thread David Gibson
oint is that both the hard and soft constraints are much easier to handle if a group or iommu domain or whatever is a persistent entity that can be set up once-per-boot by the admin with whatever degree of safety they want, rather than a transient entity tied to an fd's lifetime, which mus

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-14 Thread David Gibson
RQ_INDEX, > VFIO_PCI_NUM_IRQS > }; > > So like regions it always exposes 3 IRQ indexes where count=0 if the > device doesn't actually support that type of interrupt. I just want to > spell out that bus drivers have this kind of flexibility. I knew what you were a

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-14 Thread David Gibson
e. Handling oddly overlapping operations on that data structure is natural, enforcing strict matching of maps and unmaps is not and would require extra information to be stored by vfio. On POWER, the IOMMU operations often *are* a hot path, so manipulating those structures would have a real cos

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-16 Thread David Gibson
On Tue, Nov 15, 2011 at 11:01:28AM -0700, Alex Williamson wrote: > On Tue, 2011-11-15 at 17:34 +1100, David Gibson wrote: > > On Thu, Nov 03, 2011 at 02:12:24PM -0600, Alex Williamson wrote: > > > diff --git a/Documentation/vfio.txt b/Documentation/vfio.txt > > > new f

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-20 Thread David Gibson
On Fri, Nov 18, 2011 at 01:32:56PM -0700, Alex Williamson wrote: > On Thu, 2011-11-17 at 11:02 +1100, David Gibson wrote: > > On Tue, Nov 15, 2011 at 11:01:28AM -0700, Alex Williamson wrote: > > > On Tue, 2011-11-15 at 17:34 +1100, David Gibson wrote: > > > > On T

Re: [PATCH V2 4/6] kvm tools: Add PPC64 XICS interrupt controller support

2011-12-13 Thread David Gibson
one ics unit. It used to have at least one bug caused by confusing the two, which I'm not sure if you've also copied. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_

Re: [PATCH V2 2/6] kvm tools: Add SPAPR PPC64 hcall & rtascall structure

2011-12-13 Thread David Gibson
@@ -0,0 +1,105 @@ > +/* > + * SPAPR definitions and declarations > + * > + * Borrowed heavily from QEMU's spapr.h, > + * Copyright (c) 2010 David Gibson, IBM Corporation. So, most of the content of this file in qemu, I in turn took from arch/powerpc/include/asm/hvcall.h in the kernel tr

Re: [PATCH V2 1/6] kvm tools: Generate SPAPR PPC64 guest device tree

2011-12-13 Thread David Gibson
gt; + } while (0) > + > #endif /* KVM__KVM_ARCH_H */ > diff --git a/tools/kvm/powerpc/kvm.c b/tools/kvm/powerpc/kvm.c > index f838a8f..95ed1cc 100644 > --- a/tools/kvm/powerpc/kvm.c > +++ b/tools/kvm/powerpc/kvm.c > @@ -3,6 +3,9 @@ > * > * Copyright 2011 Matt Evans

Re: [PATCH V2 4/6] kvm tools: Add PPC64 XICS interrupt controller support

2011-12-20 Thread David Gibson
On Tue, Dec 20, 2011 at 12:16:40PM +1100, Matt Evans wrote: > Hi David, > > On 14/12/11 13:35, David Gibson wrote: > > On Tue, Dec 13, 2011 at 06:10:48PM +1100, Matt Evans wrote: > >> This patch adds XICS emulation code (heavily borrowed from QEMU), and wires > >>

Re: [PATCH V4 2/7] kvm tools: Generate SPAPR PPC64 guest device tree

2012-01-31 Thread David Gibson
imple 'cpu info' mechanism > is added to recognise/differentiate DT entries for POWER7 and PPC970 host > CPUs. > Future support of more CPUs is possible. > > libfdt is included from scripts/dtc/libfdt. > > Signed-off-by: Matt Evans For the bits derived from my

Re: [PATCH V4 6/7] kvm tools: Add PPC64 PCI Host Bridge

2012-01-31 Thread David Gibson
-by: Matt Evans For the bits derived from my qemu code: Signed-off-by: David Gibson -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _arou

RFC: Device isolation groups

2012-01-31 Thread David Gibson
This patch series introduces a new infrastructure to the driver core for representing "device isolation groups". That is, groups of devices which can be "isolated" in such a way that the rest of the system can be protected from them, even in the presence of userspace or a guest OS directly driving

[PATCH 3/3] device_isolation: Support isolation on POWER p7ioc (IODA) bridges

2012-01-31 Thread David Gibson
This patch adds code to the code for the powernv platform to create and populate isolation groups on hardware using the p7ioc (aka IODA) PCI host bridge used on some IBM POWER systems. Signed-off-by: Alexey Kardashevskiy Signed-off-by: David Gibson --- arch/powerpc/platforms/powernv/pci-ioda.c

[PATCH 2/3] device_isolation: Support isolation on POWER p5ioc2 bridges

2012-01-31 Thread David Gibson
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 Signed-off-by: David Gibson --- arch/powerpc/platforms/powernv/pci-p5ioc2.c | 14

[PATCH 1/3] Device isolation group infrastructure (v3)

2012-01-31 Thread David Gibson
vskiy Signed-off-by: David Gibson --- drivers/base/Kconfig |3 + drivers/base/Makefile|1 + drivers/base/base.h |3 + drivers/base/core.c |6 ++ drivers/base/device_isolation.c | 184 ++

Re: [PATCH 3/3] device_isolation: Support isolation on POWER p7ioc (IODA) bridges

2012-02-01 Thread David Gibson
On Wed, Feb 01, 2012 at 12:17:05PM -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 p7ioc (aka IODA) PCI > >

Re: RFC: Device isolation groups

2012-02-01 Thread David Gibson
On Wed, Feb 01, 2012 at 01:08:39PM -0700, Alex Williamson wrote: > On Wed, 2012-02-01 at 15:46 +1100, David Gibson wrote: > > This patch series introduces a new infrastructure to the driver core > > for representing "device isolation groups". That is, groups of > >

Re: [PATCH 02/13] iommu: IOMMU Groups

2012-05-13 Thread David Gibson
into iommu driver ops if provided, which may > + * result in ADD/DEL notifiers to group->notifier > + */ > + if (action == BUS_NOTIFY_ADD_DEVICE) { > + if (ops->add_device) > + return ops->add_device(dev); > + } else if (action

Re: [RFC PATCH] qemu spapr-pci: added IRQ list to PCIBus

2012-05-13 Thread David Gibson
obal IRQ number, and the usual qemu_irq model supports that. So for this function who is it that is defining the number space in which pci_get_irq() is returning values. -- David Gibson| I'll have my music baroque, and my code david AT gibson.

Re: [PATCH 02/13] iommu: IOMMU Groups

2012-05-14 Thread David Gibson
On Mon, May 14, 2012 at 11:11:42AM -0600, Alex Williamson wrote: > On Mon, 2012-05-14 at 11:16 +1000, David Gibson wrote: > > On Fri, May 11, 2012 at 04:55:41PM -0600, Alex Williamson wrote: [snip] > > > +struct iommu_group { > > > + struct kobject kobj; > >

Re: [PATCH 02/13] iommu: IOMMU Groups

2012-05-16 Thread David Gibson
On Tue, May 15, 2012 at 12:34:03AM -0600, Alex Williamson wrote: > On Tue, 2012-05-15 at 12:03 +1000, David Gibson wrote: > > On Mon, May 14, 2012 at 11:11:42AM -0600, Alex Williamson wrote: > > > On Mon, 2012-05-14 at 11:16 +1000, David Gibson wrote: > > > > On F

Re: [PATCH 03/13] iommu: IOMMU groups for VT-d and AMD-Vi

2012-05-16 Thread David Gibson
iommu groups to create and remove groups. Looks ok to me. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgib

Re: [PATCH 04/13] pci: New pci_dma_quirk()

2012-05-16 Thread David Gibson
pci_get_slot(dev->bus, > +PCI_DEVFN(PCI_SLOT(dev->devfn), 0)); > + } Hrm. This seems like a very generic name for a function performing a very specific test. We could well have devices with the same problem in future, so shouldn't this be

Re: [Qemu-devel] [PATCH] Permit -mem-path without sync mmu

2011-08-09 Thread David Gibson
On Mon, Aug 08, 2011 at 11:24:09AM +0300, Avi Kivity wrote: > On 08/08/2011 09:03 AM, David Gibson wrote: > >Second, if userspace qemu passing hugepages to kvm can cause (host) > >kernel memory corruption, that is clearly a host kernel bug. So am I > >correct in thinking thi

Re: [Qemu-devel] [PATCH] Permit -mem-path without sync mmu

2011-08-10 Thread David Gibson
On Wed, Aug 10, 2011 at 12:01:04PM +0300, Avi Kivity wrote: > On 08/10/2011 08:10 AM, David Gibson wrote: > >On Mon, Aug 08, 2011 at 11:24:09AM +0300, Avi Kivity wrote: > >> On 08/08/2011 09:03 AM, David Gibson wrote: [snip] > >This would seem to be a genuine bug in the

Fix refcounting in hugetlbfs quota handling

2011-08-10 Thread David Gibson
when they're added to the page private data. This ensures that the inode (and therefore the super block) will not be freed before we use it from free_huge_page. Signed-off-by: David Gibson Index: working-2.6/fs/hugetlb

Re: [PATCH 09/10] KVM: PPC: Support SC1 hypercalls for PAPR in PR mode

2011-08-11 Thread David Gibson
pability to let it know if it's necessary. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson -- To unsubscribe f

Re: [PATCH 07/10] KVM: PPC: Add PAPR hypercall code for PR mode

2011-08-11 Thread David Gibson
o be you could just let h_enter fall through to qemu which will put the right thing into the guest hash table which you can then walk in the kernel translation code. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, t

Re: [PATCH 07/10] KVM: PPC: Add PAPR hypercall code for PR mode

2011-08-12 Thread David Gibson
On Fri, Aug 12, 2011 at 07:38:54AM +0200, Alexander Graf wrote: > > Am 12.08.2011 um 05:35 schrieb David Gibson : > > > On Tue, Aug 09, 2011 at 06:31:45PM +0200, Alexander Graf wrote: > >> When running a PAPR guest, we need to handle a few hypercalls in kernel > >

Re: [PATCH 09/10] KVM: PPC: Support SC1 hypercalls for PAPR in PR mode

2011-08-12 Thread David Gibson
On Fri, Aug 12, 2011 at 07:35:42AM +0200, Alexander Graf wrote: > > Am 12.08.2011 um 05:33 schrieb David Gibson : > > > On Tue, Aug 09, 2011 at 06:31:47PM +0200, Alexander Graf wrote: > >> PAPR defines hypercalls as SC1 instructions. Using these, the guest > >&

Re: Fix refcounting in hugetlbfs quota handling

2011-08-12 Thread David Gibson
On Fri, Aug 12, 2011 at 12:15:21PM -0700, Hugh Dickins wrote: > On Fri, 12 Aug 2011, Minchan Kim wrote: > > On Fri, Aug 12, 2011 at 9:48 AM, Linus Torvalds > > wrote: > > > On Wed, Aug 10, 2011 at 11:40 PM, David Gibson > > > wrote: > > >> > >

Re: Fix refcounting in hugetlbfs quota handling

2011-08-15 Thread David Gibson
> return chg; > > /* There must be enough filesystem quota for the mapping */ > - if (hugetlb_get_quota(inode->i_mapping, chg)) > + if (hugetlb_get_quota(HUGETLBFS_SB(inode->i_mapping->host->i_sb), chg)) > return -ENOSPC; > >

Re: kvm PCI assignment & VFIO ramblings

2011-08-21 Thread David Gibson
. We'll > need to come up with extra options when we need to expose groups to > guest for pvdma. Are you saying that you'd no longer support the current x86 usage of putting all of one guest's devices into a single domain? If that's not what you're saying, how wou

Re: kvm PCI assignment & VFIO ramblings

2011-08-22 Thread David Gibson
On Mon, Aug 22, 2011 at 09:45:48AM -0600, Alex Williamson wrote: > On Mon, 2011-08-22 at 15:55 +1000, David Gibson wrote: > > On Sat, Aug 20, 2011 at 09:51:39AM -0700, Alex Williamson wrote: > > > We had an extremely productive VFIO BoF on Monday. Here's my attempt to >

Re: kvm PCI assignment & VFIO ramblings

2011-08-24 Thread David Gibson
uot;static". I would prefer to say 'persistent', in that the meta-groups lifetime is not tied to an fd, but they can be freely created, altered and removed during runtime. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au

Re: kvm PCI assignment & VFIO ramblings

2011-08-25 Thread David Gibson
On Wed, Aug 24, 2011 at 01:03:32PM +0200, Roedel, Joerg wrote: > On Wed, Aug 24, 2011 at 05:33:00AM -0400, David Gibson wrote: > > On Wed, Aug 24, 2011 at 11:14:26AM +0200, Roedel, Joerg wrote: > > > > I don't see a reason to make this meta-grouping static. It would har

Re: kvm PCI assignment & VFIO ramblings

2011-08-25 Thread David Gibson
don't let it fault them back in. As I see it there are two options: (a) make subsequent accesses from userspace or the guest result in either a SIGBUS that userspace must either deal with or die, or (b) replace the mapping with a dummy RO mapping containing 0xff, with any trapped writes e

Re: kvm PCI assignment & VFIO ramblings

2011-08-29 Thread David Gibson
odel doesn't necessarily prevent that. There's no reason your program can't use the administrative interface as well as the "use" interface, and I don't see that making the admin interface separate and persistent makes this any harder. -- David Gibson

Re: VFIO v2 design plan

2011-08-29 Thread David Gibson
see > which groups are merged. The group fd could simply read as: > group: 1234 > device: :00:19.0 > group: 5678 > device: :01:00.0 > device: :01:00.1 > Some might say this is screaming for xml. Do we need to go there? We > could als

Re: VFIO v2 design plan

2011-08-30 Thread David Gibson
On Mon, Aug 29, 2011 at 10:24:43PM -0600, Alex Williamson wrote: > On Tue, 2011-08-30 at 13:04 +1000, David Gibson wrote: > > On Fri, Aug 26, 2011 at 11:05:23AM -0600, Alex Williamson wrote: > > > > > > I don't think too much has changed since the previous email w

Re: VFIO v2 design plan

2011-08-31 Thread David Gibson
On Tue, Aug 30, 2011 at 08:51:38AM -0600, Alex Williamson wrote: > On Tue, 2011-08-30 at 17:48 +1000, David Gibson wrote: > > On Mon, Aug 29, 2011 at 10:24:43PM -0600, Alex Williamson wrote: > > > On Tue, 2011-08-30 at 13:04 +1000, David Gibson wrote: > > > > On F

Re: VFIO v2 design plan

2011-09-01 Thread David Gibson
On Thu, Sep 01, 2011 at 02:27:00PM -0600, Alex Williamson wrote: > On Thu, 2011-09-01 at 14:10 +1000, David Gibson wrote: > > On Tue, Aug 30, 2011 at 08:51:38AM -0600, Alex Williamson wrote: [snip] > > > > If you open a group, merge in a bunch of other groups, then re-open

Re: [Qemu-devel] RFC [v2]: vfio / device assignment -- layout of device fd files

2011-09-26 Thread David Gibson
it, even if it means some space wastage with occasionally-used fields. Anything more complex than that and userspace is just never going to use it properly. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank y

Re: [Qemu-devel] RFC [v2]: vfio / device assignment -- layout of device fd files

2011-09-30 Thread David Gibson
On Mon, Sep 26, 2011 at 12:34:52PM -0600, Alex Williamson wrote: > On Mon, 2011-09-26 at 12:04 +0200, Alexander Graf wrote: > > Am 26.09.2011 um 09:51 schrieb David Gibson : [snip] > > Also, if you can come up with an interface that does not have variable > > length descript

Re: [Qemu-devel] RFC [v2]: vfio / device assignment -- layout of device fd files

2011-09-30 Thread David Gibson
rspace which only knows the old structure won't get the new fields, but presumably it wouldn't know or care what to do with them anyway. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the

Re: [Qemu-devel] RFC [v2]: vfio / device assignment -- layout of device fd files

2011-09-30 Thread David Gibson
On Mon, Sep 26, 2011 at 12:04:47PM +0200, Alexander Graf wrote: > Am 26.09.2011 um 09:51 schrieb David Gibson : [snip] > > Um, not to put too fine a point on it, this is madness. > > > > Yes, it's very flexible and can thereby cover a very wide range of > > cases.

Re: [Qemu-devel] RFC [v2]: vfio / device assignment -- layout of device fd files

2011-09-30 Thread David Gibson
asily support reading random offsets. Thoughts? > > The table should not be particularly large, and you'll need to keep the > information around in some form regardless. Maybe in the PCI case you > could produce it dynamically (though I probably wouldn't

Re: [Qemu-devel] [PATCH] virtio-9p: fix QEMU build break

2011-10-17 Thread David Gibson
## > +# check if we have open_by_handle_at > + > +open_by_hande_at=no > +cat > $TMPC << EOF > +#include > +int main(void) { struct file_handle *fh; open_by_handle_at(0, fh, 0); } Instead, try this: int main(void) { struct file_hand

Re: [PATCH 1/3] Device isolation group infrastructure (v3)

2012-02-08 Thread David Gibson
On Wed, Feb 08, 2012 at 04:27:48PM +0100, Joerg Roedel wrote: > On Wed, Feb 01, 2012 at 03:46:52PM +1100, David Gibson wrote: > > In order to safely drive a device with a userspace driver, or to pass > > it through to a guest system, we must first make sure that the device > >

Re: [PATCH 1/3] Device isolation group infrastructure (v3)

2012-02-09 Thread David Gibson
uld iterate over > all devices on a bus and build up group structures based on isolation > information provided by the arch specific code. And how exactly do you suggest it provide that information. I really can't see how an iommu driver would specify its isolation constraints generally enough

Re: RFC: Device isolation groups

2012-03-08 Thread David Gibson
On Wed, Feb 29, 2012 at 12:30:55PM -0700, Alex Williamson wrote: > On Thu, 2012-02-02 at 12:24 +1100, David Gibson wrote: > > On Wed, Feb 01, 2012 at 01:08:39PM -0700, Alex Williamson wrote: [snip] > Any update to this series? It would be great if we could map out the > functionali

Re: [PATCH 0/2] RFC Isolation API

2012-03-13 Thread David Gibson
roposal is far from complete, but I hope it can re-fire some > discussion and work in this space. Please let me know what you like, > what you don't like, and ideas for the gaps. Thanks, -- David Gibson| I'll have my music baroque, and my code david AT gibson.dro

Re: [PATCH 1/2] Isolation groups

2012-03-13 Thread David Gibson
ct isolation_group *group, > +struct device *dev); > +extern int isolation_group_del_dev(struct device *dev); > +extern int isolation_register_notifier(struct bus_type *bus, > +struct notifier_block *nb); > +extern int

Re: [PATCH 1/2] Isolation groups

2012-03-14 Thread David Gibson
On Tue, Mar 13, 2012 at 10:49:47AM -0600, Alex Williamson wrote: > On Wed, 2012-03-14 at 01:33 +1100, David Gibson wrote: > > On Mon, Mar 12, 2012 at 04:32:54PM -0600, Alex Williamson wrote: > > > Signed-off-by: Alex Williamson > > > --- > > > >

Re: [PATCH 1/2] Isolation groups

2012-03-15 Thread David Gibson
On Thu, Mar 15, 2012 at 02:15:01PM -0600, Alex Williamson wrote: > On Wed, 2012-03-14 at 20:58 +1100, David Gibson wrote: > > On Tue, Mar 13, 2012 at 10:49:47AM -0600, Alex Williamson wrote: > > > On Wed, 2012-03-14 at 01:33 +1100, David Gibson wrote: > > > > On M

Re: [PATCH 1/2] Isolation groups

2012-03-16 Thread David Gibson
On Fri, Mar 16, 2012 at 01:31:18PM -0600, Alex Williamson wrote: > On Fri, 2012-03-16 at 14:45 +1100, David Gibson wrote: > > On Thu, Mar 15, 2012 at 02:15:01PM -0600, Alex Williamson wrote: > > > On Wed, 2012-03-14 at 20:58 +1100, David Gibson wrote: > > > > On T

Re: [PATCH 1/2] Isolation groups

2012-03-26 Thread David Gibson
On Wed, Mar 21, 2012 at 03:12:58PM -0600, Alex Williamson wrote: > On Sat, 2012-03-17 at 15:57 +1100, David Gibson wrote: > > On Fri, Mar 16, 2012 at 01:31:18PM -0600, Alex Williamson wrote: > > > On Fri, 2012-03-16 at 14:45 +1100, David Gibson wrote: > > > > On T

Re: [PATCH 1/2] Isolation groups

2012-03-29 Thread David Gibson
oprobe, > maybe setup notifications for the group, and hopefully include a way to > share iommu mappings between groups. Anything much beyond that we > should probably leave for something like the vfio driver. Thanks, Yes, well, I was hoping for a simpl

Re: [RFC PATCH 1/3] iommu: Introduce iommu_group

2012-04-18 Thread David Gibson
entity, ignoring (here) any other factors which might affect isolation. Or am I missing something? -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _

Re: [RFC PATCH 2/3] iommu: Create basic group infrastructure and update AMD-Vi & Intel VT-d

2012-04-18 Thread David Gibson
n_has_cap)(struct iommu_domain *domain, > unsigned long cap); > int (*device_group)(struct device *dev, unsigned int *groupid); > + int (*add_device)(struct device *dev); > + void (*remove_device)(struct device *dev); > unsigned long pgsize_bit

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

2013-05-24 Thread David Gibson
CE_ATTR _IOW(KVMIO, 0xe3, struct > >kvm_device_attr) > > > >+/* ioctl for SPAPR TCE IOMMU */ > >+#define KVM_CREATE_SPAPR_TCE_IOMMU _IOW(KVMIO, 0xe4, struct > >kvm_create_spapr_tce_iommu) > > Shouldn't this go under the vm ioctl section? > > -Scott > __

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

2013-06-19 Thread David Gibson
return -EINVAL; > > > > > > if (!atomic_inc_not_zero(&group->container_users)) > > return -EINVAL; > > > > return 0; > > } > > > > void vfio_group_del_external_user(struct file *filep) > > { > > struct v

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

2013-06-22 Thread David Gibson
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, 2013-06-20 at 15:28 +1000, David Gibson wrote: > > >>>

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

2013-06-23 Thread David Gibson
On Sun, Jun 23, 2013 at 09:28:13AM +1000, Benjamin Herrenschmidt wrote: > On Sat, 2013-06-22 at 22:03 +1000, David Gibson wrote: > > I think the interface should not take the group fd, but the container > > fd. Holding a reference to *that* would keep the necessary things > >

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

2013-06-23 Thread David Gibson
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 Thu, 2013-06-20 at 18:48 +1000, Alexey Kardashevskiy wrote: > > &g

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

2013-06-27 Thread David Gibson
On Sun, Jun 23, 2013 at 10:41:24PM -0600, Alex Williamson wrote: > 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 T

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Fix race in starting secondary threads

2015-09-02 Thread David Gibson
nap flag after setting the vcore pointer in > the PACA of the secondary in kvmppc_run_core. Also, ensure that a > secondary thread doesn't nap in kvm_unsplit_nap when the vcore pointer > in its PACA struct is set. > > Fixes: b4deba5c41e9 > Signed-off-by: Gautham R. Shenoy >

Re: [PATCH 2/2] KVM: PPC: Book3S HV: Exit on H_DOORBELL only if HOST_IPI is set

2015-09-02 Thread David Gibson
unconditionally exit to the host. > > Fixes: 66feed61cdf6 > Cc: sta...@vger.kernel.org # v4.1+ > Signed-off-by: Gautham R. Shenoy > Signed-off-by: Paul Mackerras Reviewed-by: David Gibson > --- > arch/powerpc/kvm/book3s_hv_rmhandlers.S | 1 + > 1 file changed, 1

Re: [PATCH 0/2] VFIO: Accept IOMMU group (PE) ID

2015-09-18 Thread David Gibson
putting the group in a very awkward place. Especially since I'm not sure if there even are any existing users of the single extant union branch. Sigh. > Also, we generally pass group > file descriptors rather than a group ID because we can prove the > ownership of the gro

Re: [PATCH] KVM: PPC: Take the kvm->srcu lock in kvmppc_h_logical_ci_load/store()

2015-09-20 Thread David Gibson
aces kvm_io_bus_{read,write}() are called on x86 are buried about 5 layers below where the srcu lock is taken :/. Reviewed-by: David Gibson > --- > arch/powerpc/kvm/book3s.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kv

Re: [PATCH 0/2] VFIO: Accept IOMMU group (PE) ID

2015-09-20 Thread David Gibson
On Sat, Sep 19, 2015 at 04:22:47PM +1000, David Gibson wrote: > On Fri, Sep 18, 2015 at 09:47:32AM -0600, Alex Williamson wrote: > > On Fri, 2015-09-18 at 16:24 +1000, Gavin Shan wrote: > > > This allows to accept IOMMU group (PE) ID from the parameter from userland >

Re: [PATCH] KVM: PPC: Book3S HV: Synthesize segment fault if SLB lookup fails

2015-11-03 Thread David Gibson
appropriate SLB entry next time and be able to handle > the fault. > > Signed-off-by: Paul Mackerras Reviewed-by: David Gibson -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT

Re: [PATCH] KVM: PPC: Exit guest upon fatal machine check exception

2015-11-11 Thread David Gibson
gt; + b mc_cont > +2: ld r10, VCPU_PC(r9) > ld r11, VCPU_MSR(r9) > - bne 2f /* Continue guest execution. */ > - /* If not, deliver a machine check. SRR0/1 are already set */ > - li r10, BOOK3S_INTERRUPT_MACHINE_CHECK > -

Re: [PATCH] KVM: PPC: Exit guest upon fatal machine check exception

2015-11-11 Thread David Gibson
have a new kernel with an old qemu, in that case qemu might not understand the new exit type and treat it as a fatal error, even though the guest could actually cope with it. Aravinda, do we need to change this so that qemu has to explicitly enable the new NMI behaviour? Or have I missed some

Re: [PATCH] KVM: PPC: Exit guest upon fatal machine check exception

2015-11-11 Thread David Gibson
On Thu, Nov 12, 2015 at 10:02:10AM +0530, Aravinda Prasad wrote: > > > On Thursday 12 November 2015 09:08 AM, David Gibson wrote: > > On Thu, Nov 12, 2015 at 01:24:19PM +1100, Daniel Axtens wrote: > >> Aravinda Prasad writes: > >> > >>> This

Re: [PATCH] KVM: PPC: Exit guest upon fatal machine check exception

2015-11-12 Thread David Gibson
On Thu, Nov 12, 2015 at 11:22:29PM +0530, Aravinda Prasad wrote: > > > On Thursday 12 November 2015 10:13 AM, David Gibson wrote: > > On Thu, Nov 12, 2015 at 10:02:10AM +0530, Aravinda Prasad wrote: > >> > >> > >> On Thursday 12 November 2015 09:08 AM

Re: [PATCH] KVM: PPC: Fix emulation of H_SET_DABR/X on POWER8

2015-11-22 Thread David Gibson
bit, it has to be shifted by > two, not only by one. This fixes hardware watchpoints in gdb of > older guests that only use the H_SET_DABR/X interface instead > of the new H_SET_MODE interface. > > Signed-off-by: Thomas Huth Reviewed-by: David Gibson Reviewed-by: David Gibson

[PATCHv4] kvmppc: Implement H_LOGICAL_CI_{LOAD,STORE} in KVM

2015-04-20 Thread David Gibson
change is also required, in order to enable these new hcall implementations with KVM_CAP_PPC_ENABLE_HCALL. Signed-off-by: David Gibson --- arch/powerpc/include/asm/kvm_book3s.h | 3 ++ arch/powerpc/kvm/book3s.c | 76 +++ arch/powerpc/kvm/book3s_hv.c

Re: [PATCHv4] kvmppc: Implement H_LOGICAL_CI_{LOAD,STORE} in KVM

2015-04-21 Thread David Gibson
On Tue, Apr 21, 2015 at 08:37:02AM +0200, Thomas Huth wrote: > Am Tue, 21 Apr 2015 10:41:51 +1000 > schrieb David Gibson : > > > On POWER, storage caching is usually configured via the MMU - attributes > > such as cache-inhibited are stored in the TLB and the hashed page

  1   2   >