diff options
| author | Jan Kiszka | 2013-05-06 16:48:02 +0200 |
|---|---|---|
| committer | Paolo Bonzini | 2013-06-20 16:32:46 +0200 |
| commit | 9f029603abb1472a33e008f9ea4127cc52566986 (patch) | |
| tree | 4bf4eb7f49c6dd99cb331ea21d858acbc8a97f7f /exec.c | |
| parent | exec.c: address_space_translate: handle access to addr 0 of 2^64 sized region (diff) | |
| download | qemu-9f029603abb1472a33e008f9ea4127cc52566986.tar.gz qemu-9f029603abb1472a33e008f9ea4127cc52566986.tar.xz qemu-9f029603abb1472a33e008f9ea4127cc52566986.zip | |
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.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'exec.c')
| -rw-r--r-- | exec.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -203,6 +203,12 @@ bool memory_region_is_unassigned(MemoryRegion *mr) && mr != &io_mem_watch; } +static MemoryRegionSection *address_space_lookup_region(AddressSpace *as, + hwaddr addr) +{ + return phys_page_find(as->dispatch, addr >> TARGET_PAGE_BITS); +} + MemoryRegionSection *address_space_translate(AddressSpace *as, hwaddr addr, hwaddr *xlat, hwaddr *plen, bool is_write) @@ -210,7 +216,7 @@ MemoryRegionSection *address_space_translate(AddressSpace *as, hwaddr addr, MemoryRegionSection *section; Int128 diff; - section = phys_page_find(as->dispatch, addr >> TARGET_PAGE_BITS); + section = address_space_lookup_region(as, addr); /* Compute offset within MemoryRegionSection */ addr -= section->offset_within_address_space; |
