android_kernel_xiaomi_sm8350/include/asm-parisc
Martin Schwidefsky 2f569afd9c CONFIG_HIGHPTE vs. sub-page page tables.
Background: I've implemented 1K/2K page tables for s390.  These sub-page
page tables are required to properly support the s390 virtualization
instruction with KVM.  The SIE instruction requires that the page tables
have 256 page table entries (pte) followed by 256 page status table entries
(pgste).  The pgstes are only required if the process is using the SIE
instruction.  The pgstes are updated by the hardware and by the hypervisor
for a number of reasons, one of them is dirty and reference bit tracking.
To avoid wasting memory the standard pte table allocation should return
1K/2K (31/64 bit) and 2K/4K if the process is using SIE.

Problem: Page size on s390 is 4K, page table size is 1K or 2K.  That means
the s390 version for pte_alloc_one cannot return a pointer to a struct
page.  Trouble is that with the CONFIG_HIGHPTE feature on x86 pte_alloc_one
cannot return a pointer to a pte either, since that would require more than
32 bit for the return value of pte_alloc_one (and the pte * would not be
accessible since its not kmapped).

Solution: The only solution I found to this dilemma is a new typedef: a
pgtable_t.  For s390 pgtable_t will be a (pte *) - to be introduced with a
later patch.  For everybody else it will be a (struct page *).  The
additional problem with the initialization of the ptl lock and the
NR_PAGETABLE accounting is solved with a constructor pgtable_page_ctor and
a destructor pgtable_page_dtor.  The page table allocation and free
functions need to call these two whenever a page table page is allocated or
freed.  pmd_populate will get a pgtable_t instead of a struct page pointer.
 To get the pgtable_t back from a pmd entry that has been installed with
pmd_populate a new function pmd_pgtable is added.  It replaces the pmd_page
call in free_pte_range and apply_to_pte_range.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 09:22:42 -08:00
..
a.out.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
agp.h x86: remove flush_agp_mappings() 2008-01-30 13:34:07 +01:00
asmregs.h
assembly.h
atomic.h Add cmpxchg_local to parisc 2008-02-07 08:42:32 -08:00
auxvec.h
bitops.h forbid asm/bitops.h direct inclusion 2007-10-19 11:53:41 -07:00
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h
checksum.h
compat_rt_sigframe.h
compat_signal.h
compat_ucontext.h
compat.h asm-*/compat.h: fix typo in comment 2008-02-03 16:32:51 +02:00
cputime.h
current.h
delay.h
device.h
div64.h
dma-mapping.h
dma.h
eisa_bus.h
eisa_eeprom.h
elf.h Cleanup asm/{elf,page,user}.h: #ifdef __KERNEL__ is no longer needed 2008-02-07 08:42:30 -08:00
emergency-restart.h
errno.h
fb.h
fcntl.h
fixmap.h
floppy.h cleanup floppy.h 2007-10-17 08:42:55 -07:00
futex.h
grfioctl.h
hardirq.h
hardware.h
hw_irq.h
ide.h ide: add CONFIG_IDE_ARCH_OBSOLETE_INIT 2007-10-20 00:32:32 +02:00
io.h [PARISC] parisc: "extern inline" -> "static inline" 2007-10-18 00:58:41 -07:00
ioctl.h
ioctls.h
ipcbuf.h
irq_regs.h
irq.h
Kbuild [PARISC] Export pdc.h for palo 2007-10-18 00:58:29 -07:00
kdebug.h
kmap_types.h
led.h
linkage.h include/asm-parisc/: Spelling fixes 2008-02-03 17:00:11 +02:00
local.h
machdep.h
mc146818rtc.h
mckinley.h
mman.h
mmu_context.h
mmu.h
mmzone.h
module.h
msgbuf.h
mutex.h
namei.h
page.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
param.h
parisc-device.h
parport.h
pci.h [PARISC] parisc: "extern inline" -> "static inline" 2007-10-18 00:58:41 -07:00
pdc_chassis.h
pdc.h [PARISC] print more than one character at a time for pdc console 2007-12-06 09:32:15 -08:00
pdcpat.h
percpu.h
perf.h
pgalloc.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
pgtable.h Merge branch 'master' of hera.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6 2007-10-20 20:19:15 -07:00
poll.h
posix_types.h asm-*/posix_types.h: scrub __GLIBC__ 2008-02-08 09:22:34 -08:00
prefetch.h [PARISC] parisc: "extern inline" -> "static inline" 2007-10-18 00:58:41 -07:00
processor.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
psw.h
ptrace.h
real.h
resource.h
ropes.h
rt_sigframe.h
rtc.h [PARISC] fix uninitialized variable warning in asm/rtc.h 2007-10-20 13:23:00 -07:00
runway.h
scatterlist.h parisc: fix sg_page() fallout 2007-10-23 09:49:31 +02:00
sections.h
segment.h
semaphore-helper.h
semaphore.h [PARISC] parisc: "extern inline" -> "static inline" 2007-10-18 00:58:41 -07:00
sembuf.h
serial.h
setup.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h
socket.h [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
sockios.h
spinlock_types.h
spinlock.h
stat.h
statfs.h
string.h
superio.h
system.h
termbits.h
termios.h
thread_info.h
timex.h
tlb.h add mm argument to pte/pmd/pud/pgd_free 2008-02-05 09:44:18 -08:00
tlbflush.h remove unused flush_tlb_pgtables 2007-10-19 11:53:34 -07:00
topology.h
traps.h
types.h
uaccess.h
ucontext.h
unaligned.h
unistd.h [PARISC] Wire up sys_fallocate (and compat_sys_fallocate) 2007-10-18 00:58:26 -07:00
unwind.h
user.h
vga.h vga.h: Fix prepocessor warning 2008-02-03 15:59:02 +02:00
xor.h