Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / arch / x86 / boot / compressed / pagetable.c
index e691ff734cb5adb5c9e5ff2c0da1c4bd790617ee..b5e5e02f8cde7fa9123dc56981c3a3a98f45843c 100644 (file)
@@ -80,16 +80,18 @@ static unsigned long top_level_pgt;
  * Mapping information structure passed to kernel_ident_mapping_init().
  * Due to relocation, pointers must be assigned at run time not build time.
  */
-static struct x86_mapping_info mapping_info = {
-       .page_flag       = __PAGE_KERNEL_LARGE_EXEC,
-};
+static struct x86_mapping_info mapping_info;
 
 /* Locates and clears a region for a new top level page table. */
 void initialize_identity_maps(void)
 {
+       unsigned long sev_me_mask = get_sev_encryption_mask();
+
        /* Init mapping_info with run-time function/buffer pointers. */
        mapping_info.alloc_pgt_page = alloc_pgt_page;
        mapping_info.context = &pgt_data;
+       mapping_info.page_flag = __PAGE_KERNEL_LARGE_EXEC | sev_me_mask;
+       mapping_info.kernpg_flag = _KERNPG_TABLE | sev_me_mask;
 
        /*
         * It should be impossible for this not to already be true,