projects/linux·commit 2ec4584e

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

2ec4584e · Linus Torvalds <[email protected]> · 2016-12-13 16:33:33 -08:00

Pull s390 updates from Martin Schwidefsky:
 "The main bulk of the s390 patches for the 4.10 merge window:

   - Add support for the contiguous memory allocator.

   - The recovery for I/O errors in the dasd device driver is improved,
     the driver will now remove channel paths that are not working
     properly.

   - Additional fields are added to /proc/sysinfo, the extended
     partition name and the partition UUID.

   - New naming for PCI devices with system defined UIDs.

   - The last few remaining alloc_bootmem calls are converted to
     memblock.

   - The thread_info structure is stripped down and moved to the
     task_struct. The only field left in thread_info is the flags field.

   - Rework of the arch topology code to fix a fake numa issue.

   - Refactoring of the atomic primitives and add a new preempt_count
     implementation.

   - Clocksource steering for the STP sync check offsets.

   - The s390 specific headers are changed to make them usable with
     CLANG.

   - Bug fixes and cleanup"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (70 commits)
  s390/cpumf: Use configuration level indication for sampling data
  s390: provide memmove implementation
  s390: cleanup arch/s390/kernel Makefile
  s390: fix initrd corruptions with gcov/kcov instrumented kernels
  s390: exclude early C code from gcov profiling
  s390/dasd: channel path aware error recovery
  s390/dasd: extend dasd path handling
  s390: remove unused labels from entry.S
  s390/vmlogrdr: fix IUCV buffer allocation
  s390/crypto: unlock on error in prng_tdes_read()
  s390/sysinfo: show partition extended name and UUID if available
  s390/numa: pin all possible cpus to nodes early
  s390/numa: establish cpu to node mapping early
  s390/topology: use cpu_topology array instead of per cpu variable
  s390/smp: initialize cpu_present_mask in setup_arch
  s390/topology: always use s390 specific sched_domain_topology_level
  s390/smp: use smp_get_base_cpu() helper function
  s390/numa: always use logical cpu and core ids
  s390: Remove VLAIS in ptff() and clear_table()
  s390: fix machine check panic stack switch
  ...
Commit
2ec4584eb89b8933d1ee307f2fc9c42e745847d7
Parents
aa3ecf38 · c19805f8

Merge commit. Changes below are compared with the first parent: aa3ecf38.

Changes

95 files changed · +2265 −1240

