Statistics
| Branch: | Revision:

root / exec.c @ f487b677

History | View | Annotate | Download (72.2 kB)

# Date Author Comment
60a3e17a 06/28/2013 02:25 pm Andreas Färber

cpu: Change cpu_exit() argument to CPUState

It no longer depends on CPUArchState, so move it to qom/cpu.c.

Prepares for changing GDBState::c_cpu to CPUState.

Signed-off-by: Andreas Färber <>

878096ee 06/28/2013 02:25 pm Andreas Färber

cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks

Make cpustats monitor command available unconditionally.

Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec()
arguments to CPUState.

Signed-off-by: Andreas Färber <>

1a1562f5 06/28/2013 02:25 pm Andreas Färber

cpu: Introduce VMSTATE_CPU() macro for CPUState

To be used to embed common CPU state into CPU subclasses.

Reviewed-by: Juan Quintela <>
Signed-off-by: Andreas Färber <>

ec3f8c99 06/27/2013 11:38 pm Peter Maydell

linux-user: Fix compilation failure

Fix compilation failures for linux-user targets following recent
migration related commits bd2fa51fcd and 43487c67.

Signed-off-by: Peter Maydell <>
Message-id: ...

bd2fa51f 06/27/2013 03:38 am Michael R. Hines

rdma: introduce qemu_ram_foreach_block()

This is used during RDMA initialization in order to
transmit a description of all the RAM blocks to the
peer for later dynamic chunk registration purposes.

Reviewed-by: Juan Quintela <>
Reviewed-by: Paolo Bonzini <>...

df32fd1c 06/20/2013 05:39 pm Paolo Bonzini

dma: eliminate DMAContext

The DMAContext is a simple pointer to an AddressSpace that is now always
already available. Make everyone hold the address space directly,
and clean up the DMA API to use the AddressSpace directly.

Reviewed-by: Peter Maydell <>...

7dca8043 06/20/2013 05:39 pm Alexey Kardashevskiy

memory: give name to every AddressSpace

The "info mtree" command in QEMU console prints only "memory" and "I/O"
address spaces while there are actually a lot more other AddressSpace
structs created by PCI and VIO devices. Those devices do not normally
have names and therefore not present in "info mtree" output....

733d5ef5 06/20/2013 05:32 pm Paolo Bonzini

exec: reorganize mem_add to match Int128 version

When adding support for 2^64-byte sections, we will have to change
the structure of mem_add to avoid failures in int128_get64.
Reorganize the code now before introducing Int128.

Signed-off-by: Paolo Bonzini <>

052e87b0 06/20/2013 05:32 pm Paolo Bonzini

memory: make section size a 128-bit integer

So far, the size of all regions passed to listeners could fit in 64 bits,
because artificial regions (containers and aliases) are eliminated by
the memory core, leaving only device regions which have reasonable sizes...

30951157 06/20/2013 05:32 pm Avi Kivity

memory: iommu support

Add a new memory region type that translates addresses it is given,
then forwards them to a target address space. This is similar to
an alias, except that the mapping is more flexible than a linear
translation and trucation, and also less efficient since the...

24addbc7 06/20/2013 05:32 pm Paolo Bonzini

dma: eliminate old-style IOMMU support

The translate function in the DMAContext is now always NULL.
Remove every reference to it.

Reviewed-by: Peter Maydell <>
Signed-off-by: Paolo Bonzini <>

3752a036 06/20/2013 05:32 pm Peter Maydell

exec.c: address_space_translate: handle access to addr 0 of 2^64 sized region

The memory API allows a MemoryRegion's size to be 2^64, as a special
case (otherwise the size always fits in a 64 bit integer). This meant
that attempts to access address zero in a 2^64 sized region would...

9f029603 06/20/2013 05:32 pm Jan Kiszka

memory: Introduce address_space_lookup_region

This introduces a wrapper for phys_page_find (before we complicate
address_space_translate with IOMMU translation). This function will
also encapsulate locking and reference counting when we introduce
BQL-free dispatching....

1db8abb1 06/20/2013 05:32 pm Paolo Bonzini

memory: move private types to exec.c

Signed-off-by: Paolo Bonzini <>

f52cc467 06/20/2013 05:32 pm Jan Kiszka

exec: Allow unaligned address_space_rw

This will be needed for some corner cases with para-virtual I/O ports.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Paolo Bonzini <>

