Skip to content

Commit 4a4eefc

Browse files
heicarstborntraeger
authored andcommitted
KVM: s390: sthyi: fix sthyi inline assembly
The sthyi inline assembly misses register r3 within the clobber list. The sthyi instruction will always write a return code to register "R2+1", which in this case would be r3. Due to that we may have register corruption and see host crashes or data corruption depending on how gcc decided to allocate and use registers during compile time. Fixes: 95ca2cb ("KVM: s390: Add sthyi emulation") Cc: <[email protected]> # 4.8+ Reviewed-by: Janosch Frank <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Signed-off-by: Christian Borntraeger <[email protected]>
1 parent 4f89914 commit 4a4eefc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/kvm/sthyi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ static int sthyi(u64 vaddr)
394394
"srl %[cc],28\n"
395395
: [cc] "=d" (cc)
396396
: [code] "d" (code), [addr] "a" (addr)
397-
: "memory", "cc");
397+
: "3", "memory", "cc");
398398
return cc;
399399
}
400400

0 commit comments

Comments
 (0)