Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit c567f29

Browse files
author
Ingo Molnar
committed
Revert "x86/mm/ident_map: Use gbpages only where full GB page should be mapped."
This reverts commit d794734. While the original change tries to fix a bug, it also unintentionally broke existing systems, see the regressions reported at: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/ Since d794734 was also marked for -stable, let's back it out before causing more damage. Note that due to another upstream change the revert was not 100% automatic: 0a845e0 mm/treewide: replace pud_large() with pud_leaf() Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: <stable@vger.kernel.org> Cc: Russ Anderson <rja@hpe.com> Cc: Steve Wahl <steve.wahl@hpe.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Link: https://lore.kernel.org/all/3a1b9909-45ac-4f97-ad68-d16ef1ce99db@pavinjoseph.com/ Fixes: d794734 ("x86/mm/ident_map: Use gbpages only where full GB page should be mapped.")
1 parent 91491e5 commit c567f29

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

arch/x86/mm/ident_map.c

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
2626
for (; addr < end; addr = next) {
2727
pud_t *pud = pud_page + pud_index(addr);
2828
pmd_t *pmd;
29-
bool use_gbpage;
3029

3130
next = (addr & PUD_MASK) + PUD_SIZE;
3231
if (next > end)
3332
next = end;
3433

35-
/* if this is already a gbpage, this portion is already mapped */
36-
if (pud_leaf(*pud))
37-
continue;
38-
39-
/* Is using a gbpage allowed? */
40-
use_gbpage = info->direct_gbpages;
41-
42-
/* Don't use gbpage if it maps more than the requested region. */
43-
/* at the begining: */
44-
use_gbpage &= ((addr & ~PUD_MASK) == 0);
45-
/* ... or at the end: */
46-
use_gbpage &= ((next & ~PUD_MASK) == 0);
47-
48-
/* Never overwrite existing mappings */
49-
use_gbpage &= !pud_present(*pud);
50-
51-
if (use_gbpage) {
34+
if (info->direct_gbpages) {
5235
pud_t pudval;
5336

37+
if (pud_present(*pud))
38+
continue;
39+
40+
addr &= PUD_MASK;
5441
pudval = __pud((addr - info->offset) | info->page_flag);
5542
set_pud(pud, pudval);
5643
continue;

0 commit comments

Comments
 (0)