Statistics
| Branch: | Revision:

root / exec.c @ c09015dd

History | View | Annotate | Download (128.3 kB)

# Date Author Comment
0e0df1e2 01/04/2012 01:34 pm Avi Kivity

Convert IO_MEM_{RAM,ROM,UNASSIGNED,NOTDIRTY} to MemoryRegions

Convert the fixed-address IO_MEM_RAM, IO_MEM_ROM, IO_MEM_UNASSIGNED,
and IO_MEM_NOTDIRTY io handlers to MemoryRegions. These aren't real
regions, since they are never added to the memory hierarchy, but they...

dd81124b 01/04/2012 01:34 pm Avi Kivity

Switch cpu_register_physical_memory_log() to use MemoryRegions

Still internally using ram_addr.

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

70c68e44 01/04/2012 01:34 pm Avi Kivity

Convert the subpage wrapper to be a MemoryRegion

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

de712f94 01/04/2012 01:34 pm Avi Kivity

Convert IO_MEM_SUBPAGE_RAM to be a MemoryRegion

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

1ec9b909 01/04/2012 01:34 pm Avi Kivity

Convert io_mem_watch to be a MemoryRegion

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

a621f38d 01/04/2012 01:34 pm Avi Kivity

Direct dispatch through MemoryRegion

Now that all mmio goes through MemoryRegions, we can convert
io_mem_opaque to be a MemoryRegion pointer, and remove the thunks
that convert from old-style CPU{Read,Write}MemoryFunc to MemoryRegionOps.

Signed-off-by: Avi Kivity <>...

b3b00c78 01/04/2012 01:34 pm Avi Kivity

Remove IO_MEM_SUBPAGE

Replace with a MemoryRegion flag.

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

75c578dc 01/04/2012 01:34 pm Avi Kivity

Drop IO_MEM_ROMD

Unlike ->readonly, ->readable is not inherited from aliase, so we can simply
query the memory region.

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

11c7ef0c 01/04/2012 01:34 pm Avi Kivity

Remove IO_MEM_SHIFT

We no longer use any of the lower bits of a ram_addr, so we might as well
use them for the io table index. This increases the number of potential
I/O handlers by a factor of 8.

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

8f77558f 01/04/2012 01:34 pm Avi Kivity

memory: obsolete cpu_physical_memory_[gs]et_dirty_tracking()

The getter is no longer used, so it is completely removed.

Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>

be675c97 01/04/2012 01:34 pm Avi Kivity

memory: move endianness compensation to memory core

Instead of doing device endianness compensation in cpu_register_io_memory(),
do it in the memory core.

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

f1f6e3b8 01/04/2012 01:34 pm Avi Kivity

exec: make phys_page_find() return a temporary

Instead of returning a PhysPageDesc pointer, return a temporary.
This lets us move away from actually storing PhysPageDesc's, and
instead sythesising them when needed.

Signed-off-by: Avi Kivity <>...

acbbec5d 01/04/2012 01:34 pm Avi Kivity

memory: move mmio access to functions

Currently mmio access goes directly to the io_mem_{read,write} arrays.
In preparation for eliminating them, add indirection via a function.

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

2774c6d0 01/04/2012 01:34 pm Avi Kivity

Fix wrong region_offset when overlaying a page with another

cpu_register_physical_memory_log() does not update region_offset
if a page was previously registered for the same address. This
could cause mmio accesses going to the wrong place, by using the
old region_offset....

1d393fa2 01/04/2012 01:34 pm Avi Kivity

Avoid range comparisons on io index types

The code sometimes uses range comparisons on io indexes (e.g.
index =< IO_MEM_ROM). Avoid these as they make moving to objects harder.

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

d39e8222 01/04/2012 01:34 pm Avi Kivity

Uninline get_page_addr_code()

Its use of IO_MEM_ROM and friends will later cause #include loops; and it
is too large to merit inlining.

Signed-off-by: Avi Kivity <>
Reviewed-by: Richard Henderson <>

