aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-09-24 15:35:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-09-24 15:35:26 -0400
commit709b8f67d72078cbbd166aaecd2d0f48d1d1560c (patch)
tree9d86b5110b0086f43099fe1813b637dcdd3fda6d
parent4b8b0ff60f1d6553914a5fc17f16f9aa38a2036e (diff)
parent7597cdc066313bfd211cca2f9252dfeb41271391 (diff)
Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull EFI fixes from Thomas Gleixner: "Two fixes for EFI/PAT: - a 32bit overflow bug in the PAT code which was unearthed by the large EFI mappings - prevent a boot hang on large systems when EFI mixed mode is enabled but not used" * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/efi: Only map RAM into EFI page tables if in mixed-mode x86/mm/pat: Prevent hang during boot when mapping pages
-rw-r--r--arch/x86/mm/pageattr.c21
-rw-r--r--arch/x86/platform/efi/efi_64.c2
2 files changed, 12 insertions, 11 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 849dc09fa4f0..e3353c97d086 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -917,11 +917,11 @@ static void populate_pte(struct cpa_data *cpa,
917 } 917 }
918} 918}
919 919
920static int populate_pmd(struct cpa_data *cpa, 920static long populate_pmd(struct cpa_data *cpa,
921 unsigned long start, unsigned long end, 921 unsigned long start, unsigned long end,
922 unsigned num_pages, pud_t *pud, pgprot_t pgprot) 922 unsigned num_pages, pud_t *pud, pgprot_t pgprot)
923{ 923{
924 unsigned int cur_pages = 0; 924 long cur_pages = 0;
925 pmd_t *pmd; 925 pmd_t *pmd;
926 pgprot_t pmd_pgprot; 926 pgprot_t pmd_pgprot;
927 927
@@ -991,12 +991,12 @@ static int populate_pmd(struct cpa_data *cpa,
991 return num_pages; 991 return num_pages;
992} 992}
993 993
994static int populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd, 994static long populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd,
995 pgprot_t pgprot) 995 pgprot_t pgprot)
996{ 996{
997 pud_t *pud; 997 pud_t *pud;
998 unsigned long end; 998 unsigned long end;
999 int cur_pages = 0; 999 long cur_pages = 0;
1000 pgprot_t pud_pgprot; 1000 pgprot_t pud_pgprot;
1001 1001
1002 end = start + (cpa->numpages << PAGE_SHIFT); 1002 end = start + (cpa->numpages << PAGE_SHIFT);
@@ -1052,7 +1052,7 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd,
1052 1052
1053 /* Map trailing leftover */ 1053 /* Map trailing leftover */
1054 if (start < end) { 1054 if (start < end) {
1055 int tmp; 1055 long tmp;
1056 1056
1057 pud = pud_offset(pgd, start); 1057 pud = pud_offset(pgd, start);
1058 if (pud_none(*pud)) 1058 if (pud_none(*pud))
@@ -1078,7 +1078,7 @@ static int populate_pgd(struct cpa_data *cpa, unsigned long addr)
1078 pgprot_t pgprot = __pgprot(_KERNPG_TABLE); 1078 pgprot_t pgprot = __pgprot(_KERNPG_TABLE);
1079 pud_t *pud = NULL; /* shut up gcc */ 1079 pud_t *pud = NULL; /* shut up gcc */
1080 pgd_t *pgd_entry; 1080 pgd_t *pgd_entry;
1081 int ret; 1081 long ret;
1082 1082
1083 pgd_entry = cpa->pgd + pgd_index(addr); 1083 pgd_entry = cpa->pgd + pgd_index(addr);
1084 1084
@@ -1327,7 +1327,8 @@ static int cpa_process_alias(struct cpa_data *cpa)
1327 1327
1328static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias) 1328static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
1329{ 1329{
1330 int ret, numpages = cpa->numpages; 1330 unsigned long numpages = cpa->numpages;
1331 int ret;
1331 1332
1332 while (numpages) { 1333 while (numpages) {
1333 /* 1334 /*
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
index 677e29e29473..8dd3784eb075 100644
--- a/arch/x86/platform/efi/efi_64.c
+++ b/arch/x86/platform/efi/efi_64.c
@@ -245,7 +245,7 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
245 * text and allocate a new stack because we can't rely on the 245 * text and allocate a new stack because we can't rely on the
246 * stack pointer being < 4GB. 246 * stack pointer being < 4GB.
247 */ 247 */
248 if (!IS_ENABLED(CONFIG_EFI_MIXED)) 248 if (!IS_ENABLED(CONFIG_EFI_MIXED) || efi_is_native())
249 return 0; 249 return 0;
250 250
251 /* 251 /*