Skip to content

Commit

Permalink
Merge tag 's390-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/s390/linux

Pull more s390 updates from Alexander Gordeev:

 - Fix virtual vs physical address confusion in vmem_add_range() and
   vmem_remove_range() functions

 - Include <linux/io.h> instead of <asm/io.h> and <asm-generic/io.h>
   throughout s390 code

 - Make all PSW related defines also available for assembler files.
   Remove PSW_DEFAULT_KEY define from uapi for that

 - When adding an undefined symbol the build still succeeds, but
   userspace crashes trying to execute VDSO, because the symbol is not
   resolved. Add undefined symbols check to prevent that

 - Use kvmalloc_array() instead of kzalloc() for allocaton of 256k
   memory when executing s390 crypto adapter IOCTL

 - Add -fPIE flag to prevent decompressor misaligned symbol build error
   with clang

 - Use .balign instead of .align everywhere. This is a no-op for s390,
   but with this there no mix in using .align and .balign anymore

 - Filter out -mno-pic-data-is-text-relative flag when compiling kernel
   to prevent VDSO build error

 - Rework entering of DAT-on mode on CPU restart to use PSW_KERNEL_BITS
   mask directly

 - Do not retry administrative requests to some s390 crypto cards, since
   the firmware assumes replay attacks

 - Remove most of the debug code, which is build in when kernel config
   option CONFIG_ZCRYPT_DEBUG is enabled

 - Remove CONFIG_ZCRYPT_MULTIDEVNODES kernel config option and switch
   off the multiple devices support for the s390 zcrypt device driver

 - With the conversion to generic entry machine checks are accounted to
   the current context instead of irq time. As result, the STCKF
   instruction at the beginning of the machine check handler and the
   lowcore member are no longer required, therefore remove it

 - Fix various typos found with codespell

 - Minor cleanups to CPU-measurement Counter and Sampling Facilities
   code

 - Revert patch that removes VMEM_MAX_PHYS macro, since it causes a
   regression

* tag 's390-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (25 commits)
  Revert "s390/mm: get rid of VMEM_MAX_PHYS macro"
  s390/cpum_sf: remove check on CPU being online
  s390/cpum_sf: handle casts consistently
  s390/cpum_sf: remove unnecessary debug statement
  s390/cpum_sf: remove parameter in call to pr_err
  s390/cpum_sf: simplify function setup_pmu_cpu
  s390/cpum_cf: remove unneeded debug statements
  s390/entry: remove mcck clock
  s390: fix various typos
  s390/zcrypt: remove ZCRYPT_MULTIDEVNODES kernel config option
  s390/zcrypt: do not retry administrative requests
  s390/zcrypt: cleanup some debug code
  s390/entry: rework entering DAT-on mode on CPU restart
  s390/mm: fence off VM macros from asm and linker
  s390: include linux/io.h instead of asm/io.h
  s390/ptrace: make all psw related defines also available for asm
  s390/ptrace: remove PSW_DEFAULT_KEY from uapi
  s390/vdso: filter out mno-pic-data-is-text-relative cflag
  s390: consistently use .balign instead of .align
  s390/decompressor: fix misaligned symbol build error
  ...
  • Loading branch information
torvalds committed Jul 6, 2023
2 parents 7b82e90 + 54372cf commit a452483
Show file tree
Hide file tree
Showing 73 changed files with 235 additions and 428 deletions.
1 change: 1 addition & 0 deletions arch/s390/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbac
KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
KBUILD_CFLAGS_DECOMPRESSOR += -ffreestanding
KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector
KBUILD_CFLAGS_DECOMPRESSOR += -fPIE
KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member)
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/appldata/appldata_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
#include <linux/notifier.h>
#include <linux/cpu.h>
#include <linux/workqueue.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <asm/appldata.h>
#include <asm/vtimer.h>
#include <linux/uaccess.h>
#include <asm/io.h>
#include <asm/smp.h>

#include "appldata.h"
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/appldata/appldata_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <linux/pagemap.h>
#include <linux/swap.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <linux/io.h>

#include "appldata.h"