c5705a77 01/04/2012 01:34 pm Avi Kivity

vmstate, memory: decouple vmstate from memory API

Currently creating a memory region automatically registers it for
live migration. This differs from other state (which is enumerated
in a VMStateDescription structure) and ties the live migration code
into the memory core....

7c637366 01/04/2012 01:34 pm Avi Kivity

Store MemoryRegion in RAMBlock

As a step in moving live migration from RAMBlocks to MemoryRegions,
store the MemoryRegion in a RAMBlock.

Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>

586c6230 01/03/2012 07:19 pm Avi Kivity

Remove cpu_get_physical_page_desc()

No longer used.

Signed-off-by: Avi Kivity <>

dcd97e33 01/03/2012 07:19 pm Avi Kivity

memory: remove CPUPhysMemoryClient

No longer used.

Signed-off-by: Avi Kivity <>

7664e80c 12/20/2011 02:14 pm Avi Kivity

memory: add API for observing updates to the physical memory map

Add an API that allows a client to observe changes in the global
memory map:
- region added (possibly with logging enabled)
- region removed (possibly with logging enabled)
- logging started on a region...

67d95c15 12/19/2011 05:28 pm Avi Kivity

memory: move obsolete exec.c functions to a private header

This will help avoid accidental usage.

Signed-off-by: Avi Kivity <>

fce537d4 12/19/2011 05:23 pm Avi Kivity

memory, xen: pass MemoryRegion to xen_ram_alloc()

Currently xen_ram_alloc() relies on ram_addr, which is going away.
Give it something else to use as a cookie.

Signed-off-by: Avi Kivity <>

5ab97b7f 12/15/2011 06:22 pm Alex Rozenman

phys_page_find_alloc: Use correct initial region_offset.

This fixes a common bug with initial region_offset value.
Usually, the pages are re-assigned afterwards, so the bug
has a very small effect on regular QEMU use flows.

Signed-off-by: Alex Rozenman <>...

56384e8b 12/15/2011 05:27 pm Andreas Färber

exec.c: Fix subpage memory access to RAM MemoryRegion

Commit 95c318f5e1f88d7e5bcc6deac17330fd4806a2d3 (Fix segfault in mmio
subpage handling code.) prevented a segfault by making all subpage
registrations over an existing memory page perform an unassigned access....

222f23f5 12/14/2011 10:58 pm Dr. David Alan Gilbert

tcg/arm: remove fixed map code buffer restriction

On ARM, don't map the code buffer at a fixed location, and fix up the
call/goto tcg routines to let it do long jumps.

Mapping the code buffer at a fixed address could sometimes result in it being
mapped over the top of the heap with pretty random results....

daf767b1 12/10/2011 07:05 pm Stefan Weil

w32: Disable buffering for log file

W32 does not support line buffering, but it supports unbuffered output.

Unbuffered output is better for writing to qemu.log than fully buffered
output because it also shows the latest log messages when an application
crash occurs....

3e837b2c 11/01/2011 05:58 pm Alex Williamson

Error check find_ram_offset

Spotted via code review, we initialize offset to 0 to avoid a
compiler warning, but in the unlikely case that offset is
never set to something else, we should abort instead of return
a value that will almost certainly cause problems....

b3c4bbe5 11/01/2011 05:58 pm Paolo Bonzini

Make cpu_single_env thread-local

Make cpu_single_env thread-local. This fixes a regression
in handling of multi-threaded programs in linux-user mode
(bug 823902).

Signed-off-by: Paolo Bonzini <>
[Peter Maydell: rename tls_cpu_single_env to cpu_single_env]...

8f355d67 10/26/2011 03:38 pm 陳韋任

exec.c: Remove useless comment

As phys_ram_size had been removed since QEMU 0.12. Remove the useless
comment.

Signed-off-by: Chen Wen-Ren <>
Signed-off-by: Stefan Hajnoczi <>

946fb27c 10/21/2011 07:14 pm Paolo Bonzini

qemu-timer: move icount to cpus.c

