Statistics
| Branch: | Revision:

root / memory.c @ 34b5d2c6

History | View | Annotate | Download (57.4 kB)

# Date Author Comment
68a7439a 09/05/2013 07:11 pm Jan Kiszka

Revert "memory: Return -1 again on reads from unsigned regions"

This reverts commit 9b8c69243585a32d14b9bb9fcd52c37b0b5a1b71.

The commit was wrong: We only return -1 on invalid accesses, not on
valid but unbacked ones. This broke various corner cases.

Cc: ...

437de2ad 08/02/2013 05:05 pm Michael S. Tsirkin

memory.c: drop kvm.h dependency

memory.c does not use any kvm specific interfaces,
don't include kvm.h

Signed-off-by: Michael S. Tsirkin <>
Acked-by: Paolo Bonzini <>
Signed-off-by: Michael Tokarev <>

55d5d048 07/29/2013 06:37 pm Paolo Bonzini

memory: add tracepoints for MMIO reads/writes

This is quite handy to debug softmmu targets.

Reviewed-by: Andreas Faerber <>
Signed-off-by: Paolo Bonzini <>
Message-id: ...

e11ef3d1 07/25/2013 04:12 pm Paolo Bonzini

memory: move functions around

Prepare for next patch, no semantic change.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Anthony Liguori <>
Message-id:
Signed-off-by: Anthony Liguori <>

547e9201 07/25/2013 04:12 pm Paolo Bonzini

memory: pass MemoryRegion to access_with_adjusted_size

The accessors all use a MemoryRegion opaque value. Avoid going
uselessly through void*.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Anthony Liguori <>
Message-id: ...

e7342aa3 07/25/2013 04:12 pm Paolo Bonzini

memory: check memory region endianness, not target's

When combining multiple accesses into a single value, we need to do so
in the device's desired endianness. The target endianness does not have
any influence.

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

fd1d9926 07/22/2013 11:40 pm Alex Williamson

memory: Fix zero-sized memory region print

if mr->size == 0, then

int128_get64(int128_sub(mr->size, int128_make64(1))) => assert(!a.hi)

Also, use int128_one().

Signed-off-by: Alex Williamson <>
Reviewed-by: Paolo Bonzini <>...

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

memory: actually set the owner

Brown paper bag for me. Originally commit 803c0816 came before commit
2c9b15c. When the order was inverted, I left in the NULL initialization
of mr->owner.

Reviewed-by: Hu Tao <>
Signed-off-by: Paolo Bonzini <>

9b8c6924 07/18/2013 07:03 am Jan Kiszka

memory: Return -1 again on reads from unsigned regions

This restore the behavior prior to b018ddf633 which accidentally changed
the return code to 0. Specifically guests probing for register existence
were affected by this.

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

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

99e86347 07/04/2013 06:42 pm Paolo Bonzini

memory: access FlatView from a local variable

We will soon require accesses to as->current_map to be placed under
a lock (with reference counting so as to keep the critical section
small). To simplify this change, always fetch as->current_map into
a local variable and access it through that variable....

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

memory: use a new FlatView pointer on every topology update

This is the first step towards converting as->current_map to
RCU-style updates, where the FlatView updates run concurrently
with uses of an old FlatView.

Reviewed-by: Anthony Liguori <>...

856d7245 07/04/2013 06:42 pm Paolo Bonzini

memory: add reference counting to FlatView

With this change, a FlatView can be used even after a concurrent
update has replaced it. Because we do not yet have RCU, we use a
mutex to protect the small critical sections that read/write the
as->current_map pointer. Accesses to the FlatView can be done...

803c0816 07/04/2013 06:42 pm Paolo Bonzini

memory: add getter for owner

Whenever memory regions are accessed outside the BQL, they need to be
preserved against hot-unplug. MemoryRegions actually do not have their
own reference count; they piggyback on a QOM object, their "owner".
The owner is set at creation time, and there is a function to retrieve...

