[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/mm: Clean up the construction of base_disallow_mask



commit 6eec5bd4dbb47017839e9ee2340d56c222e11a65
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri Jul 15 19:34:00 2016 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon Aug 1 17:45:45 2016 +0100

    x86/mm: Clean up the construction of base_disallow_mask
    
     * Use _PAGE_AVAIL_HIGH and _PAGE_NX instead of opencoding them
     * Drop further remenants of the 32bit hypervisor build
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/mm.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 56ca19f..109b8be 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -271,14 +271,13 @@ void __init arch_init_memory(void)
 {
     unsigned long i, pfn, rstart_pfn, rend_pfn, iostart_pfn, ioend_pfn;
 
-    /* Basic guest-accessible flags: PRESENT, R/W, USER, A/D, AVAIL[0,1,2] */
-    base_disallow_mask = ~(_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|
-                           _PAGE_ACCESSED|_PAGE_DIRTY|_PAGE_AVAIL);
-    /* Allow guest access to the NX flag if hardware supports it. */
-    if ( cpu_has_nx )
-        base_disallow_mask &= ~_PAGE_NX_BIT;
-    /* On x86/64, range [62:52] is available for guest software use. */
-    base_disallow_mask &= ~get_pte_flags((intpte_t)0x7ff << 52);
+    /*
+     * Basic guest-accessible flags:
+     *   PRESENT, R/W, USER, A/D, AVAIL[0,1,2], AVAIL_HIGH, NX (if available).
+     */
+    base_disallow_mask =
+        ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED |
+          _PAGE_DIRTY | _PAGE_AVAIL | _PAGE_AVAIL_HIGH | _PAGE_NX);
 
     /*
      * Initialise our DOMID_XEN domain.
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.