Re: [Qemu-devel] [big lock] Discussion about the convention of device's DMA each other after breaking down biglock

2012-09-30 Thread Avi Kivity
On 09/30/2012 10:48 AM, liu ping fan wrote: > On Sun, Sep 30, 2012 at 4:13 PM, Avi Kivity wrote: >> On 09/29/2012 11:20 AM, liu ping fan wrote: >>> >>> Do we have iommus in qemu now, >> >> We do, but they're hacked into the scsi layer, see hw/sun4m_io

Re: [Qemu-devel] [PATCH V4 4/5] exec, memory: Call to xen_modified_memory.

2012-10-02 Thread Avi Kivity
On 10/01/2012 12:36 PM, Stefano Stabellini wrote: > On Thu, 27 Sep 2012, Anthony PERARD wrote: >> This patch add some calls to xen_modified_memory to notify Xen about >> dirtybits >> during migration. >> >> Signed-off-by: Anthony PERARD > > If I am not mistaken, this is the last patch that need

Re: [Qemu-devel] [PATCH V4 4/5] exec, memory: Call to xen_modified_memory.

2012-10-02 Thread Avi Kivity
On 10/02/2012 06:16 PM, Anthony PERARD wrote: > >> Possibly the first bit too? > > But the call from invalidate_and_set_dirty, I can not remove it because > it does not work. The xen function must be called without condition as > xen and qemu does not maintained the same dirtymap. Right, in fac

Re: [Qemu-devel] [PATCH V5 4/5] exec, memory: Call to xen_modified_memory.

2012-10-02 Thread Avi Kivity
On 10/02/2012 06:52 PM, Anthony PERARD wrote: > This patch add some calls to xen_modified_memory to notify Xen about dirtybits > during migration. Reviewed-by: Avi Kivity -- error compiling committee.c: too many arguments to function

[Qemu-devel] [PATCH] s390: avoid reaching into memory core internals

2012-10-03 Thread Avi Kivity
use cpu_physical_memory_is_io() instead. Signed-off-by: Avi Kivity --- target-s390x/misc_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c index e9b3cae..2da4c90 100644 --- a/target-s390x/misc_helper.c +++ b

[Qemu-devel] [RFC v1 00/22] Integrate DMA into the memory API

2012-10-03 Thread Avi Kivity
representation of an initiator. Each address space describes the paths from some point in the system (a device or cpu) to the devices reachable from that initiator. As an example, the API is used to support PCI_COMMAND_MASTER bit. Avi Kivity (22): memory: rename 'exec-obsolete.h'

[Qemu-devel] [RFC v1 01/22] memory: rename 'exec-obsolete.h'

2012-10-03 Thread Avi Kivity
er of anyone using them. Signed-off-by: Avi Kivity --- cputlb.c | 3 +-- exec.c | 3 +-- exec-obsolete.h => memory-internal.h | 8 ++-- memory.c | 3 +-- 4 files changed, 5 insertions(+), 12 deletions(-)

[Qemu-devel] [RFC v1 03/22] kvm: use separate MemoryListeners for memory and I/O

2012-10-03 Thread Avi Kivity
ff-by: Avi Kivity --- kvm-all.c | 83 +-- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 92a7137..c69e012 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -755,9 +755,16 @@ static void kvm_log_global

[Qemu-devel] [RFC v1 20/22] dma: make dma access its own address space

2012-10-03 Thread Avi Kivity
Instead of accessing the cpu address space, use an address space configured by the caller. Eventually all dma functionality will be folded into AddressSpace, but we have to start from something. Signed-off-by: Avi Kivity --- dma-helpers.c| 25 - dma.h

[Qemu-devel] [RFC v1 04/22] xen_pt: use separate MemoryListeners for memory and I/O

2012-10-03 Thread Avi Kivity
Using an unfiltered memory listener will cause regions to be reported fails multiple times if we have more than two address spaces. Use a separate listener for memory and I/O, and utilize MemoryListener's address space filtering to fix this. Signed-off-by: Avi Kivity --- hw/xen_pt.c

[Qemu-devel] [RFC v1 17/22] memory: use AddressSpace for MemoryListener filtering

2012-10-03 Thread Avi Kivity
Using the AddressSpace type reduces confusion, as you can't accidentally supply the MemoryRegion you're interested in. Signed-off-by: Avi Kivity --- exec-memory.h | 3 +++ exec.c| 10 +- hw/vfio_pci.c | 3 +-- hw/vhost.c| 2 +- hw/xen_pt.c | 4 ++-- kvm-all.

[Qemu-devel] [RFC v1 07/22] memory: maintain a list of address spaces

2012-10-03 Thread Avi Kivity
Instead of embedding knowledge of the memory and I/O address spaces in the memory core, maintain a list of all address spaces. This list will later be extended dynamically for other but masters. Signed-off-by: Avi Kivity --- memory.c | 75

[Qemu-devel] [RFC v1 09/22] memory: use new MEMORY_LISTENER_DEFAULT_OPS

2012-10-03 Thread Avi Kivity
Removes quite a bit of useless code. Signed-off-by: Avi Kivity --- exec.c | 98 ++ 1 file changed, 2 insertions(+), 96 deletions(-) diff --git a/exec.c b/exec.c index 5c703b9..1fd6a10 100644 --- a/exec.c +++ b/exec.c @@ -3202,32

