Statistics
| Branch: | Revision:

root / exec.c @ feature-archipelago

History | View | Annotate | Download (76.4 kB)

# Date Author Comment
777872e5 03/03/2014 07:46 am Stefan Weil

exec: Remove unneeded include files

This file does not depend on windows.h.

Signed-off-by: Stefan Weil <>
Reviewed-by: Paolo Bonzini <>
Reviewed-by: Andreas Färber <>
Signed-off-by: Michael Tokarev <>

2e38847b 02/11/2014 02:57 pm Edgar E. Iglesias

exec: Make cpu_memory_rw_debug use the CPUs AS

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

2a221651 02/11/2014 02:57 pm Edgar E. Iglesias

exec: Make cpu_physical_memory_write_rom input an AS

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

db3be60d 02/11/2014 02:57 pm Edgar E. Iglesias

exec: Make stb_phys input an AddressSpace

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

5ce5944d 02/11/2014 02:57 pm Edgar E. Iglesias

exec: Make stw_*_phys input an AddressSpace

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

2198a121 02/11/2014 02:57 pm Edgar E. Iglesias

exec: Make stl_phys_notdirty input an AddressSpace

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

ab1da857 02/11/2014 02:57 pm Edgar E. Iglesias

exec: Make stl_*_phys input an AddressSpace

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

f606604f 02/11/2014 02:57 pm Edgar E. Iglesias

exec: Make stq_*_phys input an AddressSpace

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

41701aa4 02/11/2014 02:57 pm Edgar E. Iglesias

exec: Make lduw_*_phys input an AddressSpace

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

2c17449b 02/11/2014 02:57 pm Edgar E. Iglesias

exec: Make ldq/ldub_*_phys input an AddressSpace

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

fdfba1a2 02/11/2014 02:56 pm Edgar E. Iglesias

exec: Make ldl_*_phys input an AddressSpace

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

33bde2e1 02/11/2014 02:56 pm Edgar E. Iglesias

exec: On AS changes, only flush affected CPU TLBs

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

09daed84 02/11/2014 02:56 pm Edgar E. Iglesias

cpu: Add per-cpu address space

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

1b3fb98f 02/11/2014 02:56 pm Edgar E. Iglesias

exec: Make memory_region_section_get_iotlb use section AS

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

3be91e86 02/11/2014 02:56 pm Edgar E. Iglesias

exec: Always initialize MemorySection address spaces

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

77717094 02/11/2014 02:56 pm Edgar E. Iglesias

exec: Make iotlb_to_region input an AS

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

29d8ec7b 02/11/2014 02:55 pm Edgar E. Iglesias

exec: Make tb_invalidate_phys_addr input an AS

No functional change.

Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

a87f3954 02/10/2014 08:10 pm Paolo Bonzini

memory: fix limiting of translation at a page boundary

Commit 360e607 (address_space_translate: do not cross page boundaries,
2014-01-30) broke MMIO accesses in cases where the section is shorter
than the full register width. This can happen for example with the...

360e607b 01/30/2014 04:20 pm Stefano Stabellini

address_space_translate: do not cross page boundaries

The following commit:

commit 149f54b53b7666a3facd45e86eece60ce7d3b114
Author: Paolo Bonzini <>
Date: Fri May 24 12:59:37 2013 +0200

memory: add address_space_translate

breaks Xen support in QEMU, in particular the Xen mapcache. The effect...

0169c511 01/25/2014 01:52 am Anthony Liguori

Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

  • qemu-kvm/uq/master:
    kvm: always update the MPX model specific register
    KVM: fix addr type for KVM_IOEVENTFD
    KVM: Retry KVM_CREATE_VM on EINTR
    mempath prefault: fix off-by-one error
    kvm: x86: Separately write feature control MSR on reset...
52159192 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_mask_dirty_range() always clears a single flag

Document it

Signed-off-by: Juan Quintela <>
Reviewed-by: Eric Blake <>
Reviewed-by: Orit Wasserman <>

2152f5ca 01/13/2014 03:04 pm Juan Quintela

memory: only resize dirty bitmap when memory size increases

Signed-off-by: Juan Quintela <>
Reviewed-by: Eric Blake <>
Reviewed-by: Orit Wasserman <>

1ab4c8ce 01/13/2014 03:04 pm Juan Quintela

memory: split dirty bitmap into three

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

ace694cc 01/13/2014 03:04 pm Juan Quintela