FileStatusAddDelContent
MAINTAINERSmodified+1−1View file
arch/s390/Kconfigmodified+2−0View file
arch/s390/boot/compressed/head.Smodified+1−1View file
arch/s390/configs/default_defconfigmodified+5−1View file
arch/s390/configs/gcov_defconfigmodified+3−1View file
arch/s390/configs/performance_defconfigmodified+3−1View file
arch/s390/crypto/prng.cmodified+4−2View file
arch/s390/hypfs/inode.cmodified+4−20View file
arch/s390/include/asm/Kbuildmodified+2−2View file
arch/s390/include/asm/asm-offsets.hdeleted+0−1View before deletion
arch/s390/include/asm/atomic.hmodified+39−168View file
arch/s390/include/asm/atomic_ops.hadded+130−0View file
arch/s390/include/asm/bitops.hmodified+7−55View file
arch/s390/include/asm/cpu_mf.hmodified+2−1View file
arch/s390/include/asm/elf.hmodified+3−3View file
arch/s390/include/asm/facilities_src.hdeleted+0−82View before deletion
arch/s390/include/asm/ipl.hmodified+1−1View file
arch/s390/include/asm/lowcore.hmodified+3−2View file
arch/s390/include/asm/pci_clp.hmodified+4−1View file
arch/s390/include/asm/pgalloc.hmodified+11−11View file
arch/s390/include/asm/preempt.hadded+137−0View file
arch/s390/include/asm/processor.hmodified+6−0View file
arch/s390/include/asm/sclp.hmodified+9−1View file
arch/s390/include/asm/scsw.hmodified+5−1View file
arch/s390/include/asm/smp.hmodified+8−0View file
arch/s390/include/asm/string.hmodified+2−1View file
arch/s390/include/asm/sysinfo.hmodified+6−1View file
arch/s390/include/asm/thread_info.hmodified+2−22View file
arch/s390/include/asm/timex.hmodified+23−18View file
arch/s390/include/asm/topology.hmodified+15−13View file
arch/s390/include/asm/uaccess.hmodified+3−3View file
arch/s390/include/asm/vdso.hmodified+2−0View file
arch/s390/include/uapi/asm/Kbuildmodified+3−2View file
arch/s390/kernel/Makefilemodified+36−29View file
arch/s390/kernel/asm-offsets.cmodified+7−10View file
arch/s390/kernel/compat_signal.cmodified+2−2View file
arch/s390/kernel/early.cmodified+47−3View file
arch/s390/kernel/entry.Smodified+29−22View file
arch/s390/kernel/head.Smodified+1−1View file
arch/s390/kernel/head64.Smodified+3−4View file
arch/s390/kernel/ipl.cmodified+1−6View file
arch/s390/kernel/irq.cmodified+1−1View file
arch/s390/kernel/lgr.cmodified+3−2View file
arch/s390/kernel/perf_cpum_sf.cmodified+25−28View file
arch/s390/kernel/process.cmodified+2−4View file
arch/s390/kernel/ptrace.cmodified+7−7View file
arch/s390/kernel/setup.cmodified+13−9View file
arch/s390/kernel/signal.cmodified+7−7View file
arch/s390/kernel/smp.cmodified+13−19View file
arch/s390/kernel/swsusp.Smodified+1−1View file
arch/s390/kernel/sysinfo.cmodified+21−12View file
arch/s390/kernel/time.cmodified+110−81View file
arch/s390/kernel/topology.cmodified+34−19View file
arch/s390/kernel/vdso32/clock_gettime.Smodified+21−2View file
arch/s390/kernel/vdso32/gettimeofday.Smodified+21−2View file
arch/s390/kernel/vdso64/clock_gettime.Smodified+10−1View file
arch/s390/kernel/vdso64/gettimeofday.Smodified+10−1View file
arch/s390/kernel/vtime.cmodified+10−16View file
arch/s390/lib/mem.Smodified+39−0View file
arch/s390/mm/fault.cmodified+1−0View file
arch/s390/mm/vmem.cmodified+4−5View file
arch/s390/numa/mode_emu.cmodified+29−9View file
arch/s390/numa/toptree.cmodified+12−4View file
arch/s390/pci/pci.cmodified+8−0View file
arch/s390/pci/pci_clp.cmodified+3−0View file
arch/s390/pci/pci_debug.cmodified+1−1View file
arch/s390/pci/pci_dma.cmodified+19−17View file
arch/s390/tools/Makefilemodified+0−2View file
arch/s390/tools/gen_facilities.cmodified+73−3View file
drivers/pci/hotplug/s390_pci_hpc.cmodified+2−5View file
drivers/s390/block/dasd.cmodified+187−114View file
drivers/s390/block/dasd_3990_erp.cmodified+49−3View file
drivers/s390/block/dasd_devmap.cmodified+221−105View file
drivers/s390/block/dasd_eckd.cmodified+192−131View file
drivers/s390/block/dasd_eckd.hmodified+3−2View file
drivers/s390/block/dasd_eer.cmodified+21−8View file
drivers/s390/block/dasd_erp.cmodified+1−1View file
drivers/s390/block/dasd_fba.cmodified+1−1View file
drivers/s390/block/dasd_int.hmodified+440−9View file
drivers/s390/char/con3215.cmodified+1−11View file
drivers/s390/char/sclp.hmodified+23−0View file
drivers/s390/char/sclp_cmd.cmodified+1−24View file
drivers/s390/char/sclp_early.cmodified+31−0View file
drivers/s390/char/sclp_quiesce.cmodified+1−3View file
drivers/s390/char/sclp_tty.cmodified+1−2View file
drivers/s390/char/vmlogrdr.cmodified+1−1View file
drivers/s390/char/zcore.cmodified+2−20View file
drivers/s390/cio/cmf.cmodified+2−8View file
drivers/s390/cio/css.cmodified+3−3View file
drivers/s390/cio/device.cmodified+3−3View file
drivers/s390/cio/device.hmodified+0−1View file
drivers/s390/cio/device_fsm.cmodified+0−6View file
drivers/s390/cio/device_ops.cmodified+3−2View file
drivers/s390/crypto/ap_bus.cmodified+4−8View file
drivers/s390/virtio/virtio_ccw.cmodified+2−23View file

