Message ID | 20240131074427.70871-5-frankja@linux.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | s390x: Dirty cc before executing tested instructions | expand |
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; }
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(-)