public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] s390x: snippets: c: Load initial cr0
@ 2022-03-31 12:55 Janosch Frank
  2022-03-31 14:58 ` Claudio Imbrenda
  0 siblings, 1 reply; 2+ messages in thread
From: Janosch Frank @ 2022-03-31 12:55 UTC (permalink / raw)
  To: kvm; +Cc: linux-s390, imbrenda, david, thuth

As soon as we use C we need to set the AFP bit in cr0 so we can use
all fprs.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 s390x/snippets/c/cstart.S | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/s390x/snippets/c/cstart.S b/s390x/snippets/c/cstart.S
index aaa5380c..a7d4cd42 100644
--- a/s390x/snippets/c/cstart.S
+++ b/s390x/snippets/c/cstart.S
@@ -12,6 +12,8 @@
 .section .init
 	.globl start
 start:
+	larl	%r1, initial_cr0
+	lctlg	%c0, %c0, 0(%r1)
 	/* XOR all registers with themselves to clear them fully. */
 	.irp i, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
 	xgr \i,\i
@@ -34,3 +36,7 @@ exit:
 	/* For now let's only use cpu 0 in snippets so this will always work. */
 	xgr	%r0, %r0
 	sigp    %r2, %r0, SIGP_STOP
+
+initial_cr0:
+	/* enable AFP-register control, so FP regs (+BFP instr) can be used */
+	.quad	0x0000000000040000
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-31 14:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-31 12:55 [kvm-unit-tests PATCH] s390x: snippets: c: Load initial cr0 Janosch Frank
2022-03-31 14:58 ` Claudio Imbrenda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox