[kvm-unit-tests PATCH v2 4/5] s390x: mvpg: Dirty CC before mvpg execution

Janosch Frank
2024-01-31T07:44:59Z

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

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

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;
}
--
2.40.1