[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/28] exec: pass hw address to phys_page_find
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 12/28] exec: pass hw address to phys_page_find |
Date: |
Wed, 11 Dec 2013 20:30:47 +0200 |
callers always shift by target page bits so let's just do this
internally.
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
exec.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/exec.c b/exec.c
index 154ae97..b528dad 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,
--
MST
- [Qemu-devel] [PULL 03/28] qtest: split configuration of qtest accelerator and chardev, (continued)
- [Qemu-devel] [PULL 03/28] qtest: split configuration of qtest accelerator and chardev, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 02/28] pc: map PCI address space as catchall region for not mapped addresses, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 04/28] acpi-test: basic acpi unit-test, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 05/28] MAINTAINERS: update X86 machine entry, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 06/28] pci: fix address space size for bridge, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 08/28] spapr_pci: s/INT64_MAX/UINT64_MAX/, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 07/28] pc: s/INT64_MAX/UINT64_MAX/, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 09/28] split definitions for exec.c and translate-all.c radix trees, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 10/28] exec: replace leaf with skip, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 11/28] exec: extend skip field to 6 bit, page entry to 32 bit, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 12/28] exec: pass hw address to phys_page_find,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 13/28] exec: memory radix tree page level compression, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 14/28] exec: make address spaces 64-bit wide, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 15/28] exec: reduce L2_PAGE_SIZE, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 16/28] smbios: Set system manufacturer, product & version by default, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 21/28] hpet: inverse polarity when pin above ISA_NUM_IRQS, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 23/28] memory.c: bugfix - ref counting mismatch in memory_region_find, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 24/28] exec: separate sections and nodes per address space, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 22/28] hpet: enable to entitle more irq pins for hpet, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 25/28] acpi unit-test: load and check facs table, Michael S. Tsirkin, 2013/12/11
- [Qemu-devel] [PULL 26/28] acpi unit-test: adjust the test data structure for better handling, Michael S. Tsirkin, 2013/12/11