46637be2 07/04/2013 06:42 pm Paolo Bonzini

memory: add ref/unref

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

3ce10901 07/04/2013 06:42 pm Paolo Bonzini

memory: introduce memory_region_present

This new API will avoid having too many memory_region_ref/unref
in paths that currently use memory_region_find.

Signed-off-by: Paolo Bonzini <>

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

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

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

cpu: Turn cpu_unassigned_access() into a CPUState hook

Use it for all targets, but be careful not to pass invalid CPUState.
cpu_single_env can be NULL, e.g. on Xen.

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

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

8508e024 06/20/2013 05:39 pm Peter Crosthwaite

memory: Fix comment typo

s/ajacent/adjacent

Signed-off-by: Peter Crosthwaite <>
Signed-off-by: Paolo Bonzini <>

41a6e477 06/20/2013 05:39 pm Peter Crosthwaite

memory: as_update_topology_pass: Improve comments

These comments were a little difficult to read. First one had
incorrect parenthesis. The part about attributes changing is
really applicable to the region being 'in both' rather than 'in
new'

Second comment has an obscure parenthetic about 'Logging may have...

2eb74e1a 06/20/2013 05:39 pm Peter Crosthwaite

memory: render_memory_region: factor out fr constant setters

These 4 replicated lines set properties of fr that are constant over
the course of the function. Factor out their repeated setting (and also
guards against them being set multiple times in the loop below)....

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

06866575 06/20/2013 05:32 pm David Gibson

memory: Add iommu map/unmap notifiers

This patch adds a NotifierList to MemoryRegions which represent IOMMUs
allowing other parts of the code to register interest in mappings or
unmappings from the IOMMU. All IOMMU implementations will need to call
memory_region_notify_iommu() to inform those waiting on the notifier list,...

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

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

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

memory: split accesses even when the old MMIO callbacks are used

This is useful for 64-bit memory accesses.

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

08521e28 05/29/2013 05:27 pm Paolo Bonzini

memory: add big endian support to access_with_adjusted_size

This will be used to split 8-byte access down to two four-byte accesses.

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

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

memory: accept mismatching sizes in memory_region_access_valid

The memory API is able to use smaller/wider accesses than requested,
match that in memory_region_access_valid. Of course, the accepts
callback is still free to reject those accesses.

Reviewed-by: Richard Henderson <>...

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

memory: export memory_region_access_valid to exec.c

We'll use it to implement address_space_access_valid.

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

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

memory: assign MemoryRegionOps to all regions

This allows to remove the checks on section->readonly. Simply,
write accesses to ROM will not be considered "direct" and will
go through mr->ops without any special intervention.

Reviewed-by: Richard Henderson <>...

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

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

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

memory: populate FlatView for new address spaces

Even a new address space might have a non-empty FlatView. In order
to initialize it properly, address_space_init should (a) call
memory_region_transaction_commit after the address space is inserted
into the list; (b) force memory_region_transaction_commit to do something....

4c19eb72 05/24/2013 07:43 pm Avi Kivity

memory: fix address space initialization/destruction

A couple of fields were left uninitialized. This was not observed earlier
because all address spaces were statically allocated. Also free allocation
for those fields.

Reviewed-by: Peter Maydell <>...

1d671369 05/24/2013 07:42 pm Paolo Bonzini

memory: make memory_global_sync_dirty_bitmap take an AddressSpace

Since this is a MemoryListener operation, it only makes sense
on an AddressSpace granularity.

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

5553e3a5 05/24/2013 07:42 pm Paolo Bonzini

memory: do not duplicate memory_region_destructor_none

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

5f9a5ea1 05/24/2013 07:42 pm Jan Kiszka

memory: Rename readable flag to romd_mode

"Readable" is a very unfortunate name for this flag because even a
rom_device region will always be readable from the guest POV. What
differs is the mapping, just like the comments had to explain already.
Also, readable could currently be understood as being a generic region...

73034e9e 05/24/2013 07:42 pm Paolo Bonzini

