Merge branch 'nvme-4.18' of git://git.infradead.org/nvme into for-linus
[sfrench/cifs-2.6.git] / arch / x86 / boot / compressed / kaslr_64.c
index 522d11431433afd85eb4742c8afe9ab717420041..748456c365f4691af041753c63d6991f9bc8b4b8 100644 (file)
@@ -69,6 +69,8 @@ static struct alloc_pgt_data pgt_data;
 /* The top level page table entry pointer. */
 static unsigned long top_level_pgt;
 
+phys_addr_t physical_mask = (1ULL << __PHYSICAL_MASK_SHIFT) - 1;
+
 /*
  * Mapping information structure passed to kernel_ident_mapping_init().
  * Due to relocation, pointers must be assigned at run time not build time.
@@ -81,6 +83,9 @@ void initialize_identity_maps(void)
        /* If running as an SEV guest, the encryption mask is required. */
        set_sev_encryption_mask();
 
+       /* Exclude the encryption mask from __PHYSICAL_MASK */
+       physical_mask &= ~sme_me_mask;
+
        /* Init mapping_info with run-time function/buffer pointers. */
        mapping_info.alloc_pgt_page = alloc_pgt_page;
        mapping_info.context = &pgt_data;