90260c6c 06/20/2013 05:32 pm Jan Kiszka

exec: Resolve subpages in one step except for IOTLB fills

Except for the case of setting the IOTLB entry in TCG mode, we can avoid
the subpage dispatching handlers and do the resolution directly on
address_space_lookup_region. An IOTLB entry describes a full page, not...

acc9d80b 06/20/2013 05:32 pm Jan Kiszka

exec: Implement subpage_read/write via address_space_rw

This will allow to add support for unaligned memory regions: the subpage
container region can activate unaligned support unconditionally because
the read/write handler will now ensure that accesses are split as...

5c8a00ce 06/20/2013 05:32 pm Paolo Bonzini

exec: return MemoryRegion from address_space_translate

Only address_space_translate_for_iotlb needs to return the section.
Every caller of address_space_translate now uses only section->mr,
return it directly.

Signed-off-by: Paolo Bonzini <>

99b9cc06 06/20/2013 05:32 pm Paolo Bonzini

Revert "memory: limit sections in the radix tree to the actual address space size"

This reverts commit 86a8623692b1b559a419a92eb8b6897c221bca74.

Signed-off-by: Paolo Bonzini <>

fd8aaa76 05/29/2013 05:27 pm Paolo Bonzini

memory: add return value to address_space_rw/read/write

Reviewed-by: Richard Henderson <>
Signed-off-by: Paolo Bonzini <>

791af8c8 05/29/2013 05:27 pm Paolo Bonzini

memory: propagate errors on I/O dispatch

Reviewed-by: Richard Henderson <>
Signed-off-by: Paolo Bonzini <>

a649b916 05/29/2013 05:27 pm Paolo Bonzini

exec: just use io_mem_read/io_mem_write for 8-byte I/O accesses

The memory API is able to split it in two 4-byte accesses.

Reviewed-by: Richard Henderson <>
Signed-off-by: Paolo Bonzini <>

968a5627 05/29/2013 05:27 pm Paolo Bonzini

memory: correctly handle endian-swapped 64-bit accesses

Reviewed-by: Richard Henderson <>
Signed-off-by: Paolo Bonzini <>

51644ab7 05/29/2013 05:27 pm Paolo Bonzini

memory: add address_space_access_valid

The old-style IOMMU lets you check whether an access is valid in a
given DMAContext. There is no equivalent for AddressSpace in the
memory API, implement it with a lookup of the dispatch tree.

Reviewed-by: Richard Henderson <>...

c353e4cc 05/29/2013 05:27 pm Paolo Bonzini

exec: implement .valid.accepts for subpages

Reviewed-by: Richard Henderson <>
Signed-off-by: Paolo Bonzini <>

82f2563f 05/29/2013 05:27 pm Paolo Bonzini

exec: introduce memory_access_size

This will be used by address_space_access_valid too.

Reviewed-by: Richard Henderson <>
Signed-off-by: Paolo Bonzini <>

2bbfa05d 05/29/2013 05:27 pm Paolo Bonzini

exec: introduce memory_access_is_direct

After the previous patches, this is a common test for all read/write
functions.

Reviewed-by: Richard Henderson <>
Signed-off-by: Paolo Bonzini <>

d17d45e9 05/29/2013 05:27 pm Paolo Bonzini

exec: expect mr->ops to be initialized for ROM

There is no need to use the special phys_section_rom section.

Reviewed-by: Richard Henderson <>
Signed-off-by: Paolo Bonzini <>

d197063f 05/29/2013 05:26 pm Paolo Bonzini

memory: move unassigned_mem_ops to memory.c

reservation_ops is already doing the same thing.

Reviewed-by: Richard Henderson <>
Signed-off-by: Paolo Bonzini <>

149f54b5 05/29/2013 05:26 pm Paolo Bonzini

memory: add address_space_translate

Using phys_page_find to translate an AddressSpace to a MemoryRegionSection
is unwieldy. It requires to pass the page index rather than the address,
and later memory_region_section_addr has to be called. Replace
memory_region_section_addr with a function that does all of it: call...

b018ddf6 05/29/2013 05:26 pm Paolo Bonzini

memory: dispatch unassigned accesses based on .valid.accepts

This provides the basics for detecting accesses to unassigned memory
as soon as they happen, and also for a simple implementation of
address_space_access_valid.

Reviewed-by: Richard Henderson <>...

bf8d5166 05/29/2013 05:26 pm Paolo Bonzini