None of this is needed by tools, and most of it can even be made static
inside cpus.c.

Signed-off-by: Paolo Bonzini <>

3917149d 10/01/2011 12:31 pm Blue Swirl

Move GETPC from dyngen-exec.h to exec-all.h

GETPC can be used even from outside of helper code. Move the macro to
a more accessible location. Avoid a compile warning from redefining it in exec.c.

Signed-off-by: Blue Swirl <>

8b3692d1 09/21/2011 12:50 pm Stefan Weil

Remove qemu_host_page_bits

It was introduced with commit 54936004fddc52c321cb3f9a9a51140e782bed5d
as host_page_bits but never used.

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

85d59fef 08/12/2011 03:07 pm Paolo Bonzini

fix QLIST usage for RAM list

Spotted while reviewing the migration thread patches.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Stefan Hajnoczi <>

309cb471 08/08/2011 06:15 pm Avi Kivity

Integrate I/O memory regions into qemu

get_system_io() returns the root I/O memory region.

Reviewed-by: Richard Henderson <>
Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

9f4b09a4 08/07/2011 12:57 pm Tobias Nygren

Use mmap to allocate execute memory

Use mmap to allocate executable memory on NetBSD as well.

Signed-off-by: Christoph Egger <>
Signed-off-by: Blue Swirl <>

8417cebf 08/05/2011 06:57 pm Avi Kivity

memory: use signed arithmetic

When trying to map an alias of a ram region, where the alias starts at
address A and we map it into address B, and A > B, we had an arithmetic
underflow. Because we use unsigned arithmetic, the underflow converted
into a large number which failed addrrange_intersects() tests....

d5ab9713 08/05/2011 06:57 pm Jan Kiszka

Avoid allocating TCG resources in non-TCG mode

Do not allocate TCG-only resources like the translation buffer when
running over KVM or XEN. Saves a "few" bytes in the qemu address space
and is also conceptually cleaner.

Signed-off-by: Jan Kiszka <>...

3046c984 07/29/2011 05:42 pm Anthony Liguori

Merge remote-tracking branch 'agraf/xen-next' into staging

62152b8a 07/29/2011 04:25 pm Avi Kivity

exec.c: initialize memory map

Allocate the root memory region and initialize it.

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

f15fbc4b 07/26/2011 07:57 am Anthony PERARD

cpu-common: Have a ram_addr_t of uint64 with Xen.

In Xen case, memory can be bigger than the host memory. that mean a
32bits host (and QEMU) should be able to handle a RAM address of 64bits.

Signed-off-by: Anthony PERARD <>
Signed-off-by: Alexander Graf <>

8ca5692d 07/26/2011 07:43 am Anthony PERARD

exec.c: Use ram_addr_t in cpu_physical_memory_rw(...).

As the variable pd and addr1 inside the function cpu_physical_memory_rw
are mean to handle a RAM address, they should be of the ram_addr_t type
instead of unsigned long.

Signed-off-by: Anthony PERARD <>...

b14ef7c9 07/21/2011 12:28 am Blue Swirl

Fix unassigned memory access handling

cea5f9a28faa528b6b1b117c9ab2d8828f473fef exposed bugs in unassigned memory
access handling. Fix them by always passing CPUState to the handlers.

Reported-by: Hervé Poussineau <>
Signed-off-by: Blue Swirl <>

8ab934f9 07/17/2011 02:54 am Stefano Stabellini

qemu_ram_ptr_length: take ram_addr_t as arguments

qemu_ram_ptr_length should take ram_addr_t as argument rather than
target_phys_addr_t because is doing comparisons with RAMBlock addresses.

cpu_physical_memory_map should create a ram_addr_t address to pass to...

e41d7c69 07/17/2011 02:54 am Jan Kiszka

xen: Clean up map cache API naming

The map cache is a Xen thing, so its API should make this clear.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Alexander Graf <>

868bb33f 07/17/2011 02:54 am Jan Kiszka

