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

Pull more s390 updates from Heiko Carstens:
 "This includes one bpf/jit bug fix where the jit compiler could
  sometimes write generated code out of bounds of the allocated memory
  area.

  The rest of the patches are only cleanups and minor improvements"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/irq: reduce size of external interrupt handler hash array
  s390/compat,uid16: use current_cred()
  s390/ap_bus: use and-mask instead of a cast
  s390/ftrace: avoid pointer arithmetics with function pointers
  s390: make various functions static, add declarations to header files
  s390/compat signal: add couple of __force annotations
  s390/mm: add __releases()/__acquires() annotations to gmap_alloc_table()
  s390: keep Kconfig sorted
  s390/irq: rework irq subclass handling
  s390/irq: use hlists for external interrupt handler array
  s390/dumpstack: convert print_symbol to %pSR
  s390/perf: Remove print_hex_dump_bytes() debug output
  s390: update defconfig
  s390/bpf,jit: fix address randomization
This commit is contained in:
Linus Torvalds 2013-09-11 08:36:03 -07:00
commit e831cbfc1a
26 changed files with 130 additions and 135 deletions

View File

@ -62,6 +62,7 @@ config S390
def_bool y def_bool y
select ARCH_DISCARD_MEMBLOCK select ARCH_DISCARD_MEMBLOCK
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_HAVE_NMI_SAFE_CMPXCHG
select ARCH_INLINE_READ_LOCK select ARCH_INLINE_READ_LOCK
select ARCH_INLINE_READ_LOCK_BH select ARCH_INLINE_READ_LOCK_BH
@ -91,7 +92,6 @@ config S390
select ARCH_INLINE_WRITE_UNLOCK_BH select ARCH_INLINE_WRITE_UNLOCK_BH
select ARCH_INLINE_WRITE_UNLOCK_IRQ select ARCH_INLINE_WRITE_UNLOCK_IRQ
select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
select ARCH_HAS_DEBUG_STRICT_USER_COPY_CHECKS
select ARCH_SAVE_PAGE_KEYS if HIBERNATION select ARCH_SAVE_PAGE_KEYS if HIBERNATION
select ARCH_WANT_IPC_PARSE_VERSION select ARCH_WANT_IPC_PARSE_VERSION
select BUILDTIME_EXTABLE_SORT select BUILDTIME_EXTABLE_SORT
@ -135,15 +135,15 @@ config S390
select HAVE_SYSCALL_TRACEPOINTS select HAVE_SYSCALL_TRACEPOINTS
select HAVE_UID16 if 32BIT select HAVE_UID16 if 32BIT
select HAVE_VIRT_CPU_ACCOUNTING select HAVE_VIRT_CPU_ACCOUNTING
select VIRT_TO_BUS
select INIT_ALL_POSSIBLE select INIT_ALL_POSSIBLE
select KTIME_SCALAR if 32BIT select KTIME_SCALAR if 32BIT
select MODULES_USE_ELF_RELA select MODULES_USE_ELF_RELA
select OLD_SIGSUSPEND3
select OLD_SIGACTION select OLD_SIGACTION
select OLD_SIGSUSPEND3
select SYSCTL_EXCEPTION_TRACE select SYSCTL_EXCEPTION_TRACE
select USE_GENERIC_SMP_HELPERS if SMP select USE_GENERIC_SMP_HELPERS if SMP
select VIRT_CPU_ACCOUNTING select VIRT_CPU_ACCOUNTING
select VIRT_TO_BUS
config SCHED_OMIT_FRAME_POINTER config SCHED_OMIT_FRAME_POINTER
def_bool y def_bool y

View File

