SHA256
1
0
forked from pool/qemu
qemu/0039-s390x-Fix-stoc-direction.patch
Andreas Färber 5eadfc1f12 Accepting request 305644 from home:algraf:branches:Virtualization
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.3
- Fix potential segmentation fault in
  0037-linux-user-Allocate-thunk-size-dyna.patch

OBS-URL: https://build.opensuse.org/request/show/305644
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=255
2015-05-06 21:58:44 +00:00

32 lines
1.1 KiB
Diff

From 67098aac3a33ba6bf79088ac4bc4068637637dd9 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Wed, 15 Apr 2015 02:28:05 +0200
Subject: [PATCH] s390x: Fix stoc direction
The store conditional instruction wants to store when the condition
is fulfilled, so we should branch out when it's not true.
The code today branches out when the condition is true, clearly
reversing the logic. Fix it up by negating the condition.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
target-s390x/translate.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index 4f82edd..8ae4912 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -3082,6 +3082,10 @@ static ExitStatus op_soc(DisasContext *s, DisasOps *o)
disas_jcc(s, &c, get_field(s->fields, m3));
+ /* We want to store when the condition is fulfilled, so branch
+ out when it's not */
+ c.cond = tcg_invert_cond(c.cond);
+
lab = gen_new_label();
if (c.is_64) {
tcg_gen_brcond_i64(c.cond, c.u.s64.a, c.u.s64.b, lab);