linux/arch/s390
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
..
appldata mm: move most file-based accounting to the node 2016-07-28 16:07:41 -07:00
boot s390: enable kcov support 2016-06-28 09:32:39 +02:00
configs s390: Updated kernel config files 2016-06-15 16:37:07 +02:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-07-26 13:40:17 -07:00
hypfs s390/hypfs: use basic block for diag inline assembly 2016-06-28 09:32:37 +02:00
include s390/mm: clean up pte/pmd encoding 2016-07-31 05:27:57 -04:00
kernel Merge branch 'stable-4.8' of git://git.infradead.org/users/pcmoore/audit 2016-07-29 17:54:17 -07:00
kvm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2016-07-26 12:22:51 -07:00
lib s390/lib: use basic blocks for inline assemblies 2016-06-28 09:32:28 +02:00
mm s390/mm: clean up pte/pmd encoding 2016-07-31 05:27:57 -04:00
net s390/bpf: fix recache skb->data/hlen for skb_vlan_push/pop 2016-05-19 09:14:27 +02:00
numa s390/topology: add drawer scheduling domain level 2016-06-13 15:58:27 +02:00
oprofile s390/oprofile: remove hardware sampler support 2016-06-28 09:32:22 +02:00
pci s390/pci: Delete an unnecessary check before the function call "pci_dev_put" 2016-07-18 10:17:24 +02:00
tools s390/facilities: add helper tool to generate facility lists 2015-12-18 14:59:20 +01:00
defconfig s390: Updated kernel config files 2016-06-15 16:37:07 +02:00
Kbuild s390/numa: add core infrastructure 2015-08-03 18:40:25 +02:00
Kconfig s390: enable kcov support 2016-06-28 09:32:39 +02:00
Kconfig.debug arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug 2016-01-09 06:30:49 -08:00
Makefile s390/facilities: add helper tool to generate facility lists 2015-12-18 14:59:20 +01:00