Skip to content

Commit 6aaf05f

Browse files
committed
Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: [S390] topology: fix topology on z10 machines [S390] crypto: avoid MSA3 and MSA4 instructions in ESA mode [S390] avoid STCKF if running in ESA mode [S390] zfcpdump: Do not initialize zfcpdump in kdump mode [S390] ap: Setup processing for messages in request queue. [S390] Kconfig: Select CONFIG_KEXEC for CONFIG_CRASH_DUMP [S390] incorrect note program header [S390] pfault: ignore leftover completion interrupts [S390] fix pgste update logic [S390] wire up process_vm syscalls
2 parents ff0ff78 + f6bf1a8 commit 6aaf05f

15 files changed

Lines changed: 115 additions & 23 deletions

File tree

‎arch/s390/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ config KEXEC
572572
config CRASH_DUMP
573573
bool "kernel crash dumps"
574574
depends on 64BIT
575+
select KEXEC
575576
help
576577
Generate crash dump after being started by kexec.
577578
Crash dump kernels are loaded in the main kernel with kexec-tools

‎arch/s390/crypto/crypt_s390.h‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,12 @@ static inline int crypt_s390_func_available(int func,
368368

369369
if (facility_mask & CRYPT_S390_MSA && !test_facility(17))
370370
return 0;
371-
if (facility_mask & CRYPT_S390_MSA3 && !test_facility(76))
371+
372+
if (facility_mask & CRYPT_S390_MSA3 &&
373+
(!test_facility(2) || !test_facility(76)))
372374
return 0;
373-
if (facility_mask & CRYPT_S390_MSA4 && !test_facility(77))
375+
if (facility_mask & CRYPT_S390_MSA4 &&
376+
(!test_facility(2) || !test_facility(77)))
374377
return 0;
375378

376379
switch (func & CRYPT_S390_OP_MASK) {

‎arch/s390/include/asm/pgtable.h‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,8 @@ static inline pgste_t pgste_update_all(pte_t *ptep, pgste_t pgste)
593593
unsigned long address, bits;
594594
unsigned char skey;
595595

596+
if (!pte_present(*ptep))
597+
return pgste;
596598
address = pte_val(*ptep) & PAGE_MASK;
597599
skey = page_get_storage_key(address);
598600
bits = skey & (_PAGE_CHANGED | _PAGE_REFERENCED);
@@ -625,6 +627,8 @@ static inline pgste_t pgste_update_young(pte_t *ptep, pgste_t pgste)
625627
#ifdef CONFIG_PGSTE
626628
int young;
627629

630+
if (!pte_present(*ptep))
631+
return pgste;
628632
young = page_reset_referenced(pte_val(*ptep) & PAGE_MASK);
629633
/* Transfer page referenced bit to pte software bit (host view) */
630634
if (young || (pgste_val(pgste) & RCP_HR_BIT))
@@ -638,13 +642,15 @@ static inline pgste_t pgste_update_young(pte_t *ptep, pgste_t pgste)
638642

639643
}
640644

641-
static inline void pgste_set_pte(pte_t *ptep, pgste_t pgste)
645+
static inline void pgste_set_pte(pte_t *ptep, pgste_t pgste, pte_t entry)
642646
{
643647
#ifdef CONFIG_PGSTE
644648
unsigned long address;
645649
unsigned long okey, nkey;
646650

647-
address = pte_val(*ptep) & PAGE_MASK;
651+
if (!pte_present(entry))
652+
return;
653+
address = pte_val(entry) & PAGE_MASK;
648654
okey = nkey = page_get_storage_key(address);
649655
nkey &= ~(_PAGE_ACC_BITS | _PAGE_FP_BIT);
650656
/* Set page access key and fetch protection bit from pgste */
@@ -712,7 +718,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
712718

713719
if (mm_has_pgste(mm)) {
714720
pgste = pgste_get_lock(ptep);
715-
pgste_set_pte(ptep, pgste);
721+
pgste_set_pte(ptep, pgste, entry);
716722
*ptep = entry;
717723
pgste_set_unlock(ptep, pgste);
718724
} else

‎arch/s390/include/asm/setup.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ extern unsigned int user_mode;
8282
#define MACHINE_FLAG_LPAR (1UL << 12)
8383
#define MACHINE_FLAG_SPP (1UL << 13)
8484
#define MACHINE_FLAG_TOPOLOGY (1UL << 14)
85+
#define MACHINE_FLAG_STCKF (1UL << 15)
8586

8687
#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
8788
#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
@@ -100,6 +101,7 @@ extern unsigned int user_mode;
100101
#define MACHINE_HAS_PFMF (0)
101102
#define MACHINE_HAS_SPP (0)
102103
#define MACHINE_HAS_TOPOLOGY (0)
104+
#define MACHINE_HAS_STCKF (0)
103105
#else /* __s390x__ */
104106
#define MACHINE_HAS_IEEE (1)
105107
#define MACHINE_HAS_CSP (1)
@@ -111,6 +113,7 @@ extern unsigned int user_mode;
111113
#define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF)
112114
#define MACHINE_HAS_SPP (S390_lowcore.machine_flags & MACHINE_FLAG_SPP)
113115
#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
116+
#define MACHINE_HAS_STCKF (S390_lowcore.machine_flags & MACHINE_FLAG_STCKF)
114117
#endif /* __s390x__ */
115118

116119
#define ZFCPDUMP_HSA_SIZE (32UL<<20)

‎arch/s390/include/asm/timex.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static inline unsigned long long get_clock_fast(void)
9090
{
9191
unsigned long long clk;
9292

93-
if (test_facility(25))
93+
if (MACHINE_HAS_STCKF)
9494
asm volatile(".insn s,0xb27c0000,%0" : "=Q" (clk) : : "cc");
9595
else
9696
clk = get_clock();

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@
277277
#define __NR_clock_adjtime 337
278278
#define __NR_syncfs 338
279279
#define __NR_setns 339
280-
#define NR_syscalls 340
280+
#define __NR_process_vm_readv 340
281+
#define __NR_process_vm_writev 341
282+
#define NR_syscalls 342
281283

282284
/*
283285
* There are some system calls that are not present on 64 bit, some

‎arch/s390/kernel/compat_wrapper.S‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,3 +1627,23 @@ ENTRY(sys_setns_wrapper)
16271627
lgfr %r2,%r2 # int
16281628
lgfr %r3,%r3 # int
16291629
jg sys_setns
1630+
1631+
ENTRY(compat_sys_process_vm_readv_wrapper)
1632+
lgfr %r2,%r2 # compat_pid_t
1633+
llgtr %r3,%r3 # struct compat_iovec __user *
1634+
llgfr %r4,%r4 # unsigned long
1635+
llgtr %r5,%r5 # struct compat_iovec __user *
1636+
llgfr %r6,%r6 # unsigned long
1637+
llgf %r0,164(%r15) # unsigned long
1638+
stg %r0,160(%r15)
1639+
jg sys_process_vm_readv
1640+
1641+
ENTRY(compat_sys_process_vm_writev_wrapper)
1642+
lgfr %r2,%r2 # compat_pid_t
1643+
llgtr %r3,%r3 # struct compat_iovec __user *
1644+
llgfr %r4,%r4 # unsigned long
1645+
llgtr %r5,%r5 # struct compat_iovec __user *
1646+
llgfr %r6,%r6 # unsigned long
1647+
llgf %r0,164(%r15) # unsigned long
1648+
stg %r0,160(%r15)
1649+
jg sys_process_vm_writev

‎arch/s390/kernel/early.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ static __init void detect_machine_facilities(void)
390390
S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS;
391391
if (test_facility(40))
392392
S390_lowcore.machine_flags |= MACHINE_FLAG_SPP;
393+
if (test_facility(25))
394+
S390_lowcore.machine_flags |= MACHINE_FLAG_STCKF;
393395
#endif
394396
}
395397

‎arch/s390/kernel/setup.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ static void __init setup_zfcpdump(unsigned int console_devno)
211211

212212
if (ipl_info.type != IPL_TYPE_FCP_DUMP)
213213
return;
214+
if (OLDMEM_BASE)
215+
return;
214216
if (console_devno != -1)
215217
sprintf(str, " cio_ignore=all,!0.0.%04x,!0.0.%04x",
216218
ipl_info.data.fcp.dev_id.devno, console_devno);
@@ -482,7 +484,7 @@ static void __init setup_memory_end(void)
482484

483485

484486
#ifdef CONFIG_ZFCPDUMP
485-
if (ipl_info.type == IPL_TYPE_FCP_DUMP) {
487+
if (ipl_info.type == IPL_TYPE_FCP_DUMP && !OLDMEM_BASE) {
486488
memory_end = ZFCPDUMP_HSA_SIZE;
487489
memory_end_set = 1;
488490
}

‎arch/s390/kernel/syscalls.S‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,5 @@ SYSCALL(sys_open_by_handle_at,sys_open_by_handle_at,compat_sys_open_by_handle_at
348348
SYSCALL(sys_clock_adjtime,sys_clock_adjtime,compat_sys_clock_adjtime_wrapper)
349349
SYSCALL(sys_syncfs,sys_syncfs,sys_syncfs_wrapper)
350350
SYSCALL(sys_setns,sys_setns,sys_setns_wrapper)
351+
SYSCALL(sys_process_vm_readv,sys_process_vm_readv,compat_sys_process_vm_readv_wrapper) /* 340 */
352+
SYSCALL(sys_process_vm_writev,sys_process_vm_writev,compat_sys_process_vm_writev_wrapper)

0 commit comments

Comments
 (0)