memory: s/mask/clear/ cpu_physical_memory_mask_dirty_range

Now all functions use the same wording that bitops/bitmap operations

Signed-off-by: Juan Quintela <>
Reviewed-by: Eric Blake <>
Reviewed-by: Orit Wasserman <>

a2cd8c85 01/13/2014 03:04 pm Juan Quintela

memory: s/dirty/clean/ in cpu_physical_memory_is_dirty()

All uses except one really want the other meaning.

Signed-off-by: Juan Quintela <>
Reviewed-by: Eric Blake <>
Reviewed-by: Orit Wasserman <>

a2f4d5be 01/13/2014 03:04 pm Juan Quintela

memory: make cpu_physical_memory_reset_dirty() take a length parameter

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

981fdf23 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_set_dirty_tracking() should return void

Result was always 0, and not used anywhere. Once there, use bool type
for the parameter.

Signed-off-by: Juan Quintela <>
Reviewed-by: Eric Blake <>
Reviewed-by: Orit Wasserman <>

220c3ebd 01/13/2014 03:04 pm Juan Quintela

memory: split cpu_physical_memory_* functions to its own include

All the functions that use ram_addr_t should be here.

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>

06567942 01/13/2014 03:04 pm Juan Quintela

exec: use accessor function to know if memory is dirty

Signed-off-by: Juan Quintela <>
Reviewed-by: Orit Wasserman <>
Reviewed-by: Eric Blake <>

7e5609a8 01/13/2014 03:04 pm Juan Quintela

exec: create function to get a single dirty bit

Signed-off-by: Juan Quintela <>
Reviewed-by: Eric Blake <>
Reviewed-by: Orit Wasserman <>

4f08cabe 01/13/2014 03:04 pm Juan Quintela

memory: make cpu_physical_memory_is_dirty return bool

Signed-off-by: Juan Quintela <>
Reviewed-by: Eric Blake <>
Reviewed-by: Orit Wasserman <>

63995ceb 01/13/2014 03:04 pm Juan Quintela

memory: set single dirty flags when possible

Signed-off-by: Juan Quintela <>
Reviewed-by: Eric Blake <>
Reviewed-by: Orit Wasserman <>

75218e7f 01/13/2014 03:04 pm Juan Quintela

memory: cpu_physical_memory_set_dirty_range() always dirty all flags

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

2ba82852 12/30/2013 11:05 pm Marcelo Tosatti

mempath prefault: fix off-by-one error

Fix off-by-one error (noticed by Andrea Arcangeli).

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Marcelo Tosatti <>

582b55a9 12/20/2013 02:58 am Alexander Graf

roms: Flush icache when writing roms to guest memory

We use the rom infrastructure to write firmware and/or initial kernel
blobs into guest address space. So we're basically emulating the cache
off phase on very early system bootup.

That phase is usually responsible for clearing the instruction cache for...

a94b36dd 12/13/2013 02:38 pm Alexander Graf

roms: Flush icache when writing roms to guest memory

We use the rom infrastructure to write firmware and/or initial kernel
blobs into guest address space. So we're basically emulating the cache
off phase on very early system bootup.

That phase is usually responsible for clearing the instruction cache for...

53cb28cb 12/11/2013 08:11 pm Marcel Apfelbaum

exec: separate sections and nodes per address space

Every address space has its own nodes and sections, but
it uses the same global arrays of nodes/section.

This limits the number of devices that can be attached
to the guest to 20-30 devices. It happens because:...

03f49957 12/10/2013 12:29 pm Paolo Bonzini

split definitions for exec.c and translate-all.c radix trees

The exec.c and translate-all.c radix trees are quite different, and
the exec.c one in particular is not limited to the CPU---it can be
used also by devices that do DMA, and in that case the address space...

9736e55b 12/10/2013 12:29 pm Michael S. Tsirkin

exec: replace leaf with skip

In preparation for dynamic radix tree depth support, rename is_leaf
field to skip, telling us how many bits to skip to next level.
Set to 0 for leaf.

Signed-off-by: Michael S. Tsirkin <>

8b795765 12/10/2013 12:29 pm Michael S. Tsirkin

exec: extend skip field to 6 bit, page entry to 32 bit

Extend skip to 6 bit. As page entry doesn't fit in 16 bit
any longer anyway, extend it to 32 bit.
This doubles node map memory requirements, but follow-up
patches will save this memory.

Signed-off-by: Michael S. Tsirkin <>