exec: do not use error_mem_read

We will soon reach this case when doing (unaligned) accesses that
span partly past the end of memory. We do not want to crash in
that case.

unassigned_mem_ops and rom_mem_ops are now the same.

Reviewed-by: Richard Henderson <>...

0844e007 05/29/2013 05:26 pm Paolo Bonzini

exec: make io_mem_unassigned private

There is no reason to avoid a recompile before accessing unassigned
memory. In the end it will be treated as MMIO anyway.

Reviewed-by: Richard Henderson <>
Signed-off-by: Paolo Bonzini <>

ae4e43e8 05/29/2013 05:26 pm Paolo Bonzini

exec: drop useless #if

This code is only compiled for softmmu targets.

Reviewed-by: Richard Henderson <>
Signed-off-by: Paolo Bonzini <>

2a8e7499 05/29/2013 05:26 pm Paolo Bonzini

exec: eliminate io_mem_ram

It is never used, the IOTLB always goes through io_mem_notdirty.

In fact in softmmu_template.h, if it were, QEMU would crash just
below the tests, as soon as io_mem_read/write dispatches to
error_mem_read/write.

Reviewed-by: Richard Henderson <>...

fd298934 05/24/2013 07:43 pm Paolo Bonzini

memory: clean up phys_page_find

Remove the goto.

Reviewed-by: Peter Maydell <>
Signed-off-by: Paolo Bonzini <>

86a86236 05/24/2013 07:43 pm Avi Kivity

memory: limit sections in the radix tree to the actual address space size

The radix tree is statically sized to fit TARGET_PHYS_ADDR_SPACE_BITS.
If a larger memory region is registered, it will overflow.

Fix by limiting any section in the radix tree to the supported size....

68f3f65b 05/24/2013 07:42 pm Paolo Bonzini

memory: assert that PhysPageEntry's ptr does not overflow

While sized to 15 bits in PhysPageEntry, the ptr field is ORed into the
iotlb entries together with a page-aligned pointer. The ptr field must
not overflow into this page-aligned value, assert that it is smaller than...

8b0d6711 05/24/2013 07:42 pm Paolo Bonzini

exec: eliminate stq_phys_notdirty

It is not used anywhere.

Reviewed-by: Peter Maydell <>
Signed-off-by: Paolo Bonzini <>

4f39178b 05/24/2013 07:42 pm Paolo Bonzini

exec: eliminate qemu_put_ram_ptr

Reviewed-by: Peter Maydell <>
Signed-off-by: Paolo Bonzini <>

bbcfd291 05/24/2013 07:42 pm Paolo Bonzini

exec: remove obsolete comment

See how we call memory_region_section_addr two lines below to
convert a physical address to a base address in the region.

Reviewed-by: Peter Maydell <>
Signed-off-by: Paolo Bonzini <>

6eebf958 05/14/2013 04:53 pm Paolo Bonzini

osdep, kvm: rename low-level RAM allocation functions

This is preparatory to the introduction of a separate freeing API.

Reported-by: Amos Kong <>
Signed-off-by: Paolo Bonzini <>
Reviewed-by: Amos Kong <>...

e7a09b92 05/14/2013 04:53 pm Paolo Bonzini

osdep: introduce qemu_anon_ram_free to free qemu_anon_ram_alloc-ed memory

We switched from qemu_memalign to mmap() but then we don't modify
qemu_vfree() to do a munmap() over free(). Which we cannot do
because qemu_vfree() frees memory allocated by qemu_{mem,block}align....

d6b9e0d6 05/01/2013 02:04 pm Michael S. Tsirkin

cpu: Add qemu_for_each_cpu()

Wrapper to avoid open-coded loops and to make CPUState iteration
independent of CPUArchState.

Signed-off-by: Michael S. Tsirkin <>
Signed-off-by: Igor Mammedov <>
Signed-off-by: Andreas Färber <>

0d09e41a 04/08/2013 07:13 pm Paolo Bonzini

hw: move headers to include/

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....

49cd9ac6 03/26/2013 09:02 pm Stefan Hajnoczi

exec: assert that RAMBlock size is non-zero

find_ram_offset() does not handle size=0 gracefully. It hands out the
same RAMBlock offset multiple times, leading to obscure failures later
on.

Add an assert to warn early if something is incorrectly allocating a...

3d34a411 03/14/2013 09:50 pm Anthony Liguori