@ -1,14 +1,13 @@
CONFIG_EXPERIMENTAL=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
CONFIG_FHANDLE=y CONFIG_FHANDLE=y
CONFIG_AUDIT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_TASKSTATS=y CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_AUDIT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_RCU_FAST_NO_HZ=y CONFIG_RCU_FAST_NO_HZ=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y CONFIG_IKCONFIG_PROC=y
@ -27,6 +26,7 @@ CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y CONFIG_RD_XZ=y
CONFIG_RD_LZO=y CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y
CONFIG_EXPERT=y CONFIG_EXPERT=y
# CONFIG_COMPAT_BRK is not set # CONFIG_COMPAT_BRK is not set
CONFIG_PROFILING=y CONFIG_PROFILING=y
@ -38,11 +38,13 @@ CONFIG_MODULE_UNLOAD=y
CONFIG_MODVERSIONS=y CONFIG_MODVERSIONS=y
CONFIG_PARTITION_ADVANCED=y CONFIG_PARTITION_ADVANCED=y
CONFIG_IBM_PARTITION=y CONFIG_IBM_PARTITION=y
# CONFIG_EFI_PARTITION is not set
CONFIG_DEFAULT_DEADLINE=y CONFIG_DEFAULT_DEADLINE=y
CONFIG_HZ_100=y CONFIG_HZ_100=y
CONFIG_MEMORY_HOTPLUG=y CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTREMOVE=y CONFIG_MEMORY_HOTREMOVE=y
CONFIG_KSM=y CONFIG_KSM=y
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_CRASH_DUMP=y CONFIG_CRASH_DUMP=y
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_HIBERNATION=y CONFIG_HIBERNATION=y
@ -92,40 +94,49 @@ CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y CONFIG_SCSI_SCAN_ASYNC=y
CONFIG_ZFCP=y CONFIG_ZFCP=y
CONFIG_SCSI_VIRTIO=y
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_BONDING=m CONFIG_BONDING=m
CONFIG_DUMMY=m CONFIG_DUMMY=m
CONFIG_EQUALIZER=m CONFIG_EQUALIZER=m
CONFIG_TUN=m CONFIG_TUN=m
CONFIG_VIRTIO_NET=y CONFIG_VIRTIO_NET=y
# CONFIG_INPUT is not set
# CONFIG_SERIO is not set
CONFIG_RAW_DRIVER=m CONFIG_RAW_DRIVER=m
CONFIG_VIRTIO_BALLOON=y CONFIG_VIRTIO_BALLOON=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
CONFIG_EXT4_FS=y CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y CONFIG_EXT4_FS_SECURITY=y
CONFIG_XFS_FS=y
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_FANOTIFY=y
CONFIG_FUSE_FS=y
CONFIG_PROC_KCORE=y CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y CONFIG_TMPFS_POSIX_ACL=y
CONFIG_HUGETLBFS=y
# CONFIG_NETWORK_FILESYSTEMS is not set # CONFIG_NETWORK_FILESYSTEMS is not set
CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
CONFIG_MAGIC_SYSRQ=y CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_PAGEALLOC=y
CONFIG_TIMER_STATS=y CONFIG_TIMER_STATS=y
CONFIG_PROVE_LOCKING=y CONFIG_PROVE_LOCKING=y
CONFIG_PROVE_RCU=y
CONFIG_LOCK_STAT=y CONFIG_LOCK_STAT=y
CONFIG_DEBUG_LOCKDEP=y CONFIG_DEBUG_LOCKDEP=y
CONFIG_DEBUG_LIST=y CONFIG_DEBUG_LIST=y
CONFIG_DEBUG_NOTIFIERS=y CONFIG_DEBUG_NOTIFIERS=y
CONFIG_PROVE_RCU=y
CONFIG_RCU_CPU_STALL_TIMEOUT=60
CONFIG_RCU_TRACE=y CONFIG_RCU_TRACE=y
CONFIG_KPROBES_SANITY_TEST=y
CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
CONFIG_LATENCYTOP=y CONFIG_LATENCYTOP=y
CONFIG_DEBUG_PAGEALLOC=y
CONFIG_BLK_DEV_IO_TRACE=y CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_KPROBES_SANITY_TEST=y
# CONFIG_STRICT_DEVMEM is not set # CONFIG_STRICT_DEVMEM is not set
CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_CRYPTD=m CONFIG_CRYPTO_CRYPTD=m
CONFIG_CRYPTO_AUTHENC=m CONFIG_CRYPTO_AUTHENC=m
CONFIG_CRYPTO_TEST=m CONFIG_CRYPTO_TEST=m
@ -137,8 +148,10 @@ CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_LRW=m CONFIG_CRYPTO_LRW=m
CONFIG_CRYPTO_PCBC=m CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_XTS=m CONFIG_CRYPTO_XTS=m
CONFIG_CRYPTO_CMAC=m
CONFIG_CRYPTO_XCBC=m CONFIG_CRYPTO_XCBC=m
CONFIG_CRYPTO_VMAC=m CONFIG_CRYPTO_VMAC=m
CONFIG_CRYPTO_CRC32=m
CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD4=m
CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_MICHAEL_MIC=m
CONFIG_CRYPTO_RMD128=m CONFIG_CRYPTO_RMD128=m
@ -165,6 +178,8 @@ CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_DEFLATE=m CONFIG_CRYPTO_DEFLATE=m
CONFIG_CRYPTO_ZLIB=m CONFIG_CRYPTO_ZLIB=m
CONFIG_CRYPTO_LZO=m CONFIG_CRYPTO_LZO=m
CONFIG_CRYPTO_LZ4=m
CONFIG_CRYPTO_LZ4HC=m
CONFIG_ZCRYPT=m CONFIG_ZCRYPT=m
CONFIG_CRYPTO_SHA1_S390=m CONFIG_CRYPTO_SHA1_S390=m
CONFIG_CRYPTO_SHA256_S390=m CONFIG_CRYPTO_SHA256_S390=m

View File

@ -78,10 +78,14 @@ typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
int register_external_interrupt(u16 code, ext_int_handler_t handler); int register_external_interrupt(u16 code, ext_int_handler_t handler);
int unregister_external_interrupt(u16 code, ext_int_handler_t handler); int unregister_external_interrupt(u16 code, ext_int_handler_t handler);
void service_subclass_irq_register(void);
void service_subclass_irq_unregister(void); enum irq_subclass {
void measurement_alert_subclass_register(void); IRQ_SUBCLASS_MEASUREMENT_ALERT = 5,
void measurement_alert_subclass_unregister(void); IRQ_SUBCLASS_SERVICE_SIGNAL = 9,
};
void irq_subclass_register(enum irq_subclass subclass);
void irq_subclass_unregister(enum irq_subclass subclass);
#define irq_canonicalize(irq) (irq) #define irq_canonicalize(irq) (irq)

View File

