[Qemu-devel] [PATCH 0/3] Fix networking for s390x-user

2014-01-11 Thread pavel . zbitskiy
Pavel Zbitskiy (3): linux-user: fixed s390x clone() argument order linux-user: fixed getsockopt() optlen linux-user: fixed recvfrom() addrlen linux-user/s390x/syscall.h | 2 +- linux-user/syscall.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)

[Qemu-devel] [PATCH 1/3] linux-user: fixed s390x clone() argument order

2014-01-11 Thread pavel . zbitskiy
From: Pavel Zbitskiy pavel.zbits...@gmail.com It was broken by 4ce6243dc6216e35b5b691078ffa856463bfa8db, where TARGET_CLONE_BACKWARDS was specified instead of TARGET_CLONE_BACKWARDS2. Signed-off-by: Pavel Zbitskiy pavel.zbits...@gmail.com --- linux-user/s390x/syscall.h |2 +- 1 file changed

[Qemu-devel] [PATCH 3/3] linux-user: fixed recvfrom() addrlen

2014-01-11 Thread pavel . zbitskiy
From: Pavel Zbitskiy pavel.zbits...@gmail.com addrlen parameter of recvfrom() of type socklen_t* was read into variable of type socklen_t, that caused zeroing out of upper 4 bytes when running s390x on top of x86_64. This patch changes addrlen type to abi_ulong. Signed-off-by: Pavel Zbitskiy

[Qemu-devel] [PATCH 2/3] linux-user: fixed getsockopt() optlen

2014-01-11 Thread pavel . zbitskiy
From: Pavel Zbitskiy pavel.zbits...@gmail.com optlen parameter of getsockopt() of type socklen_t* was read into variable of type socklen_t, that caused zeroing out of upper 4 bytes when running s390x on top of x86_64. This patch changes optlen type to abi_ulong. Signed-off-by: Pavel Zbitskiy

[Qemu-devel] [PATCH 2/6] target/s390x: fix CSST decoding and runtime alignment check

2018-08-05 Thread Pavel Zbitskiy
of trailing bits that must be 0. For FC these numbers are: FC=0: 2 FC=1: 3 FC=2: 4 For SC these numbers are: SC=0: 0 SC=1: 1 SC=2: 2 SC=3: 3 SC=4: 4 Signed-off-by: Pavel Zbitskiy --- target/s390x/mem_helper.c | 2 +- target/s390x/translate.c | 4 ++-- 2 files

[Qemu-devel] [PATCH 0/6] Some improvements in z/Arch instructions support

2018-08-05 Thread Pavel Zbitskiy
Add BAL, BALR, CVB instructions Fix few bugs in PACK, CSST Pavel Zbitskiy (6): target/s390x: add BAL and BALR instructions target/s390x: fix CSST decoding and runtime alignment check target/s390x: fix ipm polluting irrelevant bits target/s390x: add EX support for TRT and TRTR target

[Qemu-devel] [PATCH 1/6] target/s390x: add BAL and BALR instructions

2018-08-05 Thread Pavel Zbitskiy
These instructions are provided for compatibility purposes and are used only by old software, in the new code BAS and BASR are preferred. The difference between the old and new instruction exists only in the 24-bit mode. Signed-off-by: Pavel Zbitskiy --- target/s390x/insn-data.def | 3

[Qemu-devel] [PATCH 6/6] target/s390x: implement CVB, CVBY and CVBG

2018-08-05 Thread Pavel Zbitskiy
Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. Signed-off-by: Pavel Zbitskiy --- target/s390x/helper.h | 2 ++ target/s390x/insn-data.def | 4 target/s390x

[Qemu-devel] [PATCH 3/6] target/s390x: fix ipm polluting irrelevant bits

2018-08-05 Thread Pavel Zbitskiy
Suppose psw.mask=0x8000, cc=2, r1=0 and we do "ipm 1". This command must touch only bits 32-39, so the expected output is r1=0x2000. However, currently qemu yields r1=0x20008000, because irrelevant parts of PSW leak into r1 during program mask transfer. Signed-off

