android_kernel_xiaomi_sdm845/include/asm-x86
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
..
mach-bigsmp
mach-default
mach-es7000
mach-generic
mach-numaq
mach-rdc321x
mach-summit
mach-visws
mach-voyager
xen
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
acpi.h
agp.h
alternative-asm.h
alternative.h
apic.h
apicdef.h
arch_hooks.h
asm.h
atomic_32.h
atomic_64.h
atomic.h
auxvec.h
bitops_32.h
bitops_64.h iommu sg: kill __clear_bit_string and find_next_zero_string 2008-02-05 09:44:11 -08:00
bitops.h
boot.h
bootparam.h
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h
calgary.h
calling.h
checksum_32.h
checksum_64.h
checksum.h
cmpxchg_32.h
cmpxchg_64.h Add cmpxchg64 and cmpxchg64_local to x86_64 2008-02-07 08:42:31 -08:00
cmpxchg.h
compat.h
cpu.h
cpufeature.h
cputime.h
current_32.h
current_64.h
current.h
debugreg.h
delay.h Fix __const_udelay declaration and definition mismatches 2008-02-06 10:41:06 -08:00
desc_64.h
desc_defs.h
desc.h
device.h
div64.h
dma-mapping_32.h
dma-mapping_64.h
dma-mapping.h
dma.h
dmi.h
ds.h
dwarf2_32.h
dwarf2_64.h
dwarf2.h
e820_32.h
e820_64.h
e820.h
edac.h
efi.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_32.h
fixmap_64.h
fixmap.h
floppy.h
frame.h
futex.h
gart.h
genapic_32.h
genapic_64.h
genapic.h
geode.h
gpio.h
hardirq_32.h
hardirq_64.h
hardirq.h
highmem.h i386: Resolve dependency of asm-i386/pgtable.h on highmem.h 2008-02-05 09:44:14 -08:00
hpet.h
hw_irq_32.h
hw_irq_64.h
hw_irq.h
hypertransport.h
i387.h
i8253.h
i8259.h
ia32_unistd.h
ia32.h
ide.h
idle.h
intel_arch_perfmon.h
io_32.h
io_64.h
io_apic.h
io.h
ioctl.h
ioctls.h
iommu.h
ipcbuf.h
ipi.h
irq_32.h
irq_64.h
irq_regs_32.h
irq_regs_64.h
irq_regs.h
irq.h
irqflags.h
ist.h
k8.h
Kbuild Unexport asm/user.h and linux/user.h 2008-02-07 08:42:29 -08:00
kdebug.h
kexec.h
kmap_types.h
kprobes.h
kvm_host.h
kvm_para.h
kvm_x86_emulate.h
kvm.h
ldt.h
lguest_hcall.h
lguest.h
linkage.h
local.h
mach_apic.h
math_emu.h
mc146818rtc.h
mca_dma.h
mca.h
mce.h
mman.h
mmu_context_32.h
mmu_context_64.h
mmu_context.h
mmu.h
mmx.h
mmzone_32.h Introduce flags for reserve_bootmem() 2008-02-07 08:42:25 -08:00
mmzone_64.h
mmzone.h
module.h
mpspec_def.h
mpspec.h
msgbuf.h
msidef.h
msr-index.h
msr.h
mtrr.h
mutex_32.h
mutex_64.h
mutex.h
namei.h
nmi_32.h
nmi_64.h
nmi.h
nops.h
numa_32.h
numa_64.h
numa.h
numaq.h
page_32.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
page_64.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
page.h
param.h
paravirt.h
parport.h
pci_32.h
pci_64.h
pci-direct.h
pci.h
pda.h
percpu.h
pgalloc_32.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
pgalloc_64.h CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
pgalloc.h
pgtable_32.h i386: Resolve dependency of asm-i386/pgtable.h on highmem.h 2008-02-05 09:44:14 -08:00
pgtable_64.h
pgtable-2level-defs.h
pgtable-2level.h
pgtable-3level-defs.h
pgtable-3level.h
pgtable.h
poll.h
posix_types_32.h asm-*/posix_types.h: scrub __GLIBC__ 2008-02-08 09:22:34 -08:00
posix_types_64.h
posix_types.h
prctl.h
processor-cyrix.h
processor-flags.h
processor.h aout: move STACK_TOP[_MAX] to asm/processor.h 2008-02-08 09:22:29 -08:00
proto.h
ptrace-abi.h
ptrace.h
reboot_fixups.h
reboot.h
required-features.h
resource.h
resume-trace.h
rio.h
rtc.h
rwlock.h
rwsem.h
scatterlist.h
seccomp_32.h
seccomp_64.h
seccomp.h
sections.h
segment.h
semaphore_32.h
semaphore_64.h
semaphore.h
sembuf.h
serial.h
setup.h
shmbuf.h
shmparam.h
sigcontext32.h
sigcontext.h
siginfo.h
signal.h
smp_32.h
smp_64.h
smp.h
socket.h
sockios.h
sparsemem.h
spinlock_types.h
spinlock.h
srat.h
stacktrace.h
stat.h
statfs.h
string_32.h
string_64.h
string.h
suspend_32.h
suspend_64.h
suspend.h
swiotlb.h
sync_bitops.h
system_64.h
system.h
tce.h
termbits.h
termios.h tty: fix tty network driver interactions with TCGET/TCSET calls (x86 fix) 2008-02-07 08:42:16 -08:00
therm_throt.h
thread_info_32.h
thread_info_64.h
thread_info.h
time.h
timer.h
timex.h read_current_timer() cleanups 2008-02-06 10:41:02 -08:00
tlb.h
tlbflush.h
topology.h
tsc.h
types.h
uaccess_32.h
uaccess_64.h
uaccess.h
ucontext.h
unaligned.h
unistd_32.h timerfd: wire the new timerfd API to the x86 family 2008-02-05 09:44:07 -08:00
unistd_64.h timerfd: wire the new timerfd API to the x86 family 2008-02-05 09:44:07 -08:00
unistd.h
unwind.h
user32.h
user_32.h Sanitize the type of struct user.u_ar0 2008-02-07 08:42:30 -08:00
user_64.h Sanitize the type of struct user.u_ar0 2008-02-07 08:42:30 -08:00
user.h Cleanup asm/{elf,page,user}.h: #ifdef __KERNEL__ is no longer needed 2008-02-07 08:42:30 -08:00
vdso.h
vga.h
vgtod.h
vic.h
vm86.h
vmi_time.h
vmi.h
voyager.h
vsyscall.h
xor_32.h
xor_64.h
xor.h