97115a8d 12/10/2013 12:29 pm Michael S. Tsirkin

exec: pass hw address to phys_page_find

callers always shift by target page bits so let's just do this
internally.

Signed-off-by: Michael S. Tsirkin <>

b35ba30f 12/10/2013 12:29 pm Michael S. Tsirkin

exec: memory radix tree page level compression

At the moment, memory radix tree is already variable width, but it can
only skip the low bits of address.

This is efficient if we have huge memory regions but inefficient if we
are only using a tiny portion of the address space....

57271d63 12/10/2013 12:29 pm Paolo Bonzini

exec: make address spaces 64-bit wide

As an alternative to commit 818f86b (exec: limit system memory
size, 2013-11-04) let's just make all address spaces 64-bit wide.
This eliminates problems with phys_page_find ignoring bits above
TARGET_PHYS_ADDR_SPACE_BITS and address_space_translate_internal...

026736ce 12/10/2013 12:29 pm Michael S. Tsirkin

exec: reduce L2_PAGE_SIZE

With the single exception of ppc with 16M pages,
we get the same number of levels
with L2_PAGE_SIZE = 10 as with L2_PAGE_SIZE = 9.

by doing this we reduce memory footprint of a single level
in the node memory map by 2x without runtime overhead....

ef36fa14 11/25/2013 12:28 pm Marcelo Tosatti

qemu: mempath: prefault pages manually (v4)

v4: s/fail/failed/ (Peter Maydell)

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Marcelo Tosatti <>

29c5b77d 11/13/2013 09:48 pm Anthony Liguori

Merge remote-tracking branch 'mst/tags/for_anthony' into staging

pci, pc, virtio bug fixes

This reverts PCI master abort support - we'll want it
eventually but it exposes too many core bugs to be safe for 1.7.
This also reverts a recent exec.c change that was an...

ef9e455d 11/10/2013 03:11 pm Michael S. Tsirkin

Revert "exec: limit system memory size"

This reverts commit 818f86b88394b7b2b59d313e51043fe15a8004db.

This was a work-around for bugs elsewhere in the system,
exposed by commit a53ae8e934cd54686875b5bcfc2f434244ee55d6:
"hw/pci: partially handle pci master abort"...

e8262a1b 11/08/2013 07:25 am Max Filippov

exec: fix breakpoint_invalidate when pc may not be translated

This fixes qemu abort with the following message:

include/qemu/int128.h:22: int128_get64: Assertion `!a.hi' failed.

which happens due to attempt to invalidate breakpoint by virtual address...

818f86b8 11/04/2013 03:38 pm Michael S. Tsirkin

exec: limit system memory size

The page table logic in exec.c assumes
that memory addresses are at most TARGET_PHYS_ADDR_SPACE_BITS.

But pci addresses are full 64 bit so if we try to render them ignoring
the extra bits, we get strange effects with sections overlapping each...

e85d9db5 10/28/2013 06:34 pm Kevin Wolf

exec: Fix bounce buffer allocation in address_space_map()

This fixes a regression introduced by commit e3127ae0c, which kept the
allocation size of the bounce buffer limited to one page in order to
avoid unbounded allocations (as explained in the commit message of...

041603fe 10/17/2013 06:31 pm Paolo Bonzini

exec: remove qemu_safe_ram_ptr

This is not needed since the RAM list is not modified anymore by
qemu_get_ram_ptr. Replace it with qemu_get_ram_block.

Signed-off-by: Paolo Bonzini <>

575ddeb4 10/14/2013 06:50 pm Stefan Weil

exec: Fix prototype of phys_mem_set_alloc and related functions

phys_mem_alloc and its assigned values qemu_anon_ram_alloc and
legacy_s390_alloc must have identical argument lists.

legacy_s390_alloc uses the size parameter to call mmap, so size_t is
good enough for all of them....

39c153b8 10/10/2013 11:16 pm Anthony Liguori

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

QOM CPUState refactorings / X86CPU

  • Fix for X86CPU model field of qemu32/qemu64 CPU models
  • Bug fix for longjmp on FreeBSD
  • Removal of unused function
  • Confinement of clone syscall infrastructure to linux-user...
30ba0ee5 10/07/2013 12:48 pm Andreas Färber

cpu: Move cpu_copy() into linux-user

It is only used there and is deemed very fragile if not incorrect in its
current memcpy() form. Moving it into linux-user will allow to move
parts into target_cpu.h headers and only copy what the ABI mandates.

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

016e9d62 10/02/2013 09:55 pm Amos Kong

exec: cleanup DEBUG_SUBPAGE

Touched some error after enabling DEBUG_SUBPAGE.

Signed-off-by: Amos Kong <>
Reviewed-by: Paolo Bonzini <>
Signed-off-by: Michael Tokarev <>

2e6ae666 09/23/2013 07:52 pm Anthony Liguori

Merge remote-tracking branch 'mjt/trivial-patches' into staging

  1. By Stefan Weil (8) and others
  2. Via Michael Tokarev
    • mjt/trivial-patches:
      tests/.gitignore: ignore test-throttle
      exec: Fix broken build for MinGW (regression)
      kvm: Fix compiler warning (clang)...
3e4be9c2 09/23/2013 07:52 pm Anthony Liguori

Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

  1. By Alexey Kardashevskiy (3) and others
  2. Via Paolo Bonzini
    • qemu-kvm/uq/master:
      target-i386: add feature kvm_pv_unhalt
      linux-headers: update to 3.12-rc1
      target-i386: forward CPUID cache leaves when -cpu host is used...
089f3f76 09/20/2013 07:13 pm Stefan Weil

exec: Fix broken build for MinGW (regression)

Commit 3435f39513a104294b5e3bbf3612047028d25cfc reduced the ifdeffery with
this result for MinGW:

exec.c: In function ‘qemu_ram_free’:
exec.c:1239:17: warning:
implicit declaration of function ‘munmap’ [-Wimplicit-function-declaration]...

3e469dbf 09/20/2013 01:37 pm Andrea Arcangeli

exec: always use MADV_DONTFORK

MADV_DONTFORK prevents fork to fail with -ENOMEM if the default
overcommit heuristics decides there's too much anonymous virtual
memory allocated. If the KVM secondary MMU is synchronized with MMU
notifiers or not, doesn't make a difference in that regard....

e1e84ba0 09/12/2013 07:45 pm Markus Armbruster

exec: Clean up unnecessary S390 ifdeffery

Another issue missed in commit fdec991 is -mem-path: it needs to be
rejected only for old S390 KVM, not for any S390. Not that I
personally care, but the ifdeffery in qemu_ram_alloc_from_ptr() annoys
me.

Note that this doesn't actually make -mem-path work, as the kernel...

39228250 09/12/2013 07:45 pm Markus Armbruster

exec: Don't abort when we can't allocate guest memory

We abort() on memory allocation failure. abort() is appropriate for
programming errors. Maybe most memory allocation failures are
programming errors, maybe not. But guest memory allocation failure
isn't, and aborting when the user asks for more memory than we can...

dfeaf2ab 09/12/2013 07:45 pm Markus Armbruster

exec: Fix Xen RAM allocation with unusual options

Issues:

  • We try to obey -mem-path even though it can't work with Xen.
  • To implement machine mem-merge, we call
    memory_try_enable_merging(new_block
    >host, size). But with Xen,
    new_block->host remains null. Oops....
0628c182 09/12/2013 07:45 pm Markus Armbruster

exec: Clean up fall back when -mem-path allocation fails

With -mem-path, qemu_ram_alloc_from_ptr() first tries to allocate
accordingly, but when it fails, it falls back to normal allocation.

The fall back allocation code used to be effectively identical to the...

3435f395 09/12/2013 07:45 pm Markus Armbruster

exec: Reduce ifdeffery around -mem-path

Instead of spreading its ifdeffery everywhere, confine it to
qemu_ram_alloc_from_ptr(). Everywhere else, simply test block->fd,
which is non-negative exactly when block uses -mem-path.

Signed-off-by: Markus Armbruster <>...

91138037 09/12/2013 07:45 pm Markus Armbruster

exec: Simplify the guest physical memory allocation hook

Make it a generic hook rather than a KVM hook. Less code and
ifdeffery.

Since the only user of the hook is old S390 KVM, there's hope we can
get rid of it some day.

Acked-by: Christian Borntraeger <>...

2eb9fbaa 09/12/2013 07:45 pm Markus Armbruster

exec: Drop incorrect & dead S390 code in qemu_ram_remap()

Old S390 KVM wants guest RAM mapped in a peculiar way. Commit 6b02494
implemented that.

When qemu_ram_remap() got added in commit cd19cfa, its code carefully
mimicked the allocation code: peculiar way if defined(TARGET_S390X) &&...

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

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