Expand Down
16 changes: 8 additions & 8 deletions arch/s390/boot/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ipl_start:
jz .Lagain1 # skip dataset header
larl %r13,.L_eof
clc 0(3,%r4),0(%r13) # if it is EOFx
jz .Lagain1 # skip dateset trailer
jz .Lagain1 # skip data set trailer
lgr %r5,%r2
la %r6,COMMAND_LINE-PARMAREA(%r12)
lgr %r7,%r2
Expand Down Expand Up @@ -185,19 +185,19 @@ ipl_start:
larl %r13,.Lcrash
lpsw 0(%r13)

.align 8
.balign 8
.Lwaitpsw:
.quad 0x0202000180000000,.Lioint
.Lnewpswmask:
.quad 0x0000000180000000
.align 8
.balign 8
.Lorb: .long 0x00000000,0x0080ff00,.Lccws
.Lirb: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.align 8
.balign 8
.Lcr6: .quad 0x00000000ff000000
.align 8
.balign 8
.Lcrash:.long 0x000a0000,0x00000000
.align 8
.balign 8
.Lccws: .rept 19
.long 0x02600050,0x00000000
.endr
Expand All @@ -207,7 +207,7 @@ ipl_start:
.byte 0xc8,0xd6,0xd3,0xc4 # "change rdr all keep nohold"
.L_eof: .long 0xc5d6c600 /* C'EOF' */
.L_hdr: .long 0xc8c4d900 /* C'HDR' */
.align 8
.balign 8
.Lcpuid:.fill 8,1,0

#
Expand Down Expand Up @@ -265,7 +265,7 @@ SYM_CODE_START_LOCAL(startup_normal)
brasl %r14,startup_kernel
SYM_CODE_END(startup_normal)

.align 8
.balign 8
6: .long 0x7fffffff,0xffffffff
.Lext_new_psw:
.quad 0x0002000180000000,0x1b0 # disabled wait
Expand Down
6 changes: 3 additions & 3 deletions arch/s390/boot/head_kdump.S
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,20 @@ SYM_CODE_START_LOCAL(startup_kdump)
#
# Startup of kdump (relocated new kernel)
#
.align 2
.balign 2
startup_kdump_relocated:
basr %r13,0
0: lpswe .Lrestart_psw-0b(%r13) # Start new kernel...
SYM_CODE_END(startup_kdump)
.align 8
.balign 8
.Lrestart_psw:
.quad 0x0000000080000000,0x0000000000000000 + startup
#else
SYM_CODE_START_LOCAL(startup_kdump)
larl %r13,startup_kdump_crash
lpswe 0(%r13)
SYM_CODE_END(startup_kdump)
.align 8
.balign 8
startup_kdump_crash:
.quad 0x0002000080000000,0x0000000000000000 + startup_kdump_crash
#endif /* CONFIG_CRASH_DUMP */
2 changes: 1 addition & 1 deletion arch/s390/crypto/crc32be-vx.S
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
*
* Note that the constant definitions below are extended in order to compute
* intermediate results with a single VECTOR GALOIS FIELD MULTIPLY instruction.
* The righmost doubleword can be 0 to prevent contribution to the result or
* The rightmost doubleword can be 0 to prevent contribution to the result or
* can be multiplied by 1 to perform an XOR without the need for a separate
* VECTOR EXCLUSIVE OR instruction.
*
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/ap.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ union ap_qact_ap_info {
};

/**
* ap_qact(): Query AP combatibility type.
* ap_qact(): Query AP compatibility type.
* @qid: The AP queue number
* @apinfo: On input the info about the AP queue. On output the
* alternate AP queue info provided by the qact function
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/appldata.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#ifndef _ASM_S390_APPLDATA_H
#define _ASM_S390_APPLDATA_H

#include <linux/io.h>
#include <asm/diag.h>
#include <asm/io.h>

#define APPLDATA_START_INTERVAL_REC 0x80
#define APPLDATA_STOP_REC 0x81
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/include/asm/asm-extable.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#define __EX_TABLE(_section, _fault, _target, _type) \
stringify_in_c(.section _section,"a";) \
stringify_in_c(.align 4;) \
stringify_in_c(.balign 4;) \
stringify_in_c(.long (_fault) - .;) \
stringify_in_c(.long (_target) - .;) \
stringify_in_c(.short (_type);) \
Expand All @@ -34,7 +34,7 @@

#define __EX_TABLE_UA(_section, _fault, _target, _type, _regerr, _regaddr, _len)\
stringify_in_c(.section _section,"a";) \
stringify_in_c(.align 4;) \
stringify_in_c(.balign 4;) \
stringify_in_c(.long (_fault) - .;) \
stringify_in_c(.long (_target) - .;) \
stringify_in_c(.short (_type);) \
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef _ASM_S390_DMA_H
#define _ASM_S390_DMA_H

#include <asm/io.h>
#include <linux/io.h>

/*
* MAX_DMA_ADDRESS is ambiguous because on s390 its completely unrelated
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/include/asm/lowcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ struct lowcore {
__u64 avg_steal_timer; /* 0x0300 */
__u64 last_update_timer; /* 0x0308 */
__u64 last_update_clock; /* 0x0310 */
__u64 int_clock; /* 0x0318*/
__u64 mcck_clock; /* 0x0320 */
__u64 int_clock; /* 0x0318 */
__u8 pad_0x0320[0x0328-0x0320]; /* 0x0320 */
__u64 clock_comparator; /* 0x0328 */
__u64 boot_clock[2]; /* 0x0330 */

