Commit 998e7800 authored by Heiko Carstens's avatar Heiko Carstens Committed by Vasily Gorbik
Browse files

s390/traps: get rid of magic cast for per code



Add a proper union in lowcore to reflect architecture and get rid of a
"magic" cast in order to read the full per code.

Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 52b739e2
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -43,8 +43,13 @@ struct lowcore {
	};
	__u32	data_exc_code;			/* 0x0090 */
	__u16	mon_class_num;			/* 0x0094 */
	union {
		struct {
			__u8	per_code;	/* 0x0096 */
			__u8	per_atmid;	/* 0x0097 */
		};
		__u16 per_code_combined;
	};
	__u64	per_address;			/* 0x0098 */
	__u8	exc_access_id;			/* 0x00a0 */
	__u8	per_access_id;			/* 0x00a1 */
+1 −1
Original line number Diff line number Diff line
@@ -322,7 +322,7 @@ void noinstr __do_pgm_check(struct pt_regs *regs)

			set_thread_flag(TIF_PER_TRAP);
			ev->address = S390_lowcore.per_address;
			ev->cause = *(u16 *)&S390_lowcore.per_code;
			ev->cause = S390_lowcore.per_code_combined;
			ev->paid = S390_lowcore.per_access_id;
		} else {
			/* PER event in kernel is kprobes */