x86: correct assertion in destroy_perdomain_mapping()
authorJan Beulich <jbeulich@suse.com>
Mon, 23 Apr 2018 14:12:01 +0000 (16:12 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 23 Apr 2018 14:12:01 +0000 (16:12 +0200)
hvm_domain_initialise() may call this with nr being zero, which triggers
the "does not cross L3 boundary" check.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/mm.c

index 9fe5583fc3ed3dd328f4269308bb431978548ed4..53b36d8889c621c70fb0b6e4eb8d6fcb395839db 100644 (file)
@@ -5475,7 +5475,7 @@ void destroy_perdomain_mapping(struct domain *d, unsigned long va,
 
     ASSERT(va >= PERDOMAIN_VIRT_START &&
            va < PERDOMAIN_VIRT_SLOT(PERDOMAIN_SLOTS));
-    ASSERT(!l3_table_offset(va ^ (va + nr * PAGE_SIZE - 1)));
+    ASSERT(!nr || !l3_table_offset(va ^ (va + nr * PAGE_SIZE - 1)));
 
     if ( !d->arch.perdomain_l3_pg )
         return;