[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/6] target/s390x: fix ipm polluting irrelevant
From: |
David Hildenbrand |
Subject: |
Re: [Qemu-devel] [PATCH 3/6] target/s390x: fix ipm polluting irrelevant bits |
Date: |
Mon, 6 Aug 2018 13:18:23 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 05.08.2018 20:28, Pavel Zbitskiy wrote:
> 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 <address@hidden>
> ---
> target/s390x/translate.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/s390x/translate.c b/target/s390x/translate.c
> index f318fb6e4e..05442dff36 100644
> --- a/target/s390x/translate.c
> +++ b/target/s390x/translate.c
> @@ -2442,8 +2442,8 @@ static DisasJumpType op_ipm(DisasContext *s, DisasOps
> *o)
> tcg_gen_andi_i64(o->out, o->out, ~0xff000000ull);
>
> t1 = tcg_temp_new_i64();
> - tcg_gen_shli_i64(t1, psw_mask, 20);
> - tcg_gen_shri_i64(t1, t1, 36);
> + tcg_gen_andi_i64(t1, psw_mask, 0x00000f0000000000);
ull?
> + tcg_gen_shri_i64(t1, t1, 16);
> tcg_gen_or_i64(o->out, o->out, t1);
>
> tcg_gen_extu_i32_i64(t1, cc_op);
>
--
Thanks,
David / dhildenb
- [Qemu-devel] [PATCH 0/6] Some improvements in z/Arch instructions support, Pavel Zbitskiy, 2018/08/05
- [Qemu-devel] [PATCH 0/6] Some improvements in z/Arch instructions support, Pavel Zbitskiy, 2018/08/05
- [Qemu-devel] [PATCH 1/6] target/s390x: add BAL and BALR instructions, Pavel Zbitskiy, 2018/08/05
- [Qemu-devel] [PATCH 2/6] target/s390x: fix CSST decoding and runtime alignment check, Pavel Zbitskiy, 2018/08/05
- [Qemu-devel] [PATCH 3/6] target/s390x: fix ipm polluting irrelevant bits, Pavel Zbitskiy, 2018/08/05
- [Qemu-devel] [PATCH 4/6] target/s390x: add EX support for TRT and TRTR, Pavel Zbitskiy, 2018/08/05
- [Qemu-devel] [PATCH 5/6] target/s390x: fix PACK reading 1 byte less and writing 1 byte more, Pavel Zbitskiy, 2018/08/05
- [Qemu-devel] [PATCH 6/6] target/s390x: implement CVB, CVBY and CVBG, Pavel Zbitskiy, 2018/08/05
- Re: [Qemu-devel] [PATCH 0/6] Some improvements in z/Arch instructions support, Cornelia Huck, 2018/08/06