From: Jan Beulich Date: Fri, 4 Sep 2020 08:59:33 +0000 (+0200) Subject: x86: simplify is_guest_l2_slot() X-Git-Tag: 4.15.0-rc1~858 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8cf225013582723275f0d60f1107319f5963af7f;p=people%2Fjgross%2Fxen.git x86: simplify is_guest_l2_slot() is_pv_32bit_domain() has become expensive, and its use here is redundant: Only 32-bit guests would ever get PGT_pae_xen_l2 set on their L2 page table pages anyway. (If some other error does lead to PGT_pae_xen_l2 ending up anywhere else, we still don't want to allow a guest to control the entries.) Suggested-by: Andrew Cooper Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- diff --git a/xen/include/asm-x86/x86_64/page.h b/xen/include/asm-x86/x86_64/page.h index 26621f9519..60db28f4e7 100644 --- a/xen/include/asm-x86/x86_64/page.h +++ b/xen/include/asm-x86/x86_64/page.h @@ -106,8 +106,7 @@ typedef l4_pgentry_t root_pgentry_t; #define l4_linear_offset(_a) (((_a) & VADDR_MASK) >> L4_PAGETABLE_SHIFT) #define is_guest_l2_slot(_d, _t, _s) \ - ( !is_pv_32bit_domain(_d) || \ - !((_t) & PGT_pae_xen_l2) || \ + ( !((_t) & PGT_pae_xen_l2) || \ ((_s) < COMPAT_L2_PAGETABLE_FIRST_XEN_SLOT(_d)) ) #define is_guest_l4_slot(_d, _s) \ ( is_pv_32bit_domain(_d) \