Merge remote-tracking branch 'afaerber/qom-cpu' into staging

  1. By Andreas Färber (16) and Igor Mammedov (1)
  2. Via Andreas Färber
    • afaerber/qom-cpu:
      target-lm32: Update VMStateDescription to LM32CPU
      target-arm: Override do_interrupt for ARMv7-M profile...
8ca761f6 03/12/2013 08:42 pm Peter Feiner

exec: make -mem-path filenames deterministic

Adds ramblocks' names to their backing files when using -mem-path. Eases
introspection and debugging.

Signed-off-by: Peter Feiner <>
Message-id: ...

259186a7 03/12/2013 11:35 am Andreas Färber

cpu: Move halted and interrupt_request fields to CPUState

Both fields are used in VMState, thus need to be moved together.
Explicitly zero them on reset since they were located before
breakpoints.

Pass PowerPCCPU to kvmppc_handle_halt().

Signed-off-by: Andreas Färber <>

d8ed887b 03/12/2013 11:35 am Andreas Färber

exec: Pass CPUState to cpu_reset_interrupt()

Move it to qom/cpu.c to avoid build failures depending on include order
of cpu-qom.h and exec/cpu-all.h.

Change opaques of various ..._irq_handler() functions to the
appropriate CPU type to facilitate using cpu_reset_interrupt()....

c3affe56 03/12/2013 11:35 am Andreas Färber

cpu: Pass CPUState to cpu_interrupt()

Move it to qom/cpu.h to avoid issues with include order.

Change pc_acpi_smi_interrupt() opaque to X86CPU.

Signed-off-by: Andreas Färber <>

b170fce3 03/12/2013 11:35 am Andreas Färber

cpu: Register VMStateDescription through CPUState

In comparison to DeviceClass::vmsd, CPU VMState is split in two,
"cpu_common" and "cpu", and uses cpu_index as instance_id instead of -1.
Therefore add a CPU-specific CPUClass::vmsd field.

Unlike the legacy CPUArchState registration, rather register CPUState....

d76fddae 03/12/2013 11:35 am Igor Mammedov

cpu: Fix qemu_get_cpu() to return NULL if CPU not found

Commit 55e5c2850 breaks CPU not found return value, and returns
CPU corresponding to the last non NULL env.
Fix it by returning CPU only if env is not NULL, otherwise CPU is
not found and function should return NULL....

378df4b2 03/03/2013 04:28 pm Peter Maydell

Handle CPU interrupts by inline checking of a flag

Fix some of the nasty TCG race conditions and crashes by implementing
cpu_exit() as setting a flag which is checked at the start of each TB.
This avoids crashes if a thread or signal handler calls cpu_exit()...

fcd7d003 02/16/2013 03:51 pm Andreas Färber

cpu: Move exit_request field to CPUState

Since it was located before breakpoints field, it needs to be reset.

Signed-off-by: Andreas Färber <>

907a5e32 02/16/2013 03:51 pm Andreas Färber

cputlb: Pass CPUState to cpu_unlink_tb()

CPUArchState is no longer needed.

Signed-off-by: Andreas Färber <>

e4ada482 01/19/2013 12:24 pm Stefan Weil

Replace non-portable asprintf by g_strdup_printf

g_strdup_printf already handles OOM errors, so some error handling in
QEMU code can be removed.

Signed-off-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

38d8f5c8 01/15/2013 05:09 am Andreas Färber

exec: Return CPUState from qemu_get_cpu()

Move the declaration to qemu/cpu.h and add documentation.
The implementation still depends on CPUArchState for CPU iteration.

Signed-off-by: Andreas Färber <>

1b1ed8dc 01/15/2013 05:09 am Andreas Färber

cpu: Move numa_node field to CPUState

Signed-off-by: Andreas Färber <>

55e5c285 01/15/2013 05:09 am Andreas Färber

cpu: Move cpu_index field to CPUState

Note that target-alpha accesses this field from TCG, now using a
negative offset. Therefore the field is placed last in CPUState.

Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change.

Move common parts of mips cpu_state_reset() to mips_cpu_reset()....

5708fc66 01/12/2013 06:19 pm Paolo Bonzini

stubs: fully replace qemu-tool.c and qemu-user.c

Signed-off-by: Paolo Bonzini <>

8e4a424b 01/06/2013 08:30 pm Blue Swirl

Revert "virtio-pci: replace byte swap hack"