@ -221,25 +221,26 @@ static int groups16_from_user(struct group_info *group_info, u16 __user *groupli
asmlinkage long sys32_getgroups16(int gidsetsize, u16 __user *grouplist) asmlinkage long sys32_getgroups16(int gidsetsize, u16 __user *grouplist)
{ {
const struct cred *cred = current_cred();
int i; int i;
if (gidsetsize < 0) if (gidsetsize < 0)
return -EINVAL; return -EINVAL;
get_group_info(current->cred->group_info); get_group_info(cred->group_info);
i = current->cred->group_info->ngroups; i = cred->group_info->ngroups;
if (gidsetsize) { if (gidsetsize) {
if (i > gidsetsize) { if (i > gidsetsize) {
i = -EINVAL; i = -EINVAL;
goto out; goto out;
} }
if (groups16_to_user(grouplist, current->cred->group_info)) { if (groups16_to_user(grouplist, cred->group_info)) {
i = -EFAULT; i = -EFAULT;
goto out; goto out;
} }
} }
out: out:
put_group_info(current->cred->group_info); put_group_info(cred->group_info);
return i; return i;
} }

View File

@ -332,9 +332,9 @@ static int setup_frame32(int sig, struct k_sigaction *ka,
/* Set up to return from userspace. If provided, use a stub /* Set up to return from userspace. If provided, use a stub
already in userspace. */ already in userspace. */
if (ka->sa.sa_flags & SA_RESTORER) { if (ka->sa.sa_flags & SA_RESTORER) {
regs->gprs[14] = (__u64) ka->sa.sa_restorer | PSW32_ADDR_AMODE; regs->gprs[14] = (__u64 __force) ka->sa.sa_restorer | PSW32_ADDR_AMODE;
} else { } else {
regs->gprs[14] = (__u64) frame->retcode | PSW32_ADDR_AMODE; regs->gprs[14] = (__u64 __force) frame->retcode | PSW32_ADDR_AMODE;
if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn, if (__put_user(S390_SYSCALL_OPCODE | __NR_sigreturn,
(u16 __force __user *)(frame->retcode))) (u16 __force __user *)(frame->retcode)))
goto give_sigsegv; goto give_sigsegv;
@ -400,9 +400,9 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
/* Set up to return from userspace. If provided, use a stub /* Set up to return from userspace. If provided, use a stub
already in userspace. */ already in userspace. */
if (ka->sa.sa_flags & SA_RESTORER) { if (ka->sa.sa_flags & SA_RESTORER) {
regs->gprs[14] = (__u64) ka->sa.sa_restorer | PSW32_ADDR_AMODE; regs->gprs[14] = (__u64 __force) ka->sa.sa_restorer | PSW32_ADDR_AMODE;
} else { } else {
regs->gprs[14] = (__u64) frame->retcode | PSW32_ADDR_AMODE; regs->gprs[14] = (__u64 __force) frame->retcode | PSW32_ADDR_AMODE;
err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn, err |= __put_user(S390_SYSCALL_OPCODE | __NR_rt_sigreturn,
(u16 __force __user *)(frame->retcode)); (u16 __force __user *)(frame->retcode));
} }
@ -417,7 +417,7 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
regs->psw.mask = PSW_MASK_BA | regs->psw.mask = PSW_MASK_BA |
(psw_user_bits & PSW_MASK_ASC) | (psw_user_bits & PSW_MASK_ASC) |
(regs->psw.mask & ~PSW_MASK_ASC); (regs->psw.mask & ~PSW_MASK_ASC);
regs->psw.addr = (__u64) ka->sa.sa_handler; regs->psw.addr = (__u64 __force) ka->sa.sa_handler;
regs->gprs[2] = map_signal(sig); regs->gprs[2] = map_signal(sig);
regs->gprs[3] = (__force __u64) &frame->info; regs->gprs[3] = (__force __u64) &frame->info;

View File

@ -40,14 +40,15 @@ __show_trace(unsigned long sp, unsigned long low, unsigned long high)
{ {
struct stack_frame *sf; struct stack_frame *sf;
struct pt_regs *regs; struct pt_regs *regs;
unsigned long addr;
while (1) { while (1) {
sp = sp & PSW_ADDR_INSN; sp = sp & PSW_ADDR_INSN;
if (sp < low || sp > high - sizeof(*sf)) if (sp < low || sp > high - sizeof(*sf))
return sp; return sp;
sf = (struct stack_frame *) sp; sf = (struct stack_frame *) sp;
printk("([<%016lx>] ", sf->gprs[8] & PSW_ADDR_INSN); addr = sf->gprs[8] & PSW_ADDR_INSN;
print_symbol("%s)\n", sf->gprs[8] & PSW_ADDR_INSN); printk("([<%016lx>] %pSR)\n", addr, (void *)addr);
/* Follow the backchain. */ /* Follow the backchain. */
while (1) { while (1) {
low = sp; low = sp;
@ -57,16 +58,16 @@ __show_trace(unsigned long sp, unsigned long low, unsigned long high)
if (sp <= low || sp > high - sizeof(*sf)) if (sp <= low || sp > high - sizeof(*sf))
return sp; return sp;
sf = (struct stack_frame *) sp; sf = (struct stack_frame *) sp;
printk(" [<%016lx>] ", sf->gprs[8] & PSW_ADDR_INSN); addr = sf->gprs[8] & PSW_ADDR_INSN;
print_symbol("%s\n", sf->gprs[8] & PSW_ADDR_INSN); printk(" [<%016lx>] %pSR\n", addr, (void *)addr);
} }
/* Zero backchain detected, check for interrupt frame. */ /* Zero backchain detected, check for interrupt frame. */
sp = (unsigned long) (sf + 1); sp = (unsigned long) (sf + 1);
if (sp <= low || sp > high - sizeof(*regs)) if (sp <= low || sp > high - sizeof(*regs))
return sp; return sp;
regs = (struct pt_regs *) sp; regs = (struct pt_regs *) sp;
printk(" [<%016lx>] ", regs->psw.addr & PSW_ADDR_INSN); addr = regs->psw.addr & PSW_ADDR_INSN;
print_symbol("%s\n", regs->psw.addr & PSW_ADDR_INSN); printk(" [<%016lx>] %pSR\n", addr, (void *)addr);
low = sp; low = sp;
sp = regs->gprs[15]; sp = regs->gprs[15];
} }
@ -128,8 +129,7 @@ static void show_last_breaking_event(struct pt_regs *regs)
{ {
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
printk("Last Breaking-Event-Address:\n"); printk("Last Breaking-Event-Address:\n");
printk(" [<%016lx>] ", regs->args[0] & PSW_ADDR_INSN); printk(" [<%016lx>] %pSR\n", regs->args[0], (void *)regs->args[0]);
print_symbol("%s\n", regs->args[0] & PSW_ADDR_INSN);
#endif #endif
} }
@ -143,10 +143,10 @@ void show_registers(struct pt_regs *regs)
char *mode; char *mode;
mode = user_mode(regs) ? "User" : "Krnl"; mode = user_mode(regs) ? "User" : "Krnl";
printk("%s PSW : %p %p", printk("%s PSW : %p %p (%pSR)\n",
mode, (void *) regs->psw.mask, mode, (void *) regs->psw.mask,
(void *) regs->psw.addr,
(void *) regs->psw.addr); (void *) regs->psw.addr);
print_symbol(" (%s)\n", regs->psw.addr & PSW_ADDR_INSN);
printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x " printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x "
"P:%x AS:%x CC:%x PM:%x", mask_bits(regs, PSW_MASK_PER), "P:%x AS:%x CC:%x PM:%x", mask_bits(regs, PSW_MASK_PER),
mask_bits(regs, PSW_MASK_DAT), mask_bits(regs, PSW_MASK_IO), mask_bits(regs, PSW_MASK_DAT), mask_bits(regs, PSW_MASK_IO),

View File

@ -53,27 +53,21 @@ void handle_signal32(unsigned long sig, struct k_sigaction *ka,
siginfo_t *info, sigset_t *oldset, struct pt_regs *regs); siginfo_t *info, sigset_t *oldset, struct pt_regs *regs);
void do_notify_resume(struct pt_regs *regs); void do_notify_resume(struct pt_regs *regs);
struct ext_code; void __init init_IRQ(void);
void do_extint(struct pt_regs *regs); void do_IRQ(struct pt_regs *regs, int irq);
void do_restart(void); void do_restart(void);
void __init startup_init(void); void __init startup_init(void);
void die(struct pt_regs *regs, const char *str); void die(struct pt_regs *regs, const char *str);
int setup_profiling_timer(unsigned int multiplier);
void __init time_init(void); void __init time_init(void);
int pfn_is_nosave(unsigned long);
void s390_early_resume(void);
unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip);
struct s390_mmap_arg_struct; struct s390_mmap_arg_struct;
struct fadvise64_64_args; struct fadvise64_64_args;
struct old_sigaction; struct old_sigaction;
long sys_mmap2(struct s390_mmap_arg_struct __user *arg);
long sys_s390_ipc(uint call, int first, unsigned long second,
unsigned long third, void __user *ptr);
long sys_s390_personality(unsigned int personality);
long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low,
size_t len, int advice);
long sys_s390_fadvise64_64(struct fadvise64_64_args __user *args);
long sys_s390_fallocate(int fd, int mode, loff_t offset, u32 len_high,
u32 len_low);
long sys_sigreturn(void); long sys_sigreturn(void);
long sys_rt_sigreturn(void); long sys_rt_sigreturn(void);
long sys32_sigreturn(void); long sys32_sigreturn(void);

