Skip to content

Commit

Permalink
[S390] fix loading of PER control registers for utrace.
Browse files Browse the repository at this point in the history
If the current task enables / disables PER tracing for itself the
PER control registers need to be loaded in FixPerRegisters.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Martin Schwidefsky authored and Martin Schwidefsky committed Jan 13, 2010
1 parent 7284ce6 commit c3311c1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/s390/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ FixPerRegisters(struct task_struct *task)
{
struct pt_regs *regs;
per_struct *per_info;
per_cr_words cr_words;

regs = task_pt_regs(task);
per_info = (per_struct *) &task->thread.per_info;
Expand Down Expand Up @@ -98,6 +99,13 @@ FixPerRegisters(struct task_struct *task)
per_info->control_regs.bits.storage_alt_space_ctl = 1;
else
per_info->control_regs.bits.storage_alt_space_ctl = 0;

if (task == current) {
__ctl_store(cr_words, 9, 11);
if (memcmp(&cr_words, &per_info->control_regs.words,
sizeof(cr_words)) != 0)
__ctl_load(per_info->control_regs.words, 9, 11);
}
}

void user_enable_single_step(struct task_struct *task)
Expand Down

0 comments on commit c3311c1

Please sign in to comment.