]> xenbits.xensource.com Git - people/jgross/xen.git/commitdiff
x86: simplify is_guest_l2_slot()
authorJan Beulich <jbeulich@suse.com>
Fri, 4 Sep 2020 08:59:33 +0000 (10:59 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 4 Sep 2020 08:59:33 +0000 (10:59 +0200)
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 <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/include/asm-x86/x86_64/page.h

index 26621f9519e567e3cd699b4b710fe0710d19f026..60db28f4e793d126079ca36c80716d3117ada114 100644 (file)
@@ -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)                        \