Statistics
| Branch: | Revision:

root / exec.c @ 34b5d2c6

History | View | Annotate | Download (73.4 kB)

# Date Author Comment
2641689a 09/05/2013 07:11 pm liguang

exec: do tcg_commit only when tcg_enabled

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

3bb28b72 09/05/2013 07:11 pm Jan Kiszka

memory: Provide separate handling of unassigned io ports accesses

Accesses to unassigned io ports shall return -1 on read and be ignored
on write. Ensure these properties via dedicated ops, decoupling us from
the memory core's handling of unassigned accesses....

88266249 09/05/2013 07:11 pm Hu Tao

exec: check offset_within_address_space for register subpage

If offset_within_address_space falls in a page, then we register a
subpage. So check offset_within_address_space rather than
offset_within_region.

Cc:
Cc: Paolo Bonzini <>...

098178f2 09/05/2013 07:11 pm Paolo Bonzini

exec: fix writing to MMIO area with non-power-of-two length

The problem is introduced by commit 2332616 (exec: Support 64-bit
operations in address_space_rw, 2013-07-08). Before that commit,
memory_access_size would only return 1/2/4.

Since alignment is already handled above, reduce l to the largest...

bdc44640 09/03/2013 01:25 pm Andreas Färber

cpu: Use QTAILQ for CPU list

Introduce CPU_FOREACH(), CPU_FOREACH_SAFE() and CPU_NEXT() shorthand
macros.

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

38fcbd3f 09/03/2013 01:25 pm Andreas Färber

cpu: Replace qemu_for_each_cpu()

It was introduced to loop over CPUs from target-independent code, but
since commit 182735efaf956ccab50b6d74a4fed163e0f35660 target-independent
CPUState is used.

A loop can be considered more efficient than function calls in a loop,...

e0d47944 07/31/2013 10:03 pm Andreas Färber

cpu: Fix VMSTATE_CPU() semantics

Commit 1a1562f5ea3da17d45d3829e35b5f49da9ec2db5 prepared a VMSTATE_CPU()
macro for device-style VMStateDescription registration, but missed to
adapt cpu_exec_init(), so that the "cpu_common" VMStateDescription was
still registered for AlphaCPU (fe31e7374299c0c6172ce618b29bf2fecbd881c7)...

38e478ec 07/27/2013 12:05 am Stefan Weil

kvm: Change prototype of kvm_update_guest_debug()

Passing a CPUState pointer instead of a CPUArchState pointer eliminates
the last target dependent data type in sysemu/kvm.h.

It also simplifies the code.

Signed-off-by: Stefan Weil <>
Acked-by: Paolo Bonzini <>...

874ec3c5 07/25/2013 11:56 pm Anthony Liguori

Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging

  • riku/linux-user-for-upstream: (21 commits)
    linux-user: Handle compressed ISA encodings when processing MIPS exceptions
    linux-user: Unlock mmap_lock when resuming guest from page_unprotect...
b24c882b 07/23/2013 05:28 pm Alexander Graf

linux-user: Reset copied CPUs in cpu_copy() always

When a new thread gets created, we need to reset non arch specific state to
get the new CPU into clean state.

However this reset should happen before the arch specific CPU contents get
copied over. Otherwise we end up having clean reset state in our newly created...

00b941e5 07/23/2013 03:41 am Andreas Färber

cpu: Turn cpu_get_phys_page_debug() into a CPUClass hook

Change breakpoint_invalidate() argument to CPUState alongside.

Since all targets now assign a softmmu-only field, we can drop helpers
cpu_class_set_{do_unassigned_access,vmsd}() and device_class_set_vmsd()....

f17ec444 07/23/2013 03:41 am Andreas Färber

exec: Change cpu_memory_rw_debug() argument to CPUState

Propagate X86CPU in kvmvapic for simplicity.

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

ed2803da 07/23/2013 03:41 am Andreas Färber

