summaryrefslogtreecommitdiffstats
path: root/include/exec/memory-internal.h
Commit message (Collapse)AuthorAgeFilesLines
* memory: unregister AddressSpace MemoryListener within BQLPaolo Bonzini2015-02-101-0/+1
| | | | | | | | | | | | | address_space_destroy_dispatch is called from an RCU callback and hence outside the iothread mutex (BQL). However, after address_space_destroy no new accesses can hit the destroyed AddressSpace so it is not necessary to observe changes to the memory map. Move the memory_listener_unregister call earlier, to make it thread-safe again. Reported-by: Alex Williamson <alex.williamson@redhat.com> Fixes: 374f2981d1f10bc4307f250f24b2a7ddb9b14be0 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* memory: split cpu_physical_memory_* functions to its own includeJuan Quintela2014-01-131-76/+0
| | | | | | | All the functions that use ram_addr_t should be here. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: make cpu_physical_memory_reset_dirty() take a length parameterJuan Quintela2014-01-131-1/+1
| | | | | | | | | | | | | We have an end parameter in all the callers, and this make it coherent with the rest of cpu_physical_memory_* functions, that also take a length parameter. Once here, move the start/end calculation to tlb_reset_dirty_range_all() as we don't need it here anymore. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: s/dirty/clean/ in cpu_physical_memory_is_dirty()Juan Quintela2014-01-131-3/+2
| | | | | | | | All uses except one really want the other meaning. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: cpu_physical_memory_clear_dirty_range() now uses bitmap operationsJuan Quintela2014-01-131-6/+4
| | | | | | | | We were clearing a range of bits, so use bitmap_clear(). Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: cpu_physical_memory_set_dirty_range() now uses bitmap operationsJuan Quintela2014-01-131-12/+7
| | | | | | | | | | | We were setting a range of bits, so use bitmap_set(). Note: xen has always been wrong, and should have used start instead of addr from the beginning. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: use find_next_bit() to find dirty bitsJuan Quintela2014-01-131-10/+6
| | | | | | | | This operation is way faster than doing it bit by bit. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: s/mask/clear/ cpu_physical_memory_mask_dirty_rangeJuan Quintela2014-01-131-3/+3
| | | | | | | | Now all functions use the same wording that bitops/bitmap operations Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: cpu_physical_memory_get_dirty() is used as returning a boolJuan Quintela2014-01-131-7/+8
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: make cpu_physical_memory_get_dirty() the main functionJuan Quintela2014-01-131-17/+19
| | | | | | | | | And make cpu_physical_memory_get_dirty_flag() to use it. It used to be the other way around. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: unfold cpu_physical_memory_set_dirty_flag()Juan Quintela2014-01-131-3/+6
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: unfold cpu_physical_memory_set_dirty() in its only userJuan Quintela2014-01-131-8/+3
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: unfold cpu_physical_memory_clear_dirty_flag() in its only userJuan Quintela2014-01-131-8/+2
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: split dirty bitmap into threeJuan Quintela2014-01-131-6/+3
| | | | | | | | | | | After all the previous patches, spliting the bitmap gets direct. Note: For some reason, I have to move DIRTY_MEMORY_* definitions to the beginning of memory.h to make compilation work. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: cpu_physical_memory_clear_dirty_flag() result is never usedJuan Quintela2014-01-131-2/+2
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: make sure that client is always inside rangeJuan Quintela2014-01-131-0/+4
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: cpu_physical_memory_mask_dirty_range() always clears a single flagJuan Quintela2014-01-131-22/+18
| | | | | | | | Document it Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: cpu_physical_memory_set_dirty_range() always dirty all flagsJuan Quintela2014-01-131-9/+2
| | | | | | | | | | So remove the flag argument and do it directly. After this change, there is nothing else using cpu_physical_memory_set_dirty_flags() so remove it. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: set single dirty flags when possibleJuan Quintela2014-01-131-1/+3
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: all users of cpu_physical_memory_get_dirty used only one flagJuan Quintela2014-01-131-7/+2
| | | | | | | | So cpu_physical_memory_get_dirty_flags is not needed anymore Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: make cpu_physical_memory_is_dirty return boolJuan Quintela2014-01-131-2/+6
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* exec: create function to get a single dirty bitJuan Quintela2014-01-131-0/+6
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
* memory: create function to set a single dirty bitJuan Quintela2014-01-131-0/+6
| | | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* memory: cpu_physical_memory_set_dirty_flags() result is never usedJuan Quintela2014-01-131-2/+2
| | | | | | | | So return void. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* ioport: Switch dispatching to memory core layerJan Kiszka2013-07-041-2/+0
| | | | | | | | | | | | | | | | | | | | | The current ioport dispatcher is a complex beast, mostly due to the need to deal with old portio interface users. But we can overcome it without converting all portio users by embedding the required base address of a MemoryRegionPortio access into that data structure. That removes the need to have the additional MemoryRegionIORange structure in the loop on every access. To handle old portio memory ops, we simply install dispatching handlers for portio memory regions when registering them with the memory core. This removes the need for the old_portio field. We can drop the additional aliasing of ioport regions and also the special address space listener. cpu_in and cpu_out now simply call address_space_read/write. And we can concentrate portio handling in a single source file. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* memory: move private types to exec.cPaolo Bonzini2013-06-201-15/+0
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* memory: export memory_region_access_valid to exec.cPaolo Bonzini2013-05-291-0/+3
| | | | | | | We'll use it to implement address_space_access_valid. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* memory: move unassigned_mem_ops to memory.cPaolo Bonzini2013-05-291-0/+2
| | | | | | | reservation_ops is already doing the same thing. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* exec: make qemu_get_ram_ptr privatePaolo Bonzini2013-05-241-0/+1
| | | | | | | It is a private interface between exec.c and memory.c. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* exec: remove useless declarations from memory-internal.hPaolo Bonzini2013-04-151-6/+0
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* hw: move headers to include/Paolo Bonzini2013-04-081-1/+1
| | | | | | | | | Many of these should be cleaned up with proper qdev-/QOM-ification. Right now there are many catch-all headers in include/hw/ARCH depending on cpu.h, and this makes it necessary to compile these files per-target. However, fixing this does not belong in these patches. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* exec: move include files to include/exec/Paolo Bonzini2012-12-191-0/+141
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
OpenPOWER on IntegriCloud