diff mbox series

[kvm-unit-tests,GIT,PULL,05/13] s390x: mvpg: Dirty CC before mvpg execution

Message ID 20240424105935.184138-6-nrb@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests,GIT,PULL,01/13] s390x/Makefile: simplify Secure Execution boot image generation | expand

Commit Message

Nico Boehr April 24, 2024, 10:59 a.m. UTC
From: Janosch Frank <frankja@linux.ibm.com>

Dirtying the CC allows us to find missing CC changes when mvpg is
emulated.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Link: https://lore.kernel.org/r/20240131074427.70871-5-frankja@linux.ibm.com
Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
---
 s390x/mvpg.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/s390x/mvpg.c b/s390x/mvpg.c
index 296338d4..62d42e36 100644
--- a/s390x/mvpg.c
+++ b/s390x/mvpg.c
@@ -40,12 +40,14 @@  static uint8_t *fresh;
 static inline int mvpg(unsigned long r0, void *dest, void *src)
 {
 	register unsigned long reg0 asm ("0") = r0;
+	uint64_t bogus_cc = 3;
 	int cc;
 
-	asm volatile("	mvpg    %1,%2\n"
+	asm volatile("	tmll	%[bogus_cc],3\n"
+		     "	mvpg    %1,%2\n"
 		     "	ipm     %0\n"
 		     "	srl     %0,28"
-		: "=&d" (cc) : "a" (dest), "a" (src), "d" (reg0)
+		: "=&d" (cc) : "a" (dest), "a" (src), "d" (reg0), [bogus_cc] "d" (bogus_cc)
 		: "memory", "cc");
 	return cc;
 }