OpenCloudOS-Kernel/arch/s390/mm
Gerald Schaefer ac8372f3b4 s390/mm: fix set_huge_pte_at() for empty ptes
On s390, the layout of normal and large ptes (i.e. pmds/puds) differs.
Therefore, set_huge_pte_at() does a conversion from a normal pte to
the corresponding large pmd/pud. So, when converting an empty pte, this
should result in an empty pmd/pud, which would return true for
pmd/pud_none().

However, after conversion we also mark the pmd/pud as large, and
therefore present. For empty ptes, this will result in an empty pmd/pud
that is also marked as large, and pmd/pud_none() would not return true.

There is currently no issue with this behaviour, as set_huge_pte_at()
does not seem to be called for empty ptes. It would be valid though, so
let's fix this by not marking empty ptes as large in set_huge_pte_at().

This was found by testing a patch from from Anshuman Khandual, which is
currently discussed on LKML ("mm/debug: Add more arch page table helper
tests").

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2020-05-20 10:13:27 +02:00
..
Makefile s390/mm: convert to the generic get_user_pages_fast code 2019-04-23 16:30:04 +02:00
cmm.c s390: remove broken hibernate / power management support 2020-03-23 13:41:55 +01:00
dump_pagetables.c s390/mm: fix dump_pagetables top level page table walking 2019-08-06 13:58:34 +02:00
extmem.c s390/extmem: use refcount_t for refcount 2019-08-21 12:41:43 +02:00
fault.c Merge branch 'akpm' (patches from Andrew) 2020-04-10 17:57:48 -07:00
gmap.c KVM: s390: vsie: Fix possible race when shadowing region 3 tables 2020-04-07 13:12:38 +02:00
hugetlbpage.c s390/mm: fix set_huge_pte_at() for empty ptes 2020-05-20 10:13:27 +02:00
init.c mm/memory_hotplug: add pgprot_t to mhp_params 2020-04-10 15:36:21 -07:00
kasan_init.c s390/kasan: add KASAN_VMALLOC support 2019-12-11 19:56:59 +01:00
maccess.c s390: disable preemption when switching to nodat stack with CALL_ON_STACK 2019-11-30 10:52:45 +01:00
mmap.c s390/mm: cleanup arch_get_unmapped_area() and friends 2020-03-27 10:22:46 +01:00
page-states.c s390/cmma: reuse kstrtobool for option value parsing 2019-08-26 12:51:18 +02:00
pageattr.c s390: remove broken hibernate / power management support 2020-03-23 13:41:55 +01:00
pgalloc.c s390x/mm/uaccess: Fix race between page table upgrade and uaccess 2020-04-28 09:13:08 -07:00
pgtable.c s390/mm: silence compiler warning when compiling without CONFIG_PGSTE 2019-04-10 17:48:28 +02:00
vmem.c s390: prevent leaking kernel address in BEAR 2020-03-10 15:16:25 +01:00