Only the first 600 diff lines are shown. Download the complete patch.

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 3d3ed12..1174508 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10557,7 +10557,7 @@ F: arch/s390/pci/
F: drivers/pci/hotplug/s390_pci_hpc.c
S390 ZCRYPT DRIVER
-M: Ingo Tuchscherer <[email protected]>
+M: Harald Freudenberger <[email protected]>
W: http://www.ibm.com/developerworks/linux/linux390/
S: Supported

arch/s390/Kconfig

View file
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 028f97b..c672211 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -136,6 +136,7 @@ config S390
select HAVE_CMPXCHG_LOCAL
select HAVE_DEBUG_KMEMLEAK
select HAVE_DMA_API_DEBUG
+ select HAVE_DMA_CONTIGUOUS
select HAVE_DYNAMIC_FTRACE
select HAVE_DYNAMIC_FTRACE_WITH_REGS
select HAVE_EFFICIENT_UNALIGNED_ACCESS
@@ -169,6 +170,7 @@ config S390
select OLD_SIGSUSPEND3
select SPARSE_IRQ
select SYSCTL_EXCEPTION_TRACE
+ select THREAD_INFO_IN_TASK
select TTY
select VIRT_CPU_ACCOUNTING
select ARCH_HAS_SCALED_CPUTIME

arch/s390/boot/compressed/head.S

View file
diff --git a/arch/s390/boot/compressed/head.S b/arch/s390/boot/compressed/head.S
index 28c4f96..11f6254 100644
--- a/arch/s390/boot/compressed/head.S
+++ b/arch/s390/boot/compressed/head.S
@@ -46,7 +46,7 @@ mover_end:
.align 8
.Lstack:
- .quad 0x8000 + (1<<(PAGE_SHIFT+THREAD_ORDER))
+ .quad 0x8000 + (1<<(PAGE_SHIFT+THREAD_SIZE_ORDER))
.Loffset:
.quad 0x11000
.Lmvsize:

arch/s390/configs/default_defconfig

View file
diff --git a/arch/s390/configs/default_defconfig b/arch/s390/configs/default_defconfig
index 4596868..e659daf 100644
--- a/arch/s390/configs/default_defconfig
+++ b/arch/s390/configs/default_defconfig
@@ -66,6 +66,8 @@ CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_CLEANCACHE=y
CONFIG_FRONTSWAP=y
CONFIG_CMA=y
+CONFIG_CMA_DEBUG=y
+CONFIG_CMA_DEBUGFS=y
CONFIG_MEM_SOFT_DIRTY=y
CONFIG_ZPOOL=m
CONFIG_ZBUD=m
@@ -366,6 +368,8 @@ CONFIG_BPF_JIT=y
CONFIG_NET_PKTGEN=m
CONFIG_NET_TCPPROBE=m
CONFIG_DEVTMPFS=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=0
CONFIG_CONNECTOR=y
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
@@ -438,7 +442,6 @@ CONFIG_TUN=m
CONFIG_VETH=m
CONFIG_VIRTIO_NET=m
CONFIG_NLMON=m
-CONFIG_VHOST_NET=m
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_INTEL is not set
@@ -693,3 +696,4 @@ CONFIG_CMM=m
CONFIG_APPLDATA_BASE=y
CONFIG_KVM=m
CONFIG_KVM_S390_UCONTROL=y
+CONFIG_VHOST_NET=m

arch/s390/configs/gcov_defconfig

View file
diff --git a/arch/s390/configs/gcov_defconfig b/arch/s390/configs/gcov_defconfig
index 1dd05e3..95ceac5 100644
--- a/arch/s390/configs/gcov_defconfig
+++ b/arch/s390/configs/gcov_defconfig
@@ -362,6 +362,8 @@ CONFIG_BPF_JIT=y
CONFIG_NET_PKTGEN=m
CONFIG_NET_TCPPROBE=m
CONFIG_DEVTMPFS=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=0
CONFIG_CONNECTOR=y
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
@@ -434,7 +436,6 @@ CONFIG_TUN=m
CONFIG_VETH=m
CONFIG_VIRTIO_NET=m
CONFIG_NLMON=m
-CONFIG_VHOST_NET=m
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_INTEL is not set
@@ -633,3 +634,4 @@ CONFIG_CMM=m
CONFIG_APPLDATA_BASE=y
CONFIG_KVM=m
CONFIG_KVM_S390_UCONTROL=y
+CONFIG_VHOST_NET=m