[Qemu-devel] [RFC v1 13/22] xen: use new MEMORY_LISTENER_DEFAULT_OPS

2012-10-03 Thread Avi Kivity
Removes quite a bit of useless code. Signed-off-by: Avi Kivity --- xen-all.c | 43 +-- 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/xen-all.c b/xen-all.c index f76b051..823e043 100644 --- a/xen-all.c +++ b/xen-all.c @@ -452,14 +452,6

[Qemu-devel] [RFC v1 02/22] vhost: use MemoryListener filtering to only monitor RAM address space

2012-10-03 Thread Avi Kivity
Instead of checking manually, let the listener filter for us. This prepares us for DMA address spaces. Signed-off-by: Avi Kivity --- hw/vhost.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/vhost.c b/hw/vhost.c index d0ce5aa..100f765 100644 --- a/hw/vhost.c +++ b

[Qemu-devel] [RFC v1 21/22] pci: give each device its own address space

2012-10-03 Thread Avi Kivity
ction. Signed-off-by: Avi Kivity --- hw/pci.c | 9 + hw/pci.h | 1 + 2 files changed, 10 insertions(+) diff --git a/hw/pci.c b/hw/pci.c index f855cf3..ecea286 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -33,6 +33,7 @@ #include "qmp-commands.h" #include "msi.h" #include

[Qemu-devel] [RFC v1 12/22] kvm: use new MEMORY_LISTENER_DEFAULT_OPS

2012-10-03 Thread Avi Kivity
Removes quite a bit of useless code. Signed-off-by: Avi Kivity --- kvm-all.c | 32 ++-- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index c69e012..5e9215d 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -703,14 +703,6 @@ static void

[Qemu-devel] [RFC v1 08/22] memory: provide defaults for MemoryListener operations

2012-10-03 Thread Avi Kivity
Many listeners don't need to respond to all MemoryListener callbacks; provide suitable defaults instead. Signed-off-by: Avi Kivity --- memory.c | 15 +++ memory.h | 21 + 2 files changed, 36 insertions(+) diff --git a/memory.c b/memory.c index b58b97c..ef

[Qemu-devel] [RFC v1 16/22] memory: move tcg flush into a tcg memory listener

2012-10-03 Thread Avi Kivity
We plan to make the core listener listen to all address spaces; this will cause many more flushes than necessary. Prepare for that by moving the flush into a tcg-specific listener. Later we can avoid registering the listener if tcg is disabled. Signed-off-by: Avi Kivity --- exec.c | 9

[Qemu-devel] [RFC v1 14/22] memory: manage coalesced mmio via a MemoryListener

2012-10-03 Thread Avi Kivity
space) but the result is cleaner as well. Signed-off-by: Avi Kivity --- exec.c | 13 - kvm-all.c | 20 ++-- kvm-stub.c | 10 -- kvm.h | 2 -- memory.c | 24 memory.h | 12 +++- 6 files changed, 41 insertions

[Qemu-devel] [RFC v1 18/22] s390: avoid reaching into memory core internals

2012-10-03 Thread Avi Kivity
use cpu_physical_memory_is_io() instead. Signed-off-by: Avi Kivity --- target-s390x/misc_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c index e9b3cae..2da4c90 100644 --- a/target-s390x/misc_helper.c +++ b

[Qemu-devel] [RFC v1 10/22] vfio: use new MEMORY_LISTENER_DEFAULT_OPS

2012-10-03 Thread Avi Kivity
Removes quite a bit of useless code. Signed-off-by: Avi Kivity --- hw/vfio_pci.c | 30 +- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index a1eeced..8e49535 100644 --- a/hw/vfio_pci.c +++ b/hw/vfio_pci.c @@ -803,25

[Qemu-devel] [RFC v1 19/22] memory: per-AddressSpace dispatch

2012-10-03 Thread Avi Kivity
is that address_space_io also gains a dispatch table. When we remove all the pre-memory-API I/O registrations, we can use that for dispatching I/O and get rid of the original I/O dispatch. Signed-off-by: Avi Kivity --- cputlb.c | 3 +- cputlb.h | 3 +- exec.c

[Qemu-devel] [RFC v1 22/22] pci: honor PCI_COMMAND_MASTER

2012-10-03 Thread Avi Kivity
ping was running on a NIC in slot 3. The kernel (Linux) detected the stall and recovered after the command setpci -s 03 COMMAND=7 was issued. Signed-off-by: Avi Kivity --- hw/pci.c | 12 ++-- hw/pci.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/pci.c

[Qemu-devel] [RFC v1 05/22] memory: prepare AddressSpace for exporting

2012-10-03 Thread Avi Kivity
AddressSpace contains a member, current_map, of type FlatView. Since we want to limit the leakage of internal types to public headers, switch to a pointer to a FlatView. There is no performance impact as this isn't used during lookups, only address space reconfigurations. Signed-off-by

[Qemu-devel] [RFC v1 11/22] xen_pt: use new MEMORY_LISTENER_DEFAULT_OPS

2012-10-03 Thread Avi Kivity
Removes quite a bit of useless code. Signed-off-by: Avi Kivity --- hw/xen_pt.c | 47 ++- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/hw/xen_pt.c b/hw/xen_pt.c index 438ad54..4dcf46a 100644 --- a/hw/xen_pt.c +++ b/hw/xen_pt.c