Expand Down
6 changes: 3 additions & 3 deletions arch/s390/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define PAGE_SHIFT _PAGE_SHIFT
#define PAGE_SIZE _PAGE_SIZE
#define PAGE_MASK _PAGE_MASK
#define PAGE_DEFAULT_ACC 0
#define PAGE_DEFAULT_ACC _AC(0, UL)
/* storage-protection override */
#define PAGE_SPO_ACC 9
#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4)
Expand Down Expand Up @@ -179,8 +179,6 @@ int arch_make_page_accessible(struct page *page);
#define HAVE_ARCH_MAKE_PAGE_ACCESSIBLE
#endif

#endif /* !__ASSEMBLY__ */

#define __PAGE_OFFSET 0x0UL
#define PAGE_OFFSET 0x0UL

Expand All @@ -204,6 +202,8 @@ int arch_make_page_accessible(struct page *page);

#define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_NON_EXEC

#endif /* !__ASSEMBLY__ */

#include <asm-generic/memory_model.h>
#include <asm-generic/getorder.h>

Expand Down
52 changes: 27 additions & 25 deletions arch/s390/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,40 @@
#define _PIF_GUEST_FAULT BIT(PIF_GUEST_FAULT)
#define _PIF_FTRACE_FULL_REGS BIT(PIF_FTRACE_FULL_REGS)

#ifndef __ASSEMBLY__
#define PSW32_MASK_PER _AC(0x40000000, UL)
#define PSW32_MASK_DAT _AC(0x04000000, UL)
#define PSW32_MASK_IO _AC(0x02000000, UL)
#define PSW32_MASK_EXT _AC(0x01000000, UL)
#define PSW32_MASK_KEY _AC(0x00F00000, UL)
#define PSW32_MASK_BASE _AC(0x00080000, UL) /* Always one */
#define PSW32_MASK_MCHECK _AC(0x00040000, UL)
#define PSW32_MASK_WAIT _AC(0x00020000, UL)
#define PSW32_MASK_PSTATE _AC(0x00010000, UL)
#define PSW32_MASK_ASC _AC(0x0000C000, UL)
#define PSW32_MASK_CC _AC(0x00003000, UL)
#define PSW32_MASK_PM _AC(0x00000f00, UL)
#define PSW32_MASK_RI _AC(0x00000080, UL)

#define PSW32_ADDR_AMODE _AC(0x80000000, UL)
#define PSW32_ADDR_INSN _AC(0x7FFFFFFF, UL)

#define PSW32_DEFAULT_KEY ((PAGE_DEFAULT_ACC) << 20)

#define PSW32_ASC_PRIMARY _AC(0x00000000, UL)
#define PSW32_ASC_ACCREG _AC(0x00004000, UL)
#define PSW32_ASC_SECONDARY _AC(0x00008000, UL)
#define PSW32_ASC_HOME _AC(0x0000C000, UL)

#define PSW_DEFAULT_KEY ((PAGE_DEFAULT_ACC) << 52)

#define PSW_KERNEL_BITS (PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_ASC_HOME | \
PSW_MASK_EA | PSW_MASK_BA | PSW_MASK_DAT)
#define PSW_USER_BITS (PSW_MASK_DAT | PSW_MASK_IO | PSW_MASK_EXT | \
PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_MASK_MCHECK | \
PSW_MASK_PSTATE | PSW_ASC_PRIMARY)

