[Qemu-devel] [PATCH] pcie: Fix bug in pcie_ext_cap_set_next

2012-12-18 Thread Knut Omang
Upper 16 bits of the PCIe Extended Capability Header was truncated during update, also breaking pcie_add_capability. Signed-off-by: Knut Omang --- hw/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pcie.c b/hw/pcie.c index 7c92f19..fa260af 100644 --- a/hw/pcie.c

Re: [Qemu-devel] [PATCH v4 2/3] pcie: add check for ari capability of pcie devices

2014-09-30 Thread Knut Omang
On Tue, 2014-09-30 at 21:38 +0800, Gonglei wrote: > > Subject: Re: [Qemu-devel] [PATCH v4 2/3] pcie: add check for ari capability > > of > > pcie devices > > > > On Tue, Sep 30, 2014 at 06:11:25PM +0800, arei.gong...@huawei.com wrote: > > > From: Gonglei > > > > > > In QEMU, ARI Forwarding is en

Re: [Qemu-devel] [PATCH v4 2/3] pcie: add check for ari capability of pcie devices

2014-10-03 Thread Knut Omang
On Wed, 2014-10-01 at 17:08 +0300, Marcel Apfelbaum wrote: > On Wed, 2014-10-01 at 07:26 +0200, Knut Omang wrote: > > On Tue, 2014-09-30 at 21:38 +0800, Gonglei wrote: > > > > Subject: Re: [Qemu-devel] [PATCH v4 2/3] pcie: add check for ari > > > > c

Re: [Qemu-devel] [PATCH v2 1/4] pci: Make use of the devfn property when registering new devices

2014-10-03 Thread Knut Omang
Michael, I just realized this patch set might have got "stuck" because I did not respond to this? Or did I miss something else? On Tue, 2014-09-02 at 16:55 +0300, Michael S. Tsirkin wrote: > On Tue, Sep 02, 2014 at 03:44:28PM +0200, Knut Omang wrote: > > On Tue, 2014-0

Re: [Qemu-devel] [PATCH v4 2/3] pcie: add check for ari capability of pcie devices