cpu: Move singlestep_enabled field from CPU_COMMON to CPUState

Prepares for changing cpu_single_step() argument to CPUState.

Acked-by: Michael Walle <> (for lm32)
Signed-off-by: Andreas Färber <>

3825b28f 07/23/2013 03:41 am Andreas Färber

cpu: Change cpu_single_step() argument to CPUState

Use CPUState::env_ptr for now.

Needed for GdbState::c_cpu.

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

cb85f7ab 07/18/2013 07:03 am Peter Maydell

exec.c: Pass correct pointer type to qemu_ram_ptr_length

Commit e3127ae0 introduced a problem where we're passing a
hwaddr* to qemu_ram_ptr_length() but it wants a ram_addr_t*;
this will cause problems on 32 bit hosts and in any case
provokes a clang warning on MacOSX:...

e1622f4b 07/18/2013 07:03 am Paolo Bonzini

exec: fix incorrect assumptions in memory_access_size

access_size_min can be 1 because erroneous accesses must not crash
QEMU, they should trigger exceptions in the guest or just return
garbage (depending on the CPU). I am not sure I understand the
comment: placing a 4-byte field at the last byte of a region...

23326164 07/14/2013 11:40 pm Richard Henderson

exec: Support 64-bit operations in address_space_rw

Honor the implementation maximum access size, and at least check
the minimum access size.

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

51455c59 07/10/2013 06:54 pm Anthony Liguori

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

QOM CPUState refactorings

  • Fix for OpenRISCCPU subclasses
  • Fix for gdbstub CPU selection
  • Move linux-user CPU functions into new header
  • CPUState part 10 refactoring: first_cpu, next_cpu, cpu_single_env et al....
a0762859 07/09/2013 10:33 pm Andreas Färber

log: Change log_cpu_state[_mask]() argument to CPUState

Since commit 878096eeb278a8ac1ccd6667af73e026f29b4cf5 (cpu: Turn
cpu_dump_{state,statistics}() into CPUState hooks) CPUArchState is no
longer needed.

Add documentation and make the functions available through qemu/log.h...

182735ef 07/09/2013 10:32 pm Andreas Färber

cpu: Make first_cpu and next_cpu CPUState

Move next_cpu from CPU_COMMON to CPUState.
Move first_cpu variable to qom/cpu.h.

gdbstub needs to use CPUState::env_ptr for now.
cpu_copy() no longer needs to save and restore cpu_next.

Acked-by: Paolo Bonzini <>...

4917cf44 07/09/2013 10:20 pm Andreas Färber

cpu: Replace cpu_single_env with CPUState current_cpu

Move it to qom/cpu.h.

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

2ff3de68 07/09/2013 09:38 pm Markus Armbruster

Simplify -machine option queries with qemu_get_machine_opts()

The previous two commits fixed bugs in -machine option queries. I
can't find fault with the remaining queries, but let's use
qemu_get_machine_opts() everywhere, for consistency, simplicity and...

154bb106 07/09/2013 09:38 pm Stefan Weil

exec: Remove unused global variable phys_ram_fd

It seems to be unused since several years (commit
be995c27640a82c7056b6f53d02ec823570114e5 in 2006).

Signed-off-by: Stefan Weil <>
Reviewed-by: Andreas Färber <>
Message-id: ...

6092666e 07/04/2013 06:42 pm Paolo Bonzini

exec: remove cur_map

cur_map is not used anymore; instead, each AddressSpaceDispatch
has its own nodes/sections pair. The priorities of the
MemoryListeners, and in the future RCU, guarantee that the
nodes/sections are not freed while they are still in use....

c7086b4a 07/04/2013 06:42 pm Paolo Bonzini

exec: change some APIs to take AddressSpaceDispatch

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

b41aac4f 07/04/2013 06:42 pm Liu Ping Fan

exec: change well-known physical sections to macros

Sections like phys_section_unassigned always have fixed address
in phys_sections. Declared as macro, so we can use them
when having more than one phys_sections array.

