Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274739
b: refs/heads/master
c: 61f4218
h: refs/heads/master
i:
  274737: b9648b3
  274735: cfd4614
v: v3
  • Loading branch information
Jeremy Fitzhardinge committed Oct 25, 2011
1 parent 445a9cc commit 11f8a9a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 20284aa77c0f6227da4783a920b72dc61d4bcc09
refs/heads/master: 61f42183fd15d5e666236f474d73b3555c7b83d1
51 changes: 31 additions & 20 deletions trunk/arch/s390/kernel/jump_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,15 @@ struct insn {
} __packed;

struct insn_args {
unsigned long *target;
struct insn *insn;
ssize_t size;
struct jump_entry *entry;
enum jump_label_type type;
};

static int __arch_jump_label_transform(void *data)
static void __jump_label_transform(struct jump_entry *entry,
enum jump_label_type type)
{
struct insn_args *args = data;
int rc;

rc = probe_kernel_write(args->target, args->insn, args->size);
WARN_ON_ONCE(rc < 0);
return 0;
}

void arch_jump_label_transform(struct jump_entry *entry,
enum jump_label_type type)
{
struct insn_args args;
struct insn insn;
int rc;

if (type == JUMP_LABEL_ENABLE) {
/* brcl 15,offset */
Expand All @@ -49,11 +38,33 @@ void arch_jump_label_transform(struct jump_entry *entry,
insn.offset = 0;
}

args.target = (void *) entry->code;
args.insn = &insn;
args.size = JUMP_LABEL_NOP_SIZE;
rc = probe_kernel_write((void *)entry->code, &insn, JUMP_LABEL_NOP_SIZE);
WARN_ON_ONCE(rc < 0);
}

stop_machine(__arch_jump_label_transform, &args, NULL);
static int __sm_arch_jump_label_transform(void *data)
{
struct insn_args *args = data;

__jump_label_transform(args->entry, args->type);
return 0;
}

void arch_jump_label_transform(struct jump_entry *entry,
enum jump_label_type type)
{
struct insn_args args;

args.entry = entry;
args.type = type;

stop_machine(__sm_arch_jump_label_transform, &args, NULL);
}

void arch_jump_label_transform_static(struct jump_entry *entry,
enum jump_label_type type)
{
__jump_label_transform(entry, type);
}

#endif

0 comments on commit 11f8a9a

Please sign in to comment.