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

Commit ddd6f953 authored by Martin Schwidefsky's avatar Martin Schwidefsky
Browse files

[S390] kvm: move cmf host id constant out of lowcore



There is no reason for the cpu-measurement-facility host id constant to
reside in the lowcore where space is precious. Use an entry in the literal
pool in HANDLE_SIE_INTERCEPT and a stack slot in sie64a.
While we are at it replace the id -1 with 0 to indicate host execution.

Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 4baeb964
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -271,7 +271,7 @@ struct _lowcore {
	__u64	machine_flags;			/* 0x0360 */
	__u64	machine_flags;			/* 0x0360 */
	__u64	ftrace_func;			/* 0x0368 */
	__u64	ftrace_func;			/* 0x0368 */
	__u64	gmap;				/* 0x0370 */
	__u64	gmap;				/* 0x0370 */
	__u64	cmf_hpp;			/* 0x0378 */
	__u8	pad_0x0378[0x0380-0x0378];	/* 0x0378 */


	/* Interrupt response block. */
	/* Interrupt response block. */
	__u8	irb[64];			/* 0x0380 */
	__u8	irb[64];			/* 0x0380 */
+0 −1
Original line number Original line Diff line number Diff line
@@ -150,7 +150,6 @@ int main(void)
	DEFINE(__LC_LAST_BREAK, offsetof(struct _lowcore, breaking_event_addr));
	DEFINE(__LC_LAST_BREAK, offsetof(struct _lowcore, breaking_event_addr));
	DEFINE(__LC_VDSO_PER_CPU, offsetof(struct _lowcore, vdso_per_cpu_data));
	DEFINE(__LC_VDSO_PER_CPU, offsetof(struct _lowcore, vdso_per_cpu_data));
	DEFINE(__LC_GMAP, offsetof(struct _lowcore, gmap));
	DEFINE(__LC_GMAP, offsetof(struct _lowcore, gmap));
	DEFINE(__LC_CMF_HPP, offsetof(struct _lowcore, cmf_hpp));
	DEFINE(__GMAP_ASCE, offsetof(struct gmap, asce));
	DEFINE(__GMAP_ASCE, offsetof(struct gmap, asce));
#endif /* CONFIG_32BIT */
#endif /* CONFIG_32BIT */
	return 0;
	return 0;
+5 −2
Original line number Original line Diff line number Diff line
@@ -71,7 +71,7 @@ _TIF_EXIT_SIE = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_MCCK_PENDING)
#if defined(CONFIG_KVM) || defined(CONFIG_KVM_MODULE)
#if defined(CONFIG_KVM) || defined(CONFIG_KVM_MODULE)
	tm	__TI_flags+6(%r12),_TIF_SIE>>8
	tm	__TI_flags+6(%r12),_TIF_SIE>>8
	jz	0f
	jz	0f
	SPP	__LC_CMF_HPP			# set host id
	SPP	BASED(.Lhost_id)		# set host id
	clc	SP_PSW+8(8,%r15),BASED(.Lsie_loop)
	clc	SP_PSW+8(8,%r15),BASED(.Lsie_loop)
	jl	0f
	jl	0f
	clc	SP_PSW+8(8,%r15),BASED(.Lsie_done)
	clc	SP_PSW+8(8,%r15),BASED(.Lsie_done)
@@ -1054,6 +1054,7 @@ ENTRY(sie64a)
	stmg	%r6,%r14,__SF_GPRS(%r15)	# save kernel registers
	stmg	%r6,%r14,__SF_GPRS(%r15)	# save kernel registers
	stg	%r2,__SF_EMPTY(%r15)		# save control block pointer
	stg	%r2,__SF_EMPTY(%r15)		# save control block pointer
	stg	%r3,__SF_EMPTY+8(%r15)		# save guest register save area
	stg	%r3,__SF_EMPTY+8(%r15)		# save guest register save area
	xc	__SF_EMPTY+16(8,%r15),__SF_EMPTY+16(%r15) # host id == 0
	lmg	%r0,%r13,0(%r3)			# load guest gprs 0-13
	lmg	%r0,%r13,0(%r3)			# load guest gprs 0-13
	lg	%r14,__LC_THREAD_INFO		# pointer thread_info struct
	lg	%r14,__LC_THREAD_INFO		# pointer thread_info struct
	oi	__TI_flags+6(%r14),_TIF_SIE>>8
	oi	__TI_flags+6(%r14),_TIF_SIE>>8
@@ -1070,7 +1071,7 @@ sie_gmap:
	SPP	__SF_EMPTY(%r15)		# set guest id
	SPP	__SF_EMPTY(%r15)		# set guest id
	sie	0(%r14)
	sie	0(%r14)
sie_done:
sie_done:
	SPP	__LC_CMF_HPP			# set host id
	SPP	__SF_EMPTY+16(%r15)		# set host id
	lg	%r14,__LC_THREAD_INFO		# pointer thread_info struct
	lg	%r14,__LC_THREAD_INFO		# pointer thread_info struct
sie_exit:
sie_exit:
	lctlg	%c1,%c1,__LC_USER_ASCE		# load primary asce
	lctlg	%c1,%c1,__LC_USER_ASCE		# load primary asce
@@ -1095,6 +1096,8 @@ sie_fault:
	.quad	sie_loop
	.quad	sie_loop
.Lsie_done:
.Lsie_done:
	.quad	sie_done
	.quad	sie_done
.Lhost_id:
	.quad	0


	.section __ex_table,"a"
	.section __ex_table,"a"
	.quad	sie_loop,sie_fault
	.quad	sie_loop,sie_fault
+0 −1
Original line number Original line Diff line number Diff line
@@ -400,7 +400,6 @@ setup_lowcore(void)
		__ctl_set_bit(14, 29);
		__ctl_set_bit(14, 29);
	}
	}
#else
#else
	lc->cmf_hpp = -1ULL;
	lc->vdso_per_cpu_data = (unsigned long) &lc->paste[0];
	lc->vdso_per_cpu_data = (unsigned long) &lc->paste[0];
#endif
#endif
	lc->sync_enter_timer = S390_lowcore.sync_enter_timer;
	lc->sync_enter_timer = S390_lowcore.sync_enter_timer;