[Qemu-devel] [PATCH 0/6] Some improvements in z/Arch instructions support

2018-08-05 Thread Pavel Zbitskiy
Add BAL, BALR, CVB instructions Fix few bugs in PACK, CSST Pavel Zbitskiy (6): target/s390x: add BAL and BALR instructions target/s390x: fix CSST decoding and runtime alignment check target/s390x: fix ipm polluting irrelevant bits target/s390x: add EX support for TRT and TRTR target

[Qemu-devel] [PATCH 5/6] target/s390x: fix PACK reading 1 byte less and writing 1 byte more

2018-08-05 Thread Pavel Zbitskiy
PACK fails on the test from the Principles of Operation: F1F2F3F4 becomes 234C instead of 0001234C due to an off-by-one error. Furthermore, it overwrites one extra byte to the left of F1. Signed-off-by: Pavel Zbitskiy --- target/s390x/mem_helper.c | 6 +++--- 1 file changed, 3 insertions

[Qemu-devel] [PATCH 4/6] target/s390x: add EX support for TRT and TRTR

2018-08-05 Thread Pavel Zbitskiy
Improves "b213c9f5: target/s390x: Implement TRTR" by introducing the intermediate functions, which are compatible with dx_helper type. Signed-off-by: Pavel Zbitskiy --- target/s390x/mem_helper.c | 16 1 file changed, 16 insertions(+) diff --git a/target/s390x/mem_

[Qemu-devel] [PATCH 3/7] target/s390x: fix CSST decoding and runtime alignment check

2018-08-09 Thread Pavel Zbitskiy
of trailing bits that must be 0. For FC these numbers are: FC=0 (word, 4 bytes):2 FC=1 (double word, 8 bytes): 3 FC=2 (quad word, 16 bytes): 4 For SC these numbers correspond to the size: SC=0: 0 SC=1: 1 SC=2: 2 SC=3: 3 SC=4: 4 Signed-off-by: Pavel Zbitskiy

[Qemu-devel] [PATCH 5/7] target/s390x: add EX support for TRT and TRTR

2018-08-09 Thread Pavel Zbitskiy
Improves "b213c9f5: target/s390x: Implement TRTR" by introducing the intermediate functions, which are compatible with dx_helper type. Signed-off-by: Pavel Zbitskiy --- target/s390x/mem_helper.c | 16 +++ tests/tcg/s390x/Makefile.target | 2 ++ tests/tcg/s390x/

[Qemu-devel] [PATCH 2/7] target/s390x: add BAL and BALR instructions

2018-08-09 Thread Pavel Zbitskiy
These instructions are provided for compatibility purposes and are used only by old software, in the new code BAS and BASR are preferred. The difference between the old and new instruction exists only in the 24-bit mode. Signed-off-by: Pavel Zbitskiy --- target/s390x/insn-data.def | 3

[Qemu-devel] [PATCH 6/7] target/s390x: fix PACK reading 1 byte less and writing 1 byte more

2018-08-09 Thread Pavel Zbitskiy
, the loop condition should be > and not >=. If len_src is 1, then we should flip the 1st byte and pack the 2nd. Since len_src is already decremented before the loop, the first condition should be >=, and not >. Likewise for len_src == 2 and the second condition. Signed-off-by: Pavel Zbitskiy

[Qemu-devel] [PATCH 4/7] target/s390x: fix IPM polluting irrelevant bits

2018-08-09 Thread Pavel Zbitskiy
Suppose psw.mask=0x8000, cc=2, r1=0 and we do "ipm 1". This command must touch only bits 32-39, so the expected output is r1=0x2000. However, currently qemu yields r1=0x20008000, because irrelevant parts of PSW leak into r1 during program mask transfer. Signed-off

[Qemu-devel] [PATCH 0/7] Some improvements in z/Arch instructions support