xen: Fold CONFIG_XEN_MAPCACHE into CONFIG_XEN

Xen won't be enabled if there is no backend support available for the
host. And that also means the map cache will work. So drop the separate
config switch and move the required stubs over to xen-stub.c.

Signed-off-by: Jan Kiszka <>...

a884da8a 07/12/2011 11:29 pm Peter Maydell

exec.c: Fix calculation of code_gen_buffer_max_size

When calculating the point at which we should not try to put another
TB into the code gen buffer, we have to allow not just for OPC_MAX_SIZE
but OPC_BUF_SIZE. This is because the target translate.c will only...

1e78bcc1 07/12/2011 11:00 pm Alexander Graf

exec: add endian specific phys ld/st functions

Device code some times needs to access physical memory and does that
through the ld./st._phys functions. However, these are the exact same
functions that the CPU uses to access memory, which means they will
be endianness swapped depending on the target CPU....

bb820c03 06/27/2011 07:25 pm Anthony Liguori

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

2b41f10e 06/26/2011 09:25 pm Blue Swirl

Remove exec-all.h include directives

Most exec-all.h include directives are now useless, remove them.

Signed-off-by: Blue Swirl <>

4429ab44 06/24/2011 05:34 pm Juan Quintela

exec: last_first_tb was only used in !ONLY_USER case

Once there, use a better variable name.

Signed-off-by: Juan Quintela <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Stefan Hajnoczi <>

fdba9594 06/22/2011 03:11 pm Anthony Liguori

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

Conflicts:
hw/usb-uhci.c

6506e4f9 06/19/2011 05:40 am Stefano Stabellini

xen: remove xen_map_block and xen_unmap_block

Replace xen_map_block with qemu_map_cache with the appropriate locking
and size parameters.
Replace xen_unmap_block with qemu_invalidate_entry.

Signed-off-by: Stefano Stabellini <>...

38bee5dc 06/19/2011 05:40 am Stefano Stabellini

exec.c: refactor cpu_physical_memory_map

Introduce qemu_ram_ptr_length that takes an address and a size as
parameters rather than just an address.

Refactor cpu_physical_memory_map so that we call qemu_ram_ptr_length only
once rather than calling qemu_get_ram_ptr one time per page....

712c2b41 06/19/2011 05:40 am Stefano Stabellini

xen: mapcache performance improvements

Use qemu_invalidate_entry in cpu_physical_memory_unmap.

Do not lock mapcache entries in qemu_get_ram_ptr if the address falls in
the ramblock with offset == 0. We don't need to do that because the
callers of qemu_get_ram_ptr either try to map an entire block, other...

cd306087 06/19/2011 05:40 am Stefano Stabellini

xen: remove qemu_map_cache_unlock

There is no need for qemu_map_cache_unlock, just use
qemu_invalidate_entry instead.

Signed-off-by: Stefano Stabellini <>
Signed-off-by: Alexander Graf <>

befeac45 06/15/2011 06:27 pm Michael S. Tsirkin

Merge remote-tracking branch 'origin/master' into pci

Conflicts:
hw/virtio-pci.c

2173a75f 06/12/2011 10:33 am Alex Williamson

CPUPhysMemoryClient: batch addresses in catchup

When a phys memory client registers and we play catchup by walking
the page tables, we can make a huge improvement in the number of
times the set_memory callback is called by batching contiguous
pages together. With a 4G guest, this reduces the number of callbacks...

44829396 06/10/2011 11:21 pm Edgar E. Iglesias

Merge remote branch 'rth/axp-next' into alpha-merge

  • rth/axp-next: (26 commits)
    target-alpha: Implement TLB flush primitives.
    target-alpha: Use a fixed frequency for the RPCC in system mode.
    target-alpha: Trap for unassigned and unaligned addresses....
9bf0960a 06/08/2011 11:04 am Alexandre Raymond

Fix compilation warning due to missing header for sigaction (followup)

This patch removes all references to signal.h when qemu-common.h is included
as they become redundant.

