[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/20] memory: give phys_page_find() its own tree se
From: |
Avi Kivity |
Subject: |
[Qemu-devel] [PATCH 14/20] memory: give phys_page_find() its own tree search loop |
Date: |
Tue, 14 Feb 2012 11:27:44 +0200 |
We'll change phys_page_find_alloc() soon, but phys_page_find()
doesn't need to bear the consequences.
Signed-off-by: Avi Kivity <address@hidden>
---
exec.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/exec.c b/exec.c
index bf34dc9..24423d5 100644
--- a/exec.c
+++ b/exec.c
@@ -459,14 +459,23 @@ static uint16_t *phys_page_find_alloc(target_phys_addr_t
index, int alloc)
static MemoryRegionSection phys_page_find(target_phys_addr_t index)
{
- uint16_t *p = phys_page_find_alloc(index, 0);
- uint16_t s_index = phys_section_unassigned;
+ PhysPageEntry lp = phys_map;
+ PhysPageEntry *p;
+ int i;
MemoryRegionSection section;
target_phys_addr_t delta;
+ uint16_t s_index = phys_section_unassigned;
- if (p) {
- s_index = *p;
+ for (i = P_L2_LEVELS - 1; i >= 0; i--) {
+ if (lp.u.node == PHYS_MAP_NODE_NIL) {
+ goto not_found;
+ }
+ p = phys_map_nodes[lp.u.node];
+ lp = p[(index >> (i * L2_BITS)) & (L2_SIZE - 1)];
}
+
+ s_index = lp.u.leaf;
+not_found:
section = phys_sections[s_index];
index <<= TARGET_PAGE_BITS;
assert(section.offset_within_address_space <= index
--
1.7.9
- [Qemu-devel] [PATCH 00/20] Reduce storage overhead of memory core, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 04/20] memory: support stateless memory listeners, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 06/20] memory: remove first level of l1_phys_map, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 01/20] memory: allow MemoryListeners to observe a specific address space, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 11/20] memory: unify the two branches of cpu_register_physical_memory_log(), Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 10/20] memory: fix RAM subpages in newly initialized pages, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 17/20] memory: switch phys_page_set() to a recursive implementation, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 12/20] memory: move tlb flush to MemoryListener commit callback, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 07/20] memory: unify phys_map last level with intermediate levels, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 14/20] memory: give phys_page_find() its own tree search loop,
Avi Kivity <=
- [Qemu-devel] [PATCH 03/20] memory: split memory listener for the two address spaces, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 18/20] memory: change phys_page_set() to set multiple pages, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 16/20] memory: replace phys_page_find_alloc() with phys_page_set(), Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 09/20] memory: compress phys_map node pointers to 16 bits, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 08/20] memory: store MemoryRegionSection pointers in phys_map, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 02/20] xen: ignore I/O memory regions, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 20/20] memory: allow phys_map tree paths to terminate early, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 15/20] memory: simplify multipage/subpage registration, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 13/20] memory: make phys_page_find() return a MemoryRegionSection, Avi Kivity, 2012/02/14
- [Qemu-devel] [PATCH 19/20] memory: unify PhysPageEntry::node and ::leaf, Avi Kivity, 2012/02/14