View File

@ -15,6 +15,7 @@
#include <linux/kprobes.h> #include <linux/kprobes.h>
#include <trace/syscall.h> #include <trace/syscall.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include "entry.h"
#ifdef CONFIG_DYNAMIC_FTRACE #ifdef CONFIG_DYNAMIC_FTRACE
@ -177,7 +178,7 @@ int ftrace_enable_ftrace_graph_caller(void)
offset = ((void *) prepare_ftrace_return - offset = ((void *) prepare_ftrace_return -
(void *) ftrace_graph_caller) / 2; (void *) ftrace_graph_caller) / 2;
return probe_kernel_write(ftrace_graph_caller + 2, return probe_kernel_write((void *) ftrace_graph_caller + 2,
&offset, sizeof(offset)); &offset, sizeof(offset));
} }
@ -185,7 +186,7 @@ int ftrace_disable_ftrace_graph_caller(void)
{ {
static unsigned short offset = 0x0002; static unsigned short offset = 0x0002;
return probe_kernel_write(ftrace_graph_caller + 2, return probe_kernel_write((void *) ftrace_graph_caller + 2,
&offset, sizeof(offset)); &offset, sizeof(offset));
} }

View File

@ -196,21 +196,23 @@ asmlinkage void do_softirq(void)
* ext_int_hash[index] is the list head for all external interrupts that hash * ext_int_hash[index] is the list head for all external interrupts that hash
* to this index. * to this index.
*/ */
static struct list_head ext_int_hash[256]; static struct hlist_head ext_int_hash[32] ____cacheline_aligned;
struct ext_int_info { struct ext_int_info {
ext_int_handler_t handler; ext_int_handler_t handler;
u16 code; struct hlist_node entry;
struct list_head entry;
struct rcu_head rcu; struct rcu_head rcu;
u16 code;
}; };
/* ext_int_hash_lock protects the handler lists for external interrupts */ /* ext_int_hash_lock protects the handler lists for external interrupts */
DEFINE_SPINLOCK(ext_int_hash_lock); static DEFINE_SPINLOCK(ext_int_hash_lock);
static inline int ext_hash(u16 code) static inline int ext_hash(u16 code)
{ {
return (code + (code >> 9)) & 0xff; BUILD_BUG_ON(!is_power_of_2(ARRAY_SIZE(ext_int_hash)));
return (code + (code >> 9)) & (ARRAY_SIZE(ext_int_hash) - 1);
} }
int register_external_interrupt(u16 code, ext_int_handler_t handler) int register_external_interrupt(u16 code, ext_int_handler_t handler)
@ -227,7 +229,7 @@ int register_external_interrupt(u16 code, ext_int_handler_t handler)
index = ext_hash(code); index = ext_hash(code);
spin_lock_irqsave(&ext_int_hash_lock, flags); spin_lock_irqsave(&ext_int_hash_lock, flags);
list_add_rcu(&p->entry, &ext_int_hash[index]); hlist_add_head_rcu(&p->entry, &ext_int_hash[index]);
spin_unlock_irqrestore(&ext_int_hash_lock, flags); spin_unlock_irqrestore(&ext_int_hash_lock, flags);
return 0; return 0;
} }
@ -240,9 +242,9 @@ int unregister_external_interrupt(u16 code, ext_int_handler_t handler)
int index = ext_hash(code); int index = ext_hash(code);
spin_lock_irqsave(&ext_int_hash_lock, flags); spin_lock_irqsave(&ext_int_hash_lock, flags);
list_for_each_entry_rcu(p, &ext_int_hash[index], entry) { hlist_for_each_entry_rcu(p, &ext_int_hash[index], entry) {
if (p->code == code && p->handler == handler) { if (p->code == code && p->handler == handler) {
list_del_rcu(&p->entry); hlist_del_rcu(&p->entry);
kfree_rcu(p, rcu); kfree_rcu(p, rcu);
} }
} }
@ -264,12 +266,12 @@ static irqreturn_t do_ext_interrupt(int irq, void *dummy)
index = ext_hash(ext_code.code); index = ext_hash(ext_code.code);
rcu_read_lock(); rcu_read_lock();
list_for_each_entry_rcu(p, &ext_int_hash[index], entry) hlist_for_each_entry_rcu(p, &ext_int_hash[index], entry) {
if (likely(p->code == ext_code.code)) if (unlikely(p->code != ext_code.code))
p->handler(ext_code, regs->int_parm, continue;
regs->int_parm_long); p->handler(ext_code, regs->int_parm, regs->int_parm_long);
}
rcu_read_unlock(); rcu_read_unlock();
return IRQ_HANDLED; return IRQ_HANDLED;
} }
@ -283,55 +285,32 @@ void __init init_ext_interrupts(void)
int idx; int idx;
for (idx = 0; idx < ARRAY_SIZE(ext_int_hash); idx++) for (idx = 0; idx < ARRAY_SIZE(ext_int_hash); idx++)
INIT_LIST_HEAD(&ext_int_hash[idx]); INIT_HLIST_HEAD(&ext_int_hash[idx]);
irq_set_chip_and_handler(EXT_INTERRUPT, irq_set_chip_and_handler(EXT_INTERRUPT,
&dummy_irq_chip, handle_percpu_irq); &dummy_irq_chip, handle_percpu_irq);
setup_irq(EXT_INTERRUPT, &external_interrupt); setup_irq(EXT_INTERRUPT, &external_interrupt);
} }
static DEFINE_SPINLOCK(sc_irq_lock); static DEFINE_SPINLOCK(irq_subclass_lock);
static int sc_irq_refcount; static unsigned char irq_subclass_refcount[64];
void service_subclass_irq_register(void) void irq_subclass_register(enum irq_subclass subclass)
{ {
spin_lock(&sc_irq_lock); spin_lock(&irq_subclass_lock);
if (!sc_irq_refcount) if (!irq_subclass_refcount[subclass])
ctl_set_bit(0, 9); ctl_set_bit(0, subclass);
sc_irq_refcount++; irq_subclass_refcount[subclass]++;
spin_unlock(&sc_irq_lock); spin_unlock(&irq_subclass_lock);
} }
EXPORT_SYMBOL(service_subclass_irq_register); EXPORT_SYMBOL(irq_subclass_register);
void service_subclass_irq_unregister(void) void irq_subclass_unregister(enum irq_subclass subclass)
{ {
spin_lock(&sc_irq_lock); spin_lock(&irq_subclass_lock);
sc_irq_refcount--; irq_subclass_refcount[subclass]--;
if (!sc_irq_refcount) if (!irq_subclass_refcount[subclass])
ctl_clear_bit(0, 9); ctl_clear_bit(0, subclass);
spin_unlock(&sc_irq_lock); spin_unlock(&irq_subclass_lock);
} }
EXPORT_SYMBOL(service_subclass_irq_unregister); EXPORT_SYMBOL(irq_subclass_unregister);
static DEFINE_SPINLOCK(ma_subclass_lock);
static int ma_subclass_refcount;
void measurement_alert_subclass_register(void)
{
spin_lock(&ma_subclass_lock);
if (!ma_subclass_refcount)
ctl_set_bit(0, 5);
ma_subclass_refcount++;
spin_unlock(&ma_subclass_lock);
}
EXPORT_SYMBOL(measurement_alert_subclass_register);
void measurement_alert_subclass_unregister(void)
{
spin_lock(&ma_subclass_lock);
ma_subclass_refcount--;
if (!ma_subclass_refcount)
ctl_clear_bit(0, 5);
spin_unlock(&ma_subclass_lock);
}
EXPORT_SYMBOL(measurement_alert_subclass_unregister);