Signed-off-by: Alexandre Raymond <>
Signed-off-by: Stefan Hajnoczi <>

1f2e98b6 06/03/2011 11:59 pm Alex Williamson

exec: Implement qemu_ram_free_from_ptr()

Required for regions mapped via qemu_ram_alloc_from_ptr(). VFIO
and ivshmem will make use of this to remove mappings when devices
are hot unplugged.

Signed-off-by: Alex Williamson <>
Signed-off-by: Aurelien Jarno <>

5b450407 05/31/2011 08:18 pm Richard Henderson

target-alpha: Trap for unassigned and unaligned addresses.

Signed-off-by: Richard Henderson <>

6eba5c82 05/23/2011 11:36 pm Aurelien Jarno

Merge branch 'trivial-patches' of git://repo.or.cz/qemu/stefanha

  • 'trivial-patches' of git://repo.or.cz/qemu/stefanha:
    Fix typos in comments (chek -> check)
    hw/sd.c: Don't complain about SDIO commands CMD52/CMD53
    hw/realview.c: Remove duplicate #include line...
a57d23e4 05/23/2011 12:31 am Stefan Weil

Fix typos in comments (chek -> check)

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

ff83678a 05/20/2011 06:35 pm Christian Borntraeger

s390x: change mapping base to allow guests > 2GB

the current s390x qemu memory layout is

0x1000000: guest start
0x80000000: qemu binary

which limits the amount of available memory to <2GB.
This patch moves the guest pages to 32GB to not collide with the binary...

fb8b2735 05/20/2011 06:35 pm Alexander Graf

s390x: complain when allocating ram fails

While trying out the > 64GB guest RAM patch, I hit some virtual address
limitations of my host system, which resulted in mmap failing. Unfortunately,
qemu didn't tell me about this failure, but just used the NULL pointer...

432d268c 05/08/2011 11:10 am Jun Nakajima

xen: Introduce the Xen mapcache

On IA32 host or IA32 PAE host, at present, generally, we can't create
an HVM guest with more than 2G memory, because generally it's almost
impossible for Qemu to find a large enough and consecutive virtual
address space to map an HVM guest's whole physical address space....

050a0ddf 05/08/2011 11:10 am Anthony PERARD

Introduce qemu_put_ram_ptr

This function allows to unlock a ram_ptr give by qemu_get_ram_ptr. After
a call to qemu_put_ram_ptr, the pointer may be unmap from QEMU when
used with Xen.

Signed-off-by: Anthony PERARD <>
Acked-by: Alexander Graf <>...

5300f1a5 05/05/2011 04:39 pm Michael S. Tsirkin

Merge remote branch 'origin/master' into pci

Conflicts:
exec.c

8d4c78e7 05/05/2011 04:23 pm Alex Williamson

CPUPhysMemoryClient: Pass guest physical address not region offset

When we're trying to get a newly registered phys memory client updated
with the current page mappings, we end up passing the region offset
(a ram_addr_t) as the start address rather than the actual guest...

c2f42bf0 05/05/2011 04:21 pm Alex Williamson

CPUPhysMemoryClient: Fix typo in phys memory client registration

When we register a physical memory client, we try to walk the page
tables, calling the set_memory hook for every entry. Effectively
playing catchup for the client for everything already registered....

97ffbd8d 05/02/2011 03:38 pm Jan Kiszka

Break up user and system cpu_interrupt implementations

Both have only two lines in common, and we will convert the system
service into a callback which is of no use for user mode operation.

Signed-off-by: Jan Kiszka <>
CC: Riku Voipio <>...

ec6959d0 05/02/2011 03:38 pm Jan Kiszka

Redirect cpu_interrupt to callback handler

This allows to override the interrupt handling of QEMU in system mode.
KVM will make use of it to set a specialized handler.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Marcelo Tosatti <>

618ba8e6 04/20/2011 11:37 am Stefan Weil

Remove unused function parameter from cpu_restore_state

The previous patch removed the need for parameter puc.
Is is now unused, so remove it.