memory: allow memory_region_find() to run on non-root memory regions

memory_region_find() is similar to registering a MemoryListener and
checking for the MemoryRegionSections that come from a particular
region. There is no reason for this to be limited to a root memory...

2c7cfd65 03/22/2013 02:21 pm Hu Tao

memory: fix a bug of detection of memory region collision

The collision reports before and after this patch are:

before:

warning: subregion collision cfc/4 (pci-conf-data) vs cf8/4 (pci-conf-idx)
warning: subregion collision 8000000/f8000000 (pci-hole) vs 0/8000000 (ram-below-4g)...

5bbf90be 02/16/2013 01:12 pm Richard Henderson

memory: Use non-bitops ctzl

A memory size of zero is invalid, and so that edge condition
does not occur.

Signed-off-by: Richard Henderson <>
Reviewed-by: Eric Blake <>
Signed-off-by: Blue Swirl <>

fbeadf50 02/02/2013 10:16 pm Paolo Bonzini

bitops: unify bitops_ffsl with the one in host-utils.h, call it bitops_ctzl

We had two copies of a ffs function for longs with subtly different
semantics and, for the one in bitops.h, a confusing name: the result
was off-by-one compared to the library function ffsl....

6c279db8 12/21/2012 12:09 am Juan Quintela

memory: introduce memory_region_test_and_clear_dirty

This function avoids having to do two calls, one to test the dirty bit, and
other to reset it.

Signed-off-by: Juan Quintela <>

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

7ea692b2 11/10/2012 03:24 pm Jan Kiszka

memory: Don't dump disabled regions

This makes "info mtree" output readable again.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Blue Swirl <>

22bde714 11/10/2012 02:30 pm Jan Kiszka

memory: Reintroduce dirty flag to optimize changes on disabled regions

Cirrus is triggering this, e.g. during Win2k boot: Changes only on
disabled regions require no topology update when transaction depth drops
to 0 again.

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

d26a8cae 10/29/2012 09:32 pm Avi Kivity

memory: fix rendering of a region obscured by another

The memory core drops regions that are hidden by another region (for example,
during BAR sizing), but it doesn't do so correctly if the lower address of the
existing range is below the lower address of the new range....

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

50d2b4d9 10/22/2012 10:49 pm Anthony Liguori

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

  • qemu-kvm/memory/urgent:
    memory: abort if a memory region is destroyed during a transaction
    i440fx: avoid destroying memory regions within a transaction
    memory: Make eventfd adhere to device endianness
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 <>

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

2be0e25f 10/17/2012 06:14 pm Avi Kivity

memory: abort if a memory region is destroyed during a transaction

Destroying a memory region is illegal within a transaction, as until
the transaction is committed, the memory core may hold references to
the region. Add an assert to check for violations of this rule....

28f362be 10/17/2012 05:47 pm Alexander Graf

memory: Make eventfd adhere to device endianness

Our memory API MMIO regions know the concept of device endianness. This
is used to automatically swap endianness between devices and host CPU,
depending on whether buses in between would swizzle the bits.
...

8786db7c 10/15/2012 12:43 pm Avi Kivity

memory: prepare AddressSpace for exporting

AddressSpace contains a member, current_map, of type FlatView. Since we
want to limit the leakage of internal types to public headers, switch to
a pointer to a FlatView. There is no performance impact as this isn't used...

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

memory: export AddressSpace

The DMA API will use an AddressSpace to differentiate among different
initiators.

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

0d673e36 10/15/2012 12:43 pm Avi Kivity

memory: maintain a list of address spaces

Instead of embedding knowledge of the memory and I/O address spaces in the
memory core, maintain a list of all address spaces. This list will later
be extended dynamically for other bus masters.

Reviewed-by: Anthony Liguori <>...

975aefe0 10/15/2012 12:43 pm Avi Kivity

memory: provide defaults for MemoryListener operations

