All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: [Qemu-devel] [PATCH v2 3/7] exec: extend skip field to 6 bit, page entry to 32 bit
Date: Wed, 13 Nov 2013 21:23:52 +0200	[thread overview]
Message-ID: <1384370613-6433-4-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1384370613-6433-1-git-send-email-mst@redhat.com>

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>
---
 exec.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/exec.c b/exec.c
index 51e4953..ec46aea 100644
--- a/exec.c
+++ b/exec.c
@@ -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);
-- 
MST

  parent reply	other threads:[~2013-11-13 19:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 19:23 [Qemu-devel] [PATCH v2 0/7] making address spaces 64 bit wide Michael S. Tsirkin
2013-11-13 19:23 ` [Qemu-devel] [PATCH v2 1/7] split definitions for exec.c and translate-all.c radix trees Michael S. Tsirkin
2013-11-13 19:23 ` [Qemu-devel] [PATCH v2 2/7] exec: replace leaf with skip Michael S. Tsirkin
2013-11-13 19:23 ` Michael S. Tsirkin [this message]
2013-11-13 19:23 ` [Qemu-devel] [PATCH v2 4/7] exec: pass hw address to phys_page_find Michael S. Tsirkin
2013-11-13 19:23 ` [Qemu-devel] [PATCH v2 5/7] exec: memory radix tree page level compression Michael S. Tsirkin
2013-11-14  8:54   ` Avi Kivity
2013-11-14 14:40     ` [Qemu-devel] [PATCH v2 5/7] exec: memory radix tree page level?compression Michael S. Tsirkin
2013-11-14 14:56       ` Avi Kivity
2013-11-14 15:37         ` Michael S. Tsirkin
2013-11-14 15:42           ` Avi Kivity
2013-11-17 15:37             ` Michael S. Tsirkin
2013-11-17 16:12               ` Avi Kivity
2013-11-13 19:24 ` [Qemu-devel] [PATCH v2 6/7] exec: make address spaces 64-bit wide Michael S. Tsirkin
2013-11-13 19:24 ` [Qemu-devel] [PATCH v2 7/7] exec: reduce L2_PAGE_SIZE Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384370613-6433-4-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.