2014-10-03 Thread Knut Omang
On Fri, 2014-10-03 at 13:22 +0200, Knut Omang wrote: > On Wed, 2014-10-01 at 17:08 +0300, Marcel Apfelbaum wrote: > > On Wed, 2014-10-01 at 07:26 +0200, Knut Omang wrote: > > > On Tue, 2014-09-30 at 21:38 +0800, Gonglei wrote: > > > > > Subject: Re: [Qemu-devel] [

Re: [Qemu-devel] [PATCH v3 0/5] intel-iommu: introduce Intel IOMMU (VT-d) emulation to q35 chipset

2014-08-14 Thread Knut Omang
On Thu, 2014-08-14 at 14:10 +0200, Jan Kiszka wrote: > On 2014-08-14 13:15, Michael S. Tsirkin wrote: > > On Mon, Aug 11, 2014 at 03:04:57PM +0800, Le Tan wrote: > >> Hi, > >> > >> These patches are intended to introduce Intel IOMMU (VT-d) emulation to q35 > >> chipset. The major job in these patch

Re: [Qemu-devel] [PATCH v3 0/5] intel-iommu: introduce Intel IOMMU (VT-d) emulation to q35 chipset

2014-08-15 Thread Knut Omang
On Fri, 2014-08-15 at 06:42 +0200, Knut Omang wrote: > On Thu, 2014-08-14 at 14:10 +0200, Jan Kiszka wrote: > > On 2014-08-14 13:15, Michael S. Tsirkin wrote: > > > On Mon, Aug 11, 2014 at 03:04:57PM +0800, Le Tan wrote: > > >> Hi, > > >> > > >&g

Re: [Qemu-devel] [PATCH v3 0/5] intel-iommu: introduce Intel IOMMU (VT-d) emulation to q35 chipset

2014-08-16 Thread Knut Omang
On Fri, 2014-08-15 at 19:37 +0800, Le Tan wrote: > Hi Knut, > > 2014-08-15 19:15 GMT+08:00 Knut Omang : > > On Fri, 2014-08-15 at 06:42 +0200, Knut Omang wrote: > >> On Thu, 2014-08-14 at 14:10 +0200, Jan Kiszka wrote: > >> > On 2014-08-14 13:15, Michael S. Ts

Re: [Qemu-devel] [PATCH v3 0/5] intel-iommu: introduce Intel IOMMU (VT-d) emulation to q35 chipset

2014-08-18 Thread Knut Omang
On Sat, 2014-08-16 at 10:47 +0200, Jan Kiszka wrote: > On 2014-08-16 10:45, Jan Kiszka wrote: > > On 2014-08-16 09:54, Knut Omang wrote: > >> On Fri, 2014-08-15 at 19:37 +0800, Le Tan wrote: > >>> Hi Knut, > >>> > >>> 2014-08-15 19:15 GMT+08:00

Re: [Qemu-devel] [PATCH v3 0/5] intel-iommu: introduce Intel IOMMU (VT-d) emulation to q35 chipset

2014-08-18 Thread Knut Omang
On Mon, 2014-08-18 at 20:50 +0200, Jan Kiszka wrote: > On 2014-08-18 18:34, Knut Omang wrote: > > On Sat, 2014-08-16 at 10:47 +0200, Jan Kiszka wrote: > >> On 2014-08-16 10:45, Jan Kiszka wrote: > >>> On 2014-08-16 09:54, Knut Omang wrote: > >>>> On

Re: [Qemu-devel] [PATCH v3 0/5] intel-iommu: introduce Intel IOMMU (VT-d) emulation to q35 chipset

2014-08-18 Thread Knut Omang
On Tue, 2014-08-19 at 06:08 +0200, Knut Omang wrote: > On Mon, 2014-08-18 at 20:50 +0200, Jan Kiszka wrote: > > On 2014-08-18 18:34, Knut Omang wrote: > > > On Sat, 2014-08-16 at 10:47 +0200, Jan Kiszka wrote: > > >> On 2014-08-16 10:45, Jan Kiszka wrote: > >

Re: [Qemu-devel] [Question] Why doesn't PCIe hotplug work for Q35 machine?

2014-08-19 Thread Knut Omang
On Wed, 2014-08-20 at 02:16 +, Gonglei (Arei) wrote: > > -Original Message- > > From: Michael S. Tsirkin [mailto:m...@redhat.com] > > Sent: Wednesday, August 20, 2014 5:19 AM > > To: Gonglei (Arei) > > Cc: Paolo Bonzini; Marcel Apfelbaum; qemu-devel@nongnu.org; > > imamm...@redhat.com;

Re: [Qemu-devel] [Question] Why doesn't PCIe hotplug work for Q35 machine?

2014-08-19 Thread Knut Omang
On Wed, 2014-08-20 at 06:39 +0200, Knut Omang wrote: > On Wed, 2014-08-20 at 02:16 +, Gonglei (Arei) wrote: > > > -Original Message- > > > From: Michael S. Tsirkin [mailto:m...@redhat.com] > > > Sent: Wednesday, August 20, 2014 5:19 AM > > > To:

Re: [Qemu-devel] [Question] Why doesn't PCIe hotplug work for Q35 machine?

2014-08-19 Thread Knut Omang
On Wed, 2014-08-20 at 06:04 +, Gonglei (Arei) wrote: > > On Wed, 2014-08-20 at 06:39 +0200, Knut Omang wrote: > > > On Wed, 2014-08-20 at 02:16 +, Gonglei (Arei) wrote: > > > > > -Original Message- > > > > > From: Michael S. Ts

[Qemu-devel] [PATCH 0/3] q35: Minor fixes/enhancements to improve usability of root ports

2014-08-19 Thread Knut Omang
These are some minor fixes necessary to be able to operate ARI capable devices in PCIe root ports on a q35 machine, using command line options like this: -device ioh3420,slot=0 -device ioh3420,slot=1 -device ,bus=pcie_port.0 -device ,bus=pcie_port.1 Knut Omang (3): pcie: Fix next function

[Qemu-devel] [PATCH 1/3] pcie: Fix next function setting

2014-08-19 Thread Knut Omang
PCI_ARI_CAP_NFN is for reading next function not writing it Signed-off-by: Knut Omang --- hw/pci/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index a123c01..de0e967 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -630,5 +630,5

[Qemu-devel] [PATCH 2/3] ioh3420: Provide a unique bus name and an interrupt mapping function

2014-08-19 Thread Knut Omang
A unique bus name is necessary to be able to refer to each instance from the command line and monitors. Signed-off-by: Knut Omang --- hw/pci-bridge/ioh3420.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c index 7cd87fc..8f6c8b0 100644

[Qemu-devel] [PATCH 3/3] ioh3420: Support ARI forwarding

2014-08-19 Thread Knut Omang
Enable the PCIe capability bit that indicates that this port is able to support and forward requests to > 8 functions for ARI capable devices. Signed-off-by: Knut Omang --- hw/pci-bridge/ioh3420.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/pci-bridge/ioh3420.c b/hw/

Re: [Qemu-devel] [PATCH 0/3] q35: Minor fixes/enhancements to improve usability of root ports

2014-08-20 Thread Knut Omang
On Wed, 2014-08-20 at 09:54 +0200, Markus Armbruster wrote: > Please make sure the parts of your series are threaded together properly > with In-Reply-To and References headers, because that helps e-mail > readers to keep the parts together. Lack of threading is annoying, and > annoying reviewers

Re: [Qemu-devel] [PATCH 3/3] ioh3420: Support ARI forwarding

2014-08-20 Thread Knut Omang
s to > 8 functions for ARI capable devices. > > > > Signed-off-by: Knut Omang > > --- > > hw/pci-bridge/ioh3420.c | 7 +++ > > 1 file changed, 7 insertions(+) > > > > I think you should associate patch 2/3 with patch 3/3 to > one patch, otherwise

Re: [Qemu-devel] [PATCH 3/3] ioh3420: Support ARI forwarding

2014-08-20 Thread Knut Omang
On Wed, 2014-08-20 at 11:57 +0300, Marcel Apfelbaum wrote: > On Wed, 2014-08-20 at 08:53 +0200, Knut Omang wrote: > > Enable the PCIe capability bit that indicates that this port is able to > > support > > and forward requests to > 8 functions for ARI capable devices. >

Re: [Qemu-devel] [PATCH 2/3] ioh3420: Provide a unique bus name and an interrupt mapping function

2014-08-20 Thread Knut Omang
On Wed, 2014-08-20 at 10:52 +0200, Paolo Bonzini wrote: > Il 20/08/2014 08:53, Knut Omang ha scritto: > > A unique bus name is necessary to be able to refer to each instance > > from the command line and monitors. > > Is it needed? Can't you just add id= to the -device

Re: [Qemu-devel] [PATCH 3/3] ioh3420: Support ARI forwarding

2014-08-20 Thread Knut Omang
On Wed, 2014-08-20 at 09:02 +, Gonglei (Arei) wrote: > > > static int ioh3420_initfn(PCIDevice *d) > > > { > > > +PCIBridge* br = PCI_BRIDGE(d); > > > PCIEPort *p = PCIE_PORT(d); > > > PCIESlot *s = PCIE_SLOT(d); > > > +uint8_t *exp_cap; > > > int rc; > > > char tm

Re: [Qemu-devel] [PATCH 2/3] ioh3420: Provide a unique bus name and an interrupt mapping function

2014-08-20 Thread Knut Omang
On Wed, 2014-08-20 at 13:36 +0200, Michael S. Tsirkin wrote: > On Wed, Aug 20, 2014 at 11:30:55AM +0200, Knut Omang wrote: > > On Wed, 2014-08-20 at 10:52 +0200, Paolo Bonzini wrote: > > > Il 20/08/2014 08:53, Knut Omang ha scritto: > > > > A unique bus name is ne

[Qemu-devel] Commit d8d95814609e89e5438a3318a647ec322fc4ff16 seems to break ioh3420

2014-08-20 Thread Knut Omang
I am struggling with the latest master and -device ioh3420,slot=0,id=pcie_port.0 as argument. I bisected it down to: d8d95814609e89e5438a3318a647ec322fc4ff16 is the first bad commit commit d8d95814609e89e5438a3318a647ec322fc4ff16 Author: Paolo Bonzini Date: Wed Jun 11 12:42:01 2014 +0200

Re: [Qemu-devel] Commit d8d95814609e89e5438a3318a647ec322fc4ff16 seems to break ioh3420

2014-08-20 Thread Knut Omang
Seems very similar to what Gonglei just reported... Knut On Wed, 2014-08-20 at 16:10 +0200, Knut Omang wrote: > I am struggling with the latest master and > > -device ioh3420,slot=0,id=pcie_port.0 > > as argument. I bisected it down to: > > d8d95814609e89e5438a3318a6

[Qemu-devel] [PATCH v2 0/4] q35: Minor fixes/enhancements to improve usability of root ports

2014-08-24 Thread Knut Omang
since v1: Removed "ioh3420: Provide a unique bus name and an interrupt mapping function" as it is no longer necessary. Added rename of ari -> arifwd for clarity and removal of obsolete init function (separate patches) Use the renamed functions in ioh3420. Knut Omang (4)

[Qemu-devel] [PATCH v2 2/4] pcie: Rename the pcie_cap_ari_* functions to pcie_cap_arifwd_*

2014-08-24 Thread Knut Omang
Rename helper functions to make a clearer distinction between the PCIe capability/control register feature ARI forwarding and a device that supports the ARI feature via an ARI extended PCIe capability. Signed-off-by: Knut Omang --- hw/pci-bridge/ioh3420.c| 1 + hw/pci-bridge

[Qemu-devel] [PATCH v2 3/4] ioh3420: Remove obsoleted, unused ioh3420_init function

2014-08-24 Thread Knut Omang
Signed-off-by: Knut Omang --- hw/pci-bridge/ioh3420.c | 24 1 file changed, 24 deletions(-) diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c index aed2bf1..e6674a1 100644 --- a/hw/pci-bridge/ioh3420.c +++ b/hw/pci-bridge/ioh3420.c @@ -157,30 +157,6

[Qemu-devel] [PATCH v2 1/4] pcie: Fix incorrect write to the ari capability next function field

2014-08-24 Thread Knut Omang
PCI_ARI_CAP_NFN, a macro for reading next function was used instead of the intended write. Signed-off-by: Knut Omang --- hw/pci/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index a123c01..de0e967 100644 --- a/hw/pci/pcie.c +++ b/hw/pci

[Qemu-devel] [PATCH v2 4/4] ioh3420: Enable ARI forwarding

2014-08-24 Thread Knut Omang
Signed-off-by: Knut Omang --- hw/pci-bridge/ioh3420.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c index e6674a1..cce2fdd 100644 --- a/hw/pci-bridge/ioh3420.c +++ b/hw/pci-bridge/ioh3420.c @@ -85,6 +85,7 @@ static void ioh3420_reset

Re: [Qemu-devel] [PATCH v2 2/2] pci: add check for pcie root ports and downstream ports

2014-08-25 Thread Knut Omang
On Thu, 2014-08-21 at 17:47 +0800, arei.gong...@huawei.com wrote: > From: Gonglei > > If ARI Forwarding is disabled, according to PCIe spec > section 7.3.1, only slot 0 with the device attached to > logic bus representing the link from downstream > ports and root ports. > > So, adding check for

Re: [Qemu-devel] [PATCH v2 4/4] ioh3420: Enable ARI forwarding

2014-08-25 Thread Knut Omang
On Mon, 2014-08-25 at 06:09 +, Gonglei (Arei) wrote: > > From: Michael S. Tsirkin [mailto:m...@redhat.com] > > Subject: Re: [PATCH v2 4/4] ioh3420: Enable ARI forwarding > > > > On Sun, Aug 24, 2014 at 03:32:20PM +0200, Knut Omang wrote: > > > Signed

Re: [Qemu-devel] [PATCH v2 3/4] ioh3420: Remove obsoleted, unused ioh3420_init function

2014-08-25 Thread Knut Omang
On Mon, 2014-08-25 at 07:47 +, Gonglei (Arei) wrote: > > -Original Message- > > From: Knut Omang [mailto:knut.om...@oracle.com] > > Sent: Sunday, August 24, 2014 9:32 PM > > To: qemu-devel@nongnu.org > > Cc: Michael S. Tsirkin; Alexey Kardashevskiy; Juan Q

Re: [Qemu-devel] [PATCH] ioh3420: Remove unused ioh3420_init() declaration

2014-08-25 Thread Knut Omang
ci_map_irq_fn map_irq, > - uint8_t port, uint8_t chassis, uint16_t slot); > - > #endif /* QEMU_IOH3420_H */ Reviewed-by: Knut Omang Knut

Re: [Qemu-devel] [PATCH v2 2/2] pci: add check for pcie root ports and downstream ports

2014-08-25 Thread Knut Omang
On Mon, 2014-08-25 at 09:23 +, Gonglei (Arei) wrote: > > -Original Message- > > From: Knut Omang [mailto:knut.om...@oracle.com] > > Subject: Re: [Qemu-devel] [PATCH v2 2/2] pci: add check for pcie root ports > > and > > downstream ports > > &

Re: [Qemu-devel] [PATCH] ioh3420: Remove unused ioh3420_init() declaration

2014-08-25 Thread Knut Omang
On Mon, 2014-08-25 at 11:48 +0200, Markus Armbruster wrote: > writes: > > > From: Gonglei > > > > Signed-off-by: Gonglei > > --- > > hw/pci-bridge/ioh3420.h | 4 > > 1 file changed, 4 deletions(-) > > > > diff --git a/hw/pci-bridge/ioh3420.h b/hw/pci-bridge/ioh3420.h > > index 7776e5b..ea

Re: [Qemu-devel] [PATCH v2 2/2] pci: add check for pcie root ports and downstream ports

2014-08-25 Thread Knut Omang
On Mon, 2014-08-25 at 10:51 +, Gonglei (Arei) wrote: > > From: Knut Omang [mailto:knut.om...@oracle.com] > > Sent: Monday, August 25, 2014 5:51 PM > > Subject: Re: [Qemu-devel] [PATCH v2 2/2] pci: add check for pcie root ports > > and > > downstream ports > &

Re: [Qemu-devel] [PATCH v2 2/2] pci: add check for pcie root ports and downstream ports

2014-08-26 Thread Knut Omang
On Mon, 2014-08-25 at 11:23 +, Gonglei (Arei) wrote: > > -Original Message- > > From: Knut Omang [mailto:knut.om...@oracle.com] > > Sent: Monday, August 25, 2014 7:02 PM > > Subject: Re: [Qemu-devel] [PATCH v2 2/2] pci: add check for pcie root ports >

[Qemu-devel] [PATCH 2/4] pcie: Add support for Single Root I/O Virtualization (SR/IOV)

2014-08-29 Thread Knut Omang
This patch provides the building blocks for creating an SR/IOV PCIe Extended Capability header and creating and removing SR/IOV Virtual Functions. Signed-off-by: Knut Omang --- hw/pci/pci.c | 107 +++--- hw/pci/pcie.c | 205

[Qemu-devel] [PATCH 0/4] pcie: Add support for Single Root I/O Virtualization

2014-08-29 Thread Knut Omang
rect write to the ari capability next function field and for stability on Paolo's [PATCH] pci_bridge: manually destroy memory regions within PCIBridgeWindows both of which Michael has pulled, but which are not in master yet. Thanks, Knut Omang (4): pci: Update pci_regs header pc

[Qemu-devel] [PATCH 4/4] igb: Example code to illustrate the SR/IOV support.

2014-08-29 Thread Knut Omang
the VFs (if enabled vith a nonzero value for the num_vfs parameter to the igb driver) will load and present ethernet devices, but the PF fails to load because it fails to detect a valid flash content in BAR 1. Signed-off-by: Knut Omang --- hw/net/Makefile.objs | 2 +- hw/net/igb.c | 293

[Qemu-devel] [PATCH 1/4] pci: Update pci_regs header

2014-08-29 Thread Knut Omang
Pulls in latest version from kernel v3.16 msi: Removed local definitions now in pci_regs.h Also replace usage of PCI_MSIX_FLAGS_BIRMASK with PCI_MSIX_TABLE_BIR to keep in sync with the kernel for future updates. Signed-off-by: Knut Omang --- hw/i386/kvm/pci-assign.c | 4 +- hw/misc/vfio.c

[Qemu-devel] [PATCH 3/4] e1000: Refactor to allow subclassing from other source file

2014-08-29 Thread Knut Omang
Signed-off-by: Knut Omang --- hw/net/e1000.c | 126 +++ hw/net/e1000.h | 139 + 2 files changed, 155 insertions(+), 110 deletions(-) create mode 100644 hw/net/e1000.h diff --git a/hw/net

Re: [Qemu-devel] [PATCH] intel_iommu: fix VTD_SID_TO_BUS

2014-10-20 Thread Knut Omang
> obvious to me. It means that invalidation will not work as intended if a device is place on another bus than 01:xx.x (or 0 in theory) as this bus_num always evaluate to 1 or 0 as a boolean. I have been doing quite some testing of the virtual iommu, but by luck or unluck depending on viewpoint my device so far has always been in bus 1... Note that input is always supposed to be a 16 bit value here so the and is in theory not really necessary unless from a documentation and precaution point of view. Reviewed-by: Knut Omang Knut > > Reviewed-by: Markus Armbruster >

Re: [Qemu-devel] [PATCH] intel_iommu: fix VTD_SID_TO_BUS

2014-10-20 Thread Knut Omang
On Mon, 2014-10-20 at 17:23 +0300, Michael S. Tsirkin wrote: > WRT intel_iommu, it does not yet seem to be as fully functional as I > hoped. People also discussed the best way to handle virtio versus iommu > (it bypasses it ATM). > I'd like to suggest we hide the iommu from the command line > help

Re: [Qemu-devel] [PATCH] intel_iommu: fix VTD_SID_TO_BUS

2014-10-20 Thread Knut Omang
On Mon, 2014-10-20 at 20:18 +0200, Jan Kiszka wrote: > On 2014-10-20 17:15, Knut Omang wrote: > > On Mon, 2014-10-20 at 17:23 +0300, Michael S. Tsirkin wrote: > >> WRT intel_iommu, it does not yet seem to be as fully functional as I > >> hoped. People also discussed th

Re: [Qemu-devel] [PATCH] intel_iommu: fix VTD_SID_TO_BUS

2014-10-20 Thread Knut Omang
On Mon, 2014-10-20 at 21:03 +0200, Knut Omang wrote: > On Mon, 2014-10-20 at 20:18 +0200, Jan Kiszka wrote: > > On 2014-10-20 17:15, Knut Omang wrote: > > > On Mon, 2014-10-20 at 17:23 +0300, Michael S. Tsirkin wrote: > > >> WRT intel_iommu, it does not yet seem

[Qemu-devel] [PATCH 1/2] iommu: Replace bus+devfn arguments with PCIDevice* in PCIIOMMUFunc

2014-10-20 Thread Knut Omang
The dev pointer is needed by intel_iommu to enable it to store the dma address pointer with the device. Signed-off-by: Knut Omang --- hw/alpha/typhoon.c | 2 +- hw/pci-host/apb.c| 2 +- hw/pci-host/prep.c | 3 +-- hw/pci-host/q35.c| 5 +++-- hw/pci/pci.c | 7 +++ hw/ppc

[Qemu-devel] [PATCH 2/2] intel_iommu: Add support for translation for devices behind bridges.

2014-10-20 Thread Knut Omang
NULL dev to q35_host_dma_iommu to indicate a special (non-pci) device (needed by interrupt remapping logic) Signed-off-by: Knut Omang --- hw/i386/intel_iommu.c | 58 ++- hw/pci-host/q35.c | 40 - hw/pci

[Qemu-devel] [PATCH 0/2] intel_iommu: Add support for translation for devices behind bridges

2014-10-20 Thread Knut Omang
index, instead a QLIST is used. This requires a change in the API for setup of IOMMUs which is taken care of by the first patch. The second patch implements the fix. Knut Omang (2): iommu: Replace bus+devfn arguments with PCIDevice* in PCIIOMMUFunc intel_iommu: Add support for translation for

Re: [Qemu-devel] [PATCH] intel_iommu: fix VTD_SID_TO_BUS

2014-10-20 Thread Knut Omang
On Mon, 2014-10-20 at 21:03 +0200, Knut Omang wrote: > On Mon, 2014-10-20 at 20:18 +0200, Jan Kiszka wrote: > > On 2014-10-20 17:15, Knut Omang wrote: > > > On Mon, 2014-10-20 at 17:23 +0300, Michael S. Tsirkin wrote: > > >> WRT intel_iommu, it does not yet seem

Re: [Qemu-devel] [PATCH 0/2] intel_iommu: Add support for translation for devices behind bridges

2014-10-20 Thread Knut Omang
On Tue, 2014-10-21 at 01:29 +0200, Alexander Graf wrote: > > > > Am 21.10.2014 um 00:34 schrieb Knut Omang : > > > > This patch set changes the data structure used to handle address spaces > > within > > the emulated Intel iommu to support traversal also

Re: [Qemu-devel] [PATCH 0/2] intel_iommu: Add support for translation for devices behind bridges

2014-10-21 Thread Knut Omang
On Tue, 2014-10-21 at 11:07 +0200, Alexander Graf wrote: > > > > Am 21.10.2014 um 07:26 schrieb Knut Omang : > > > >> On Tue, 2014-10-21 at 01:29 +0200, Alexander Graf wrote: > >> > >> > >>> Am 21.10.2014 um 00:34 schrieb Knut Omang

Re: [Qemu-devel] [PATCH 0/2] intel_iommu: Add support for translation for devices behind bridges

2014-10-21 Thread Knut Omang
On Tue, 2014-10-21 at 14:26 +0300, Michael S. Tsirkin wrote: > On Tue, Oct 21, 2014 at 01:15:14PM +0200, Alexander Graf wrote: > > > > > > On 21.10.14 11:35, Knut Omang wrote: > > > On Tue, 2014-10-21 at 11:07 +0200, Alexander Graf wrote: > > >> > >

Re: [Qemu-devel] [PATCH 2/2] intel_iommu: Add support for translation for devices behind bridges.

2014-10-25 Thread Knut Omang
On Sat, 2014-10-25 at 14:24 +0200, Jan Kiszka wrote: > On 2014-10-25 13:36, Jan Kiszka wrote: > > On 2014-10-21 00:34, Knut Omang wrote: > >> diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c > >> index 40c97b1..e6832c4 100644 > >> --- a/hw/pci/pci_bri

Re: [Qemu-devel] [PATCH 2/2] intel_iommu: Add support for translation for devices behind bridges.

2014-10-26 Thread Knut Omang
On Sun, 2014-10-26 at 13:06 +0100, Jan Kiszka wrote: > On 2014-10-21 00:34, Knut Omang wrote: > > @@ -65,11 +66,12 @@ struct VTDContextCacheEntry { > > }; > > > > struct VTDAddressSpace { > > -uint8_t bus_num; > > +PCIDevice *dev; > > Thi

Re: [Qemu-devel] [PATCH 0/4] pcie: Add support for Single Root I/O Virtualization

2014-08-29 Thread Knut Omang
On Fri, 2014-08-29 at 18:17 +0200, Michael S. Tsirkin wrote: > On Fri, Aug 29, 2014 at 09:17:05AM +0200, Knut Omang wrote: > > This patch set consists of two parts: > > > > - The two first patches implements SR/IOV building blocks in pcie/pci. > >I have held

Re: [Qemu-devel] [PATCH 2/4] pcie: Add support for Single Root I/O Virtualization (SR/IOV)

2014-09-01 Thread Knut Omang
On Mon, 2014-09-01 at 12:39 +0300, Michael S. Tsirkin wrote: > On Fri, Aug 29, 2014 at 09:17:07AM +0200, Knut Omang wrote: > > This patch provides the building blocks for creating an SR/IOV > > PCIe Extended Capability header and creating and removing > > SR/IOV Virtual Funct

[Qemu-devel] [PATCH v2 0/4] pcie: Add support for Single Root I/O Virtualization

2014-09-02 Thread Knut Omang
- Fix numerous syntax, whitespace and comment issues according to Michael's review. - Fix memory leaks. - Removed igb example device - a rebased version available on github instead. Knut Omang (4): pci: Make use of the devfn property when registering new devices pci: Avoid l

[Qemu-devel] [PATCH v2 4/4] pcie: Add support for Single Root I/O Virtualization (SR/IOV)

2014-09-02 Thread Knut Omang
This patch provides the building blocks for creating an SR/IOV PCIe Extended Capability header and register/unregister SR/IOV Virtual Functions. Signed-off-by: Knut Omang --- hw/pci/Makefile.objs| 2 +- hw/pci/pci.c| 97 hw/pci/pcie.c

[Qemu-devel] [PATCH v2 3/4] pci: Update pci_regs header

2014-09-02 Thread Knut Omang
Pulls in latest version from kernel v3.16 msi: Removed local definitions now in pci_regs.h Also replace usage of PCI_MSIX_FLAGS_BIRMASK with PCI_MSIX_TABLE_BIR to keep in sync with the kernel for future updates. Signed-off-by: Knut Omang --- hw/i386/kvm/pci-assign.c | 4 +- hw/misc/vfio.c

[Qemu-devel] [PATCH v2 1/4] pci: Make use of the devfn property when registering new devices

2014-09-02 Thread Knut Omang
Without this, the devfn argument to pci_create_*() does not affect the assigned devfn. Needed to support (VF_STRIDE,VF_OFFSET) values other than (1,1) for SR/IOV. Signed-off-by: Knut Omang --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw

[Qemu-devel] [PATCH v2 2/4] pci: Avoid losing config updates to MSI/MSIX cap regs

2014-09-02 Thread Knut Omang
Introduce an extra local variable to avoid that the shifting in the for loop causes updates to msi/msix capability registers to get lost in pci_default_write_config. Signed-off-by: Knut Omang --- hw/pci/pci.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/pci

Re: [Qemu-devel] [PATCH v2 1/4] pci: Make use of the devfn property when registering new devices

2014-09-02 Thread Knut Omang
On Tue, 2014-09-02 at 16:03 +0300, Michael S. Tsirkin wrote: > On Tue, Sep 02, 2014 at 01:00:03PM +0200, Knut Omang wrote: > > Without this, the devfn argument to pci_create_*() > > does not affect the assigned devfn. > > > > Needed to support (VF_STRIDE,VF_OFFSET) valu

Re: [Qemu-devel] [PATCH 1/3] intel-iommu: introduce Intel IOMMU (VT-d) emulation

2014-08-03 Thread Knut Omang
ile mode 100644 > >> index 000..3ba0e1e > >> --- /dev/null > >> +++ b/hw/i386/intel_iommu.c > >> @@ -0,0 +1,1139 @@ > >> +/* > >> + * QEMU emulation of an Intel IOMMU (VT-d) > >> + * (DMA Remapping device) > >> + * > >>

Re: [Qemu-devel] VFIO VGA test branches

2013-05-13 Thread Knut Omang
e happy if someone has any hints as to if/how the ifgx_off option could be extended/modified to only affect iommu operation on selected device(s), if at all possible.. Thanks, Knut Omang

Re: [Qemu-devel] VFIO VGA test branches

2013-05-20 Thread Knut Omang
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: [Qemu-devel] VFIO VGA test branches

2013-05-20 Thread Knut Omang
On Sun, 2013-05-19 at 22:15 -0600, Alex Williamson wrote: > 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, > >

Re: [Qemu-devel] Are there any IOMMU emulation in QEMU for x86 platform

2013-12-02 Thread Knut Omang
some way of adapting to what "real" hardware that exists and use the "best" approach from that. > > Nested device > > assignment would require a host IOMMU, and would require the host > > IOMMU driver to do some kind of shadow-paging. > > > > Paolo > Knut Omang

Re: [Qemu-devel] PCI iommu issues

2015-01-31 Thread Knut Omang
On Fri, 2015-01-30 at 08:40 +0100, Jan Kiszka wrote: > Adding Knut to CC as he particularly looked into and fixed the bridging > issues or the vtd emulation. I will have to refresh my memories first. Thanks for cc'ing me, Jan - Yes I did some work specifically to serve my need of being able to use

[Qemu-devel] [PATCH v4 1/1] intel_iommu: Add support for translation for devices behind bridges

2015-09-25 Thread Knut Omang
based invalidate, in which case the bus number is lazily resolved from the bus hash table and cached in a separate index. Signed-off-by: Knut Omang --- hw/i386/intel_iommu.c | 90 +++ hw/pci-host/q35.c | 25 ++-- include/hw

[Qemu-devel] [PATCH v4 0/1] intel_iommu: Add support for translation for devices behind bridges

2015-09-25 Thread Knut Omang
change no longer necessary, so just a single patch. Changes from v1: - Rebased to current master - Fixed minor syntax issues Knut Omang (1): intel_iommu: Add support for translation for devices behind bridges hw/i386/intel_iommu.c | 90 +++ hw/pci

Re: [Qemu-devel] [PATCH v4 1/1] intel_iommu: Add support for translation for devices behind bridges

2015-10-04 Thread Knut Omang
On Sun, 2015-09-27 at 13:07 +0300, Michael S. Tsirkin wrote: > On Sat, Sep 26, 2015 at 08:09:56AM +0200, Knut Omang wrote: > > - Use a hash table indexed on bus pointers to store information > > about buses > > instead of using the bus numbers. > > Bus pointers

[Qemu-devel] [PATCH v5 1/1] intel_iommu: Add support for translation for devices behind bridges

2015-10-04 Thread Knut Omang
based invalidate, in which case the bus number is lazily resolved from the bus hash table and cached in a separate index. Signed-off-by: Knut Omang --- hw/i386/intel_iommu.c | 89 +++ hw/pci-host/q35.c | 25 ++-- include/hw

[Qemu-devel] [PATCH v5 0/1] intel_iommu: Add support for translation for devices behind bridges

2015-10-04 Thread Knut Omang
to avoid API change and further logical deviation from how hardware works. API change no longer necessary, so just a single patch. Changes from v1: - Rebased to current master - Fixed minor syntax issues Knut Omang (1): intel_iommu: Add support for translation for devices behind

Re: [Qemu-devel] [PATCH v4 2/3] pci: Update pci_regs header

2015-10-10 Thread Knut Omang
On Wed, 2015-10-07 at 16:32 +0300, Marcel Apfelbaum wrote: > On 09/12/2015 03:36 PM, Knut Omang wrote: > > Merge in new definitions from kernel v4.2 > > Adds definition necessary to support emulated SR/IOV. > > In the meantime Paolo updated this header to 4.3-RC1, is this

Re: [Qemu-devel] [PATCH v4 3/3] pcie: Add support for Single Root I/O Virtualization (SR/IOV)

2015-10-11 Thread Knut Omang
On Wed, 2015-10-07 at 18:06 +0300, Marcel Apfelbaum wrote: > On 09/12/2015 03:36 PM, Knut Omang wrote: > > This patch provides the building blocks for creating an SR/IOV > > PCIe Extended Capability header and register/unregister > > SR/IOV Virtual Functions. > > &g

Re: [Qemu-devel] Possible reference leak in device_set_realized(...)

2016-01-12 Thread Knut Omang
On Fri, 2016-01-01 at 23:37 +0100, Paolo Bonzini wrote: > > On 31/12/2015 19:13, Ilya Lesokhin wrote: > > I was able to overcome this issue by calling object_unparent on my > > device but I’m not sure that the correct way of fixing it. > > Yes, it's definitely the right way to fix it. Sorry for

[Qemu-devel] [PATCH] Add new DEFAULT_MACHINE_OPTIONS to q35 as well

2013-01-16 Thread Knut Omang
Without this a typical q35 based setup would no longer boot after commit e4ada29e909787f629626660b1561f6a680187d3 Signed-off-by: Knut Omang --- hw/pc_q35.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/pc_q35.c b/hw/pc_q35.c index 52d9976..d82353e 100644 --- a/hw/pc_q35.c +++ b/hw

[Qemu-devel] [PATCH v2] Add new DEFAULT_MACHINE_OPTIONS to q35 and ppc405

2013-01-16 Thread Knut Omang
Without this default q35/ppc405 based machines would no longer boot after commit e4ada29e909787f629626660b1561f6a680187d3 Signed-off-by: Knut Omang --- hw/pc_q35.c| 1 + hw/ppc405_boards.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/pc_q35.c b/hw/pc_q35.c index 52d9976

[Qemu-devel] [PATCH v2] Add new DEFAULT_MACHINE_OPTIONS to q35 and ppc405

2013-01-16 Thread Knut Omang
Without this default q35/ppc405 based machines would no longer boot after commit e4ada29e909787f629626660b1561f6a680187d3 Signed-off-by: Knut Omang Reviewed-by: Markus Armbruster --- hw/pc_q35.c| 1 + hw/ppc405_boards.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/pc_q35.c

Re: [Qemu-devel] VFIO VGA test branches

2013-05-27 Thread Knut Omang
On Mon, 2013-05-20 at 23:11 +0200, Knut Omang wrote: > On Sun, 2013-05-19 at 22:15 -0600, Alex Williamson wrote: > > 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

Re: [Qemu-devel] [PATCH v4 1/3] pci: Make use of the devfn property when registering new devices

2015-10-14 Thread Knut Omang
On Thu, 2015-09-17 at 15:41 +0300, Marcel Apfelbaum wrote: > On 09/17/2015 03:12 PM, Knut Omang wrote: > > On Thu, 2015-09-17 at 14:11 +0300, Marcel Apfelbaum wrote: > > > On 09/12/2015 03:36 PM, Knut Omang wrote: > > > > Without this, the devfn argument to pci_crea

Re: [Qemu-devel] [PATCH v4 3/3] pcie: Add support for Single Root I/O Virtualization (SR/IOV)

2015-10-14 Thread Knut Omang
On Thu, 2015-09-17 at 16:10 +0200, Knut Omang wrote: > On Thu, 2015-09-17 at 14:49 +0300, Marcel Apfelbaum wrote: > > On 09/12/2015 03:36 PM, Knut Omang wrote: > > > This patch provides the building blocks for creating an SR/IOV > > > PCIe Extended Capability hea

[Qemu-devel] [PATCH v5 0/4] pcie: Add support for Single Root I/O Virtualization

2015-10-14 Thread Knut Omang
ed is_vf member with pci_is_vf() function abstraction - Fix numerous syntax, whitespace and comment issues according to Michael's review. - Fix memory leaks. - Removed igb example device - a rebased version available on github instead. Knut Omang (4): pci: Make use of the devfn prop

[Qemu-devel] [PATCH v5 3/4] pcie: Add some SR/IOV API documentation in docs/pcie_sriov.txt

2015-10-14 Thread Knut Omang
Add a small intro + minimal documentation for how to implement SR/IOV support for an emulated device. Signed-off-by: Knut Omang --- docs/pcie_sriov.txt | 115 1 file changed, 115 insertions(+) create mode 100644 docs/pcie_sriov.txt diff

[Qemu-devel] [PATCH v5 1/4] pci: Make use of the devfn property when registering new devices

2015-10-14 Thread Knut Omang
Without this, the devfn argument to pci_create_*() does not affect the assigned devfn. Needed to support (VF_STRIDE,VF_OFFSET) values other than (1,1) for SR/IOV. Signed-off-by: Knut Omang Reviewed-by: Marcel Apfelbaum --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[Qemu-devel] [PATCH v5 4/4] pcie: A few minor fixes (type+code simplify)

2015-10-14 Thread Knut Omang
- Fix comment typo in pcie_cap_slot_write_config - Simplify code in pcie_cap_slot_hot_unplug_request_cb. Signed-off-by: Knut Omang --- hw/pci/pcie.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 774b9ed..ba49c0f 100644 --- a/hw

[Qemu-devel] [PATCH v5 2/4] pcie: Add support for Single Root I/O Virtualization (SR/IOV)

2015-10-14 Thread Knut Omang
This patch provides the building blocks for creating an SR/IOV PCIe Extended Capability header and register/unregister SR/IOV Virtual Functions. Signed-off-by: Knut Omang --- hw/pci/Makefile.objs| 2 +- hw/pci/pci.c| 102 - hw/pci/pcie.c

Re: [Qemu-devel] [PATCH v5 3/4] pcie: Add some SR/IOV API documentation in docs/pcie_sriov.txt

2015-10-16 Thread Knut Omang
On Fri, 2015-10-16 at 13:54 +0300, Michael S. Tsirkin wrote: > On Fri, Oct 16, 2015 at 11:56:39AM +0200, Knut Omang wrote: > > But feel free to just skip this patch, the most important is to get > > the > > generic SR/IOV code in there for others to use. > > That'

Re: [Qemu-devel] [PATCH v5 3/4] pcie: Add some SR/IOV API documentation in docs/pcie_sriov.txt

2015-10-16 Thread Knut Omang
On Fri, 2015-10-16 at 11:36 +0300, Michael S. Tsirkin wrote: > On Wed, Oct 14, 2015 at 05:51:17PM +0200, Knut Omang wrote: > > Add a small intro + minimal documentation for how to > > implement SR/IOV support for an emulated device. > > I worry that we won't keep this up

Re: [Qemu-devel] [PATCH v5 0/4] pcie: Add support for Single Root I/O Virtualization

2015-10-18 Thread Knut Omang
On Sun, 2015-10-18 at 14:02 +0300, Marcel Apfelbaum wrote: > On 10/14/2015 06:51 PM, Knut Omang wrote: > > This patch set implements generic support for SR/IOV as an > > extension to the > > core PCIe functionality, similar to the way other capabilities such > >

Re: [Qemu-devel] [PATCH v5 2/4] pcie: Add support for Single Root I/O Virtualization (SR/IOV)

2015-10-18 Thread Knut Omang
On Sun, 2015-10-18 at 14:02 +0300, Marcel Apfelbaum wrote: > On 10/14/2015 06:51 PM, Knut Omang wrote: > > This patch provides the building blocks for creating an SR/IOV > > PCIe Extended Capability header and register/unregister > > SR/IOV Virtual Functions. > > &g

Re: [Qemu-devel] [PATCH v5 2/4] pcie: Add support for Single Root I/O Virtualization (SR/IOV)

2015-10-18 Thread Knut Omang
sriov.h: > > + * > > + * Implementation of SR/IOV emulation support. > > + * > > + * Copyright (c) 2015 Knut Omang > > + * > > + * This work is licensed under the terms of the GNU GPL, version 2 > > or later. > > + * See the COPYING file in the top-leve

Re: [Qemu-devel] [PATCH v2 03/16] sockets: allow port to be NULL when listening on IP address

2015-10-21 Thread Knut Omang
On Mon, 2015-10-12 at 12:14 +0100, Daniel P. Berrange wrote: > If the port in the SocketAddress struct is NULL, it can allow > the kernel to automatically select a free port. This is useful > in particular in unit tests to avoid a race trying to find a > free port to run a test case on. This patch

[Qemu-devel] [PATCH v6 1/4] pci: Make use of the devfn property when registering new devices

2015-10-22 Thread Knut Omang
Without this, the devfn argument to pci_create_*() does not affect the assigned devfn. Needed to support (VF_STRIDE,VF_OFFSET) values other than (1,1) for SR/IOV. Reviewed-by: Marcel Apfelbaum Signed-off-by: Knut Omang --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[Qemu-devel] [PATCH v6 3/4] pcie: Add some SR/IOV API documentation in docs/pcie_sriov.txt

2015-10-22 Thread Knut Omang
Add a small intro + minimal documentation for how to implement SR/IOV support for an emulated device. Signed-off-by: Knut Omang --- docs/pcie_sriov.txt | 115 1 file changed, 115 insertions(+) create mode 100644 docs/pcie_sriov.txt diff

[Qemu-devel] [PATCH v6 0/4] pcie: Add support for Single Root I/O Virtualization

2015-10-22 Thread Knut Omang
version available on github instead. Knut Omang (4): pci: Make use of the devfn property when registering new devices pcie: Add support for Single Root I/O Virtualization (SR/IOV) pcie: Add some SR/IOV API documentation in docs/pcie_sriov.txt pcie: A few minor fixes (type+code simpli

[Qemu-devel] [PATCH v6 4/4] pcie: A few minor fixes (type+code simplify)

2015-10-22 Thread Knut Omang
- Fix comment typo in pcie_cap_slot_write_config - Simplify code in pcie_cap_slot_hot_unplug_request_cb. Signed-off-by: Knut Omang --- hw/pci/pcie.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 774b9ed..ba49c0f 100644 --- a/hw

  1   2   3   >