[Qemu-devel] [RFC v1 15/22] memory: move address_space_memory and address_space_io out of memory core

2012-10-03 Thread Avi Kivity
With this change, memory.c no longer knows anything about special address spaces, so it is prepared for AddressSpace based DMA. Signed-off-by: Avi Kivity --- exec-memory.h | 6 -- exec.c| 9 +++-- memory.c | 16 3 files changed, 7 insertions(+), 24

[Qemu-devel] [RFC v1 06/22] memory: export AddressSpace

2012-10-03 Thread Avi Kivity
The DMA API will use an AddressSpace to differentiate among different initiators. Signed-off-by: Avi Kivity --- memory.c | 11 +-- memory.h | 21 + 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/memory.c b/memory.c index 7e9e373..431a867 100644

Re: [Qemu-devel] [RFC v1 03/22] kvm: use separate MemoryListeners for memory and I/O

2012-10-03 Thread Avi Kivity
On 10/03/2012 10:16 PM, Blue Swirl wrote: > > +static MemoryListener kvm_io_listener = { > > const > There is a list link field in there. It's a mixed data/ops structure (perhaps we should make it a traditional ->ops-> pointer). -- I have a truly marvellous patch that fixes the bug which this s

Re: [Qemu-devel] [RFC v1 19/22] memory: per-AddressSpace dispatch

2012-10-03 Thread Avi Kivity
On 10/03/2012 10:24 PM, Blue Swirl wrote: > > > > #else > > -void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, > > -int len, int is_write) > > + > > +void address_space_rw(AddressSpace *as, target_phys_addr_t addr, uint8_t > > *buf, > > +

Re: [Qemu-devel] [RFC v1 00/22] Integrate DMA into the memory API

2012-10-03 Thread Avi Kivity
Adding missing cc's: there are minor changes to vfio and xen here, please review and test. On 10/03/2012 06:03 PM, Avi Kivity wrote: > Most of the work on the memory API focused on memory access targets - the > memory regions > and how they are composed into an address space.

[Qemu-devel] [PATCH v2] s390: avoid reaching into memory core internals

2012-10-04 Thread Avi Kivity
use cpu_physical_memory_is_io() instead. Signed-off-by: Avi Kivity --- v2: drop unnecessary #include target-s390x/misc_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c index e9b3cae..fdccd58 100644 --- a

[Qemu-devel] [PATCH] Make target_phys_addr_t 64 bits unconditionally

2012-10-04 Thread Avi Kivity
ff-by: Avi Kivity --- .gitignore | 1 + Makefile| 2 +- Makefile.hw | 1 - Makefile.target | 3 --- configure | 34 -- cpu-common.h| 2 +- dma.h | 2 +- hw

Re: [Qemu-devel] [RFC v1 19/22] memory: per-AddressSpace dispatch

2012-10-04 Thread Avi Kivity
On 10/04/2012 10:47 AM, Peter Maydell wrote: >>> I'd make address_space_* use uint64_t instead of target_phys_addr_t >>> for the address. It may actually be buggy for 32 bit >>> target_phys_addr_t and 64 bit DMA addresses, if such architectures >>> exist. Maybe memory.c could be made target indepe

Re: [Qemu-devel] [RFC v1 17/22] memory: use AddressSpace for MemoryListener filtering

2012-10-04 Thread Avi Kivity
On 10/03/2012 10:16 PM, Blue Swirl wrote: >> @@ -141,7 +141,7 @@ static bool memory_listener_match(MemoryListener >> *listener, >> #define MEMORY_LISTENER_UPDATE_REGION(fr, as, dir, callback)\ >> MEMORY_LISTENER_CALL(callback, dir, (&(MemoryRegionSection) { \ >> .m

Re: [Qemu-devel] [RFC v1 00/22] Integrate DMA into the memory API

2012-10-04 Thread Avi Kivity
On 10/03/2012 10:26 PM, Blue Swirl wrote: > On Wed, Oct 3, 2012 at 4:03 PM, Avi Kivity wrote: >> Most of the work on the memory API focused on memory access targets - the >> memory regions >> and how they are composed into an address space. This patchset tackles the >&

Re: [Qemu-devel] [RFC v1 07/22] memory: maintain a list of address spaces

2012-10-04 Thread Avi Kivity
On 10/04/2012 12:17 PM, Gleb Natapov wrote: > On Wed, Oct 03, 2012 at 06:03:50PM +0200, Avi Kivity wrote: >> Instead of embedding knowledge of the memory and I/O address spaces in the >> memory core, maintain a list of all address spaces. This list will later >> be extended

Re: [Qemu-devel] [RFC v1 19/22] memory: per-AddressSpace dispatch

2012-10-04 Thread Avi Kivity
On 10/04/2012 12:29 PM, Peter Maydell wrote: > On 4 October 2012 11:15, Avi Kivity wrote: >> On 10/04/2012 10:47 AM, Peter Maydell wrote: >>> I'd favour just moving everything to 64 bits (the remaining >>> 32 bit targets are: cris, lm32, m68k, microblaze,

[Qemu-devel] [PATCH v2] Make target_phys_addr_t 64 bits unconditionally

2012-10-04 Thread Avi Kivity
ff-by: Avi Kivity --- v2: no changes, but copied the maintainers of architectures that will see their target_phys_addr_t changed as a result. Please view and/or test. .gitignore | 1 + Makefile| 2 +- Makefile.hw | 1 - Makefile.target

Re: [Qemu-devel] [PATCH 2/2] Adding BAR0 for e500 PCI controller

2012-10-04 Thread Avi Kivity
On 10/03/2012 01:50 PM, Bharat Bhushan wrote: > sysbus_connect_irq(s, 0, mpic[pci_irq_nrs[0]]); > diff --git a/hw/ppce500_pci.c b/hw/ppce500_pci.c > index 92b1dc0..16e4af2 100644 > --- a/hw/ppce500_pci.c > +++ b/hw/ppce500_pci.c > @@ -87,6 +87,7 @@ struct PPCE500PCIState { > /* mmio maps

Re: [Qemu-devel] [RFC v1 14/22] memory: manage coalesced mmio via a MemoryListener

2012-10-04 Thread Avi Kivity
On 10/04/2012 04:08 PM, Anthony Liguori wrote: > Avi Kivity writes: > >> Instead of calling a global function on coalesced mmio changes, which >> routes the call to kvm if enabled, add coalesced mmio hooks to >> MemoryListener and make kvm use that instead. >> &g

Re: [Qemu-devel] [RFC v1 00/22] Integrate DMA into the memory API

2012-10-04 Thread Avi Kivity
On 10/04/2012 04:16 PM, Anthony Liguori wrote: > Paolo Bonzini writes: > >> Il 03/10/2012 18:03, Avi Kivity ha scritto: >>> Most of the work on the memory API focused on memory access targets - the >>> memory regions >>> and how they are composed into a

Re: [Qemu-devel] [PATCH 2/2] Adding BAR0 for e500 PCI controller

2012-10-04 Thread Avi Kivity
On 10/04/2012 03:46 PM, Bhushan Bharat-R65777 wrote: > > >> -Original Message----- >> From: Avi Kivity [mailto:a...@redhat.com] >> Sent: Thursday, October 04, 2012 6:02 PM >> To: Bhushan Bharat-R65777 >> Cc: qemu-devel@nongnu.org; qemu-...@nongnu.or

Re: [Qemu-devel] [RFC v1 08/22] memory: provide defaults for MemoryListener operations

2012-10-04 Thread Avi Kivity
On 10/04/2012 04:05 PM, Anthony Liguori wrote: > Avi Kivity writes: > >> Many listeners don't need to respond to all MemoryListener callbacks; >> provide suitable defaults instead. >> >> +#define MEMORY_LISTENER_DEFAULT_OPS

Re: [Qemu-devel] [RFC v1 03/22] kvm: use separate MemoryListeners for memory and I/O

2012-10-04 Thread Avi Kivity
On 10/04/2012 06:44 PM, Blue Swirl wrote: > On Thu, Oct 4, 2012 at 6:33 AM, Avi Kivity wrote: >> On 10/03/2012 10:16 PM, Blue Swirl wrote: >>> > +static MemoryListener kvm_io_listener = { >>> >>> const >>> >> >> There is a list link fie

Re: [Qemu-devel] [PATCH 2/2] Adding BAR0 for e500 PCI controller

2012-10-04 Thread Avi Kivity
On 10/04/2012 06:50 PM, Alexander Graf wrote: >>> >>> No, it also meets (2). The PCI address space is identical to the CPU memory >>> space in our mapping right now. So if the guest maps BAR0 somewhere, it >>> automatically maps CCSR into CPU address space, which exposes it to PCI >>> address >>>

Re: [Qemu-devel] [RFC v1 19/22] memory: per-AddressSpace dispatch

2012-10-04 Thread Avi Kivity
On 10/04/2012 07:13 PM, Blue Swirl wrote: > On Thu, Oct 4, 2012 at 6:38 AM, Avi Kivity wrote: >> On 10/03/2012 10:24 PM, Blue Swirl wrote: >>> > >>> > #else >>> > -void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, >>>

Re: [Qemu-devel] [RFC v1 19/22] memory: per-AddressSpace dispatch

2012-10-04 Thread Avi Kivity
On 10/04/2012 04:13 PM, Anthony Liguori wrote: >> >> +void address_space_init_dispatch(AddressSpace *as) >> +{ >> +AddressSpaceDispatch *d = g_new(AddressSpaceDispatch, 1); >> + >> +d->phys_map = (PhysPageEntry) { .ptr = PHYS_MAP_NODE_NIL, .is_leaf = 0 >> }; >> +d->listener = (Memor

Re: [Qemu-devel] [PATCH 2/2] Adding BAR0 for e500 PCI controller

2012-10-07 Thread Avi Kivity
On 10/05/2012 01:59 PM, Alexander Graf wrote: Do you mean that we add the "MemoryRegion bar0" in PCIDevice struct. Do the >>> same thing that I was doing in e500_pcihost_initfn() in the k->init() (will >>> add >>> this) function of "e500-host-bridge" >>> >>> No, he means that you create a ne

Re: [Qemu-devel] Ping [PATCH 0/2] Add TPCI200 and IP-Octal 232 IndustryPack emulation

2012-10-07 Thread Avi Kivity
On 10/05/2012 06:24 PM, Blue Swirl wrote: > > I'd suppose addressing devices in the bus could be implemented more > efficiently with better use of memory API, now some of it is > reimplemented. Maybe Avi can propose something? Luckily the low-order bits are used for offsets, and the high-order bi

Re: [Qemu-devel] Ping [PATCH 0/2] Add TPCI200 and IP-Octal 232 IndustryPack emulation

2012-10-07 Thread Avi Kivity
On 10/07/2012 12:13 PM, Avi Kivity wrote: > On 10/05/2012 06:24 PM, Blue Swirl wrote: >> >> I'd suppose addressing devices in the bus could be implemented more >> efficiently with better use of memory API, now some of it is >> reimplemented. Maybe Avi can propose

Re: [Qemu-devel] [PATCH v2] Make target_phys_addr_t 64 bits unconditionally

2012-10-07 Thread Avi Kivity
On 10/04/2012 08:15 PM, Stefan Weil wrote: > Am 04.10.2012 12:36, schrieb Avi Kivity: >> The hassle and compile time overhead of maintaining both 32-bit and >> 64-bit >> capable source isn't worth the tiny performance advantage which is >> seen on >> a

Re: [Qemu-devel] [PATCH] build: rm libhw

2012-10-07 Thread Avi Kivity
On 10/05/2012 06:06 PM, Anthony Liguori wrote: > Signed-off-by: Anthony Liguori > > -QEMULIBS=libhw libuser libdis libdis-user > +QEMULIBS=libuser libdis libdis-user > Two other possibilities: - make it 'libhw.a' (and introduce a way of including just relevant hardware models) - reduces bina

Re: [Qemu-devel] [RFC v1 19/22] memory: per-AddressSpace dispatch

2012-10-07 Thread Avi Kivity
On 10/04/2012 09:16 PM, Peter Maydell wrote: > On 4 October 2012 20:05, Anthony Liguori wrote: >> Blue Swirl writes: >>> They can all be 64 bits, I'm just considering types. Getting rid of >>> target_phys_addr_t, pcibus_t, pio_addr_t and dma_addr_t (are there >>> more?) may be also worthwhile. >>

[Qemu-devel] [PATCH v1 07/23] memory: maintain a list of address spaces

2012-10-07 Thread Avi Kivity
Instead of embedding knowledge of the memory and I/O address spaces in the memory core, maintain a list of all address spaces. This list will later be extended dynamically for other bus masters. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- memory.c | 75

[Qemu-devel] [PATCH v1 12/23] kvm: use new MEMORY_LISTENER_DEFAULT_OPS

2012-10-07 Thread Avi Kivity
Removes quite a bit of useless code. Signed-off-by: Avi Kivity --- kvm-all.c | 32 ++-- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index c69e012..5e9215d 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -703,14 +703,6 @@ static void

[Qemu-devel] [PATCH v1 19/23] memory: per-AddressSpace dispatch

2012-10-07 Thread Avi Kivity
is that address_space_io also gains a dispatch table. When we remove all the pre-memory-API I/O registrations, we can use that for dispatching I/O and get rid of the original I/O dispatch. Signed-off-by: Avi Kivity --- cputlb.c | 3 +- cputlb.h | 3 +- exec.c

[Qemu-devel] [PATCH v1 15/23] memory: move address_space_memory and address_space_io out of memory core

2012-10-07 Thread Avi Kivity
With this change, memory.c no longer knows anything about special address spaces, so it is prepared for AddressSpace based DMA. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- exec-memory.h | 6 -- exec.c| 9 +++-- memory.c | 16 3 files

[Qemu-devel] [PATCH v1 09/23] memory: use new MEMORY_LISTENER_DEFAULT_OPS

2012-10-07 Thread Avi Kivity
Removes quite a bit of useless code. Signed-off-by: Avi Kivity --- exec.c | 98 ++ 1 file changed, 2 insertions(+), 96 deletions(-) diff --git a/exec.c b/exec.c index 5c703b9..1fd6a10 100644 --- a/exec.c +++ b/exec.c @@ -3202,32

[Qemu-devel] [PATCH v1 11/23] xen_pt: use new MEMORY_LISTENER_DEFAULT_OPS

2012-10-07 Thread Avi Kivity
Removes quite a bit of useless code. Signed-off-by: Avi Kivity --- hw/xen_pt.c | 47 ++- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/hw/xen_pt.c b/hw/xen_pt.c index 438ad54..4dcf46a 100644 --- a/hw/xen_pt.c +++ b/hw/xen_pt.c

Re: [Qemu-devel] [PATCH 2/2] Adding BAR0 for e500 PCI controller

2012-10-07 Thread Avi Kivity
On 10/07/2012 01:57 PM, Alexander Graf wrote: > > > On 07.10.2012, at 11:48, Avi Kivity wrote: > >> On 10/05/2012 01:59 PM, Alexander Graf wrote: >>>>>> Do you mean that we add the "MemoryRegion bar0" in PCIDevice struct. Do >>>>>&

[Qemu-devel] [PATCH v1 16/23] memory: move tcg flush into a tcg memory listener

2012-10-07 Thread Avi Kivity
We plan to make the core listener listen to all address spaces; this will cause many more flushes than necessary. Prepare for that by moving the flush into a tcg-specific listener. Later we can avoid registering the listener if tcg is disabled. Signed-off-by: Avi Kivity --- exec.c | 9

[Qemu-devel] [PATCH v1 21/23] memory: add address_space_destroy()

2012-10-07 Thread Avi Kivity
Since address spaces can be created dynamically by device hotplug, they can also be destroyed dynamically. Signed-off-by: Avi Kivity --- exec.c| 10 ++ memory-internal.h | 1 + memory.c | 18 -- memory.h | 12 4 files changed

[Qemu-devel] [PATCH v1 20/23] dma: make dma access its own address space

2012-10-07 Thread Avi Kivity
Instead of accessing the cpu address space, use an address space configured by the caller. Eventually all dma functionality will be folded into AddressSpace, but we have to start from something. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- dma-helpers.c| 25

[Qemu-devel] [PATCH v1 22/23] pci: give each device its own address space

2012-10-07 Thread Avi Kivity
Accesses from different devices can resolve differently (depending on bridge settings, iommus, and PCI_COMMAND_MASTER), so set up an address space for each device. Currently iommus are expressed outside the memory API, so this doesn't work if an iommu is present. Signed-off-by: Avi K

Re: [Qemu-devel] [PATCH v2] Make target_phys_addr_t 64 bits unconditionally

2012-10-07 Thread Avi Kivity
On 10/05/2012 06:45 PM, Peter Maydell wrote: > On 4 October 2012 11:36, Avi Kivity wrote: >> diff --git a/targphys.h b/targphys.h >> index bd4938f..08cade9 100644 >> --- a/targphys.h >> +++ b/targphys.h >> @@ -3,25 +3,10 @@ >> #ifndef TARGPHYS

[Qemu-devel] [PATCH v1 10/23] vfio: use new MEMORY_LISTENER_DEFAULT_OPS

2012-10-07 Thread Avi Kivity
Removes quite a bit of useless code. Acked-by: Alex Williamson Signed-off-by: Avi Kivity --- hw/vfio_pci.c | 30 +- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c index a1eeced..8e49535 100644 --- a/hw/vfio_pci.c +++ b/hw

[Qemu-devel] [PATCH v1 00/23] Integrate DMA into the memory API

2012-10-07 Thread Avi Kivity
ehaviour is preexisting. They will be resolved in a future patchset. Avi Kivity (23): memory: rename 'exec-obsolete.h' vhost: use MemoryListener filtering to only monitor RAM address space kvm: use separate MemoryListeners for memory and I/O xen_pt: use separate MemoryListeners for me

[Qemu-devel] [PATCH v1 23/23] pci: honor PCI_COMMAND_MASTER

2012-10-07 Thread Avi Kivity
ping was running on a NIC in slot 3. The kernel (Linux) detected the stall and recovered after the command setpci -s 03 COMMAND=7 was issued. Signed-off-by: Avi Kivity --- hw/pci.c | 13 +++-- hw/pci.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/pci.c

[Qemu-devel] [PATCH v1 13/23] xen: use new MEMORY_LISTENER_DEFAULT_OPS

2012-10-07 Thread Avi Kivity
Removes quite a bit of useless code. Signed-off-by: Avi Kivity --- xen-all.c | 43 +-- 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/xen-all.c b/xen-all.c index f76b051..823e043 100644 --- a/xen-all.c +++ b/xen-all.c @@ -452,14 +452,6

[Qemu-devel] [PATCH v1 06/23] memory: export AddressSpace

2012-10-07 Thread Avi Kivity
The DMA API will use an AddressSpace to differentiate among different initiators. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- memory.c | 11 +-- memory.h | 21 + 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/memory.c b/memory.c

[Qemu-devel] [PATCH v1 18/23] s390: avoid reaching into memory core internals

2012-10-07 Thread Avi Kivity
use cpu_physical_memory_is_io() instead. Signed-off-by: Avi Kivity --- target-s390x/misc_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c index e9b3cae..fdccd58 100644 --- a/target-s390x/misc_helper.c +++ b

[Qemu-devel] [PATCH v1 17/23] memory: use AddressSpace for MemoryListener filtering

2012-10-07 Thread Avi Kivity
Using the AddressSpace type reduces confusion, as you can't accidentally supply the MemoryRegion you're interested in. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- exec-memory.h | 3 +++ exec.c| 10 +- hw/vfio_pci.c | 3 +-- hw/vhost.c| 2 +- h

[Qemu-devel] [PATCH v1 02/23] vhost: use MemoryListener filtering to only monitor RAM address space

2012-10-07 Thread Avi Kivity
Instead of checking manually, let the listener filter for us. This prepares us for DMA address spaces. Signed-off-by: Avi Kivity --- hw/vhost.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/vhost.c b/hw/vhost.c index d0ce5aa..100f765 100644 --- a/hw/vhost.c +++ b

[Qemu-devel] [PATCH v1 03/23] kvm: use separate MemoryListeners for memory and I/O

2012-10-07 Thread Avi Kivity
ff-by: Avi Kivity --- kvm-all.c | 83 +-- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 92a7137..c69e012 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -755,9 +755,16 @@ static void kvm_log_global

[Qemu-devel] [PATCH v1 04/23] xen_pt: use separate MemoryListeners for memory and I/O

2012-10-07 Thread Avi Kivity
Using an unfiltered memory listener will cause regions to be reported fails multiple times if we have more than two address spaces. Use a separate listener for memory and I/O, and utilize MemoryListener's address space filtering to fix this. Signed-off-by: Avi Kivity --- hw/xen_pt.c

[Qemu-devel] [PATCH v1 14/23] memory: manage coalesced mmio via a MemoryListener

2012-10-07 Thread Avi Kivity
space) but the result is cleaner as well. Signed-off-by: Avi Kivity --- exec.c | 13 - kvm-all.c | 20 ++-- kvm-stub.c | 10 -- kvm.h | 2 -- memory.c | 24 memory.h | 12 +++- 6 files changed, 41 insertions

[Qemu-devel] [PATCH v1 05/23] memory: prepare AddressSpace for exporting

2012-10-07 Thread Avi Kivity
thony Liguori Signed-off-by: Avi Kivity --- memory.c | 39 --- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/memory.c b/memory.c index 1aeca08..7e9e373 100644 --- a/memory.c +++ b/memory.c @@ -222,7 +222,7 @@ struct FlatView { /* A system ad

[Qemu-devel] [PATCH v1 08/23] memory: provide defaults for MemoryListener operations

2012-10-07 Thread Avi Kivity
Many listeners don't need to respond to all MemoryListener callbacks; provide suitable defaults instead. Signed-off-by: Avi Kivity --- memory.c | 15 +++ memory.h | 21 + 2 files changed, 36 insertions(+) diff --git a/memory.c b/memory.c index b58b97c..ef

[Qemu-devel] [PATCH v1 01/23] memory: rename 'exec-obsolete.h'

2012-10-07 Thread Avi Kivity
er of anyone using them. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- cputlb.c | 3 +-- exec.c | 3 +-- exec-obsolete.h => memory-internal.h | 8 ++-- memory.c | 3 +-- 4 files ch

Re: [Qemu-devel] [PATCH 2/3] e500: Adding CCSR memory region

2012-10-09 Thread Avi Kivity
On 10/08/2012 07:21 PM, Andreas Färber wrote: > Am 08.10.2012 18:46, schrieb Bharat Bhushan: >> All devices are also placed under CCSR memory region. >> The CCSR memory region is exported to pci device. The MSI interrupt >> generation is the main reason to export the CCSR region to PCI device. >> T

Re: [Qemu-devel] Block I/O outside the QEMU global mutex was "Re: [RFC PATCH 00/17] Support for multiple "AIO contexts""

2012-10-09 Thread Avi Kivity
On 10/09/2012 11:08 AM, Stefan Hajnoczi wrote: > Here are the steps that have been mentioned: > > 1. aio fastpath - for raw-posix and other aio block drivers, can we reduce I/O >request latency by skipping block layer coroutines? Is coroutine overhead noticable? > I'm also curious about vi

Re: [Qemu-devel] Using PCI config space to indicate config location

2012-10-09 Thread Avi Kivity
On 10/09/2012 05:16 AM, Rusty Russell wrote: > Anthony Liguori writes: >> We'll never remove legacy so we shouldn't plan on it. There are >> literally hundreds of thousands of VMs out there with the current virtio >> drivers installed in them. We'll be supporting them for a very, very >> long ti

Re: [Qemu-devel] Block I/O outside the QEMU global mutex was "Re: [RFC PATCH 00/17] Support for multiple "AIO contexts""

2012-10-09 Thread Avi Kivity
On 10/09/2012 12:36 PM, Paolo Bonzini wrote: > Il 09/10/2012 11:26, Avi Kivity ha scritto: >> On 10/09/2012 11:08 AM, Stefan Hajnoczi wrote: >>> Here are the steps that have been mentioned: >>> >>> 1. aio fastpath - for raw-posix and other aio block drivers, c

Re: [Qemu-devel] Block I/O outside the QEMU global mutex was "Re: [RFC PATCH 00/17] Support for multiple "AIO contexts""

2012-10-09 Thread Avi Kivity
On 10/09/2012 01:08 PM, Paolo Bonzini wrote: >> >> That's not strictly a coroutine issue. Switching to ordinary threads >> may make the problem worse, since there will clearly be contention. > > The point is you don't need either coroutines or userspace threads if > you use native AIO. longjmp/

Re: [Qemu-devel] Block I/O outside the QEMU global mutex was "Re: [RFC PATCH 00/17] Support for multiple "AIO contexts""

2012-10-09 Thread Avi Kivity
On 10/09/2012 02:01 PM, Paolo Bonzini wrote: > >> [could we also avoid refcounting by doing the equivalent of >> stop_machine() during hotunplug?] > > That's quite an interesting alternative. It's somewhat unattractive in that we know how much stop_machine is hated in Linux. But maybe it makes

Re: [Qemu-devel] Block I/O outside the QEMU global mutex was "Re: [RFC PATCH 00/17] Support for multiple "AIO contexts""

2012-10-09 Thread Avi Kivity
On 10/09/2012 02:18 PM, Jan Kiszka wrote: > Not sure about the full context of this discussion, but I played with > "stop-machine" (pause_all_vcpus) recently. The problem is, at least ATM, > that it drops the BQL to wait for those threads, and that creates an > unexpected rescheduling point over wh

Re: [Qemu-devel] Block I/O outside the QEMU global mutex was "Re: [RFC PATCH 00/17] Support for multiple "AIO contexts""

2012-10-09 Thread Avi Kivity
On 10/09/2012 03:11 PM, Paolo Bonzini wrote: >> But no, it's actually impossible. Hotplug may be triggered from a vcpu >> thread, which clearly it can't be stopped. > > Hotplug should always be asynchronous (because that's how hardware > works), so it should always be possible to delegate the act

Re: [Qemu-devel] Block I/O outside the QEMU global mutex was "Re: [RFC PATCH 00/17] Support for multiple "AIO contexts""

2012-10-09 Thread Avi Kivity
On 10/09/2012 03:50 PM, Paolo Bonzini wrote: > Il 09/10/2012 15:21, Avi Kivity ha scritto: >> On 10/09/2012 03:11 PM, Paolo Bonzini wrote: >>>> But no, it's actually impossible. Hotplug may be triggered from a vcpu >>>> thread, which clearly it can't b

Re: [Qemu-devel] Block I/O outside the QEMU global mutex was "Re: [RFC PATCH 00/17] Support for multiple "AIO contexts""

2012-10-09 Thread Avi Kivity
On 10/09/2012 04:35 PM, Paolo Bonzini wrote: >> Of course we can violate that and it wouldn't know a thing, but I prefer >> to stick to the established pattern. > > I wasn't suggesting that, just evaluating the different tradeoffs QEMU > could make. Reference counting is complicated because it h

Re: [Qemu-devel] [RFC v1 08/22] memory: provide defaults for MemoryListener operations

2012-10-09 Thread Avi Kivity
On 10/09/2012 05:14 PM, Anthony Liguori wrote: >>> >>> I think it'd be nicer to check for NULL when invoking the functions in >>> the memory core. >>> >>> Then you avoid the exported stub functions entirely. >> >> Yes, that's the common style, but I happen not to like the extra check, >> both fro

[Qemu-devel] [PULL v3 00/23] Integrate DMA into the memory API

2012-10-09 Thread Avi Kivity
ehaviour is preexisting. They will be resolved in a future patchset. Available as a git tree in: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git memory/dma Avi Kivity (23): memory: rename 'exec-obsolete.h' vhost: use MemoryListener filtering to only monitor RAM address spac

[Qemu-devel] [PATCH v3 06/23] memory: export AddressSpace

2012-10-09 Thread Avi Kivity
The DMA API will use an AddressSpace to differentiate among different initiators. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- memory.c | 11 +-- memory.h | 21 + 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/memory.c b/memory.c

[Qemu-devel] [PATCH v3 17/23] memory: use AddressSpace for MemoryListener filtering

2012-10-09 Thread Avi Kivity
Using the AddressSpace type reduces confusion, as you can't accidentally supply the MemoryRegion you're interested in. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- exec-memory.h | 3 +++ exec.c| 10 +- hw/vfio_pci.c | 3 +-- hw/vhost.c| 2 +- h

[Qemu-devel] [PATCH v3 18/23] s390: avoid reaching into memory core internals

2012-10-09 Thread Avi Kivity
use cpu_physical_memory_is_io() instead. Signed-off-by: Avi Kivity --- target-s390x/misc_helper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c index e9b3cae..fdccd58 100644 --- a/target-s390x/misc_helper.c +++ b

[Qemu-devel] [PATCH v3 22/23] pci: give each device its own address space

2012-10-09 Thread Avi Kivity
Accesses from different devices can resolve differently (depending on bridge settings, iommus, and PCI_COMMAND_MASTER), so set up an address space for each device. Currently iommus are expressed outside the memory API, so this doesn't work if an iommu is present. Signed-off-by: Avi K

[Qemu-devel] [PATCH v3 03/23] kvm: use separate MemoryListeners for memory and I/O

2012-10-09 Thread Avi Kivity
ff-by: Avi Kivity --- kvm-all.c | 83 +-- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 92a7137..c69e012 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -755,9 +755,16 @@ static void kvm_log_global

[Qemu-devel] [PATCH v3 04/23] xen_pt: use separate MemoryListeners for memory and I/O

2012-10-09 Thread Avi Kivity
Using an unfiltered memory listener will cause regions to be reported fails multiple times if we have more than two address spaces. Use a separate listener for memory and I/O, and utilize MemoryListener's address space filtering to fix this. Signed-off-by: Avi Kivity --- hw/xen_pt.c

Re: [Qemu-devel] [PATCH 2/3] e500: Adding CCSR memory region

2012-10-09 Thread Avi Kivity
On 10/09/2012 06:45 PM, Bhushan Bharat-R65777 wrote: > > What about adding a API: > void sysbus_mmio_map_to_mr(SysBusDevice *dev, int n, target_phys_addr_t addr, >MemoryRegion *mr) > { > assert(n >= 0 && n < dev->num_mmio); > > if (dev->mmio[n].addr == addr) {

[Qemu-devel] [PATCH v3 13/23] xen: drop no-op MemoryListener callbacks

2012-10-09 Thread Avi Kivity
Removes quite a bit of useless code. Signed-off-by: Avi Kivity --- xen-all.c | 42 -- 1 file changed, 42 deletions(-) diff --git a/xen-all.c b/xen-all.c index f76b051..cf0e0c3 100644 --- a/xen-all.c +++ b/xen-all.c @@ -452,14 +452,6 @@ static void

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