[Qemu-devel] [PATCH 5/6] exec.c: correct the maximum skip value during compact

Wei Yang posted 6 patches 6 years, 10 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <rth@twiddle.net>
[Qemu-devel] [PATCH 5/6] exec.c: correct the maximum skip value during compact
Posted by Wei Yang 6 years, 10 months ago
skip is defined with 6 bits. So the maximum value should be (1 << 6).

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exec.c b/exec.c
index 788a8c3f69..6c660f656c 100644
--- a/exec.c
+++ b/exec.c
@@ -322,7 +322,7 @@ static void phys_page_compact(PhysPageEntry *lp, Node *nodes)
     assert(valid_ptr < P_L2_SIZE);
 
     /* Don't compress if it won't fit in the # of bits we have. */
-    if (lp->skip + p[valid_ptr].skip >= (1 << 3)) {
+    if (lp->skip + p[valid_ptr].skip >= (1 << 6)) {
         return;
     }
 
-- 
2.19.1