Cc: Aurelien Jarno <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Stefan Weil <>

71d2b725 04/12/2011 10:51 pm Stefan Weil

exec: Remove a type cast which is no longer needed

All other type casts in calls of cpu_physical_memory_write are
used by hardware emulations and will be fixed by separate patches.

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

54f7b4a3 04/12/2011 10:51 pm Stefan Weil

Replace cpu_physical_memory_rw were possible

Using cpu_physical_memory_read, cpu_physical_memory_write and ldub_phys
improves readability and allows removing some type casts.

lduw_phys and ldl_phys were not used because both require aligned
addresses. Therefore it is not possible to simply replace existing...

3b8e6a2d 04/07/2011 11:53 am Edgar E. Iglesias

exec: Handle registrations of the entire address space

Signed-off-by: Edgar E. Iglesias <>

0fd542fb 04/06/2011 10:28 pm Michael S. Tsirkin

cpu: add set_memory flag to request dirty logging

Pass the flag to all cpu notifiers, doing
nothing at this point. Will be used by
follow-up patches.

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

dc7a09cf 03/16/2011 10:11 pm Jan Kiszka

Expose thread_id in info cpus

Based on patch by Glauber Costa:

To allow management applications like libvirt to apply CPU affinities to
the VCPU threads, expose their ID via info cpus. This patch provides the
pre-existing and used interface from qemu-kvm....

fd28aa13 03/15/2011 07:36 pm Jan Kiszka

s390: Detect invalid invocations of qemu_ram_free/remap

This both detects invalid invocations of qemu_ram_free and
qemu_ram_remap when mem_path is non-NULL and fixes a build error on
s390 ("'area' may be used uninitialized in this function").

Signed-off-by: Jan Kiszka <>...

cd19cfa2 03/15/2011 06:19 am Huang Ying

Add qemu_ram_remap

qemu_ram_remap() unmaps the specified RAM pages, then re-maps these
pages again. This is used by KVM HWPoison support to clear HWPoisoned
page tables across guest rebooting, so that a new page may be
allocated later to recover the memory error....

b7680cb6 03/13/2011 04:44 pm Jan Kiszka

Refactor thread retrieval and check

We have qemu_cpu_self and qemu_thread_self. The latter is retrieving the
current thread, the former is checking for equality (using CPUState). We
also have qemu_thread_equal which is only used like qemu_cpu_self.

This refactors the interfaces, creating qemu_cpu_is_self and...

7d82af38 03/11/2011 12:12 am Vincent Palatin

Fix performance regression in qemu_get_ram_ptr

When the commit f471a17e9d869df3c6573f7ec02c4725676d6f3a converted the
ram_blocks structure to QLIST, it also removed the conditional check before
switching the current block at the beginning of the list.

In the common use case where ram_blocks has a few blocks with only one...

e5896b12 02/14/2011 04:39 pm Anthony PERARD

Introduce log_start/log_stop in CPUPhysMemoryClient

In order to use log_start/log_stop with Xen as well in the vga code,
this two operations have been put in CPUPhysMemoryClient.

The two new functions cpu_physical_log_start,cpu_physical_log_stop are
used in hw/vga.c and replace the kvm_log_start/stop. With this, vga does...

d1a1eb74 02/10/2011 07:17 pm Tristan Gingold

Make tb_alloc static

This function is only used within exec.c, so no need to make it public.

Signed-off-by: Tristan Gingold <>
Signed-off-by: Aurelien Jarno <>

4cd31ad2 01/16/2011 10:32 am Blue Swirl

tcg/sparc64: fix segfault

With current OpenBSD, code_gen_buffer was mapped 8GB away from
text segment. Then any helpers were beyond the 2GB range of call
instruction genereated by TCG and so the calls would go nowhere,
leading to a segfault.

Fix by specifying an address for the code_gen_buffer,...

cbb608a5 12/21/2010 09:44 pm Brad

Use mmap() within code_gen_alloc() for OpenBSD.

