summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2013-11-13 20:08:19 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2014-02-20 21:59:18 -0600
commit4c3e00d83f19206cd916edb3d6869478dcbc3ab0 (patch)
tree9cb1cee68a09f3523fef4331dbb6a036e69cc699
parent6a108c4802809f9f3c7e5cc49724f5131acb5bb8 (diff)
downloadqemu-4c3e00d83f19206cd916edb3d6869478dcbc3ab0.tar.gz
exec: pass hw address to phys_page_find
callers always shift by target page bits so let's just do this internally. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 97115a8d4500abeb090b968f01605e0bdafcdfd3) *prereq for 53cb28c backport Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--exec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/exec.c b/exec.c
index 885e329cc0..283b196778 100644
--- a/exec.c
+++ b/exec.c
@@ -216,10 +216,11 @@ static void phys_page_set(AddressSpaceDispatch *d,
phys_page_set_level(&d->phys_map, &index, &nb, leaf, P_L2_LEVELS - 1);
}
-static MemoryRegionSection *phys_page_find(PhysPageEntry lp, hwaddr index,
+static MemoryRegionSection *phys_page_find(PhysPageEntry lp, hwaddr addr,
Node *nodes, MemoryRegionSection *sections)
{
PhysPageEntry *p;
+ hwaddr index = addr >> TARGET_PAGE_BITS;
int i;
for (i = P_L2_LEVELS; lp.skip && (i -= lp.skip) >= 0;) {
@@ -245,8 +246,7 @@ static MemoryRegionSection *address_space_lookup_region(AddressSpaceDispatch *d,
MemoryRegionSection *section;
subpage_t *subpage;
- section = phys_page_find(d->phys_map, addr >> TARGET_PAGE_BITS,
- d->nodes, d->sections);
+ section = phys_page_find(d->phys_map, addr, d->nodes, d->sections);
if (resolve_subpage && section->mr->subpage) {
subpage = container_of(section->mr, subpage_t, iomem);
section = &d->sections[subpage->sub_section[SUBPAGE_IDX(addr)]];
@@ -802,7 +802,7 @@ static void register_subpage(AddressSpaceDispatch *d, MemoryRegionSection *secti
subpage_t *subpage;
hwaddr base = section->offset_within_address_space
& TARGET_PAGE_MASK;
- MemoryRegionSection *existing = phys_page_find(d->phys_map, base >> TARGET_PAGE_BITS,
+ MemoryRegionSection *existing = phys_page_find(d->phys_map, base,
next_map.nodes, next_map.sections);
MemoryRegionSection subsection = {
.offset_within_address_space = base,