View File

@ -50,7 +50,7 @@ static void add_elf_notes(int cpu)
/* /*
* Initialize CPU ELF notes * Initialize CPU ELF notes
*/ */
void setup_regs(void) static void setup_regs(void)
{ {
unsigned long sa = S390_lowcore.prefixreg_save_area + SAVE_AREA_BASE; unsigned long sa = S390_lowcore.prefixreg_save_area + SAVE_AREA_BASE;
int cpu, this_cpu; int cpu, this_cpu;

View File

@ -274,7 +274,7 @@ static int reserve_pmc_hardware(void)
int flags = PMC_INIT; int flags = PMC_INIT;
on_each_cpu(setup_pmc_cpu, &flags, 1); on_each_cpu(setup_pmc_cpu, &flags, 1);
measurement_alert_subclass_register(); irq_subclass_register(IRQ_SUBCLASS_MEASUREMENT_ALERT);
return 0; return 0;
} }
@ -285,7 +285,7 @@ static void release_pmc_hardware(void)
int flags = PMC_RELEASE; int flags = PMC_RELEASE;
on_each_cpu(setup_pmc_cpu, &flags, 1); on_each_cpu(setup_pmc_cpu, &flags, 1);
measurement_alert_subclass_unregister(); irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT);
} }
/* Release the PMU if event is the last perf event */ /* Release the PMU if event is the last perf event */

