[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/25] memory: Introduce address_space_lookup_region
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 02/25] memory: Introduce address_space_lookup_region |
Date: |
Thu, 20 Jun 2013 16:44:30 +0200 |
From: Jan Kiszka <address@hidden>
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 <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
exec.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/exec.c b/exec.c
index eb200d0..86efed7 100644
--- a/exec.c
+++ b/exec.c
@@ -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;
--
1.8.1.4
- [Qemu-devel] [PULL 00/25] Memory/IOMMU patches, part 3: IOMMU implementation, Paolo Bonzini, 2013/06/20
- [Qemu-devel] [PATCH 01/25] exec.c: address_space_translate: handle access to addr 0 of 2^64 sized region, Paolo Bonzini, 2013/06/20
- [Qemu-devel] [PATCH 02/25] memory: Introduce address_space_lookup_region,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 03/25] memory: move private types to exec.c, Paolo Bonzini, 2013/06/20
- [Qemu-devel] [PATCH 04/25] exec: Allow unaligned address_space_rw, Paolo Bonzini, 2013/06/20
- [Qemu-devel] [PATCH 05/25] exec: Resolve subpages in one step except for IOTLB fills, Paolo Bonzini, 2013/06/20
- [Qemu-devel] [PATCH 06/25] exec: Implement subpage_read/write via address_space_rw, Paolo Bonzini, 2013/06/20
- [Qemu-devel] [PATCH 07/25] exec: return MemoryRegion from address_space_translate, Paolo Bonzini, 2013/06/20
- [Qemu-devel] [PATCH 08/25] Revert "memory: limit sections in the radix tree to the actual address space size", Paolo Bonzini, 2013/06/20
- [Qemu-devel] [PATCH 09/25] Revert "s390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62", Paolo Bonzini, 2013/06/20
- [Qemu-devel] [PATCH 10/25] exec: reorganize mem_add to match Int128 version, Paolo Bonzini, 2013/06/20
- [Qemu-devel] [PATCH 12/25] memory: iommu support, Paolo Bonzini, 2013/06/20
- [Qemu-devel] [PATCH 13/25] memory: Add iommu map/unmap notifiers, Paolo Bonzini, 2013/06/20