Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b6b38b0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull s390 fixes from Martin Schwidefsky:

 - convert the debug feature to refcount_t

 - reduce the copy size for strncpy_from_user

 - 8 bug fixes

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/virtio: change virtio_feature_desc:features type to __le32
  s390: convert debug_info.ref_count from atomic_t to refcount_t
  s390: move _text symbol to address higher than zero
  s390/qdio: increase string buffer size
  s390/ccwgroup: increase string buffer size
  s390/topology: let topology_mnest_limit() return unsigned char
  s390/uaccess: use sane length for __strncpy_from_user()
  s390/uprobes: fix compile for !KPROBES
  s390/ftrace: fix compile for !MODULES
  s390/cputime: fix incorrect system time
parents bec6cd63 fb317002
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include <linux/spinlock.h>
#include <linux/kernel.h>
#include <linux/time.h>
#include <linux/refcount.h>
#include <uapi/asm/debug.h>

#define DEBUG_MAX_LEVEL            6  /* debug levels range from 0 to 6 */
@@ -31,7 +32,7 @@ struct debug_view;
typedef struct debug_info {	
	struct debug_info* next;
	struct debug_info* prev;
	atomic_t ref_count;
	refcount_t ref_count;
	spinlock_t lock;			
	int level;
	int nr_areas;
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ static inline int insn_length(unsigned char code)
	return ((((int) code + 64) >> 7) + 1) << 1;
}

struct pt_regs;

void show_code(struct pt_regs *regs);
void print_fn_code(unsigned char *code, unsigned long len);
int insn_to_mnemonic(unsigned char *instruction, char *buf, unsigned int len);
+10 −10
Original line number Diff line number Diff line
@@ -27,12 +27,21 @@
 * 2005-Dec	Used as a template for s390 by Mike Grundy
 *		<grundym@us.ibm.com>
 */
#include <linux/types.h>
#include <asm-generic/kprobes.h>

#define BREAKPOINT_INSTRUCTION	0x0002

#define FIXUP_PSW_NORMAL	0x08
#define FIXUP_BRANCH_NOT_TAKEN	0x04
#define FIXUP_RETURN_REGISTER	0x02
#define FIXUP_NOT_REQUIRED	0x01

int probe_is_prohibited_opcode(u16 *insn);
int probe_get_fixup_type(u16 *insn);
int probe_is_insn_relative_long(u16 *insn);

#ifdef CONFIG_KPROBES
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/percpu.h>
#include <linux/sched/task_stack.h>
@@ -56,11 +65,6 @@ typedef u16 kprobe_opcode_t;

#define KPROBE_SWAP_INST	0x10

#define FIXUP_PSW_NORMAL	0x08
#define FIXUP_BRANCH_NOT_TAKEN	0x04
#define FIXUP_RETURN_REGISTER	0x02
#define FIXUP_NOT_REQUIRED	0x01

/* Architecture specific copy of original instruction */
struct arch_specific_insn {
	/* copy of original instruction */
@@ -90,10 +94,6 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
int kprobe_exceptions_notify(struct notifier_block *self,
	unsigned long val, void *data);

int probe_is_prohibited_opcode(u16 *insn);
int probe_get_fixup_type(u16 *insn);
int probe_is_insn_relative_long(u16 *insn);

#define flush_insn_slot(p)	do { } while (0)

#endif /* CONFIG_KPROBES */
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ extern int topology_max_mnest;
 * Returns the maximum nesting level supported by the cpu topology code.
 * The current maximum level is 4 which is the drawer level.
 */
static inline int topology_mnest_limit(void)
static inline unsigned char topology_mnest_limit(void)
{
	return min(topology_max_mnest, 4);
}
+4 −4
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ debug_info_alloc(const char *name, int pages_per_area, int nr_areas,
	memset(rc->views, 0, DEBUG_MAX_VIEWS * sizeof(struct debug_view *));
	memset(rc->debugfs_entries, 0 ,DEBUG_MAX_VIEWS *
		sizeof(struct dentry*));
	atomic_set(&(rc->ref_count), 0);
	refcount_set(&(rc->ref_count), 0);

	return rc;

@@ -361,7 +361,7 @@ debug_info_create(const char *name, int pages_per_area, int nr_areas,
        debug_area_last = rc;
        rc->next = NULL;

	debug_info_get(rc);
	refcount_set(&rc->ref_count, 1);
out:
	return rc;
}
@@ -416,7 +416,7 @@ static void
debug_info_get(debug_info_t * db_info)
{
	if (db_info)
		atomic_inc(&db_info->ref_count);
		refcount_inc(&db_info->ref_count);
}

/*
@@ -431,7 +431,7 @@ debug_info_put(debug_info_t *db_info)

	if (!db_info)
		return;
	if (atomic_dec_and_test(&db_info->ref_count)) {
	if (refcount_dec_and_test(&db_info->ref_count)) {
		for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
			if (!db_info->views[i])
				continue;
Loading