Many listeners don't need to respond to all MemoryListener callbacks;
provide suitable no-op defaults instead.

Signed-off-by: Avi Kivity <>

7762c2c1 10/15/2012 12:43 pm Avi Kivity

memory: rename 'exec-obsolete.h'

exec-obsolete.h used to hold pre-memory-API functions that were used from
device code prior to the transition to the memory API. Now that the
transition is complete, the name no longer describes the file. The
functions still need to be merged better into the memory core, but there's...

bb880ded 09/12/2012 12:15 am Jan Kiszka

memory: Flush coalesced MMIO on mapping and state changes

Flush pending coalesced MMIO before performing mapping or state changes
that could affect the event orderings or route the buffered requests to
a wrong region.

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

02e2b95f 09/12/2012 12:15 am Jan Kiszka

memory: Fold memory_region_update_topology into memory_region_transaction_commit

Simplify the code as we are using now only a subset of the original
features of memory_region_update_topology.

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

59023ef4 09/12/2012 12:15 am Jan Kiszka

memory: Use transaction_begin/commit also for single-step operations

Wrap also simple operations consisting only of a single step with
memory_region_transaction_begin/commit. This allows to perform
additional steps like coalesced MMIO flushing from a single place....

d410515e 09/12/2012 12:15 am Jan Kiszka

memory: Flush coalesced MMIO on selected region access

Instead of flushing pending coalesced MMIO requests on every vmexit,
this provides a mechanism to selectively flush when memory regions
related to the coalesced one are accessed. This first of all includes...

7e2a62d8 08/29/2012 04:25 pm Jan Kiszka

memory: Fix copy&paste mistake in memory_region_iorange_write

The last argument of find_portio is "write", so this must be true here.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

753d5e14 07/12/2012 02:08 pm Paolo Bonzini

memory: pass EventNotifier, not eventfd

Under Win32, EventNotifiers will not have event_notifier_get_fd, so we
cannot call it in common code such as hw/virtio-pci.c. Pass a pointer to
the notifier, and only retrieve the file descriptor in kvm-specific code....

221b3a3f 04/05/2012 01:09 pm Julien Grall

memory: check address space when a listener is registered

This patch resolves a bug in memory listener registration.
"range_add" callback was called on each section of the both
address space (IO and memory space) even if it doesn't match
the address space filter....

b9f9be88 03/19/2012 03:17 pm Blue Swirl

memory: print aliased IO ranges in info mtree

Print also I/O ports behind bridges and other aliases.

Signed-off-by: Blue Swirl <>
Signed-off-by: Avi Kivity <>

97161e17 03/08/2012 07:16 pm Avi Kivity

memory: get rid of cpu_register_io_memory()

The return value of cpu_register_io_memory() is no longer used anywhere, so
we can remove it and all associated data and code.

Signed-off-by: Avi Kivity <>

37ec01d4 03/08/2012 07:06 pm Avi Kivity

memory: dispatch directly via MemoryRegion

Instead of indirecting via io_mem_region, dispatch directly
through the MemoryRegion obtained from the iotlb or phys_page_find().

Signed-off-by: Avi Kivity <>

a2d33521 03/05/2012 05:40 pm Avi Kivity

memory: fix I/O port aliases

