Skip to content

Commit

Permalink
Merge tag 's390-5.7-1' 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 s390 updates from Vasily Gorbik:

 - Update maintainers. Niklas Schnelle takes over zpci and Vineeth
   Vijayan common io code.

 - Extend cpuinfo to include topology information.

 - Add new extended counters for IBM z15 and sampling buffer allocation
   rework in perf code.

 - Add control over zeroing out memory during system restart.

 - CCA protected key block version 2 support and other
   fixes/improvements in crypto code.

 - Convert to new fallthrough; annotations.

 - Replace zero-length arrays with flexible-arrays.

 - QDIO debugfs and other small improvements.

 - Drop 2-level paging support optimization for compat tasks. Varios mm
   cleanups.

 - Remove broken and unused hibernate / power management support.

 - Remove fake numa support which does not bring any benefits.

 - Exclude offline CPUs from CPU topology masks to be more consistent
   with other architectures.

 - Prevent last branching instruction address leaking to userspace.

 - Other small various fixes and improvements all over the code.

* tag 's390-5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (57 commits)
  s390/mm: cleanup init_new_context() callback
  s390/mm: cleanup virtual memory constants usage
  s390/mm: remove page table downgrade support
  s390/qdio: set qdio_irq->cdev at allocation time
  s390/qdio: remove unused function declarations
  s390/ccwgroup: remove pm support
  s390/ap: remove power management code from ap bus and drivers
  s390/zcrypt: use kvmalloc instead of kmalloc for 256k alloc
  s390/mm: cleanup arch_get_unmapped_area() and friends
  s390/ism: remove pm support
  s390/cio: use fallthrough;
  s390/vfio: use fallthrough;
  s390/zcrypt: use fallthrough;
  s390: use fallthrough;
  s390/cpum_sf: Fix wrong page count in error message
  s390/diag: fix display of diagnose call statistics
  s390/ap: Remove ap device suspend and resume callbacks
  s390/pci: Improve handling of unset UID
  s390/pci: Fix zpci_alloc_domain() over allocation
  s390/qdio: pass ISC as parameter to chsc_sadc()
  ...
  • Loading branch information
torvalds committed Apr 4, 2020
2 parents 5364abc + 1058c16 commit ad0bf4e
Show file tree
Hide file tree
Showing 95 changed files with 800 additions and 2,809 deletions.
4 changes: 2 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -14613,7 +14613,7 @@ F: Documentation/s390/
F: Documentation/driver-api/s390-drivers.rst

S390 COMMON I/O LAYER
M: Sebastian Ott <sebott@linux.ibm.com>
M: Vineeth Vijayan <vneethv@linux.ibm.com>
M: Peter Oberparleiter <[email protected]>
L: [email protected]
W: http://www.ibm.com/developerworks/linux/linux390/
Expand Down Expand Up @@ -14655,7 +14655,7 @@ S: Supported
F: drivers/s390/net/

S390 PCI SUBSYSTEM
M: Sebastian Ott <sebott@linux.ibm.com>
M: Niklas Schnelle <schnelle@linux.ibm.com>
M: Gerald Schaefer <[email protected]>
L: [email protected]
W: http://www.ibm.com/developerworks/linux/linux390/
Expand Down
73 changes: 3 additions & 70 deletions arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ config S390
select ARCH_INLINE_WRITE_UNLOCK_IRQ
select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
select ARCH_KEEP_MEMBLOCK
select ARCH_SAVE_PAGE_KEYS if HIBERNATION
select ARCH_STACKWALK
select ARCH_SUPPORTS_ATOMIC_RMW
select ARCH_SUPPORTS_NUMA_BALANCING
select ARCH_USE_BUILTIN_BSWAP
select ARCH_USE_CMPXCHG_LOCKREF
select ARCH_WANTS_DYNAMIC_TASK_STRUCT
select ARCH_WANT_DEFAULT_BPF_JIT
select ARCH_WANT_IPC_PARSE_VERSION
select BUILDTIME_TABLE_SORT
select CLONE_BACKWARDS2
Expand Down Expand Up @@ -451,14 +451,6 @@ config NR_CPUS
config HOTPLUG_CPU
def_bool y

