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>
#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