WSL2-Linux-Kernel/arch
Arjun Roy c97078bd21 mm: define pte_index as macro for x86
pte_index() is either defined as a macro (e.g.  sparc64) or as an
inlined function (e.g.  x86).  vm_insert_pages() depends on pte_index
but it is not defined on all platforms (e.g.  m68k).

To fix compilation of vm_insert_pages() on architectures not providing
pte_index(), we perform the following fix:

0. For platforms where it is meaningful, and defined as a macro, no
    change is needed.
1. For platforms where it is meaningful and defined as an inlined
    function, and we want to use it with vm_insert_pages(), we define
    a degenerate macro of the form:  #define pte_index pte_index
2. vm_insert_pages() checks for the existence of a pte_index macro
   definition. If found, it implements a batched insert. If not found,
   it devolves to calling vm_insert_page() in a loop.

This patch implements step 1 for x86.

v3 of this patch fixes a compilation warning for an unused method.
v2 of this patch moved a macro definition to a more readable location.

Signed-off-by: Arjun Roy <arjunroy@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Link: http://lkml.kernel.org/r/20200228054714.204424-1-arjunroy.kdev@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-04-10 15:36:21 -07:00
..
alpha asm-generic: fix unistd_32.h generation format 2020-04-07 10:43:42 -07:00
arc ARC updates for 5.7-rc1 2020-04-03 15:28:42 -07:00
arm - Fix-ups 2020-04-07 19:44:52 -07:00
arm64 mm: hugetlb: optionally allocate gigantic hugepages using cma 2020-04-10 15:36:21 -07:00
c6x SCSI misc on 20200402 2020-04-02 17:03:53 -07:00
csky mm/vma: append unlikely() while testing VMA access permissions 2020-04-07 10:43:38 -07:00
h8300 asm-generic: make more kernel-space headers mandatory 2020-04-02 09:35:25 -07:00
hexagon mm: allow VM_FAULT_RETRY for multiple times 2020-04-02 09:35:30 -07:00
ia64 kasan: stackdepot: move filter_irq_stacks() to stackdepot.c 2020-04-07 10:43:43 -07:00
m68k Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2020-04-09 10:59:56 -07:00
microblaze asm-generic: fix unistd_32.h generation format 2020-04-07 10:43:42 -07:00
mips virtio: fixes, vdpa 2020-04-08 10:51:53 -07:00
nds32 kasan: stackdepot: move filter_irq_stacks() to stackdepot.c 2020-04-07 10:43:43 -07:00
nios2 dma-mapping updates for 5.7 2020-04-04 10:12:47 -07:00
openrisc OpenRISC updates for 5.6 2020-04-07 12:33:37 -07:00
parisc Merge branch 'akpm' (patches from Andrew) 2020-04-07 14:11:54 -07:00
powerpc powerpc updates for 5.7 #2 2020-04-09 11:01:42 -07:00
riscv RISC-V Patches for the 5.7 Merge Window, Part 1 2020-04-09 10:51:30 -07:00
s390 s390: 2020-04-08 10:56:50 -07:00
sh asm-generic: fix unistd_32.h generation format 2020-04-07 10:43:42 -07:00
sparc mm: bring sparc pte_index() semantics inline with other platforms 2020-04-10 15:36:21 -07:00
um This pull request contains the following changes for UML: 2020-04-07 12:36:09 -07:00
unicore32 - Fix-ups 2020-04-07 19:44:52 -07:00
x86 mm: define pte_index as macro for x86 2020-04-10 15:36:21 -07:00
xtensa asm-generic: fix unistd_32.h generation format 2020-04-07 10:43:42 -07:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Kconfig dma-mapping updates for 5.7 2020-04-04 10:12:47 -07:00