aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/kernel/ptrace.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 9eed6bb5c4a9..eabfb4594517 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -1091,12 +1091,6 @@ static int s390_tdb_set(struct task_struct *target,
1091 return 0; 1091 return 0;
1092} 1092}
1093 1093
1094static int s390_vxrs_active(struct task_struct *target,
1095 const struct user_regset *regset)
1096{
1097 return !!target->thread.vxrs;
1098}
1099
1100static int s390_vxrs_low_get(struct task_struct *target, 1094static int s390_vxrs_low_get(struct task_struct *target,
1101 const struct user_regset *regset, 1095 const struct user_regset *regset,
1102 unsigned int pos, unsigned int count, 1096 unsigned int pos, unsigned int count,
@@ -1105,6 +1099,8 @@ static int s390_vxrs_low_get(struct task_struct *target,
1105 __u64 vxrs[__NUM_VXRS_LOW]; 1099 __u64 vxrs[__NUM_VXRS_LOW];
1106 int i; 1100 int i;
1107 1101
1102 if (!MACHINE_HAS_VX)
1103 return -ENODEV;
1108 if (target->thread.vxrs) { 1104 if (target->thread.vxrs) {
1109 if (target == current) 1105 if (target == current)
1110 save_vx_regs(target->thread.vxrs); 1106 save_vx_regs(target->thread.vxrs);
@@ -1123,6 +1119,8 @@ static int s390_vxrs_low_set(struct task_struct *target,
1123 __u64 vxrs[__NUM_VXRS_LOW]; 1119 __u64 vxrs[__NUM_VXRS_LOW];
1124 int i, rc; 1120 int i, rc;
1125 1121
1122 if (!MACHINE_HAS_VX)
1123 return -ENODEV;
1126 if (!target->thread.vxrs) { 1124 if (!target->thread.vxrs) {
1127 rc = alloc_vector_registers(target); 1125 rc = alloc_vector_registers(target);
1128 if (rc) 1126 if (rc)
@@ -1148,6 +1146,8 @@ static int s390_vxrs_high_get(struct task_struct *target,
1148{ 1146{
1149 __vector128 vxrs[__NUM_VXRS_HIGH]; 1147 __vector128 vxrs[__NUM_VXRS_HIGH];
1150 1148
1149 if (!MACHINE_HAS_VX)
1150 return -ENODEV;
1151 if (target->thread.vxrs) { 1151 if (target->thread.vxrs) {
1152 if (target == current) 1152 if (target == current)
1153 save_vx_regs(target->thread.vxrs); 1153 save_vx_regs(target->thread.vxrs);
@@ -1165,6 +1165,8 @@ static int s390_vxrs_high_set(struct task_struct *target,
1165{ 1165{
1166 int rc; 1166 int rc;
1167 1167
1168 if (!MACHINE_HAS_VX)
1169 return -ENODEV;
1168 if (!target->thread.vxrs) { 1170 if (!target->thread.vxrs) {
1169 rc = alloc_vector_registers(target); 1171 rc = alloc_vector_registers(target);
1170 if (rc) 1172 if (rc)
@@ -1249,7 +1251,6 @@ static const struct user_regset s390_regsets[] = {
1249 .n = __NUM_VXRS_LOW, 1251 .n = __NUM_VXRS_LOW,
1250 .size = sizeof(__u64), 1252 .size = sizeof(__u64),
1251 .align = sizeof(__u64), 1253 .align = sizeof(__u64),
1252 .active = s390_vxrs_active,
1253 .get = s390_vxrs_low_get, 1254 .get = s390_vxrs_low_get,
1254 .set = s390_vxrs_low_set, 1255 .set = s390_vxrs_low_set,
1255 }, 1256 },
@@ -1258,7 +1259,6 @@ static const struct user_regset s390_regsets[] = {
1258 .n = __NUM_VXRS_HIGH, 1259 .n = __NUM_VXRS_HIGH,
1259 .size = sizeof(__vector128), 1260 .size = sizeof(__vector128),
1260 .align = sizeof(__vector128), 1261 .align = sizeof(__vector128),
1261 .active = s390_vxrs_active,
1262 .get = s390_vxrs_high_get, 1262 .get = s390_vxrs_high_get,
1263 .set = s390_vxrs_high_set, 1263 .set = s390_vxrs_high_set,
1264 }, 1264 },
@@ -1472,7 +1472,6 @@ static const struct user_regset s390_compat_regsets[] = {
1472 .n = __NUM_VXRS_LOW, 1472 .n = __NUM_VXRS_LOW,
1473 .size = sizeof(__u64), 1473 .size = sizeof(__u64),
1474 .align = sizeof(__u64), 1474 .align = sizeof(__u64),
1475 .active = s390_vxrs_active,
1476 .get = s390_vxrs_low_get, 1475 .get = s390_vxrs_low_get,
1477 .set = s390_vxrs_low_set, 1476 .set = s390_vxrs_low_set,
1478 }, 1477 },
@@ -1481,7 +1480,6 @@ static const struct user_regset s390_compat_regsets[] = {
1481 .n = __NUM_VXRS_HIGH, 1480 .n = __NUM_VXRS_HIGH,
1482 .size = sizeof(__vector128), 1481 .size = sizeof(__vector128),
1483 .align = sizeof(__vector128), 1482 .align = sizeof(__vector128),
1484 .active = s390_vxrs_active,
1485 .get = s390_vxrs_high_get, 1483 .get = s390_vxrs_high_get,
1486 .set = s390_vxrs_high_set, 1484 .set = s390_vxrs_high_set,
1487 }, 1485 },