diff --git a/qemu/exec.c b/qemu/exec.c index e7c9ce5c..49497b59 100644 --- a/qemu/exec.c +++ b/qemu/exec.c @@ -247,7 +247,8 @@ static void phys_page_compact(PhysPageEntry *lp, Node *nodes, unsigned long *com 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 << 6)) { + if (P_L2_LEVELS >= (1 << 6) && + lp->skip + p[valid_ptr].skip >= (1 << 6)) { return; }