diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2013-11-11 14:51:56 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2013-12-10 12:29:56 +0200 |
commit | 8b795765db36544da6193fb64e4e0f1dc55aaa36 (patch) | |
tree | 57740487878d2dc4aed396c83de21184728a295b | |
parent | 9736e55b78dc49b7f3a265932ab32ed360f633e4 (diff) |
exec: extend skip field to 6 bit, page entry to 32 bit
Extend skip to 6 bit. As page entry doesn't fit in 16 bit
any longer anyway, extend it to 32 bit.
This doubles node map memory requirements, but follow-up
patches will save this memory.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | exec.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -84,11 +84,13 @@ typedef struct PhysPageEntry PhysPageEntry; struct PhysPageEntry { /* How many bits skip to next level (in units of L2_SIZE). 0 for a leaf. */ - uint16_t skip : 1; + uint32_t skip : 6; /* index into phys_sections (!skip) or phys_map_nodes (skip) */ - uint16_t ptr : 15; + uint32_t ptr : 26; }; +#define PHYS_MAP_NODE_NIL (((uint32_t)~0) >> 6) + /* Size of the L2 (and L3, etc) page tables. */ #define ADDR_SPACE_BITS TARGET_PHYS_ADDR_SPACE_BITS @@ -134,8 +136,6 @@ typedef struct PhysPageMap { static PhysPageMap *prev_map; static PhysPageMap next_map; -#define PHYS_MAP_NODE_NIL (((uint16_t)~0) >> 1) - static void io_mem_init(void); static void memory_map_init(void); @@ -156,10 +156,10 @@ static void phys_map_node_reserve(unsigned nodes) } } -static uint16_t phys_map_node_alloc(void) +static uint32_t phys_map_node_alloc(void) { unsigned i; - uint16_t ret; + uint32_t ret; ret = next_map.nodes_nb++; assert(ret != PHYS_MAP_NODE_NIL); |