This reverts commit 9807caccd605d09a72495637959568d690e10175.

Signed-off-by: Blue Swirl <>

9807cacc 01/06/2013 10:24 am Blue Swirl

virtio-pci: replace byte swap hack

Remove byte swaps by declaring the config space
as native endian.

Signed-off-by: Blue Swirl <>

a3161038 12/21/2012 12:08 am Paolo Bonzini

exec: change RAM list to a TAILQ

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

abb26d63 12/21/2012 12:08 am Paolo Bonzini

exec: sort the memory from biggest to smallest

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

f798b07f 12/21/2012 12:08 am Umesh Deshpande

add a version number to ram_list

This will be used to detect if last_block might have become invalid
across different calls to ram_save_live.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Umesh Deshpande <>
Signed-off-by: Juan Quintela <>...

b2a8658e 12/21/2012 12:08 am Umesh Deshpande

protect the ramlist with a separate mutex

Add the new mutex that protects shared state between ram_save_live
and the iothread. If the iothread mutex has to be taken together
with the ramlist mutex, the iothread shall always be outside.

Signed-off-by: Paolo Bonzini <>...

0d6d3c87 12/21/2012 12:08 am Paolo Bonzini

exec: change ramlist from MRU order to a 1-item cache

Most of the time, only 2 items will be active (from/to for a string operation,
or code/data). But TCG guests likely won't have gigabytes of memory, so
this actually goes down to 1 item.

Signed-off-by: Paolo Bonzini <>...

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

077805fa 12/19/2012 09:29 am Paolo Bonzini

janitor: do not rely on indirect inclusions of or from qemu-char.h

Various header files rely on qemu-char.h including qemu-config.h or
main-loop.h, but they really do not need qemu-char.h at all (particularly
interesting is the case of the block layer!). Clean this up, and also...

5b6dd868 12/16/2012 10:28 am Blue Swirl

exec: move TB handling to translate-all.c

Signed-off-by: Blue Swirl <>

5a316526 12/16/2012 10:28 am Blue Swirl

exec: extract TB watchpoint check

Will be moved by the next patch.

Signed-off-by: Blue Swirl <>

44209fc4 12/16/2012 10:28 am Blue Swirl

exec: fix coding style

Fix coding style in areas to be moved by later patches.

Signed-off-by: Blue Swirl <>

0be4835b 12/08/2012 04:18 pm Richard Henderson

exec: Advise huge pages for the TCG code gen buffer

After allocating 32MB or more contiguous memory, huge pages
would seem to be ideal.

Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

9e11908f 11/12/2012 05:44 pm Peter Maydell

dma: Define dma_context_memory and use in sysbus-ohci

Define a new global dma_context_memory which is a DMAContext corresponding
to the global address_space_memory AddressSpace. This can be used by
sysbus peripherals like sysbus-ohci which need to do DMA....

ef84755e 11/03/2012 02:55 pm Blue Swirl

Merge branch 'trivial-patches' of git://github.com/stefanha/qemu

  • 'trivial-patches' of git://github.com/stefanha/qemu:
    pc: Drop redundant test for ROM memory region
    exec: make some functions static
    target-ppc: make some functions static
    ppc: add missing static...
fdbb84d1 11/03/2012 11:44 am Yeongkyoon Lee

tcg: Add extended GETPC mechanism for MMU helpers with ldst optimization

Add GETPC_EXT which is used by MMU helpers to selectively calculate the code
address of accessing guest memory when called from a qemu_ld/st optimized code
or a C function. Currently, it supports only i386 and x86-64 hosts....

8b9c99d9 11/01/2012 08:49 pm Blue Swirl

exec: make some functions static

Signed-off-by: Blue Swirl <>
Signed-off-by: Stefan Hajnoczi <>

9f09e18a 10/31/2012 05:12 am Andreas Färber

cpu: Move thread_id to CPUState

Signed-off-by: Andreas Färber <>

c08d7424 10/31/2012 02:02 am Andreas Färber

cpus: Pass CPUState to qemu_cpu_kick()

CPUArchState is no longer needed there.

Signed-off-by: Andreas Färber <>

60e82579 10/31/2012 02:02 am Andreas Färber

cpus: Pass CPUState to qemu_cpu_is_self()

Change return type to bool, move to include/qemu/cpu.h and
add documentation.