Signed-off-by: Brad Smith <>
Signed-off-by: Blue Swirl <>

dd310534 12/11/2010 05:24 pm Alexander Graf

exec: introduce endianness swapped mmio

The way we're currently modeling mmio is too simplified. We assume that
every device has the same endianness as the target CPU. In reality,
most devices are little endian (all PCI and ISA ones I'm aware of). Some
are big endian (special system devices) and a very little fraction is...

2507c12a 12/11/2010 05:24 pm Alexander Graf

Add endianness as io mem parameter

As stated before, devices can be little, big or native endian. The
target endianness is not of their concern, so we need to push things
down a level.

This patch adds a parameter to cpu_register_io_memory that allows a
device to choose its endianness. For now, all devices simply choose...

db1923de 12/03/2010 07:50 pm Stefan Hajnoczi

exec: Remove debugging fprintf() that slipped into qemu_ram_alloc_from_ptr()

Remove the debugging fprintf() slipped in via the following commit:

commit b2e0a138e77245290428a7d599a929e2e1bfe510
Author: Michael S. Tsirkin &lt;&gt;
Date: Mon Nov 22 19:52:34 2010 +0200...
b2e0a138 12/02/2010 09:13 pm Michael S. Tsirkin

migration: stable ram block ordering

This makes ram block ordering under migration stable, ordered by offset.
This is especially useful for migration to exec, for debugging.

Signed-off-by: Michael S. Tsirkin <>
Tested-by: Jason Wang <>

055403b2 10/30/2010 11:01 am Stefan Weil

exec: Use fprintf_function for dump_exec_info (format checking)

fprintf_function uses format checking with GCC_FMT_ATTR.

It is declared in qemu-common.h and used in cpu-all.h
(which is included from cpu.h), so qemu-common.h must
be included earlier. Some redundant include statements...

e890261f 10/21/2010 12:15 am Marcelo Tosatti

Export qemu_ram_addr_from_host

To be used by next patches.

Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Avi Kivity <>

7fd3f494 10/03/2010 09:41 am Stefan Weil

exec: Fix compilation error for debug code

is_softmmu was removed with commit
d4c430a80f000d722bb70287af4d4c184a8d7006,
so remove it now from debug code, too.

Fix also the format specifier for paddr
in the same line of code.

Cc: Blue Swirl <>...

e78815a5 09/25/2010 02:26 pm Andreas Färber

Introduce qemu_madvise()

vl.c has a Sun-specific hack to supply a prototype for madvise(),
but the call site has apparently moved to arch_init.c.

Haiku doesn't implement madvise() in favor of posix_madvise().
OpenBSD and Solaris 10 don't implement posix_madvise() but madvise()....

95c318f5 08/28/2010 11:47 am Gleb Natapov

Fix segfault in mmio subpage handling code.

It is possible that subpage mmio is registered over existing memory
page. When this happens "memory" will have real memory address and not
index into io_mem array so next access to the page will generate
segfault. It is uncommon to have some part of a page to be accessed as...

9742bf26 08/23/2010 12:19 am Yoshiaki Tamura

exec: replace tabs by spaces.

Signed-off-by: Yoshiaki Tamura <>
Signed-off-by: Anthony Liguori <>

6977dfe6 08/23/2010 12:19 am Yoshiaki Tamura

exec: remove code duplication in qemu_ram_alloc() and qemu_ram_alloc_from_ptr()

Since most of the code in qemu_ram_alloc() and
qemu_ram_alloc_from_ptr() are duplicated, let
qemu_ram_alloc_from_ptr() to switch by checking void *host, and change
qemu_ram_alloc() to a wrapper....

84b89d78 08/11/2010 12:25 am Cam Macdonell

Add qemu_ram_alloc_from_ptr function

Provide a function to add an allocated region of memory to the qemu RAM.

This patch is copied from Marcelo's qemu_ram_map() in qemu-kvm and given the
clearer name qemu_ram_alloc_from_ptr().

Signed-off-by: Cam Macdonell <>...