# Some NUMA nodes have memory ranges that span
# other nodes. Even though a pfn is valid and
# between a node's start and end pfns, it may not
# reside on that node. See memmap_init_zone()
# for details. <- They meant memory holes!
config NODES_SPAN_OTHER_NODES
def_bool NUMA

config NUMA
bool "NUMA support"
depends on SCHED_TOPOLOGY
Expand All @@ -468,58 +460,9 @@ config NUMA

This option adds NUMA support to the kernel.

An operation mode can be selected by appending
numa=<method> to the kernel command line.

The default behaviour is identical to appending numa=plain to
the command line. This will create just one node with all
available memory and all CPUs in it.

config NODES_SHIFT
int "Maximum NUMA nodes (as a power of 2)"
range 1 10
depends on NUMA
default "4"
help
Specify the maximum number of NUMA nodes available on the target
system. Increases memory reserved to accommodate various tables.

menu "Select NUMA modes"
depends on NUMA

config NUMA_EMU
bool "NUMA emulation"
default y
help
Numa emulation mode will split the available system memory into
equal chunks which then are distributed over the configured number
of nodes in a round-robin manner.

The number of fake nodes is limited by the number of available memory
chunks (i.e. memory size / fake size) and the number of supported
nodes in the kernel.

The CPUs are assigned to the nodes in a way that partially respects
the original machine topology (if supported by the machine).
Fair distribution of the CPUs is not guaranteed.

config EMU_SIZE
hex "NUMA emulation memory chunk size"
default 0x10000000
range 0x400000 0x100000000
depends on NUMA_EMU
help
Select the default size by which the memory is chopped and then
assigned to emulated NUMA nodes.

This can be overridden by specifying

emu_size=<n>

on the kernel command line where also suffixes K, M, G, and T are
supported.

endmenu
int
default "1"

config SCHED_SMT
def_bool n
Expand Down Expand Up @@ -867,15 +810,6 @@ config SECCOMP

If unsure, say Y.

menu "Power Management"

config ARCH_HIBERNATION_POSSIBLE
def_bool y

source "kernel/power/Kconfig"

endmenu

config CCW
def_bool y

Expand Down Expand Up @@ -1010,7 +944,6 @@ config S390_GUEST
select TTY
select VIRTUALIZATION
select VIRTIO
select VIRTIO_CONSOLE
help
Enabling this option adds support for virtio based paravirtual device
drivers on s390.
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/appldata/appldata_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct appldata_os_data {
(waiting for I/O) */

/* per cpu data */
struct appldata_os_per_cpu os_cpu[0];
struct appldata_os_per_cpu os_cpu[];
} __attribute__((packed));

static struct appldata_os_data *appldata_os_data;
Expand Down
17 changes: 6 additions & 11 deletions arch/s390/boot/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,10 @@
if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi

# Default install - same as make zlilo
echo "Warning: '${INSTALLKERNEL}' command not available - additional " \
"bootloader config required" >&2
if [ -f $4/vmlinuz-$1 ]; then mv $4/vmlinuz-$1 $4/vmlinuz-$1.old; fi
if [ -f $4/System.map-$1 ]; then mv $4/System.map-$1 $4/System.map-$1.old; fi

if [ -f $4/vmlinuz ]; then
mv $4/vmlinuz $4/vmlinuz.old
fi

if [ -f $4/System.map ]; then
mv $4/System.map $4/System.old
fi

cat $2 > $4/vmlinuz
cp $3 $4/System.map
cat $2 > $4/vmlinuz-$1
cp $3 $4/System.map-$1
1 change: 1 addition & 0 deletions arch/s390/configs/debug_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ CONFIG_INPUT_EVDEV=y
# CONFIG_SERIO is not set
CONFIG_LEGACY_PTY_COUNT=0
CONFIG_NULL_TTY=m
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_RAW_DRIVER=m
CONFIG_HANGCHECK_TIMER=m
Expand Down
1 change: 1 addition & 0 deletions arch/s390/configs/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ CONFIG_INPUT_EVDEV=y
# CONFIG_SERIO is not set
CONFIG_LEGACY_PTY_COUNT=0
CONFIG_NULL_TTY=m
CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_RAW_DRIVER=m
CONFIG_HANGCHECK_TIMER=m
Expand Down
3 changes: 3 additions & 0 deletions arch/s390/crypto/aes_s390.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ static int cbc_aes_crypt(struct skcipher_request *req, unsigned long modifier)
memcpy(walk.iv, param.iv, AES_BLOCK_SIZE);
ret = skcipher_walk_done(&walk, nbytes - n);
}
memzero_explicit(&param, sizeof(param));
return ret;
}