Signed-off-by: Andreas Färber <>
Reviewed-by: Igor Mammedov <>
[AF: Updated new caller qemu_in_vcpu_thread()]

a8170e5e 10/23/2012 04:58 pm Avi Kivity

Rename target_phys_addr_t to hwaddr

target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
reserved) and its purpose doesn't match the name (most target_phys_addr_t
addresses are not target specific). Replace it with a finger-friendly,...

ad0b5321 10/22/2012 09:26 pm Luiz Capitulino

Call MADV_HUGEPAGE for guest RAM allocations

This makes it possible for QEMU to use transparent huge pages (THP)
when transparent_hugepage/enabled=madvise. Otherwise THP is only
used when it's enabled system wide.

Signed-off-by: Luiz Capitulino <>...

f526f3c3 10/22/2012 09:26 pm Anthony Liguori

Merge remote-tracking branch 'quintela/migration-next-20121017' into staging

  • quintela/migration-next-20121017: (41 commits)
    cpus: create qemu_in_vcpu_thread()
    savevm: make qemu_file_put_notify() return errors
    savevm: un-export qemu_file_set_error()...
d3e2efc5 10/22/2012 09:26 pm Anthony Liguori

Merge remote-tracking branch 'qemu-kvm/memory/dma' into staging

  • qemu-kvm/memory/dma: (23 commits)
    pci: honor PCI_COMMAND_MASTER
    pci: give each device its own address space
    memory: add address_space_destroy()
    dma: make dma access its own address space...
ac1970fb 10/22/2012 03:50 pm Avi Kivity

memory: per-AddressSpace dispatch

Currently we use a global radix tree to dispatch memory access. This only
works with a single address space; to support multiple address spaces we
make the radix tree a member of AddressSpace (via an intermediate structure...

83f3c251 10/22/2012 03:50 pm Avi Kivity

memory: add address_space_destroy()

Since address spaces can be created dynamically by device hotplug, they
can also be destroyed dynamically.

Signed-off-by: Avi Kivity <>

2673a5da 10/22/2012 03:50 pm Avi Kivity

memory: move address_space_memory and address_space_io out of memory core

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 <>

1d71148e 10/22/2012 03:50 pm Avi Kivity

memory: move tcg flush into a tcg memory listener

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....

f6790af6 10/22/2012 03:50 pm Avi Kivity

memory: use AddressSpace for MemoryListener filtering

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 <>

95d2994a 10/22/2012 03:50 pm Avi Kivity

memory: manage coalesced mmio via a MemoryListener

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.

The motivation is support for multiple address spaces (which means we...

f1bc0bcc 10/20/2012 10:54 am Richard Henderson

exec: Split up and tidy code_gen_buffer

It now consists of:

A macro definition of MAX_CODE_GEN_BUFFER_SIZE with host-specific values,

A function size_code_gen_buffer that applies most of the reasoning for
choosing a buffer size,

Three variations of a function alloc_code_gen_buffer that contain all...

3d85a72f 10/20/2012 10:54 am Richard Henderson

exec: Don't make DEFAULT_CODE_GEN_BUFFER_SIZE too large

For ARM we cap the buffer size to 16MB. Do not allocate 32MB in that case.

Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

405def18 10/20/2012 10:54 am Richard Henderson

exec: Do not use absolute address hints for code_gen_buffer with -fpie

The hard-coded addresses inside alloc_code_gen_buffer only make sense
if we're building an executable that will actually run at the address
we've put into the linker scripts.

When we're building with -fpie, the executable will run at some...

4438c8a9 10/20/2012 10:54 am Richard Henderson

exec: Allocate code_gen_prologue from code_gen_buffer

We had a hack for arm and sparc, allocating code_gen_prologue to a
special section. Which, honestly does no good under certain cases.
We've already got limits on code_gen_buffer_size to ensure that all...

74d590c8 10/20/2012 10:54 am Richard Henderson

exec: Make MIN_CODE_GEN_BUFFER_SIZE private to exec.c

It is used nowhere else, and the corresponding MAX_CODE_GEN_BUFFER_SIZE
also lives there.

Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

652d7ec2 10/17/2012 07:34 pm Juan Quintela

ram: Export last_ram_offset()

Is the only way of knowing the RAM size.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

9a2c913b 10/15/2012 12:43 pm Avi Kivity

memory: drop no-op MemoryListener callbacks

Removes quite a bit of useless code.

Signed-off-by: Avi Kivity <>