s390/ptrace: guarded storage regset for the current task
The regset functions for guarded storage are supposed to work on the current task as well. For task == current add the required load and store instructions for the guarded storage control block. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
53d7f25f09
commit
f5bbd72198
@ -1160,6 +1160,8 @@ static int s390_gs_cb_get(struct task_struct *target,
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
if (!data)
|
if (!data)
|
||||||
return -ENODATA;
|
return -ENODATA;
|
||||||
|
if (target == current)
|
||||||
|
save_gs_cb(data);
|
||||||
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
|
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
|
||||||
data, 0, sizeof(struct gs_cb));
|
data, 0, sizeof(struct gs_cb));
|
||||||
}
|
}
|
||||||
@ -1170,6 +1172,7 @@ static int s390_gs_cb_set(struct task_struct *target,
|
|||||||
const void *kbuf, const void __user *ubuf)
|
const void *kbuf, const void __user *ubuf)
|
||||||
{
|
{
|
||||||
struct gs_cb *data = target->thread.gs_cb;
|
struct gs_cb *data = target->thread.gs_cb;
|
||||||
|
int rc;
|
||||||
|
|
||||||
if (!MACHINE_HAS_GS)
|
if (!MACHINE_HAS_GS)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@ -1177,10 +1180,18 @@ static int s390_gs_cb_set(struct task_struct *target,
|
|||||||
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
||||||
if (!data)
|
if (!data)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
data->gsd = 25;
|
||||||
target->thread.gs_cb = data;
|
target->thread.gs_cb = data;
|
||||||
|
if (target == current)
|
||||||
|
__ctl_set_bit(2, 4);
|
||||||
|
} else if (target == current) {
|
||||||
|
save_gs_cb(data);
|
||||||
}
|
}
|
||||||
return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
|
rc = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
|
||||||
data, 0, sizeof(struct gs_cb));
|
data, 0, sizeof(struct gs_cb));
|
||||||
|
if (target == current)
|
||||||
|
restore_gs_cb(data);
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int s390_gs_bc_get(struct task_struct *target,
|
static int s390_gs_bc_get(struct task_struct *target,
|
||||||
|
Loading…
Reference in New Issue
Block a user