]> git.karo-electronics.de Git - karo-tx-linux.git/commit
s390/kvm: avoid global config of vm.alloc_pgste=1
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 7 Jun 2017 12:10:24 +0000 (14:10 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 13 Jun 2017 11:03:41 +0000 (13:03 +0200)
commit23fefe119ceb5fb0c7d3321010620010a4eddb18
tree28bb0f8eb256391130e3afc6527e9ef385c4b3ce
parenta752598254016d2f9b4415d43a6402fe083f70b2
s390/kvm: avoid global config of vm.alloc_pgste=1

The system control vm.alloc_pgste is used to control the size of the
page tables, either 2K or 4K. The idea is that a KVM host sets the
vm.alloc_pgste control to 1 which causes *all* new processes to run
with 4K page tables. For a non-kvm system the control should stay off
to save on memory used for page tables.

Trouble is that distributions choose to set the control globally to
be able to run KVM guests. This wastes memory on non-KVM systems.

Introduce the PT_S390_PGSTE ELF segment type to "mark" the qemu
executable with it. All executables with this (empty) segment in
its ELF phdr array will be started with 4K page tables. Any executable
without PT_S390_PGSTE will run with the default 2K page tables.

This removes the need to set vm.alloc_pgste=1 for a KVM host and
minimizes the waste of memory for page tables.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/Kconfig
arch/s390/include/asm/elf.h
arch/s390/include/asm/mmu_context.h
arch/s390/include/asm/ptrace.h
arch/s390/include/asm/thread_info.h
arch/s390/kernel/entry.S