View File

@ -105,13 +105,10 @@ void perf_event_print_debug(void)
cpu = smp_processor_id(); cpu = smp_processor_id();
memset(&cf_info, 0, sizeof(cf_info)); memset(&cf_info, 0, sizeof(cf_info));
if (!qctri(&cf_info)) { if (!qctri(&cf_info))
pr_info("CPU[%i] CPUM_CF: ver=%u.%u A=%04x E=%04x C=%04x\n", pr_info("CPU[%i] CPUM_CF: ver=%u.%u A=%04x E=%04x C=%04x\n",
cpu, cf_info.cfvn, cf_info.csvn, cpu, cf_info.cfvn, cf_info.csvn,
cf_info.auth_ctl, cf_info.enable_ctl, cf_info.act_ctl); cf_info.auth_ctl, cf_info.enable_ctl, cf_info.act_ctl);
print_hex_dump_bytes("CPUMF Query: ", DUMP_PREFIX_OFFSET,
&cf_info, sizeof(cf_info));
}
local_irq_restore(flags); local_irq_restore(flags);
} }

View File

@ -139,10 +139,10 @@ static int __init runtime_instr_init(void)
if (!runtime_instr_avail()) if (!runtime_instr_avail())
return 0; return 0;
measurement_alert_subclass_register(); irq_subclass_register(IRQ_SUBCLASS_MEASUREMENT_ALERT);
rc = register_external_interrupt(0x1407, runtime_instr_int_handler); rc = register_external_interrupt(0x1407, runtime_instr_int_handler);
if (rc) if (rc)
measurement_alert_subclass_unregister(); irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT);
else else
pr_info("Runtime instrumentation facility initialized\n"); pr_info("Runtime instrumentation facility initialized\n");
return rc; return rc;

View File

