android_kernel_xiaomi_sm8350/include/asm-sparc
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-core.h aout: suppress A.OUT library support if !CONFIG_ARCH_SUPPORTS_AOUT 2008-02-08 09:22:30 -08:00
a.out.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
apc.h
asi.h
asmmacro.h
atomic.h Add cmpxchg_local to sparc, move __cmpxchg to system.h 2008-02-07 08:42:32 -08:00
auxio.h
auxvec.h
bitext.h
bitops.h forbid asm/bitops.h direct inclusion 2007-10-19 11:53:41 -07:00
bpp.h
bsderrno.h
btfixup.h
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h
checksum.h
clock.h
contregs.h
cpudata.h
cputime.h
current.h
cypress.h
delay.h
device.h [SPARC64]: Fix conflicts in SBUS/PCI/EBUS/ISA DMA handling. 2007-07-30 00:27:34 -07:00
div64.h
dma-mapping.h
dma.h [SPARC32]: __inline__ --> inline 2007-10-27 00:17:01 -07:00
ebus.h
ecc.h
eeprom.h
elf.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-02-07 10:21:26 -08:00
emergency-restart.h
errno.h
fb.h
fbio.h
fcntl.h [SPARC32]: Fix build. 2007-08-04 21:17:18 -07:00
fixmap.h
floppy.h [SPARC32]: __inline__ --> inline 2007-10-27 00:17:01 -07:00
futex.h
hardirq.h
head.h
highmem.h
hw_irq.h
ide.h [SPARC32]: __inline__ --> inline 2007-10-27 00:17:01 -07:00
idprom.h
io-unit.h
io.h Remove dma_cache_(wback|inv|wback_inv) functions 2007-10-17 08:42:57 -07:00
ioctl.h
ioctls.h [SPARC]: Support for new termios. 2007-10-17 19:38:10 -07:00
iommu.h
ipcbuf.h
irq_regs.h
irq.h [SPARC32]: Fix modular build of floppy driver. 2007-08-03 14:08:42 -07:00
irqflags.h [SPARC32]: Add irqflags.h to sparc32 and use it from generic code. 2007-10-13 21:53:11 -07:00
jsflash.h
Kbuild
kdebug.h
kgdb.h
kmap_types.h
linkage.h
local.h
machines.h
mbus.h
mc146818rtc.h
memreg.h
mman.h
mmu_context.h
mmu.h
module.h
mostek.h
mpmbox.h
msgbuf.h
msi.h
mutex.h
mxcc.h
namei.h
obio.h
of_device.h
of_platform.h [SPARC/64]: Consolidate of_register_driver 2007-10-17 21:17:42 -07:00
openprom.h
openpromio.h
oplib.h
page.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
param.h avoid overflows in kernel/time.c 2008-02-08 09:22:39 -08:00
pbm.h
pci.h
pcic.h
pconf.h
percpu.h
perfctr.h
pgalloc.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
pgtable.h
pgtsrmmu.h
pgtsun4.h
pgtsun4c.h
poll.h
posix_types.h asm-*/posix_types.h: scrub __GLIBC__ 2008-02-08 09:22:34 -08:00
processor.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
prom.h [SPARC]: Centralize find_in_proplist() instead of duplicating N times. 2007-08-07 18:46:36 -07:00
psr.h
ptrace.h [SPARC]: Move over to arch_ptrace(). 2008-02-07 03:00:17 -08:00
reg.h
resource.h
ross.h
rtc.h
sbi.h
sbus.h [SPARC32]: Remove iommu from struct sbus_bus and use archdata like sparc64. 2007-08-10 15:52:06 -07:00
scatterlist.h Add CONFIG_DEBUG_SG sg validation 2007-10-22 21:20:03 +02:00
sections.h
semaphore.h kill DECLARE_MUTEX_LOCKED 2007-10-17 08:42:47 -07:00
sembuf.h
setup.h
sfp-machine.h [MATH-EMU]: Fix underflow exception reporting. 2007-08-16 22:59:49 -07:00
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h
smpprim.h
socket.h [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
sockios.h
solerrno.h
spinlock_types.h
spinlock.h
stat.h
statfs.h
string.h
sun4paddr.h
sun4prom.h
sunbpp.h
svr4.h
swift.h
sysen.h
system.h Add cmpxchg_local to sparc, move __cmpxchg to system.h 2008-02-07 08:42:32 -08:00
termbits.h [SPARC]: Support for new termios. 2007-10-17 19:38:10 -07:00
termios.h [SPARC]: Support for new termios. 2007-10-17 19:38:10 -07:00
thread_info.h
timer.h
timex.h
tlb.h
tlbflush.h remove unused flush_tlb_pgtables 2007-10-19 11:53:34 -07:00
topology.h
traps.h
tsunami.h
turbosparc.h
types.h
uaccess.h aout: remove unnecessary inclusions of {asm, linux}/a.out.h 2008-02-08 09:22:30 -08:00
unaligned.h
unistd.h [SPARC]: Add new timerfd syscall entries. 2008-02-06 04:12:23 -08:00
user.h
vac-ops.h
vaddrs.h
vfc_ioctls.h
vga.h
viking.h
winmacro.h
xor.h