aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-04-01 08:15:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-04-01 08:15:54 -0400
commitdc8a64ee1ab3f7ef34488392de7ee908047d6f99 (patch)
tree4db9103f405a6c1cf709058db91c56e5efd2b061 /arch/s390/mm
parentc05c2ec96bb8b7310da1055c7b9d786a3ec6dc0c (diff)
parent3358999a8e7ae82912e5908adb7150a6558d6702 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Martin Schwidefsky: - A proper fix for the locking issue in the dasd driver - Wire up the new preadv2 nad pwritev2 system calls - Add the mark_rodata_ro function and set DEBUG_RODATA=y - A few more bug fixes. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: wire up preadv2/pwritev2 syscalls s390/pci: PCI function group 0 is valid for clp_query_pci_fn s390/crypto: provide correct file mode at device register. s390/mm: handle PTE-mapped tail pages in fast gup s390: add DEBUG_RODATA support s390: disable postinit-readonly for now s390/dasd: reorder lcu and device lock s390/cpum_sf: Fix cpu hotplug notifier transitions s390/cpum_cf: Fix missing cpu hotplug notifier transition
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/gup.c8
-rw-r--r--arch/s390/mm/init.c10
2 files changed, 12 insertions, 6 deletions
diff --git a/arch/s390/mm/gup.c b/arch/s390/mm/gup.c
index 49a1c84ed266..a8a6765f1a51 100644
--- a/arch/s390/mm/gup.c
+++ b/arch/s390/mm/gup.c
@@ -20,9 +20,9 @@
20static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr, 20static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
21 unsigned long end, int write, struct page **pages, int *nr) 21 unsigned long end, int write, struct page **pages, int *nr)
22{ 22{
23 struct page *head, *page;
23 unsigned long mask; 24 unsigned long mask;
24 pte_t *ptep, pte; 25 pte_t *ptep, pte;
25 struct page *page;
26 26
27 mask = (write ? _PAGE_PROTECT : 0) | _PAGE_INVALID | _PAGE_SPECIAL; 27 mask = (write ? _PAGE_PROTECT : 0) | _PAGE_INVALID | _PAGE_SPECIAL;
28 28
@@ -37,12 +37,14 @@ static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
37 return 0; 37 return 0;
38 VM_BUG_ON(!pfn_valid(pte_pfn(pte))); 38 VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
39 page = pte_page(pte); 39 page = pte_page(pte);
40 if (!page_cache_get_speculative(page)) 40 head = compound_head(page);
41 if (!page_cache_get_speculative(head))
41 return 0; 42 return 0;
42 if (unlikely(pte_val(pte) != pte_val(*ptep))) { 43 if (unlikely(pte_val(pte) != pte_val(*ptep))) {
43 put_page(page); 44 put_page(head);
44 return 0; 45 return 0;
45 } 46 }
47 VM_BUG_ON_PAGE(compound_head(page) != head, page);
46 pages[*nr] = page; 48 pages[*nr] = page;
47 (*nr)++; 49 (*nr)++;
48 50
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 73e290337092..c7b0451397d6 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -108,6 +108,13 @@ void __init paging_init(void)
108 free_area_init_nodes(max_zone_pfns); 108 free_area_init_nodes(max_zone_pfns);
109} 109}
110 110
111void mark_rodata_ro(void)
112{
113 /* Text and rodata are already protected. Nothing to do here. */
114 pr_info("Write protecting the kernel read-only data: %luk\n",
115 ((unsigned long)&_eshared - (unsigned long)&_stext) >> 10);
116}
117
111void __init mem_init(void) 118void __init mem_init(void)
112{ 119{
113 if (MACHINE_HAS_TLB_LC) 120 if (MACHINE_HAS_TLB_LC)
@@ -126,9 +133,6 @@ void __init mem_init(void)
126 setup_zero_pages(); /* Setup zeroed pages. */ 133 setup_zero_pages(); /* Setup zeroed pages. */
127 134
128 mem_init_print_info(NULL); 135 mem_init_print_info(NULL);
129 printk("Write protected kernel read-only data: %#lx - %#lx\n",
130 (unsigned long)&_stext,
131 PFN_ALIGN((unsigned long)&_eshared) - 1);
132} 136}
133 137
134void free_initmem(void) 138void free_initmem(void)