2018-08-09 Thread Pavel Zbitskiy
output. * CVB, CVBY, CVBG: Added. Changes since v1: * Tests. * Call pc_to_link_info() instead of op_bas(). * Clarified CSST commit message. * Rewrote IPM using extract/deposit. * Clarified PACK commit message. * Do not use LowCore for CONFIG_USER_ONLY. * Reduce duplication in CVB code. Pavel Zbitskiy

[Qemu-devel] [PATCH 1/7] tests/tcg: add a simple s390x test

2018-08-09 Thread Pavel Zbitskiy
Copied from alpha. Signed-off-by: Pavel Zbitskiy --- tests/tcg/s390x/Makefile.target | 3 +++ tests/tcg/s390x/hello-s390x.c | 7 +++ 2 files changed, 10 insertions(+) create mode 100644 tests/tcg/s390x/Makefile.target create mode 100644 tests/tcg/s390x/hello-s390x.c diff --git a/tests

[Qemu-devel] [PATCH 7/7] target/s390x: implement CVB, CVBY and CVBG

2018-08-09 Thread Pavel Zbitskiy
Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. Signed-off-by: Pavel Zbitskiy --- target/s390x/helper.h | 1 + target/s390x/insn-data.def | 4 +++ target/s390x

[Qemu-devel] [PATCH 0/7] Some improvements in z/Arch instructions support

2018-08-20 Thread Pavel Zbitskiy
. * Clarified PACK commit message. * Do not use LowCore for CONFIG_USER_ONLY. * Reduce duplication in CVB code. Pavel Zbitskiy (7): tests/tcg: add a simple s390x test target/s390x: add BAL and BALR instructions target/s390x: fix CSST decoding and runtime alignment check target/s390x: fix IPM

[Qemu-devel] [PATCH 5/7] target/s390x: add EX support for TRT and TRTR

2018-08-20 Thread Pavel Zbitskiy
Improves "b213c9f5: target/s390x: Implement TRTR" by introducing the intermediate functions, which are compatible with dx_helper type. Signed-off-by: Pavel Zbitskiy --- target/s390x/mem_helper.c | 16 +++ tests/tcg/s390x/Makefile.target | 2 ++ tests/tcg/s390x/

[Qemu-devel] [PATCH 1/7] tests/tcg: add a simple s390x test

2018-08-20 Thread Pavel Zbitskiy
Copied from alpha. Signed-off-by: Pavel Zbitskiy --- MAINTAINERS | 1 + tests/tcg/s390x/Makefile.target | 3 +++ tests/tcg/s390x/hello-s390x.c | 7 +++ 3 files changed, 11 insertions(+) create mode 100644 tests/tcg/s390x/Makefile.target create mode 100644 tests/tcg

[Qemu-devel] [PATCH 6/7] target/s390x: fix PACK reading 1 byte less and writing 1 byte more

2018-08-20 Thread Pavel Zbitskiy
, the loop condition should be > and not >=. If len_src is 1, then we should flip the 1st byte and pack the 2nd. Since len_src is already decremented before the loop, the first condition should be >=, and not >. Likewise for len_src == 2 and the second condition. Signed-off-by: Pavel Zbitskiy

[Qemu-devel] [PATCH 2/7] target/s390x: add BAL and BALR instructions

2018-08-20 Thread Pavel Zbitskiy
- and 31-bit addressing modes. Signed-off-by: Pavel Zbitskiy --- target/s390x/insn-data.def | 3 +++ target/s390x/translate.c | 55 +- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index

[Qemu-devel] [PATCH 3/7] target/s390x: fix CSST decoding and runtime alignment check

2018-08-20 Thread Pavel Zbitskiy
of trailing bits that must be 0. For FC these numbers are: FC=0 (word, 4 bytes):2 FC=1 (double word, 8 bytes): 3 FC=2 (quad word, 16 bytes): 4 For SC these numbers correspond to the size: SC=0: 0 SC=1: 1 SC=2: 2 SC=3: 3 SC=4: 4 Signed-off-by: Pavel Zbitskiy

[Qemu-devel] [PATCH 7/7] target/s390x: implement CVB, CVBY and CVBG

