s390: KVM preparation: provide hook to enable pgstes in user pagetable
The SIE instruction on s390 uses the 2nd half of the page table page to virtualize the storage keys of a guest. This patch offers the s390_enable_sie function, which reorganizes the page tables of a single-threaded process to reserve space in the page table: s390_enable_sie makes sure that the process is single threaded and then uses dup_mm to create a new mm with reorganized page tables. The old mm is freed and the process has now a page status extended field after every page table. Code that wants to exploit pgstes should SELECT CONFIG_PGSTE. This patch has a small common code hit, namely making dup_mm non-static. Edit (Carsten): I've modified Martin's patch, following Jeremy Fitzhardinge's review feedback. Now we do have the prototype for dup_mm in include/linux/sched.h. Following Martin's suggestion, s390_enable_sie() does now call task_lock() to prevent race against ptrace modification of mm_users. Signed-off-by:Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by:
Carsten Otte <cotte@de.ibm.com> Acked-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Avi Kivity <avi@qumranet.com>
Showing
- arch/s390/Kconfig 4 additions, 0 deletionsarch/s390/Kconfig
- arch/s390/kernel/setup.c 4 additions, 0 deletionsarch/s390/kernel/setup.c
- arch/s390/mm/pgtable.c 62 additions, 3 deletionsarch/s390/mm/pgtable.c
- include/asm-s390/mmu.h 1 addition, 0 deletionsinclude/asm-s390/mmu.h
- include/asm-s390/mmu_context.h 7 additions, 1 deletioninclude/asm-s390/mmu_context.h
- include/asm-s390/pgtable.h 1 addition, 0 deletionsinclude/asm-s390/pgtable.h
- include/linux/sched.h 2 additions, 0 deletionsinclude/linux/sched.h
- kernel/fork.c 1 addition, 1 deletionkernel/fork.c
Loading
Please register or sign in to comment