arch/s390/configs/performance_defconfig

View file
diff --git a/arch/s390/configs/performance_defconfig b/arch/s390/configs/performance_defconfig
index 29d1178..bc7b176 100644
--- a/arch/s390/configs/performance_defconfig
+++ b/arch/s390/configs/performance_defconfig
@@ -362,6 +362,8 @@ CONFIG_BPF_JIT=y
CONFIG_NET_PKTGEN=m
CONFIG_NET_TCPPROBE=m
CONFIG_DEVTMPFS=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=0
CONFIG_CONNECTOR=y
CONFIG_BLK_DEV_LOOP=m
CONFIG_BLK_DEV_CRYPTOLOOP=m
@@ -434,7 +436,6 @@ CONFIG_TUN=m
CONFIG_VETH=m
CONFIG_VIRTIO_NET=m
CONFIG_NLMON=m
-CONFIG_VHOST_NET=m
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_INTEL is not set
@@ -632,3 +633,4 @@ CONFIG_CMM=m
CONFIG_APPLDATA_BASE=y
CONFIG_KVM=m
CONFIG_KVM_S390_UCONTROL=y
+CONFIG_VHOST_NET=m

arch/s390/crypto/prng.c

View file
diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c
index 9cc050f..1113389 100644
--- a/arch/s390/crypto/prng.c
+++ b/arch/s390/crypto/prng.c
@@ -507,8 +507,10 @@ static ssize_t prng_tdes_read(struct file *file, char __user *ubuf,
prng_data->prngws.byte_counter += n;
prng_data->prngws.reseed_counter += n;
- if (copy_to_user(ubuf, prng_data->buf, chunk))
- return -EFAULT;
+ if (copy_to_user(ubuf, prng_data->buf, chunk)) {
+ ret = -EFAULT;
+ break;
+ }
nbytes -= chunk;
ret += chunk;

arch/s390/hypfs/inode.c

View file
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 09bccb2..cf8a2d9 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -3,6 +3,7 @@
*
* Copyright IBM Corp. 2006, 2008
* Author(s): Michael Holzheu <[email protected]>
+ * License: GPL
*/
#define KMSG_COMPONENT "hypfs"
@@ -18,7 +19,8 @@
#include <linux/time.h>
#include <linux/parser.h>
#include <linux/sysfs.h>
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kobject.h>
#include <linux/seq_file.h>
#include <linux/mount.h>
#include <linux/uio.h>
@@ -443,7 +445,6 @@ static struct file_system_type hypfs_type = {
.mount = hypfs_mount,
.kill_sb = hypfs_kill_super
};
-MODULE_ALIAS_FS("s390_hypfs");
static const struct super_operations hypfs_s_ops = {
.statfs = simple_statfs,
@@ -497,21 +498,4 @@ fail_dbfs_exit:
pr_err("Initialization of hypfs failed with rc=%i\n", rc);
return rc;
}
-
-static void __exit hypfs_exit(void)
-{
- unregister_filesystem(&hypfs_type);
- sysfs_remove_mount_point(hypervisor_kobj, "s390");
- hypfs_diag0c_exit();
- hypfs_sprp_exit();
- hypfs_vm_exit();
- hypfs_diag_exit();
- hypfs_dbfs_exit();
-}
-
-module_init(hypfs_init)
-module_exit(hypfs_exit)
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Michael Holzheu <[email protected]>");
-MODULE_DESCRIPTION("s390 Hypervisor Filesystem");
+device_initcall(hypfs_init)

arch/s390/include/asm/Kbuild

View file
diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild
index 20f196b..8aea32f 100644
--- a/arch/s390/include/asm/Kbuild
+++ b/arch/s390/include/asm/Kbuild
@@ -1,6 +1,6 @@
-
-
+generic-y += asm-offsets.h
generic-y += clkdev.h
+generic-y += dma-contiguous.h
generic-y += export.h
generic-y += irq_work.h
generic-y += mcs_spinlock.h

arch/s390/include/asm/asm-offsets.h

View before deletion
diff --git a/arch/s390/include/asm/asm-offsets.h b/arch/s390/include/asm/asm-offsets.h
deleted file mode 100644
index d370ee3..0000000
--- a/arch/s390/include/asm/asm-offsets.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <generated/asm-offsets.h>

arch/s390/include/asm/atomic.h

View file
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
index d28cc2f..f7f69df 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -1,13 +1,8 @@
/*
- * Copyright IBM Corp. 1999, 2009
+ * Copyright IBM Corp. 1999, 2016
* Author(s): Martin Schwidefsky <[email protected]>,
* Denis Joseph Barrow,
- * Arnd Bergmann <[email protected]>,
- *
- * Atomic operations that C can't guarantee us.
- * Useful for resource counting etc.
- * s390 uses 'Compare And Swap' for atomicity in SMP environment.
- *
+ * Arnd Bergmann,
*/
#ifndef __ARCH_S390_ATOMIC__
@@ -15,62 +10,12 @@
#include <linux/compiler.h>
#include <linux/types.h>
+#include <asm/atomic_ops.h>
#include <asm/barrier.h>
#include <asm/cmpxchg.h>
#define ATOMIC_INIT(i) { (i) }
-#define __ATOMIC_NO_BARRIER "\n"
-
-#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
-
-#define __ATOMIC_OR "lao"
-#define __ATOMIC_AND "lan"
-#define __ATOMIC_ADD "laa"
-#define __ATOMIC_XOR "lax"
-#define __ATOMIC_BARRIER "bcr 14,0\n"
-
-#define __ATOMIC_LOOP(ptr, op_val, op_string, __barrier) \
-({ \
- int old_val; \
- \
- typecheck(atomic_t *, ptr); \
- asm volatile( \
- op_string " %0,%2,%1\n" \
- __barrier \
- : "=d" (old_val), "+Q" ((ptr)->counter) \
- : "d" (op_val) \
- : "cc", "memory"); \
- old_val; \
-})
-
-#else /* CONFIG_HAVE_MARCH_Z196_FEATURES */
-
-#define __ATOMIC_OR "or"
-#define __ATOMIC_AND "nr"
-#define __ATOMIC_ADD "ar"
-#define __ATOMIC_XOR "xr"
-#define __ATOMIC_BARRIER "\n"
-
-#define __ATOMIC_LOOP(ptr, op_val, op_string, __barrier) \
-({ \
- int old_val, new_val; \
- \
- typecheck(atomic_t *, ptr); \
- asm volatile( \
- " l %0,%2\n" \
- "0: lr %1,%0\n" \
- op_string " %1,%3\n" \
- " cs %0,%1,%2\n" \
- " jl 0b" \
- : "=&d" (old_val), "=&d" (new_val), "+Q" ((ptr)->counter)\
- : "d" (op_val) \
- : "cc", "memory"); \
- old_val; \
-})
-
-#endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */
-
static inline int atomic_read(const atomic_t *v)
{
int c;
@@ -90,27 +35,23 @@ static inline void atomic_set(atomic_t *v, int i)
static inline int atomic_add_return(int i, atomic_t *v)
{
- return __ATOMIC_LOOP(v, i, __ATOMIC_ADD, __ATOMIC_BARRIER) + i;
+ return __atomic_add_barrier(i, &v->counter) + i;
}
static inline int atomic_fetch_add(int i, atomic_t *v)
{
- return __ATOMIC_LOOP(v, i, __ATOMIC_ADD, __ATOMIC_BARRIER);
+ return __atomic_add_barrier(i, &v->counter);
}
static inline void atomic_add(int i, atomic_t *v)
{
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
if (__builtin_constant_p(i) && (i > -129) && (i < 128)) {
- asm volatile(
- "asi %0,%1\n"
- : "+Q" (v->counter)
- : "i" (i)
- : "cc", "memory");
+ __atomic_add_const(i, &v->counter);
return;
}
#endif
- __ATOMIC_LOOP(v, i, __ATOMIC_ADD, __ATOMIC_NO_BARRIER);
+ __atomic_add(i, &v->counter);
}
#define atomic_add_negative(_i, _v) (atomic_add_return(_i, _v) < 0)
@@ -125,19 +66,19 @@ static inline void atomic_add(int i, atomic_t *v)
#define atomic_dec_return(_v) atomic_sub_return(1, _v)
#define atomic_dec_and_test(_v) (atomic_sub_return(1, _v) == 0)
-#define ATOMIC_OPS(op, OP) \
+#define ATOMIC_OPS(op) \
static inline void atomic_##op(int i, atomic_t *v) \
{ \
- __ATOMIC_LOOP(v, i, __ATOMIC_##OP, __ATOMIC_NO_BARRIER); \
+ __atomic_##op(i, &v->counter); \
} \
static inline int atomic_fetch_##op(int i, atomic_t *v) \
{ \
- return __ATOMIC_LOOP(v, i, __ATOMIC_##OP, __ATOMIC_BARRIER); \
+ return __atomic_##op##_barrier(i, &v->counter); \
}
-ATOMIC_OPS(and, AND)
-ATOMIC_OPS(or, OR)
-ATOMIC_OPS(xor, XOR)
+ATOMIC_OPS(and)
+ATOMIC_OPS(or)
+ATOMIC_OPS(xor)
#undef ATOMIC_OPS
@@ -145,12 +86,7 @@ ATOMIC_OPS(xor, XOR)
static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
{
- asm volatile(
- " cs %0,%2,%1"
- : "+d" (old), "+Q" (v->counter)
- : "d" (new)
- : "cc", "memory");
- return old;
+ return __atomic_cmpxchg(&v->counter, old, new);
}
static inline int __atomic_add_unless(atomic_t *v, int a, int u)
@@ -168,65 +104,11 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
return c;
}
-
-#undef __ATOMIC_LOOP
-
#define ATOMIC64_INIT(i) { (i) }
-#define __ATOMIC64_NO_BARRIER "\n"
-
-#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
-
-#define __ATOMIC64_OR "laog"
-#define __ATOMIC64_AND "lang"
-#define __ATOMIC64_ADD "laag"
-#define __ATOMIC64_XOR "laxg"
-#define __ATOMIC64_BARRIER "bcr 14,0\n"
-
-#define __ATOMIC64_LOOP(ptr, op_val, op_string, __barrier) \
-({ \
- long long old_val; \
- \
- typecheck(atomic64_t *, ptr); \
- asm volatile( \
- op_string " %0,%2,%1\n" \
- __barrier \
- : "=d" (old_val), "+Q" ((ptr)->counter) \
- : "d" (op_val) \
- : "cc", "memory"); \
- old_val; \
-})
-
-#else /* CONFIG_HAVE_MARCH_Z196_FEATURES */
-
-#define __ATOMIC64_OR "ogr"
-#define __ATOMIC64_AND "ngr"
-#define __ATOMIC64_ADD "agr"
-#define __ATOMIC64_XOR "xgr"
-#define __ATOMIC64_BARRIER "\n"
-
-#define __ATOMIC64_LOOP(ptr, op_val, op_string, __barrier) \
-({ \
- long long old_val, new_val; \
- \
- typecheck(atomic64_t *, ptr); \
- asm volatile( \
- " lg %0,%2\n" \
- "0: lgr %1,%0\n" \
- op_string " %1,%3\n" \
- " csg %0,%1,%2\n" \
- " jl 0b" \
- : "=&d" (old_val), "=&d" (new_val), "+Q" ((ptr)->counter)\
- : "d" (op_val) \
- : "cc", "memory"); \
- old_val; \
-})
-
-#endif /* CONFIG_HAVE_MARCH_Z196_FEATURES */
-
-static inline long long atomic64_read(const atomic64_t *v)
+static inline long atomic64_read(const atomic64_t *v)
{
- long long c;
+ long c;
asm volatile(
" lg %0,%1\n"
@@ -234,71 +116,60 @@ static inline long long atomic64_read(const atomic64_t *v)
return c;
}
-static inline void atomic64_set(atomic64_t *v, long long i)
+static inline void atomic64_set(atomic64_t *v, long i)
{
asm volatile(
" stg %1,%0\n"
: "=Q" (v->counter) : "d" (i));
}
-static inline long long atomic64_add_return(long long i, atomic64_t *v)
+static inline long atomic64_add_return(long i, atomic64_t *v)
{
- return __ATOMIC64_LOOP(v, i, __ATOMIC64_ADD, __ATOMIC64_BARRIER) + i;
+ return __atomic64_add_barrier(i, &v->counter) + i;
}
-static inline long long atomic64_fetch_add(long long i, atomic64_t *v)
+static inline long atomic64_fetch_add(long i, atomic64_t *v)
{
- return __ATOMIC64_LOOP(v, i, __ATOMIC64_ADD, __ATOMIC64_BARRIER);
+ return __atomic64_add_barrier(i, &v->counter);
}
-static inline void atomic64_add(long long i, atomic64_t *v)
+static inline void atomic64_add(long i, atomic64_t *v)
{
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
if (__builtin_constant_p(i) && (i > -129) && (i < 128)) {
- asm volatile(
- "agsi %0,%1\n"
- : "+Q" (v->counter)
- : "i" (i)
- : "cc", "memory");
+ __atomic64_add_const(i, &v->counter);
return;
}
#endif
- __ATOMIC64_LOOP(v, i, __ATOMIC64_ADD, __ATOMIC64_NO_BARRIER);
+ __atomic64_add(i, &v->counter);
}
#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
-static inline long long atomic64_cmpxchg(atomic64_t *v,
- long long old, long long new)
+static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
{
- asm volatile(
- " csg %0,%2,%1"
- : "+d" (old), "+Q" (v->counter)
- : "d" (new)
- : "cc", "memory");
- return old;
+ return __atomic64_cmpxchg(&v->counter, old, new);
}
-#define ATOMIC64_OPS(op, OP) \
+#define ATOMIC64_OPS(op) \
static inline void atomic64_##op(long i, atomic64_t *v) \
{ \
- __ATOMIC64_LOOP(v, i, __ATOMIC64_##OP, __ATOMIC64_NO_BARRIER); \
+ __atomic64_##op(i, &v->counter); \
} \
static inline long atomic64_fetch_##op(long i, atomic64_t *v) \
{ \
- return __ATOMIC64_LOOP(v, i, __ATOMIC64_##OP, __ATOMIC64_BARRIER); \
+ return __atomic64_##op##_barrier(i, &v->counter); \
}
-ATOMIC64_OPS(and, AND)
-ATOMIC64_OPS(or, OR)
-ATOMIC64_OPS(xor, XOR)
+ATOMIC64_OPS(and)
+ATOMIC64_OPS(or)
+ATOMIC64_OPS(xor)
#undef ATOMIC64_OPS
-#undef __ATOMIC64_LOOP
-static inline int atomic64_add_unless(atomic64_t *v, long long i, long long u)
+static inline int atomic64_add_unless(atomic64_t *v, long i, long u)
{
- long long c, old;
+ long c, old;
c = atomic64_read(v);
for (;;) {
@@ -312,9 +183,9 @@ static inline int atomic64_add_unless(atomic64_t *v, long long i, long long u)
return c != u;
}
-static inline long long atomic64_dec_if_positive(atomic64_t *v)
+static inline long atomic64_dec_if_positive(atomic64_t *v)
{
- long long c, old, dec;
+ long c, old, dec;
c = atomic64_read(v);
for (;;) {
@@ -333,9 +204,9 @@ static inline long long atomic64_dec_if_positive(atomic64_t *v)
#define atomic64_inc(_v) atomic64_add(1, _v)
#define atomic64_inc_return(_v) atomic64_add_return(1, _v)
#define atomic64_inc_and_test(_v) (atomic64_add_return(1, _v) == 0)
-#define atomic64_sub_return(_i, _v) atomic64_add_return(-(long long)(_i), _v)
-#define atomic64_fetch_sub(_i, _v) atomic64_fetch_add(-(long long)(_i), _v)
-#define atomic64_sub(_i, _v) atomic64_add(-(long long)(_i), _v)
+#define atomic64_sub_return(_i, _v) atomic64_add_return(-(long)(_i), _v)
+#define atomic64_fetch_sub(_i, _v) atomic64_fetch_add(-(long)(_i), _v)
+#define atomic64_sub(_i, _v) atomic64_add(-(long)(_i), _v)
#define atomic64_sub_and_test(_i, _v) (atomic64_sub_return(_i, _v) == 0)
#define atomic64_dec(_v) atomic64_sub(1, _v)
#define atomic64_dec_return(_v) atomic64_sub_return(1, _v)

arch/s390/include/asm/atomic_ops.h

View file
diff --git a/arch/s390/include/asm/atomic_ops.h b/arch/s390/include/asm/atomic_ops.h
new file mode 100644
index 0000000..ac9e2b9
--- /dev/null
+++ b/arch/s390/include/asm/atomic_ops.h
@@ -0,0 +1,130 @@
+/*
+ * Low level function for atomic operations
+ *
+ * Copyright IBM Corp. 1999, 2016
+ */
+
+#ifndef __ARCH_S390_ATOMIC_OPS__
+#define __ARCH_S390_ATOMIC_OPS__
+
+#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
+
+#define __ATOMIC_OP(op_name, op_type, op_string, op_barrier) \
+static inline op_type op_name(op_type val, op_type *ptr) \
+{ \
+ op_type old; \
+ \
+ asm volatile( \
+ op_string " %[old],%[val],%[ptr]\n" \
+ op_barrier \
+ : [old] "=d" (old), [ptr] "+Q" (*ptr) \
+ : [val] "d" (val) : "cc", "memory"); \
+ return old; \
+} \
+
+#define __ATOMIC_OPS(op_name, op_type, op_string) \
+ __ATOMIC_OP(op_name, op_type, op_string, "\n") \
+ __ATOMIC_OP(op_name##_barrier, op_type, op_string, "bcr 14,0\n")
+
+__ATOMIC_OPS(__atomic_add, int, "laa")
+__ATOMIC_OPS(__atomic_and, int, "lan")
+__ATOMIC_OPS(__atomic_or, int, "lao")
+__ATOMIC_OPS(__atomic_xor, int, "lax")

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/bitops.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/cpu_mf.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/elf.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/facilities_src.h

View before deletion

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/ipl.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/lowcore.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/pci_clp.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/pgalloc.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/preempt.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/processor.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/sclp.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/scsw.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/smp.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/string.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/sysinfo.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/thread_info.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/timex.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/topology.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/uaccess.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/asm/vdso.h

View file

This diff is incomplete. Download the complete patch.

arch/s390/include/uapi/asm/Kbuild

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/asm-offsets.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/compat_signal.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/early.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/entry.S

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/head.S

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/head64.S

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/ipl.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/irq.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/lgr.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/perf_cpum_sf.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/process.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/ptrace.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/setup.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/signal.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/smp.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/swsusp.S

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/sysinfo.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/time.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/topology.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/vdso32/clock_gettime.S

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/vdso32/gettimeofday.S

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/vdso64/clock_gettime.S

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/vdso64/gettimeofday.S

View file

This diff is incomplete. Download the complete patch.

arch/s390/kernel/vtime.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/lib/mem.S

View file

This diff is incomplete. Download the complete patch.

arch/s390/mm/fault.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/mm/vmem.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/numa/mode_emu.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/numa/toptree.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/pci/pci.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/pci/pci_clp.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/pci/pci_debug.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/pci/pci_dma.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/tools/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/s390/tools/gen_facilities.c

View file

This diff is incomplete. Download the complete patch.

drivers/pci/hotplug/s390_pci_hpc.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd_3990_erp.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd_devmap.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd_eckd.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd_eckd.h

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd_eer.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd_erp.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd_fba.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/block/dasd_int.h

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/con3215.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/sclp.h

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/sclp_cmd.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/sclp_early.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/sclp_quiesce.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/sclp_tty.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/vmlogrdr.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/char/zcore.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/cio/cmf.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/cio/css.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/cio/device.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/cio/device.h

View file

This diff is incomplete. Download the complete patch.

drivers/s390/cio/device_fsm.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/cio/device_ops.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/crypto/ap_bus.c

View file

This diff is incomplete. Download the complete patch.

drivers/s390/virtio/virtio_ccw.c

View file

This diff is incomplete. Download the complete patch.