2018-08-20 Thread Pavel Zbitskiy
Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. Signed-off-by: Pavel Zbitskiy --- target/s390x/helper.h | 1 + target/s390x/insn-data.def | 4 +++ target/s390x

[Qemu-devel] [PATCH 4/7] target/s390x: fix IPM polluting irrelevant bits

2018-08-20 Thread Pavel Zbitskiy
Suppose psw.mask=0x8000, cc=2, r1=0 and we do "ipm 1". This command must touch only bits 32-39, so the expected output is r1=0x2000. However, currently qemu yields r1=0x20008000, because irrelevant parts of PSW leak into r1 during program mask transfer. Signed-off

[Qemu-devel] [PATCH v4 1/3] target/s390x: use regular spaces in translate.c

2018-08-22 Thread Pavel Zbitskiy
In a few places translate.c contains non-breaking spaces (0xc2 0xa0) instead of regular ones (0x20): 7c 7c c2 a0 63 63 7c 7c 2063 63 | |c c This confuses some text editors. Signed-off-by: Pavel Zbitskiy --- target/s390x/translate.c | 4 ++-- 1 file changed, 2 insertions

[Qemu-devel] [PATCH v4 2/3] target/s390x: exception on non-aligned LPSW(E)

2018-08-22 Thread Pavel Zbitskiy
too late - specification exception should be recognized before memory accesses take place. Signed-off-by: Pavel Zbitskiy --- target/s390x/helper.h | 1 + target/s390x/mem_helper.c | 19 --- target/s390x/translate.c | 8 3 files changed, 21 insertions(+), 7 deleti

[Qemu-devel] [PATCH v4 0/3] Some improvements in z/Arch instructions support

2018-08-22 Thread Pavel Zbitskiy
Changes since v3: * Patches 1-6 were accepted, thanks! * Use in1_la2 in op_cvb(). * Free a temp in op_cvb(). * Make ra const in helper_cvb(). * Use wrap_address() in helper_cvb(). * Add a minor formatting patch. * Add LPSW(E) alignment check. Pavel Zbitskiy (3): target/s390x: use regular spaces

[Qemu-devel] [PATCH v4 3/3] target/s390x: implement CVB, CVBY and CVBG

2018-08-22 Thread Pavel Zbitskiy
Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. Signed-off-by: Pavel Zbitskiy --- target/s390x/helper.h | 1 + target/s390x/insn-data.def | 4 +++ target/s390x

[Qemu-devel] [PATCH v5 3/3] target/s390x: implement CVB, CVBY and CVBG

2018-09-01 Thread Pavel Zbitskiy
Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. Signed-off-by: Pavel Zbitskiy --- target/s390x/helper.h | 1 + target/s390x/insn-data.def | 4 +++ target/s390x

[Qemu-devel] [PATCH v5 0/3] Some improvements in z/Arch instructions support

2018-09-01 Thread Pavel Zbitskiy
Changes since v4: * Simplified alignment checks by using tcg_gen_qemu_ld_i64 and MO_ALIGN*. Pavel Zbitskiy (3): target/s390x: use regular spaces in translate.c target/s390x: exception on non-aligned LPSW(E) target/s390x: implement CVB, CVBY and CVBG target/s390x/helper.h | 1

[Qemu-devel] [PATCH v5 2/3] target/s390x: exception on non-aligned LPSW(E)

2018-09-01 Thread Pavel Zbitskiy
Both LPSW and LPSWE should raise a specification exception when their operand is not doubleword aligned. Signed-off-by: Pavel Zbitskiy --- target/s390x/translate.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index

[Qemu-devel] [PATCH v5 1/3] target/s390x: use regular spaces in translate.c

2018-09-01 Thread Pavel Zbitskiy
In a few places translate.c contains non-breaking spaces (0xc2 0xa0) instead of regular ones (0x20): 7c 7c c2 a0 63 63 7c 7c 2063 63 | |c c This confuses some text editors. Signed-off-by: Pavel Zbitskiy Reviewed-by: Thomas Huth Reviewed-by: David Hildenbrand --- target