Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
target/s390x: fix IPM polluting irrelevant bits
Suppose psw.mask=0x0000000080000000, cc=2, r1=0 and we do "ipm 1". This command must touch only bits 32-39, so the expected output is r1=0x20000000. However, currently qemu yields r1=0x20008000, because irrelevant parts of PSW leak into r1 during program mask transfer. Signed-off-by: Pavel Zbitskiy <pavel.zbitskiy@gmail.com> Message-Id: <20180821025104.19604-5-pavel.zbitskiy@gmail.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
- Loading branch information
Showing
3 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ VPATH+=$(SRC_PATH)/tests/tcg/s390x | |
CFLAGS+=-march=zEC12 -m64 | ||
TESTS+=hello-s390x | ||
TESTS+=csst | ||
TESTS+=ipm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <stdint.h> | ||
#include <unistd.h> | ||
|
||
int main(void) | ||
{ | ||
uint32_t op1 = 0x55555555; | ||
uint32_t op2 = 0x44444444; | ||
uint64_t cc = 0xffffffffffffffffull; | ||
|
||
asm volatile( | ||
" clc 0(4,%[op1]),0(%[op2])\n" | ||
" ipm %[cc]\n" | ||
: [cc] "+r" (cc) | ||
: [op1] "r" (&op1), | ||
[op2] "r" (&op2) | ||
: "cc"); | ||
if (cc != 0xffffffff20ffffffull) { | ||
write(1, "bad cc\n", 7); | ||
return 1; | ||
} | ||
return 0; | ||
} |