[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 24/51] exec: pass hw address to phys_page_find
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 24/51] exec: pass hw address to phys_page_find |
Date: |
Fri, 21 Feb 2014 02:17:00 -0600 |
From: "Michael S. Tsirkin" <address@hidden>
callers always shift by target page bits so let's just do this
internally.
Signed-off-by: Michael S. Tsirkin <address@hidden>
(cherry picked from commit 97115a8d4500abeb090b968f01605e0bdafcdfd3)
*prereq for 53cb28c backport
Signed-off-by: Michael Roth <address@hidden>
---
exec.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/exec.c b/exec.c
index 885e329..283b196 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,
--
1.7.9.5
- [Qemu-stable] [PATCH 17/51] qom: Split out object and class caches, (continued)
- [Qemu-stable] [PATCH 17/51] qom: Split out object and class caches, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 15/51] intel-hda: fix position buffer, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 16/51] memory.c: bugfix - ref counting mismatch in memory_region_find, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 19/51] vl: add missing transition debug->finish_migrate, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 18/51] migration: Fix rate limit, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 20/51] x86: only allow real mode to access 32bit without LMA, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 22/51] split definitions for exec.c and translate-all.c radix trees, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 21/51] qdev-monitor: Avoid device_add crashing on non-device driver name, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 23/51] exec: replace leaf with skip, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 06/51] virtio-blk: switch exit callback to VirtioDeviceClass, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 24/51] exec: pass hw address to phys_page_find,
Michael Roth <=
- [Qemu-stable] [PATCH 28/51] target-mips: fix 64-bit FPU config for user-mode emulation, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 26/51] pc: map PCI address space as catchall region for not mapped addresses, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 27/51] piix: fix 32bit pci hole, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 29/51] linux-user: pass correct parameter to do_shmctl(), Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 25/51] exec: separate sections and nodes per address space, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 32/51] tcg/optimize: fix known-zero bits for right shift ops, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 31/51] Fix QEMU build on OpenBSD on x86 archs, Michael Roth, 2014/02/21