Commit e58ac72b6a0 ("ioport: change portio_list not to use
memory_region_set_offset()") started using aliases of I/O memory
regions. Since the IORange used for the I/O was contained in the
target region, the alias information (specifically, the offset...

d7ec83e6 02/29/2012 01:44 pm Avi Kivity

memory: don't pass ->readable attribute to cpu_register_physical_memory_log

It can be derived from the MemoryRegion itself (which is why it is not
used there).

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

93632747 02/29/2012 01:44 pm Avi Kivity

memory: use a MemoryListener for core memory map updates too

This transforms memory.c into a library which can then be unit tested
easily, by feeding it inputs and listening to its outputs.

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

8df8a843 02/29/2012 01:44 pm Avi Kivity

memory: drop AddressSpaceOps

All functionality has been moved to various MemoryListeners.

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

7376e582 02/29/2012 01:44 pm Avi Kivity

memory: allow MemoryListeners to observe a specific address space

Ignore any regions not belonging to a specified address space.

Signed-off-by: Avi Kivity <>

50c1e149 02/29/2012 01:44 pm Avi Kivity

memory: support stateless memory listeners

Current memory listeners are incremental; that is, they are expected to
maintain their own state, and receive callbacks for changes to that state.

This patch adds support for stateless listeners; these work by receiving...

2b50aa1f 02/29/2012 01:44 pm Avi Kivity

memory: remove memory_region_set_offset()

memory_region_set_offset() complicates the API, and has been deprecated
since its introduction. Now that it is no longer used, remove it.

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

946996e9 02/29/2012 01:44 pm Avi Kivity

memory: add shorthand for invoking a callback on all listeners

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

72e22d2f 02/29/2012 01:44 pm Avi Kivity

memory: switch memory listeners to a QTAILQ

This allows reverse iteration, which in turns allows consistent ordering
among multiple listeners:

l1->add
l2->add
l2->del
l1->del

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

0e0d36b4 02/29/2012 01:44 pm Avi Kivity

memory: code motion: move MEMORY_LISTENER_CALL()

So it can be used in earlier code.

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

80a1ea37 02/29/2012 01:44 pm Avi Kivity

memory: move ioeventfd ops to MemoryListener

This way the accelerator (kvm) can handle them directly.

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

7a8499e8 02/29/2012 01:44 pm Avi Kivity

memory: add a readonly attribute to MemoryRegionSection

.readonly cannot be obtained from the MemoryRegion, since it is
inherited from aliases (so you can have a MemoryRegion mapped RW
at one address and RO at another). Record it in a MemoryRegionSection...

4896d74b 02/11/2012 12:49 pm Jan Kiszka

memory-region: Report if region is read-only or write-only on info mtree

Helpful to understand guest configurations of things like the i440FX's
PAM or the state of ROM devices.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Blue Swirl <>

cd7a45c9 02/04/2012 02:45 pm Blue Swirl

memory: change dirty getting API to take a size

Instead of each device knowing or guessing the guest page size,
just pass the desired size of dirtied memory area.

Signed-off-by: Blue Swirl <>

fd4aa979 01/25/2012 08:32 pm Blue Swirl

memory: change dirty setting APIs to take a size

Instead of each target knowing or guessing the guest page size,
just pass the desired size of dirtied memory area.

Signed-off-by: Blue Swirl <>

1660e72d 01/19/2012 01:14 pm Jan Kiszka

memory: Introduce memory_region_init_reservation

Introduce a memory region type that can reserve I/O space. Such regions
are useful for modeling I/O that is only handled outside of QEMU, i.e.
in the context of an accelerator like KVM.

Any access to such a region from QEMU is a bug, but could theoretically...

6b620ca3 01/13/2012 06:55 pm Paolo Bonzini

prepare for future GPLv2+ relicensing

All files under GPLv2 will get GPLv2+ changes starting tomorrow.
event_notifier.c and exec-obsolete.h were only ever touched by Red Hat
employees and can be relicensed now.

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

1470a0cd 01/08/2012 01:10 pm Andreas Färber

memory: Fix adjust_endianness()

Commit a621f38de85598a13d8d8524d1a94fc6a1818215 (Direct dispatch
through MemoryRegion) moved byte swaps to a central function.

Add a missing break, so that long-sized byte swaps don't abort.

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

2c3579ab 01/08/2012 01:10 pm Andreas Färber

memory: Fix memory_region_wrong_endianness()

Since commit be675c972088eba210e18dc125613e9f205a6bfb (memory: move
endianness compensation to memory core) it was checking for
TARGET_BIG_ENDIAN instead of TARGET_WORDS_BIGENDIAN, thereby not
swapping correctly for Big Endian targets....

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

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