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

Commit 7490daf0 authored by Martin Schwidefsky's avatar Martin Schwidefsky
Browse files

s390/ptrace: always include vector registers in core files



On machines with support for vector registers the signal frame includes
an area for the vector registers and the ptrace regset interface allow
read and write. This is true even if the task never used any vector
instruction. Only elf core dumps do not include the vector registers,
to make things consistent always include the vector register note in
core dumps create on a machine with vector register support.

Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 4b4ee3ee
Loading
Loading
Loading
Loading
+8 −10
Original line number Original line Diff line number Diff line
@@ -1091,12 +1091,6 @@ static int s390_tdb_set(struct task_struct *target,
	return 0;
	return 0;
}
}


static int s390_vxrs_active(struct task_struct *target,
			      const struct user_regset *regset)
{
	return !!target->thread.vxrs;
}

static int s390_vxrs_low_get(struct task_struct *target,
static int s390_vxrs_low_get(struct task_struct *target,
			     const struct user_regset *regset,
			     const struct user_regset *regset,
			     unsigned int pos, unsigned int count,
			     unsigned int pos, unsigned int count,
@@ -1105,6 +1099,8 @@ static int s390_vxrs_low_get(struct task_struct *target,
	__u64 vxrs[__NUM_VXRS_LOW];
	__u64 vxrs[__NUM_VXRS_LOW];
	int i;
	int i;


	if (!MACHINE_HAS_VX)
		return -ENODEV;
	if (target->thread.vxrs) {
	if (target->thread.vxrs) {
		if (target == current)
		if (target == current)
			save_vx_regs(target->thread.vxrs);
			save_vx_regs(target->thread.vxrs);
@@ -1123,6 +1119,8 @@ static int s390_vxrs_low_set(struct task_struct *target,
	__u64 vxrs[__NUM_VXRS_LOW];
	__u64 vxrs[__NUM_VXRS_LOW];
	int i, rc;
	int i, rc;


	if (!MACHINE_HAS_VX)
		return -ENODEV;
	if (!target->thread.vxrs) {
	if (!target->thread.vxrs) {
		rc = alloc_vector_registers(target);
		rc = alloc_vector_registers(target);
		if (rc)
		if (rc)
@@ -1148,6 +1146,8 @@ static int s390_vxrs_high_get(struct task_struct *target,
{
{
	__vector128 vxrs[__NUM_VXRS_HIGH];
	__vector128 vxrs[__NUM_VXRS_HIGH];


	if (!MACHINE_HAS_VX)
		return -ENODEV;
	if (target->thread.vxrs) {
	if (target->thread.vxrs) {
		if (target == current)
		if (target == current)
			save_vx_regs(target->thread.vxrs);
			save_vx_regs(target->thread.vxrs);
@@ -1165,6 +1165,8 @@ static int s390_vxrs_high_set(struct task_struct *target,
{
{
	int rc;
	int rc;


	if (!MACHINE_HAS_VX)
		return -ENODEV;
	if (!target->thread.vxrs) {
	if (!target->thread.vxrs) {
		rc = alloc_vector_registers(target);
		rc = alloc_vector_registers(target);
		if (rc)
		if (rc)
@@ -1249,7 +1251,6 @@ static const struct user_regset s390_regsets[] = {
		.n = __NUM_VXRS_LOW,
		.n = __NUM_VXRS_LOW,
		.size = sizeof(__u64),
		.size = sizeof(__u64),
		.align = sizeof(__u64),
		.align = sizeof(__u64),
		.active = s390_vxrs_active,
		.get = s390_vxrs_low_get,
		.get = s390_vxrs_low_get,
		.set = s390_vxrs_low_set,
		.set = s390_vxrs_low_set,
	},
	},
@@ -1258,7 +1259,6 @@ static const struct user_regset s390_regsets[] = {
		.n = __NUM_VXRS_HIGH,
		.n = __NUM_VXRS_HIGH,
		.size = sizeof(__vector128),
		.size = sizeof(__vector128),
		.align = sizeof(__vector128),
		.align = sizeof(__vector128),
		.active = s390_vxrs_active,
		.get = s390_vxrs_high_get,
		.get = s390_vxrs_high_get,
		.set = s390_vxrs_high_set,
		.set = s390_vxrs_high_set,
	},
	},
@@ -1472,7 +1472,6 @@ static const struct user_regset s390_compat_regsets[] = {
		.n = __NUM_VXRS_LOW,
		.n = __NUM_VXRS_LOW,
		.size = sizeof(__u64),
		.size = sizeof(__u64),
		.align = sizeof(__u64),
		.align = sizeof(__u64),
		.active = s390_vxrs_active,
		.get = s390_vxrs_low_get,
		.get = s390_vxrs_low_get,
		.set = s390_vxrs_low_set,
		.set = s390_vxrs_low_set,
	},
	},
@@ -1481,7 +1480,6 @@ static const struct user_regset s390_compat_regsets[] = {
		.n = __NUM_VXRS_HIGH,
		.n = __NUM_VXRS_HIGH,
		.size = sizeof(__vector128),
		.size = sizeof(__vector128),
		.align = sizeof(__vector128),
		.align = sizeof(__vector128),
		.active = s390_vxrs_active,
		.get = s390_vxrs_high_get,
		.get = s390_vxrs_high_get,
		.set = s390_vxrs_high_set,
		.set = s390_vxrs_high_set,
	},
	},