OpenCloudOS-Kernel/arch/s390/mm
Gerald Schaefer bc29b7ac1d s390/mm: clean up pte/pmd encoding
The hugetlbfs pte<->pmd conversion functions currently assume that the pmd
bit layout is consistent with the pte layout, which is not really true.

The SW read and write bits are encoded as the sequence "wr" in a pte, but
in a pmd it is "rw". The hugetlbfs conversion assumes that the sequence
is identical in both cases, which results in swapped read and write bits
in the pmd. In practice this is not a problem, because those pmd bits are
only relevant for THP pmds and not for hugetlbfs pmds. The hugetlbfs code
works on (fake) ptes, and the converted pte bits are correct.

There is another variation in pte/pmd encoding which affects dirty
prot-none ptes/pmds. In this case, a pmd has both its HW read-only and
invalid bit set, while it is only the invalid bit for a pte. This also has
no effect in practice, but it should better be consistent.

This patch fixes both inconsistencies by changing the SW read/write bit
layout for pmds as well as the PAGE_NONE encoding for ptes. It also makes
the hugetlbfs conversion functions more robust by introducing a
move_set_bit() macro that uses the pte/pmd bit #defines instead of
constant shifts.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2016-07-31 05:27:57 -04:00
..
Makefile s390/extable: use generic search and sort routines 2016-03-22 15:36:02 -07:00
cmm.c s390: convert use of typedef ctl_table to struct ctl_table 2013-10-28 08:36:25 +01:00
dump_pagetables.c s390/pgtable: get rid of _REGION3_ENTRY_RO 2016-06-13 15:58:14 +02:00
extmem.c s390: Use pr_warn instead of pr_warning 2016-03-07 13:12:04 +01:00
fault.c Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
gmap.c s390/mm: fix gmap tlb flush issues 2016-07-13 10:58:01 +02:00
gup.c s390/mm: add support for 2GB hugepages 2016-07-06 08:46:43 +02:00
hugetlbpage.c s390/mm: clean up pte/pmd encoding 2016-07-31 05:27:57 -04:00
init.c s390: add proper __ro_after_init support 2016-06-13 15:58:23 +02:00
maccess.c s390/maccess: reduce stnsm instructions 2016-02-17 09:05:04 +01:00
mem_detect.c s390/mem_detect: use unsigned longs 2016-01-11 12:27:11 +01:00
mmap.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2016-05-18 12:17:16 -07:00
page-states.c s390/mm: use basic block for essa inline assembly 2016-06-28 09:32:29 +02:00
pageattr.c s390/mm: fix compile for PAGE_DEFAULT_KEY != 0 2016-06-14 16:54:05 +02:00
pgalloc.c s390: get rid of superfluous __GFP_REPEAT 2016-06-24 17:23:52 -07:00
pgtable.c s390/mm: add support for 2GB hugepages 2016-07-06 08:46:43 +02:00
vmem.c s390: add proper __ro_after_init support 2016-06-13 15:58:23 +02:00