#ifndef __ASSEMBLY__

struct psw_bits {
unsigned long : 1;
unsigned long per : 1; /* PER-Mask */
Expand Down Expand Up @@ -71,30 +97,6 @@ enum {
&(*(struct psw_bits *)(&(__psw))); \
}))

#define PSW32_MASK_PER 0x40000000UL
#define PSW32_MASK_DAT 0x04000000UL
#define PSW32_MASK_IO 0x02000000UL
#define PSW32_MASK_EXT 0x01000000UL
#define PSW32_MASK_KEY 0x00F00000UL
#define PSW32_MASK_BASE 0x00080000UL /* Always one */
#define PSW32_MASK_MCHECK 0x00040000UL
#define PSW32_MASK_WAIT 0x00020000UL
#define PSW32_MASK_PSTATE 0x00010000UL
#define PSW32_MASK_ASC 0x0000C000UL
#define PSW32_MASK_CC 0x00003000UL
#define PSW32_MASK_PM 0x00000f00UL
#define PSW32_MASK_RI 0x00000080UL

#define PSW32_ADDR_AMODE 0x80000000UL
#define PSW32_ADDR_INSN 0x7FFFFFFFUL

#define PSW32_DEFAULT_KEY (((u32)PAGE_DEFAULT_ACC) << 20)

#define PSW32_ASC_PRIMARY 0x00000000UL
#define PSW32_ASC_ACCREG 0x00004000UL
#define PSW32_ASC_SECONDARY 0x00008000UL
#define PSW32_ASC_HOME 0x0000C000UL

typedef struct {
unsigned int mask;
unsigned int addr;
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/uapi/asm/cmb.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
struct cmbdata {
__u64 size;
__u64 elapsed_time;
/* basic and exended format: */
/* basic and extended format: */
__u64 ssch_rsch_count;
__u64 sample_count;
__u64 device_connect_time;
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/uapi/asm/dasd.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/*
* struct dasd_information2_t
* represents any data about the device, which is visible to userspace.
* including foramt and featueres.
* including format and featueres.
*/
typedef struct dasd_information2_t {
unsigned int devno; /* S/390 devno */
Expand Down
6 changes: 3 additions & 3 deletions arch/s390/include/uapi/asm/pkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ struct pkey_kblob2pkey2 {
* Is able to find out which type of secure key is given (CCA AES secure
* key, CCA AES cipher key, CCA ECC private key, EP11 AES key, EP11 ECC private
* key) and tries to find all matching crypto cards based on the MKVP and maybe
* other criterias (like CCA AES cipher keys need a CEX5C or higher, EP11 keys
* other criteria (like CCA AES cipher keys need a CEX5C or higher, EP11 keys
* with BLOB_PKEY_EXTRACTABLE need a CEX7 and EP11 api version 4). The list of
* APQNs is further filtered by the key's mkvp which needs to match to either
* the current mkvp (CCA and EP11) or the alternate mkvp (old mkvp, CCA adapters
Expand All @@ -370,7 +370,7 @@ struct pkey_kblob2pkey2 {
* is empty (apqn_entries is 0) the apqn_entries field is updated to the number
* of apqn targets found and the ioctl returns with 0. If apqn_entries is > 0
* but the number of apqn targets does not fit into the list, the apqn_targets
* field is updatedd with the number of reqired entries but there are no apqn
* field is updated with the number of required entries but there are no apqn
* values stored in the list and the ioctl returns with ENOSPC. If no matching
* APQN is found, the ioctl returns with 0 but the apqn_entries value is 0.
*/
Expand Down Expand Up @@ -408,7 +408,7 @@ struct pkey_apqns4key {
* is empty (apqn_entries is 0) the apqn_entries field is updated to the number
* of apqn targets found and the ioctl returns with 0. If apqn_entries is > 0
* but the number of apqn targets does not fit into the list, the apqn_targets
* field is updatedd with the number of reqired entries but there are no apqn
* field is updated with the number of required entries but there are no apqn
* values stored in the list and the ioctl returns with ENOSPC. If no matching
* APQN is found, the ioctl returns with 0 but the apqn_entries value is 0.
*/
Expand Down
Loading

0 comments on commit a452483

Please sign in to comment.