Skip to content

Commit dc8a64e

Browse files
committed
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
2 parents c05c2ec + 3358999 commit dc8a64e

File tree

14 files changed

+114
-193
lines changed

14 files changed

+114
-193
lines changed

arch/s390/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ config PCI_QUIRKS
5959
config ARCH_SUPPORTS_UPROBES
6060
def_bool y
6161

62+
config DEBUG_RODATA
63+
def_bool y
64+
6265
config S390
6366
def_bool y
6467
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE

arch/s390/crypto/prng.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,13 @@ static const struct file_operations prng_tdes_fops = {
669669
static struct miscdevice prng_sha512_dev = {
670670
.name = "prandom",
671671
.minor = MISC_DYNAMIC_MINOR,
672+
.mode = 0644,
672673
.fops = &prng_sha512_fops,
673674
};
674675
static struct miscdevice prng_tdes_dev = {
675676
.name = "prandom",
676677
.minor = MISC_DYNAMIC_MINOR,
678+
.mode = 0644,
677679
.fops = &prng_tdes_fops,
678680
};
679681

arch/s390/include/asm/cache.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@
1515

1616
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
1717

18+
/* Read-only memory is marked before mark_rodata_ro() is called. */
19+
#define __ro_after_init __read_mostly
20+
1821
#endif

arch/s390/include/uapi/asm/unistd.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@
311311
#define __NR_shutdown 373
312312
#define __NR_mlock2 374
313313
#define __NR_copy_file_range 375
314-
#define NR_syscalls 376
314+
#define __NR_preadv2 376
315+
#define __NR_pwritev2 377
316+
#define NR_syscalls 378
315317

316318
/*
317319
* There are some system calls that are not present on 64 bit, some

arch/s390/kernel/perf_cpum_cf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ static int cpumf_pmu_notifier(struct notifier_block *self, unsigned long action,
670670

671671
switch (action & ~CPU_TASKS_FROZEN) {
672672
case CPU_ONLINE:
673+
case CPU_DOWN_FAILED:
673674
flags = PMC_INIT;
674675
smp_call_function_single(cpu, setup_pmc_cpu, &flags, 1);
675676
break;

arch/s390/kernel/perf_cpum_sf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,7 @@ static int cpumf_pmu_notifier(struct notifier_block *self,
15211521

15221522
switch (action & ~CPU_TASKS_FROZEN) {
15231523
case CPU_ONLINE:
1524-
case CPU_ONLINE_FROZEN:
1524+
case CPU_DOWN_FAILED:
15251525
flags = PMC_INIT;
15261526
smp_call_function_single(cpu, setup_pmc_cpu, &flags, 1);
15271527
break;

arch/s390/kernel/syscalls.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,3 +384,5 @@ SYSCALL(sys_recvmsg,compat_sys_recvmsg)
384384
SYSCALL(sys_shutdown,sys_shutdown)
385385
SYSCALL(sys_mlock2,compat_sys_mlock2)
386386
SYSCALL(sys_copy_file_range,compat_sys_copy_file_range) /* 375 */
387+
SYSCALL(sys_preadv2,compat_sys_preadv2)
388+
SYSCALL(sys_pwritev2,compat_sys_pwritev2)

arch/s390/mm/gup.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
2121
unsigned long end, int write, struct page **pages, int *nr)
2222
{
23+
struct page *head, *page;
2324
unsigned long mask;
2425
pte_t *ptep, pte;
25-
struct page *page;
2626

2727
mask = (write ? _PAGE_PROTECT : 0) | _PAGE_INVALID | _PAGE_SPECIAL;
2828

@@ -37,12 +37,14 @@ static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
3737
return 0;
3838
VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
3939
page = pte_page(pte);
40-
if (!page_cache_get_speculative(page))
40+
head = compound_head(page);
41+
if (!page_cache_get_speculative(head))
4142
return 0;
4243
if (unlikely(pte_val(pte) != pte_val(*ptep))) {
43-
put_page(page);
44+
put_page(head);
4445
return 0;
4546
}
47+
VM_BUG_ON_PAGE(compound_head(page) != head, page);
4648
pages[*nr] = page;
4749
(*nr)++;
4850

arch/s390/mm/init.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ void __init paging_init(void)
108108
free_area_init_nodes(max_zone_pfns);
109109
}
110110

111+
void 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+
111118
void __init mem_init(void)
112119
{
113120
if (MACHINE_HAS_TLB_LC)
@@ -126,9 +133,6 @@ void __init mem_init(void)
126133
setup_zero_pages(); /* Setup zeroed pages. */
127134

128135
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);
132136
}
133137

134138
void free_initmem(void)

arch/s390/pci/pci_clp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ static int clp_query_pci_fn(struct zpci_dev *zdev, u32 fh)
176176
rc = clp_store_query_pci_fn(zdev, &rrb->response);
177177
if (rc)
178178
goto out;
179-
if (rrb->response.pfgid)
180-
rc = clp_query_pci_fngrp(zdev, rrb->response.pfgid);
179+
rc = clp_query_pci_fngrp(zdev, rrb->response.pfgid);
181180
} else {
182181
zpci_err("Q PCI FN:\n");
183182
zpci_err_clp(rrb->response.hdr.rsp, rc);

0 commit comments

Comments
 (0)