diff mbox series

[kvm-unit-tests,3/5] lib: s390x: uv: Dirty CC before uvc execution

Message ID 20240108132921.255769-4-frankja@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: Dirty cc before executing tested instructions | expand

Commit Message

Janosch Frank Jan. 8, 2024, 1:29 p.m. UTC
Dirtying the CC allows us to find missing CC changes.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 lib/s390x/asm/uv.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
index e9fb19af..85f7b060 100644
--- a/lib/s390x/asm/uv.h
+++ b/lib/s390x/asm/uv.h
@@ -9,6 +9,8 @@ 
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2.
  */
+#include <asm/arch_def.h>
+
 #ifndef _ASMS390X_UV_H_
 #define _ASMS390X_UV_H_
 
@@ -216,14 +218,16 @@  struct uv_cb_ssc {
 
 static inline int uv_call_once(unsigned long r1, unsigned long r2)
 {
+	uint64_t spm_cc = 1 << SPM_CC_SHIFT;
 	int cc;
 
 	asm volatile(
+		"	spm %[spm_cc]\n"
 		"0:	.insn rrf,0xB9A40000,%[r1],%[r2],0,0\n"
 		"		ipm	%[cc]\n"
 		"		srl	%[cc],28\n"
 		: [cc] "=d" (cc)
-		: [r1] "a" (r1), [r2] "a" (r2)
+		: [r1] "a" (r1), [r2] "a" (r2), [spm_cc] "d" (spm_cc)
 		: "memory", "cc");
 
 	if (UVC_ERR_DEBUG && cc == 1)