Fix regression in IA-64 caused by page table allocation refactoring

The refactoring and consolidation of <asm/pgalloc.h> caused regression
 on parisc and ia64. The fix for parisc made it into v5.9-rc1 while the
 fix ia64 got delayed a bit and here it is.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEeOVYVaWZL5900a/pOQOGJssO/ZEFAl87qP8THHJwcHRAbGlu
 dXguaWJtLmNvbQAKCRA5A4Ymyw79keEuB/4yCQjJbW+0y+DaivCjUtAPpBek+tpn
 sYW5nWFiE4JlTfZf1ujQ4QpHHkL9y8OXo3zfE1G49lCT97j1GveMpEu68k31+YjO
 uhLY9mv7kFlkuDTgrdkCKOJg+e8HmM6NRUEGJ+Vxoo03S9jpqWjckAURGaluEI/w
 uoI8f64Apc6bjGiOygUIva73B2RGjWOnfoVecy0h7EMRrRHgQV/sJQWHRKVcHKok
 3Mdnswzg07jmR55GTJtm0rO78h/+5B0FCgr1iOK9oo0tMkxSk3DS0Xy7eHhlPaX4
 x1gqhi11XsqDowJfMr/WyfpjGFUp2/yeRoNux1L34zFdxxxKCNowvXk0
 =h7gw
 -----END PGP SIGNATURE-----

Merge tag 'fixes-2020-08-18' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock

Pull ia64 page table fix from Mike Rapoport:
 "Fix regression in IA-64 caused by page table allocation refactoring

  The refactoring and consolidation of <asm/pgalloc.h> caused regression
  on parisc and ia64. The fix for parisc made it into v5.9-rc1 while the
  fix ia64 got delayed a bit and here it is"

* tag 'fixes-2020-08-18' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock:
  arch/ia64: Restore arch-specific pgd_offset_k implementation
This commit is contained in:
Linus Torvalds 2020-08-18 12:05:46 -07:00
commit 9899b58758
2 changed files with 11 additions and 0 deletions

View File

@ -366,6 +366,15 @@ pgd_index (unsigned long address)
}
#define pgd_index pgd_index
/*
* In the kernel's mapped region we know everything is in region number 5, so
* as an optimisation its PGD already points to the area for that region.
* However, this also means that we cannot use pgd_index() and we must
* never add the region here.
*/
#define pgd_offset_k(addr) \
(init_mm.pgd + (((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)))
/* Look up a pgd entry in the gate area. On IA-64, the gate-area
resides in the kernel-mapped segment, hence we use pgd_offset_k()
here. */

View File

@ -117,7 +117,9 @@ static inline pgd_t *pgd_offset_pgd(pgd_t *pgd, unsigned long address)
* a shortcut which implies the use of the kernel's pgd, instead
* of a process's
*/
#ifndef pgd_offset_k
#define pgd_offset_k(address) pgd_offset(&init_mm, (address))
#endif
/*
* In many cases it is known that a virtual address is mapped at PMD or PTE