Expand Down Expand Up @@ -470,6 +471,8 @@ static int xts_aes_crypt(struct skcipher_request *req, unsigned long modifier)
walk.dst.virt.addr, walk.src.virt.addr, n);
ret = skcipher_walk_done(&walk, nbytes - n);
}
memzero_explicit(&pcc_param, sizeof(pcc_param));
memzero_explicit(&xts_param, sizeof(xts_param));
return ret;
}

Expand Down
1 change: 0 additions & 1 deletion arch/s390/include/asm/hw_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@

void __init init_airq_interrupts(void);
void __init init_cio_interrupts(void);
void __init init_ext_interrupts(void);

#endif
1 change: 1 addition & 0 deletions arch/s390/include/asm/ipl.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ enum diag308_subcode {
DIAG308_LOAD_NORMAL_DUMP = 4,
DIAG308_SET = 5,
DIAG308_STORE = 6,
DIAG308_LOAD_NORMAL = 7,
};

enum diag308_rc {
Expand Down
4 changes: 3 additions & 1 deletion arch/s390/include/asm/lowcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ struct lowcore {

/* br %r1 trampoline */
__u16 br_r1_trampoline; /* 0x0400 */
__u8 pad_0x0402[0x0e00-0x0402]; /* 0x0402 */
__u32 return_lpswe; /* 0x0402 */
__u32 return_mcck_lpswe; /* 0x0406 */
__u8 pad_0x040a[0x0e00-0x040a]; /* 0x040a */

/*
* 0xe00 contains the address of the IPL Parameter Information
Expand Down
2 changes: 0 additions & 2 deletions arch/s390/include/asm/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ typedef struct {
unsigned int uses_cmm:1;
/* The gmaps associated with this context are allowed to use huge pages. */
unsigned int allow_gmap_hpage_1m:1;
/* The mmu context is for compat task */
unsigned int compat_mm:1;
} mm_context_t;

#define INIT_MM_CONTEXT(name) \
Expand Down
44 changes: 23 additions & 21 deletions arch/s390/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
static inline int init_new_context(struct task_struct *tsk,
struct mm_struct *mm)
{
unsigned long asce_type, init_entry;

spin_lock_init(&mm->context.lock);
INIT_LIST_HEAD(&mm->context.pgtable_list);
INIT_LIST_HEAD(&mm->context.gmap_list);
Expand All @@ -26,7 +28,6 @@ static inline int init_new_context(struct task_struct *tsk,
atomic_set(&mm->context.is_protected, 0);
mm->context.gmap_asce = 0;
mm->context.flush_mm = 0;
mm->context.compat_mm = test_thread_flag(TIF_31BIT);
#ifdef CONFIG_PGSTE
mm->context.alloc_pgste = page_table_allocate_pgste ||
test_thread_flag(TIF_PGSTE) ||
Expand All @@ -37,33 +38,34 @@ static inline int init_new_context(struct task_struct *tsk,
mm->context.allow_gmap_hpage_1m = 0;
#endif
switch (mm->context.asce_limit) {
case _REGION2_SIZE:
default:
/*
* forked 3-level task, fall through to set new asce with new
* mm->pgd
* context created by exec, the value of asce_limit can
* only be zero in this case
*/
case 0:
/* context created by exec, set asce limit to 4TB */
mm->context.asce_limit = STACK_TOP_MAX;
mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
_ASCE_USER_BITS | _ASCE_TYPE_REGION3;
VM_BUG_ON(mm->context.asce_limit);
/* continue as 3-level task */
mm->context.asce_limit = _REGION2_SIZE;
fallthrough;
case _REGION2_SIZE:
/* forked 3-level task */
init_entry = _REGION3_ENTRY_EMPTY;
asce_type = _ASCE_TYPE_REGION3;
break;
case -PAGE_SIZE:
/* forked 5-level task, set new asce with new_mm->pgd */
mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
_ASCE_USER_BITS | _ASCE_TYPE_REGION1;
case TASK_SIZE_MAX:
/* forked 5-level task */
init_entry = _REGION1_ENTRY_EMPTY;
asce_type = _ASCE_TYPE_REGION1;
break;
case _REGION1_SIZE:
/* forked 4-level task, set new asce with new mm->pgd */
mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
_ASCE_USER_BITS | _ASCE_TYPE_REGION2;
/* forked 4-level task */
init_entry = _REGION2_ENTRY_EMPTY;
asce_type = _ASCE_TYPE_REGION2;
break;
case _REGION3_SIZE:
/* forked 2-level compat task, set new asce with new mm->pgd */
mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
_ASCE_USER_BITS | _ASCE_TYPE_SEGMENT;
}
crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm));
mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
_ASCE_USER_BITS | asce_type;
crst_table_init((unsigned long *) mm->pgd, init_entry);
return 0;
}

Expand Down
13 changes: 1 addition & 12 deletions arch/s390/include/asm/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,13 @@
#ifdef CONFIG_NUMA

#include <linux/numa.h>
#include <linux/cpumask.h>

void numa_setup(void);
int numa_pfn_to_nid(unsigned long pfn);
int __node_distance(int a, int b);
void numa_update_cpu_topology(void);

extern cpumask_t node_to_cpumask_map[MAX_NUMNODES];
extern int numa_debug_enabled;

#else

static inline void numa_setup(void) { }
static inline void numa_update_cpu_topology(void) { }
static inline int numa_pfn_to_nid(unsigned long pfn)
{
return 0;
}

#endif /* CONFIG_NUMA */

#endif /* _ASM_S390_NUMA_H */
18 changes: 9 additions & 9 deletions arch/s390/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,20 @@ int arch_make_page_accessible(struct page *page);
#define __pa(x) ((unsigned long)(x))
#define __va(x) ((void *)(unsigned long)(x))

#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
#define phys_to_pfn(phys) ((phys) >> PAGE_SHIFT)
#define pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)

#define phys_to_page(phys) pfn_to_page(phys_to_pfn(phys))
#define page_to_phys(page) pfn_to_phys(page_to_pfn(page))

#define pfn_to_virt(pfn) __va(pfn_to_phys(pfn))
#define virt_to_pfn(kaddr) (phys_to_pfn(__pa(kaddr)))
#define pfn_to_kaddr(pfn) pfn_to_virt(pfn)

#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
#define page_to_virt(page) pfn_to_virt(page_to_pfn(page))

#define phys_to_pfn(kaddr) ((kaddr) >> PAGE_SHIFT)
#define pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)

#define phys_to_page(kaddr) pfn_to_page(phys_to_pfn(kaddr))
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)

