[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 19/30] memory: Introduce address_space_lookup_region
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 19/30] memory: Introduce address_space_lookup_region |
Date: |
Tue, 21 May 2013 12:57:20 +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 4cc5ecb..a29dec5 100644
--- a/exec.c
+++ b/exec.c
@@ -198,13 +198,19 @@ static MemoryRegionSection
*phys_page_find(AddressSpaceDispatch *d, hwaddr index
return &phys_sections[lp.ptr];
}
+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)
{
MemoryRegionSection *section;
- 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;
*plen = MIN(section->size - addr, *plen);
--
1.8.1.4
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, (continued)
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Paolo Bonzini, 2013/05/27
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Jan Kiszka, 2013/05/27
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Paolo Bonzini, 2013/05/27
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Jan Kiszka, 2013/05/27
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Peter Maydell, 2013/05/27
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Paolo Bonzini, 2013/05/27
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Peter Maydell, 2013/05/27
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Paolo Bonzini, 2013/05/26
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Jan Kiszka, 2013/05/26
- Re: [Qemu-devel] [PATCH 17/30] memory: add address_space_translate, Paolo Bonzini, 2013/05/26
[Qemu-devel] [PATCH 19/30] memory: Introduce address_space_lookup_region,
Paolo Bonzini <=
[Qemu-devel] [PATCH 20/30] memory: iommu support, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 21/30] memory: Add iommu map/unmap notifiers, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 22/30] vfio: abort if an emulated iommu is used, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 23/30] spapr: convert TCE API to use an opaque type, Paolo Bonzini, 2013/05/21
[Qemu-devel] [PATCH 24/30] spapr: make IOMMU translation go through IOMMUTLBEntry, Paolo Bonzini, 2013/05/21