@ -362,7 +362,7 @@ void smp_yield_cpu(int cpu)
* Send cpus emergency shutdown signal. This gives the cpus the * Send cpus emergency shutdown signal. This gives the cpus the
* opportunity to complete outstanding interrupts. * opportunity to complete outstanding interrupts.
*/ */
void smp_emergency_stop(cpumask_t *cpumask) static void smp_emergency_stop(cpumask_t *cpumask)
{ {
u64 end; u64 end;
int cpu; int cpu;

View File

@ -13,6 +13,7 @@
#include <asm/ipl.h> #include <asm/ipl.h>
#include <asm/cio.h> #include <asm/cio.h>
#include <asm/pci.h> #include <asm/pci.h>
#include "entry.h"
/* /*
* References to section boundaries * References to section boundaries

View File

@ -673,7 +673,7 @@ static int __init pfault_irq_init(void)
rc = pfault_init() == 0 ? 0 : -EOPNOTSUPP; rc = pfault_init() == 0 ? 0 : -EOPNOTSUPP;
if (rc) if (rc)
goto out_pfault; goto out_pfault;
service_subclass_irq_register(); irq_subclass_register(IRQ_SUBCLASS_SERVICE_SIGNAL);
hotcpu_notifier(pfault_cpu_notify, 0); hotcpu_notifier(pfault_cpu_notify, 0);
return 0; return 0;

View File

@ -14,6 +14,7 @@
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <asm/ctl_reg.h> #include <asm/ctl_reg.h>
#include <asm/io.h>
/* /*
* This function writes to kernel memory bypassing DAT and possible * This function writes to kernel memory bypassing DAT and possible

View File

@ -246,6 +246,8 @@ EXPORT_SYMBOL_GPL(gmap_disable);
*/ */
static int gmap_alloc_table(struct gmap *gmap, static int gmap_alloc_table(struct gmap *gmap,
unsigned long *table, unsigned long init) unsigned long *table, unsigned long init)
__releases(&gmap->mm->page_table_lock)
__acquires(&gmap->mm->page_table_lock)
{ {
struct page *page; struct page *page;
unsigned long *new; unsigned long *new;
@ -966,7 +968,7 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table)
tlb_remove_table(tlb, table); tlb_remove_table(tlb, table);
} }
void __tlb_remove_table(void *_table) static void __tlb_remove_table(void *_table)
{ {
const unsigned long mask = (FRAG_MASK << 4) | FRAG_MASK; const unsigned long mask = (FRAG_MASK << 4) | FRAG_MASK;
void *table = (void *)((unsigned long) _table & ~mask); void *table = (void *)((unsigned long) _table & ~mask);

View File

@ -805,7 +805,7 @@ static struct bpf_binary_header *bpf_alloc_binary(unsigned int bpfsize,
return NULL; return NULL;
memset(header, 0, sz); memset(header, 0, sz);
header->pages = sz / PAGE_SIZE; header->pages = sz / PAGE_SIZE;
hole = sz - bpfsize + sizeof(*header); hole = sz - (bpfsize + sizeof(*header));
/* Insert random number of illegal instructions before BPF code /* Insert random number of illegal instructions before BPF code
* and make sure the first instruction starts at an even address. * and make sure the first instruction starts at an even address.
*/ */

View File

@ -1001,7 +1001,7 @@ int hwsampler_deallocate(void)
if (hws_state != HWS_STOPPED) if (hws_state != HWS_STOPPED)
goto deallocate_exit; goto deallocate_exit;
measurement_alert_subclass_unregister(); irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT);
deallocate_sdbt(); deallocate_sdbt();
hws_state = HWS_DEALLOCATED; hws_state = HWS_DEALLOCATED;
@ -1115,7 +1115,7 @@ int hwsampler_shutdown(void)
mutex_lock(&hws_sem); mutex_lock(&hws_sem);
if (hws_state == HWS_STOPPED) { if (hws_state == HWS_STOPPED) {
measurement_alert_subclass_unregister(); irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT);
deallocate_sdbt(); deallocate_sdbt();
} }
if (hws_wq) { if (hws_wq) {
@ -1190,7 +1190,7 @@ int hwsampler_start_all(unsigned long rate)
hws_oom = 1; hws_oom = 1;
hws_flush_all = 0; hws_flush_all = 0;
/* now let them in, 1407 CPUMF external interrupts */ /* now let them in, 1407 CPUMF external interrupts */
measurement_alert_subclass_register(); irq_subclass_register(IRQ_SUBCLASS_MEASUREMENT_ALERT);
return 0; return 0;
} }

View File

@ -645,7 +645,7 @@ dasd_diag_init(void)
} }
ASCEBC(dasd_diag_discipline.ebcname, 4); ASCEBC(dasd_diag_discipline.ebcname, 4);
service_subclass_irq_register(); irq_subclass_register(IRQ_SUBCLASS_SERVICE_SIGNAL);
register_external_interrupt(0x2603, dasd_ext_handler); register_external_interrupt(0x2603, dasd_ext_handler);
dasd_diag_discipline_pointer = &dasd_diag_discipline; dasd_diag_discipline_pointer = &dasd_diag_discipline;
return 0; return 0;
@ -655,7 +655,7 @@ static void __exit
dasd_diag_cleanup(void) dasd_diag_cleanup(void)
{ {
unregister_external_interrupt(0x2603, dasd_ext_handler); unregister_external_interrupt(0x2603, dasd_ext_handler);
service_subclass_irq_unregister(); irq_subclass_unregister(IRQ_SUBCLASS_SERVICE_SIGNAL);
dasd_diag_discipline_pointer = NULL; dasd_diag_discipline_pointer = NULL;
} }

View File

