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

Commit a62bc073 authored by Michael Holzheu's avatar Michael Holzheu Committed by Martin Schwidefsky
Browse files

s390/kdump: add support for vector extension



With this patch for kdump the s390 vector registers are stored into the
prepared save areas in the old kernel and into the REGSET_VX_LOW and
REGSET_VX_HIGH ELF notes for /proc/vmcore in the new kernel.

The NT_S390_VXRS_LOW note contains the lower halves of the first 16 vector
registers 0-15. The higher halves are stored in the floating point register
ELF note.  The NT_S390_VXRS_HIGH contains the full vector registers 16-31.

The kernel provides a save area for storing vector register in case of
machine checks. A pointer to this save are is stored in the CPU lowcore
at offset 0x11b0. This save area is also used to save the registers for
kdump. In case of a dumped crashed kdump those areas are used to extract
the registers of the production system.

The vector registers for remote CPUs are stored using the "store additional
status at address" SIGP. For the dump CPU the vector registers are stored
with the VSTM instruction.

With this patch also zfcpdump stores the vector registers.

Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 3585cb02
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -226,6 +226,6 @@ int arch_setup_additional_pages(struct linux_binprm *, int);
extern unsigned long arch_randomize_brk(struct mm_struct *mm);
#define arch_randomize_brk arch_randomize_brk

void *fill_cpu_elf_notes(void *ptr, struct save_area *sa);
void *fill_cpu_elf_notes(void *ptr, struct save_area *sa, __vector128 *vxrs);

#endif
+2 −2
Original line number Diff line number Diff line
@@ -89,12 +89,12 @@ extern u32 ipl_flags;
extern u32 dump_prefix_page;

struct dump_save_areas {
	struct save_area **areas;
	struct save_area_ext **areas;
	int count;
};

extern struct dump_save_areas dump_save_areas;
struct save_area *dump_save_area_create(int cpu);
struct save_area_ext *dump_save_area_create(int cpu);

extern void do_reipl(void);
extern void do_halt(void);
+11 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include <linux/types.h>
#include <asm/ptrace.h>
#include <asm/cpu.h>
#include <asm/types.h>

#ifdef CONFIG_32BIT

@@ -31,6 +32,11 @@ struct save_area {
	u32	ctrl_regs[16];
} __packed;

struct save_area_ext {
	struct save_area	sa;
	__vector128		vx_regs[32];
};

struct _lowcore {
	psw_t	restart_psw;			/* 0x0000 */
	psw_t	restart_old_psw;		/* 0x0008 */
@@ -183,6 +189,11 @@ struct save_area {
	u64	ctrl_regs[16];
} __packed;

struct save_area_ext {
	struct save_area	sa;
	__vector128		vx_regs[32];
};

struct _lowcore {
	__u8	pad_0x0000[0x0014-0x0000];	/* 0x0000 */
	__u32	ipl_parmblock_ptr;		/* 0x0014 */
+4 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#define SIGP_SET_ARCHITECTURE	     18
#define SIGP_COND_EMERGENCY_SIGNAL   19
#define SIGP_SENSE_RUNNING	     21
#define SIGP_STORE_ADDITIONAL_STATUS 23

/* SIGP condition codes */
#define SIGP_CC_ORDER_CODE_ACCEPTED 0
@@ -33,9 +34,10 @@

#ifndef __ASSEMBLY__

static inline int __pcpu_sigp(u16 addr, u8 order, u32 parm, u32 *status)
static inline int __pcpu_sigp(u16 addr, u8 order, unsigned long parm,
			      u32 *status)
{
	register unsigned int reg1 asm ("1") = parm;
	register unsigned long reg1 asm ("1") = parm;
	int cc;

	asm volatile(
+13 −0
Original line number Diff line number Diff line
@@ -114,6 +114,19 @@ static inline void save_vx_regs(__vector128 *vxrs)
		: "=Q" (*(addrtype *) vxrs) : : "1");
}

static inline void save_vx_regs_safe(__vector128 *vxrs)
{
	unsigned long cr0, flags;

	flags = arch_local_irq_save();
	__ctl_store(cr0, 0, 0);
	__ctl_set_bit(0, 17);
	__ctl_set_bit(0, 18);
	save_vx_regs(vxrs);
	__ctl_load(cr0, 0, 0);
	arch_local_irq_restore(flags);
}

static inline void restore_vx_regs(__vector128 *vxrs)
{
	typedef struct { __vector128 _[__NUM_VXRS]; } addrtype;
Loading