Signed-off-by: Liu Ping Fan <>...

9affd6fc 07/04/2013 06:42 pm Paolo Bonzini

exec: separate current memory map from the one being built

Currently, phys_node_map and phys_sections are shared by all
of the AddressSpaceDispatch. When updating mem topology, all
AddressSpaceDispatch will rebuild dispatch tables sequentially
on them. In order to prepare for RCU access, leave the old...

89ae337a 07/04/2013 06:42 pm Paolo Bonzini

exec: move listener from AddressSpaceDispatch to AddressSpace

This will help having two copies of AddressSpaceDispatch during the
recreation of the radix tree (one being built, and one that is complete
and will be protected by RCU). We do not want to have to unregister and...

00752703 07/04/2013 06:42 pm Paolo Bonzini

exec: separate current radix tree from the one being built

This same treatment previously done to phys_node_map and phys_sections
is now applied to the dispatch field of AddressSpace. Topology updates
use as->next_dispatch while accesses use as->dispatch....

0475d94f 07/04/2013 06:42 pm Paolo Bonzini

exec: put memory map in AddressSpaceDispatch

After this patch, AddressSpaceDispatch holds a constistent tuple of
(phys_map, nodes, sections). This will be important when updates
of the topology will run concurrently with reads.

cur_map is not used anymore except for freeing it at the end of the...

1b5ec234 07/04/2013 06:42 pm Paolo Bonzini

memory: return MemoryRegion from qemu_ram_addr_from_host

It will be needed in the next patch.

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

e3127ae0 07/04/2013 06:42 pm Paolo Bonzini

exec: reorganize address_space_map

First of all, rename "todo" to "done".

Second, clearly separate the case of done == 0 with the case of done != 0.
This will help handling reference counting in the next patch.

Third, this test:

if (memory_region_get_ram_addr(mr) + xlat != raddr + todo) {...
d3e71559 07/04/2013 06:42 pm Paolo Bonzini

memory: ref/unref memory across address_space_map/unmap

The iothread mutex might be released between map and unmap, so the
mapped region might disappear.

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

b7e95164 07/04/2013 06:42 pm Paolo Bonzini

exec: simplify destruction of the phys map

Do not bother visiting the radix tree when an address space is destroyed.
After the previous patch, this has become a pointless exercise. When
called from address_space_destroy_dispatch, all you're doing is zeroing...

dfde4e6e 07/04/2013 06:42 pm Paolo Bonzini

memory: add ref/unref calls

Add ref/unref calls at the following places:

- places where memory regions are stashed by a listener and
used outside the BQL (including in Xen or KVM).

- memory_region_find callsites

- creation of aliases and containers (only the aliased/contained...

23887b79 07/04/2013 06:42 pm Paolo Bonzini

exec: check MRU in qemu_ram_addr_from_host

This function is not used outside the iothread mutex, so it
can use ram_list.mru_block.

Signed-off-by: Paolo Bonzini <>

7443b437 07/04/2013 06:42 pm Paolo Bonzini

exec: move qemu_ram_addr_from_host_nofail to cputlb.c

After the next patch it would not be used elsewhere anyway. Also,
the _nofail and the standard versions of this function return different
things, which is confusing. Removing the function from the public headers...

b40acf99 07/04/2013 06:42 pm Jan Kiszka

ioport: Switch dispatching to memory core layer

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

2c9b15ca 07/04/2013 06:42 pm Paolo Bonzini

memory: add owner argument to initialization functions

Signed-off-by: Paolo Bonzini <>

058bc4b5 07/04/2013 06:42 pm Paolo Bonzini

memory: destroy phys_sections one by one

phys_sections_clear is invoked after the dispatch tree has been
destroyed. This leaves a window where phys_sections_nb > 0 but the
subpages are not valid anymore, which is a recipe for use-after-free
bugs.

Move the destruction of subpages in phys_sections_clear. We will...

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