@ -524,20 +524,20 @@ static const struct file_operations fs3270_fops = {
.llseek = no_llseek, .llseek = no_llseek,
}; };
void fs3270_create_cb(int minor) static void fs3270_create_cb(int minor)
{ {
__register_chrdev(IBM_FS3270_MAJOR, minor, 1, "tub", &fs3270_fops); __register_chrdev(IBM_FS3270_MAJOR, minor, 1, "tub", &fs3270_fops);
device_create(class3270, NULL, MKDEV(IBM_FS3270_MAJOR, minor), device_create(class3270, NULL, MKDEV(IBM_FS3270_MAJOR, minor),
NULL, "3270/tub%d", minor); NULL, "3270/tub%d", minor);
} }
void fs3270_destroy_cb(int minor) static void fs3270_destroy_cb(int minor)
{ {
device_destroy(class3270, MKDEV(IBM_FS3270_MAJOR, minor)); device_destroy(class3270, MKDEV(IBM_FS3270_MAJOR, minor));
__unregister_chrdev(IBM_FS3270_MAJOR, minor, 1, "tub"); __unregister_chrdev(IBM_FS3270_MAJOR, minor, 1, "tub");
} }
struct raw3270_notifier fs3270_notifier = static struct raw3270_notifier fs3270_notifier =
{ {
.create = fs3270_create_cb, .create = fs3270_create_cb,
.destroy = fs3270_destroy_cb, .destroy = fs3270_destroy_cb,

View File

@ -910,12 +910,12 @@ sclp_check_interface(void)
spin_unlock_irqrestore(&sclp_lock, flags); spin_unlock_irqrestore(&sclp_lock, flags);
/* Enable service-signal interruption - needs to happen /* Enable service-signal interruption - needs to happen
* with IRQs enabled. */ * with IRQs enabled. */
service_subclass_irq_register(); irq_subclass_register(IRQ_SUBCLASS_SERVICE_SIGNAL);
/* Wait for signal from interrupt or timeout */ /* Wait for signal from interrupt or timeout */
sclp_sync_wait(); sclp_sync_wait();
/* Disable service-signal interruption - needs to happen /* Disable service-signal interruption - needs to happen
* with IRQs enabled. */ * with IRQs enabled. */
service_subclass_irq_unregister(); irq_subclass_unregister(IRQ_SUBCLASS_SERVICE_SIGNAL);
spin_lock_irqsave(&sclp_lock, flags); spin_lock_irqsave(&sclp_lock, flags);
del_timer(&sclp_request_timer); del_timer(&sclp_request_timer);
if (sclp_init_req.status == SCLP_REQ_DONE && if (sclp_init_req.status == SCLP_REQ_DONE &&
@ -1131,7 +1131,7 @@ sclp_init(void)
spin_unlock_irqrestore(&sclp_lock, flags); spin_unlock_irqrestore(&sclp_lock, flags);
/* Enable service-signal external interruption - needs to happen with /* Enable service-signal external interruption - needs to happen with
* IRQs enabled. */ * IRQs enabled. */
service_subclass_irq_register(); irq_subclass_register(IRQ_SUBCLASS_SERVICE_SIGNAL);
sclp_init_mask(1); sclp_init_mask(1);
return 0; return 0;

View File

@ -1845,17 +1845,17 @@ static const struct tty_operations tty3270_ops = {
.set_termios = tty3270_set_termios .set_termios = tty3270_set_termios
}; };
void tty3270_create_cb(int minor) static void tty3270_create_cb(int minor)
{ {
tty_register_device(tty3270_driver, minor - RAW3270_FIRSTMINOR, NULL); tty_register_device(tty3270_driver, minor - RAW3270_FIRSTMINOR, NULL);
} }
void tty3270_destroy_cb(int minor) static void tty3270_destroy_cb(int minor)
{ {
tty_unregister_device(tty3270_driver, minor - RAW3270_FIRSTMINOR); tty_unregister_device(tty3270_driver, minor - RAW3270_FIRSTMINOR);
} }
struct raw3270_notifier tty3270_notifier = static struct raw3270_notifier tty3270_notifier =
{ {
.create = tty3270_create_cb, .create = tty3270_create_cb,
.destroy = tty3270_destroy_cb, .destroy = tty3270_destroy_cb,

View File

@ -413,7 +413,7 @@ __ap_send(ap_qid_t qid, unsigned long long psmid, void *msg, size_t length,
register unsigned long reg2 asm ("2") = (unsigned long) msg; register unsigned long reg2 asm ("2") = (unsigned long) msg;
register unsigned long reg3 asm ("3") = (unsigned long) length; register unsigned long reg3 asm ("3") = (unsigned long) length;
register unsigned long reg4 asm ("4") = (unsigned int) (psmid >> 32); register unsigned long reg4 asm ("4") = (unsigned int) (psmid >> 32);
register unsigned long reg5 asm ("5") = (unsigned int) psmid; register unsigned long reg5 asm ("5") = psmid & 0xffffffff;
if (special == 1) if (special == 1)
reg0 |= 0x400000UL; reg0 |= 0x400000UL;

View File

@ -472,7 +472,7 @@ static int __init kvm_devices_init(void)
INIT_WORK(&hotplug_work, hotplug_devices); INIT_WORK(&hotplug_work, hotplug_devices);
service_subclass_irq_register(); irq_subclass_register(IRQ_SUBCLASS_SERVICE_SIGNAL);
register_external_interrupt(0x2603, kvm_extint_handler); register_external_interrupt(0x2603, kvm_extint_handler);
scan_devices(); scan_devices();