#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
#define virt_addr_valid(kaddr) pfn_valid(virt_to_pfn(kaddr))

#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
Expand Down
6 changes: 6 additions & 0 deletions arch/s390/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <linux/pci.h>
#include <linux/mutex.h>
#include <linux/iommu.h>
#include <linux/pci_hotplug.h>
#include <asm-generic/pci.h>
#include <asm/pci_clp.h>
#include <asm/pci_debug.h>
Expand All @@ -25,6 +26,7 @@ int pci_proc_domain(struct pci_bus *);

#define ZPCI_NR_DMA_SPACES 1
#define ZPCI_NR_DEVICES CONFIG_PCI_NR_FUNCTIONS
#define ZPCI_DOMAIN_BITMAP_SIZE (1 << 16)

/* PCI Function Controls */
#define ZPCI_FC_FN_ENABLED 0x80
Expand Down Expand Up @@ -96,6 +98,7 @@ struct s390_domain;
struct zpci_dev {
struct pci_bus *bus;
struct list_head entry; /* list of all zpci_devices, needed for hotplug, etc. */
struct hotplug_slot hotplug_slot;

enum zpci_state state;
u32 fid; /* function ID, used by sclp */
Expand Down Expand Up @@ -186,6 +189,9 @@ int clp_enable_fh(struct zpci_dev *, u8);
int clp_disable_fh(struct zpci_dev *);
int clp_get_state(u32 fid, enum zpci_state *state);

/* UID */
void update_uid_checking(bool new);

/* IOMMU Interface */
int zpci_init_iommu(struct zpci_dev *zdev);
void zpci_destroy_iommu(struct zpci_dev *zdev);
Expand Down
Loading

0 comments on commit ad0bf4e

Please sign in to comment.