Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Alex Williamson
On Fri, 2012-06-08 at 17:05 +0200, Jan Kiszka wrote: > On 2012-06-08 16:56, Alex Williamson wrote: > > The difference between VFIO and kvm device assignment is that VFIO > > emulates a lot of config space for us, so most things are passed > > through. > > That's not different from current device a

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Jan Kiszka
On 2012-06-08 16:56, Alex Williamson wrote: > The difference between VFIO and kvm device assignment is that VFIO > emulates a lot of config space for us, so most things are passed > through. That's not different from current device assignment, is it? I think the major difference is that VFIO filte

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Alex Williamson
On Fri, 2012-06-08 at 16:43 +0200, Jan Kiszka wrote: > On 2012-06-08 16:00, Alexey Kardashevskiy wrote: > > 08.06.2012 21:30, Jan Kiszka пишет: > >> On 2012-06-08 13:16, Alexey Kardashevskiy wrote: > >>> 08.06.2012 20:56, Jan Kiszka написал: > On 2012-06-08 10:47, Alexey Kardashevskiy wrote: >

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Jan Kiszka
On 2012-06-08 16:00, Alexey Kardashevskiy wrote: > 08.06.2012 21:30, Jan Kiszka пишет: >> On 2012-06-08 13:16, Alexey Kardashevskiy wrote: >>> 08.06.2012 20:56, Jan Kiszka написал: On 2012-06-08 10:47, Alexey Kardashevskiy wrote: > Yet another try :) > > Normally the pci_add_capabi

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Alexey Kardashevskiy
08.06.2012 21:30, Jan Kiszka пишет: > On 2012-06-08 13:16, Alexey Kardashevskiy wrote: >> 08.06.2012 20:56, Jan Kiszka написал: >>> On 2012-06-08 10:47, Alexey Kardashevskiy wrote: Yet another try :) Normally the pci_add_capability is called on devices to add new capability. Thi

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Jan Kiszka
On 2012-06-08 13:16, Alexey Kardashevskiy wrote: > 08.06.2012 20:56, Jan Kiszka написал: >> On 2012-06-08 10:47, Alexey Kardashevskiy wrote: >>> Yet another try :) >>> >>> Normally the pci_add_capability is called on devices to add new >>> capability. This is ok for emulated devices which capabilit

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Alexey Kardashevskiy
08.06.2012 20:56, Jan Kiszka написал: > On 2012-06-08 10:47, Alexey Kardashevskiy wrote: >> Yet another try :) >> >> Normally the pci_add_capability is called on devices to add new >> capability. This is ok for emulated devices which capabilities list >> is being built by QEMU. >> >> In the case of

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Jan Kiszka
On 2012-06-08 10:47, Alexey Kardashevskiy wrote: > Yet another try :) > > Normally the pci_add_capability is called on devices to add new > capability. This is ok for emulated devices which capabilities list > is being built by QEMU. > > In the case of VFIO the capability may already exist and ad

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-06-08 Thread Alexey Kardashevskiy
Yet another try :) Normally the pci_add_capability is called on devices to add new capability. This is ok for emulated devices which capabilities list is being built by QEMU. In the case of VFIO the capability may already exist and adding new capability into the beginning of the linked list may c

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-22 Thread Benjamin Herrenschmidt
On Tue, 2012-05-22 at 09:13 +0200, Alexander Graf wrote: > On 22.05.2012, at 09:01, Alexey Kardashevskiy wrote: > > This is internal kitchen of PCIDevice which I do not want to touch > from anywhere but pci.c. And > > there is no "fixup_capability" or something. > > Hrm. Maybe we should have one?

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-22 Thread Alexander Graf
On 22.05.2012, at 09:01, Alexey Kardashevskiy wrote: > On 22/05/12 16:31, Alexander Graf wrote: >> >> >> On 22.05.2012, at 08:11, Alexey Kardashevskiy wrote: >> >>> On 22/05/12 15:52, Alexander Graf wrote: On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: > On 2

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-22 Thread Alexey Kardashevskiy
On 22/05/12 16:31, Alexander Graf wrote: > > > On 22.05.2012, at 08:11, Alexey Kardashevskiy wrote: > >> On 22/05/12 15:52, Alexander Graf wrote: >>> >>> >>> On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: >>> On 22/05/12 13:21, Alexander Graf wrote: > > > On 22.05.2012,

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexander Graf
On 22.05.2012, at 08:11, Alexey Kardashevskiy wrote: > On 22/05/12 15:52, Alexander Graf wrote: >> >> >> On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: >> >>> On 22/05/12 13:21, Alexander Graf wrote: On 22.05.2012, at 04:02, Benjamin Herrenschmidt wrote:

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexander Graf
On 22.05.2012, at 08:11, Alexey Kardashevskiy wrote: > On 22/05/12 15:52, Alexander Graf wrote: >> >> >> On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: >> >>> On 22/05/12 13:21, Alexander Graf wrote: On 22.05.2012, at 04:02, Benjamin Herrenschmidt wrote:

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexey Kardashevskiy
On 22/05/12 15:52, Alexander Graf wrote: > > > On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: > >> On 22/05/12 13:21, Alexander Graf wrote: >>> >>> >>> On 22.05.2012, at 04:02, Benjamin Herrenschmidt >>> wrote: >>> On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote:

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexander Graf
On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: > On 22/05/12 13:21, Alexander Graf wrote: >> >> >> On 22.05.2012, at 04:02, Benjamin Herrenschmidt >> wrote: >> >>> On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote: Alexander, Is that any better? :) >>> >>

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexey Kardashevskiy
On 22/05/12 13:21, Alexander Graf wrote: > > > On 22.05.2012, at 04:02, Benjamin Herrenschmidt > wrote: > >> On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote: >>> Alexander, >>> >>> Is that any better? :) >> >> Alex (Graf that is), ping ? >> >> The original patch from Alexey was f

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexander Graf
On 22.05.2012, at 04:02, Benjamin Herrenschmidt wrote: > On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote: >> Alexander, >> >> Is that any better? :) > > Alex (Graf that is), ping ? > > The original patch from Alexey was fine btw. > > VFIO will always call things with the exis

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Benjamin Herrenschmidt
On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote: > Alexander, > > Is that any better? :) Alex (Graf that is), ping ? The original patch from Alexey was fine btw. VFIO will always call things with the existing capability offset so there's no real risk of doing the wrong thing or br

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-17 Thread Alexey Kardashevskiy
Alexander, Is that any better? :) @@ -1779,11 +1779,29 @@ static void pci_del_option_rom(PCIDevice *pdev) * in pci config space */ int pci_add_capability(PCIDevice *pdev, uint8_t cap_id, uint8_t offset, uint8_t size) { -uint8_t *config; +uint8_t *config, exist

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-13 Thread Alexey Kardashevskiy
On 12/05/12 00:13, Alexander Graf wrote: > > On 11.05.2012, at 14:47, Alexey Kardashevskiy wrote: > >> 11.05.2012 20:52, Alexander Graf написал: >>> >>> On 11.05.2012, at 08:45, Alexey Kardashevskiy wrote: >>> Normally the pci_add_capability is called on devices to add new capability. T

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-13 Thread Alex Williamson
On Sat, 2012-05-12 at 10:27 +1000, Alexey Kardashevskiy wrote: > 12.05.2012 5:20, Jason Baron написал: > > On Fri, May 11, 2012 at 04:45:21PM +1000, Alexey Kardashevskiy wrote: > >> Normally the pci_add_capability is called on devices to add new > >> capability. This is ok for emulated devices whic

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-11 Thread Alexey Kardashevskiy
12.05.2012 5:20, Jason Baron написал: > On Fri, May 11, 2012 at 04:45:21PM +1000, Alexey Kardashevskiy wrote: >> Normally the pci_add_capability is called on devices to add new >> capability. This is ok for emulated devices which capabilities list >> is being built by QEMU. >> >> In the case of VFI

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-11 Thread Jason Baron
On Fri, May 11, 2012 at 04:45:21PM +1000, Alexey Kardashevskiy wrote: > Normally the pci_add_capability is called on devices to add new > capability. This is ok for emulated devices which capabilities list > is being built by QEMU. > > In the case of VFIO the capability may already exist and addin

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-11 Thread Alexander Graf
On 11.05.2012, at 14:47, Alexey Kardashevskiy wrote: > 11.05.2012 20:52, Alexander Graf написал: >> >> On 11.05.2012, at 08:45, Alexey Kardashevskiy wrote: >> >>> Normally the pci_add_capability is called on devices to add new >>> capability. This is ok for emulated devices which capabilities l

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-11 Thread Alexey Kardashevskiy
11.05.2012 20:52, Alexander Graf написал: > > On 11.05.2012, at 08:45, Alexey Kardashevskiy wrote: > >> Normally the pci_add_capability is called on devices to add new >> capability. This is ok for emulated devices which capabilities list >> is being built by QEMU. >> >> In the case of VFIO the c

Re: [Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-11 Thread Alexander Graf
On 11.05.2012, at 08:45, Alexey Kardashevskiy wrote: > Normally the pci_add_capability is called on devices to add new > capability. This is ok for emulated devices which capabilities list > is being built by QEMU. > > In the case of VFIO the capability may already exist and adding new > capabil

[Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-11 Thread Alexey Kardashevskiy
Normally the pci_add_capability is called on devices to add new capability. This is ok for emulated devices which capabilities list is being built by QEMU. In the case of VFIO the capability may already exist and adding new capability into the beginning of the linked list may create a loop. For e

[Qemu-devel] [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-11 Thread Alexey Kardashevskiy
Normally the pci_add_capability is called on devices to add new capability. This is ok for emulated devices which capabilities list is being built by QEMU. In the case of VFIO the capability may already exist and adding new capability into the beginning of the linked list may create a loop. For e