]> xenbits.xensource.com Git - xtf.git/commitdiff
Uniformly enable WP for HVM environments
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 18 Nov 2016 13:21:34 +0000 (13:21 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 18 Nov 2016 13:21:34 +0000 (13:21 +0000)
This brings them in line with PV environments (which have no choice in the
matter), and better matches usual expectations for the behaviour of read-only
pages.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/boot/head_hvm.S

index 231d746afee822208409537cc1333555fd4c1100..985abe20548924aa2f97afd792a1cbee37a267b8 100644 (file)
@@ -46,10 +46,14 @@ GLOBAL(_start)                  /* HVM common setup. */
 #endif /* __x86_64__ */
 
 #if CONFIG_PAGING_LEVELS > 0    /* CR0.PG = 1 */
+# define MAYBE_PG X86_CR0_PG
+#else
+# define MAYBE_PG 0
+#endif /* CONFIG_PAGING_LEVELS > 0 */
+
         mov %cr0, %eax
-        or $X86_CR0_PG, %eax
+        or $(X86_CR0_WP | MAYBE_PG), %eax
         mov %eax, %cr0
-#endif /* CONFIG_PAGING_LEVELS > 0 */
 
         lgdt gdt_ptr