* [PATCH qemu v2] s390x: sck: load into a temporary not into in1
@ 2022-01-26 8:42 ` Nico Boehr
0 siblings, 0 replies; 7+ messages in thread
From: Nico Boehr @ 2022-01-26 8:42 UTC (permalink / raw)
To: qemu-devel; +Cc: richard.henderson, thuth, david, linux-s390
We previously loaded into in1, but in1 is not filled during
disassembly and hence always zero. This leads to an assertion failure:
qemu-system-s390x: /home/nrb/qemu/include/tcg/tcg.h:654: temp_idx:
Assertion `n >= 0 && n < tcg_ctx->nb_temps' failed.`
Instead, use in2_la2_m64a to load from storage into in2 and pass that to
the helper, which matches what we already do for SCKC.
This fixes the SCK test I sent here under TCG:
<https://www.spinics.net/lists/kvm/msg265169.html>
Suggested-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
---
target/s390x/tcg/insn-data.def | 2 +-
target/s390x/tcg/translate.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/target/s390x/tcg/insn-data.def b/target/s390x/tcg/insn-data.def
index 3e5594210c88..848a9c9e622f 100644
--- a/target/s390x/tcg/insn-data.def
+++ b/target/s390x/tcg/insn-data.def
@@ -1317,7 +1317,7 @@
/* SET ADDRESS SPACE CONTROL FAST */
F(0xb279, SACF, S, Z, 0, a2, 0, 0, sacf, 0, IF_PRIV)
/* SET CLOCK */
- F(0xb204, SCK, S, Z, la2, 0, 0, 0, sck, 0, IF_PRIV | IF_IO)
+ F(0xb204, SCK, S, Z, 0, m2_64a, 0, 0, sck, 0, IF_PRIV | IF_IO)
/* SET CLOCK COMPARATOR */
F(0xb206, SCKC, S, Z, 0, m2_64a, 0, 0, sckc, 0, IF_PRIV | IF_IO)
/* SET CLOCK PROGRAMMABLE FIELD */
diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
index dcc249a197ce..7fb87cd9f3b7 100644
--- a/target/s390x/tcg/translate.c
+++ b/target/s390x/tcg/translate.c
@@ -4295,8 +4295,7 @@ static DisasJumpType op_stcke(DisasContext *s, DisasOps *o)
#ifndef CONFIG_USER_ONLY
static DisasJumpType op_sck(DisasContext *s, DisasOps *o)
{
- tcg_gen_qemu_ld_i64(o->in1, o->addr1, get_mem_index(s), MO_TEQ | MO_ALIGN);
- gen_helper_sck(cc_op, cpu_env, o->in1);
+ gen_helper_sck(cc_op, cpu_env, o->in2);
set_cc_static(s);
return DISAS_NEXT;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH qemu v2] s390x: sck: load into a temporary not into in1
@ 2022-01-26 8:42 ` Nico Boehr
0 siblings, 0 replies; 7+ messages in thread
From: Nico Boehr @ 2022-01-26 8:42 UTC (permalink / raw)
To: qemu-devel; +Cc: linux-s390, thuth, richard.henderson, david
We previously loaded into in1, but in1 is not filled during
disassembly and hence always zero. This leads to an assertion failure:
qemu-system-s390x: /home/nrb/qemu/include/tcg/tcg.h:654: temp_idx:
Assertion `n >= 0 && n < tcg_ctx->nb_temps' failed.`
Instead, use in2_la2_m64a to load from storage into in2 and pass that to
the helper, which matches what we already do for SCKC.
This fixes the SCK test I sent here under TCG:
<https://www.spinics.net/lists/kvm/msg265169.html>
Suggested-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
---
target/s390x/tcg/insn-data.def | 2 +-
target/s390x/tcg/translate.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/target/s390x/tcg/insn-data.def b/target/s390x/tcg/insn-data.def
index 3e5594210c88..848a9c9e622f 100644
--- a/target/s390x/tcg/insn-data.def
+++ b/target/s390x/tcg/insn-data.def
@@ -1317,7 +1317,7 @@
/* SET ADDRESS SPACE CONTROL FAST */
F(0xb279, SACF, S, Z, 0, a2, 0, 0, sacf, 0, IF_PRIV)
/* SET CLOCK */
- F(0xb204, SCK, S, Z, la2, 0, 0, 0, sck, 0, IF_PRIV | IF_IO)
+ F(0xb204, SCK, S, Z, 0, m2_64a, 0, 0, sck, 0, IF_PRIV | IF_IO)
/* SET CLOCK COMPARATOR */
F(0xb206, SCKC, S, Z, 0, m2_64a, 0, 0, sckc, 0, IF_PRIV | IF_IO)
/* SET CLOCK PROGRAMMABLE FIELD */
diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
index dcc249a197ce..7fb87cd9f3b7 100644
--- a/target/s390x/tcg/translate.c
+++ b/target/s390x/tcg/translate.c
@@ -4295,8 +4295,7 @@ static DisasJumpType op_stcke(DisasContext *s, DisasOps *o)
#ifndef CONFIG_USER_ONLY
static DisasJumpType op_sck(DisasContext *s, DisasOps *o)
{
- tcg_gen_qemu_ld_i64(o->in1, o->addr1, get_mem_index(s), MO_TEQ | MO_ALIGN);
- gen_helper_sck(cc_op, cpu_env, o->in1);
+ gen_helper_sck(cc_op, cpu_env, o->in2);
set_cc_static(s);
return DISAS_NEXT;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH qemu v2] s390x: sck: load into a temporary not into in1
2022-01-26 8:42 ` Nico Boehr
@ 2022-01-26 8:46 ` David Hildenbrand
-1 siblings, 0 replies; 7+ messages in thread
From: David Hildenbrand @ 2022-01-26 8:46 UTC (permalink / raw)
To: Nico Boehr, qemu-devel; +Cc: richard.henderson, thuth, linux-s390
On 26.01.22 09:42, Nico Boehr wrote:
> We previously loaded into in1, but in1 is not filled during
> disassembly and hence always zero. This leads to an assertion failure:
>
> qemu-system-s390x: /home/nrb/qemu/include/tcg/tcg.h:654: temp_idx:
> Assertion `n >= 0 && n < tcg_ctx->nb_temps' failed.`
>
> Instead, use in2_la2_m64a to load from storage into in2 and pass that to
> the helper, which matches what we already do for SCKC.
>
> This fixes the SCK test I sent here under TCG:
> <https://www.spinics.net/lists/kvm/msg265169.html>
>
> Suggested-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
> ---
> target/s390x/tcg/insn-data.def | 2 +-
> target/s390x/tcg/translate.c | 3 +--
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/target/s390x/tcg/insn-data.def b/target/s390x/tcg/insn-data.def
> index 3e5594210c88..848a9c9e622f 100644
> --- a/target/s390x/tcg/insn-data.def
> +++ b/target/s390x/tcg/insn-data.def
> @@ -1317,7 +1317,7 @@
> /* SET ADDRESS SPACE CONTROL FAST */
> F(0xb279, SACF, S, Z, 0, a2, 0, 0, sacf, 0, IF_PRIV)
> /* SET CLOCK */
> - F(0xb204, SCK, S, Z, la2, 0, 0, 0, sck, 0, IF_PRIV | IF_IO)
> + F(0xb204, SCK, S, Z, 0, m2_64a, 0, 0, sck, 0, IF_PRIV | IF_IO)
> /* SET CLOCK COMPARATOR */
> F(0xb206, SCKC, S, Z, 0, m2_64a, 0, 0, sckc, 0, IF_PRIV | IF_IO)
> /* SET CLOCK PROGRAMMABLE FIELD */
> diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
> index dcc249a197ce..7fb87cd9f3b7 100644
> --- a/target/s390x/tcg/translate.c
> +++ b/target/s390x/tcg/translate.c
> @@ -4295,8 +4295,7 @@ static DisasJumpType op_stcke(DisasContext *s, DisasOps *o)
> #ifndef CONFIG_USER_ONLY
> static DisasJumpType op_sck(DisasContext *s, DisasOps *o)
> {
> - tcg_gen_qemu_ld_i64(o->in1, o->addr1, get_mem_index(s), MO_TEQ | MO_ALIGN);
> - gen_helper_sck(cc_op, cpu_env, o->in1);
> + gen_helper_sck(cc_op, cpu_env, o->in2);
> set_cc_static(s);
> return DISAS_NEXT;
> }
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH qemu v2] s390x: sck: load into a temporary not into in1
@ 2022-01-26 8:46 ` David Hildenbrand
0 siblings, 0 replies; 7+ messages in thread
From: David Hildenbrand @ 2022-01-26 8:46 UTC (permalink / raw)
To: Nico Boehr, qemu-devel; +Cc: linux-s390, thuth, richard.henderson
On 26.01.22 09:42, Nico Boehr wrote:
> We previously loaded into in1, but in1 is not filled during
> disassembly and hence always zero. This leads to an assertion failure:
>
> qemu-system-s390x: /home/nrb/qemu/include/tcg/tcg.h:654: temp_idx:
> Assertion `n >= 0 && n < tcg_ctx->nb_temps' failed.`
>
> Instead, use in2_la2_m64a to load from storage into in2 and pass that to
> the helper, which matches what we already do for SCKC.
>
> This fixes the SCK test I sent here under TCG:
> <https://www.spinics.net/lists/kvm/msg265169.html>
>
> Suggested-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
> ---
> target/s390x/tcg/insn-data.def | 2 +-
> target/s390x/tcg/translate.c | 3 +--
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/target/s390x/tcg/insn-data.def b/target/s390x/tcg/insn-data.def
> index 3e5594210c88..848a9c9e622f 100644
> --- a/target/s390x/tcg/insn-data.def
> +++ b/target/s390x/tcg/insn-data.def
> @@ -1317,7 +1317,7 @@
> /* SET ADDRESS SPACE CONTROL FAST */
> F(0xb279, SACF, S, Z, 0, a2, 0, 0, sacf, 0, IF_PRIV)
> /* SET CLOCK */
> - F(0xb204, SCK, S, Z, la2, 0, 0, 0, sck, 0, IF_PRIV | IF_IO)
> + F(0xb204, SCK, S, Z, 0, m2_64a, 0, 0, sck, 0, IF_PRIV | IF_IO)
> /* SET CLOCK COMPARATOR */
> F(0xb206, SCKC, S, Z, 0, m2_64a, 0, 0, sckc, 0, IF_PRIV | IF_IO)
> /* SET CLOCK PROGRAMMABLE FIELD */
> diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
> index dcc249a197ce..7fb87cd9f3b7 100644
> --- a/target/s390x/tcg/translate.c
> +++ b/target/s390x/tcg/translate.c
> @@ -4295,8 +4295,7 @@ static DisasJumpType op_stcke(DisasContext *s, DisasOps *o)
> #ifndef CONFIG_USER_ONLY
> static DisasJumpType op_sck(DisasContext *s, DisasOps *o)
> {
> - tcg_gen_qemu_ld_i64(o->in1, o->addr1, get_mem_index(s), MO_TEQ | MO_ALIGN);
> - gen_helper_sck(cc_op, cpu_env, o->in1);
> + gen_helper_sck(cc_op, cpu_env, o->in2);
> set_cc_static(s);
> return DISAS_NEXT;
> }
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH qemu v2] s390x: sck: load into a temporary not into in1
2022-01-26 8:42 ` Nico Boehr
(?)
(?)
@ 2022-01-27 10:32 ` Janosch Frank
2022-01-27 10:45 ` David Hildenbrand
-1 siblings, 1 reply; 7+ messages in thread
From: Janosch Frank @ 2022-01-27 10:32 UTC (permalink / raw)
To: Nico Boehr, qemu-devel; +Cc: linux-s390, thuth, richard.henderson, david
On 1/26/22 09:42, Nico Boehr wrote:
> We previously loaded into in1, but in1 is not filled during
> disassembly and hence always zero. This leads to an assertion failure:
>
> qemu-system-s390x: /home/nrb/qemu/include/tcg/tcg.h:654: temp_idx:
> Assertion `n >= 0 && n < tcg_ctx->nb_temps' failed.`
>
> Instead, use in2_la2_m64a to load from storage into in2 and pass that to
> the helper, which matches what we already do for SCKC.
>
> This fixes the SCK test I sent here under TCG:
> <https://www.spinics.net/lists/kvm/msg265169.html>
>
> Suggested-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
@David: Was this already broken when it was implemented?
I.e. do we want a "Fixes: 9dc67537 ("s390x/tcg: implement SET CLOCK ")" tag?
> ---
> target/s390x/tcg/insn-data.def | 2 +-
> target/s390x/tcg/translate.c | 3 +--
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/target/s390x/tcg/insn-data.def b/target/s390x/tcg/insn-data.def
> index 3e5594210c88..848a9c9e622f 100644
> --- a/target/s390x/tcg/insn-data.def
> +++ b/target/s390x/tcg/insn-data.def
> @@ -1317,7 +1317,7 @@
> /* SET ADDRESS SPACE CONTROL FAST */
> F(0xb279, SACF, S, Z, 0, a2, 0, 0, sacf, 0, IF_PRIV)
> /* SET CLOCK */
> - F(0xb204, SCK, S, Z, la2, 0, 0, 0, sck, 0, IF_PRIV | IF_IO)
> + F(0xb204, SCK, S, Z, 0, m2_64a, 0, 0, sck, 0, IF_PRIV | IF_IO)
> /* SET CLOCK COMPARATOR */
> F(0xb206, SCKC, S, Z, 0, m2_64a, 0, 0, sckc, 0, IF_PRIV | IF_IO)
> /* SET CLOCK PROGRAMMABLE FIELD */
> diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
> index dcc249a197ce..7fb87cd9f3b7 100644
> --- a/target/s390x/tcg/translate.c
> +++ b/target/s390x/tcg/translate.c
> @@ -4295,8 +4295,7 @@ static DisasJumpType op_stcke(DisasContext *s, DisasOps *o)
> #ifndef CONFIG_USER_ONLY
> static DisasJumpType op_sck(DisasContext *s, DisasOps *o)
> {
> - tcg_gen_qemu_ld_i64(o->in1, o->addr1, get_mem_index(s), MO_TEQ | MO_ALIGN);
> - gen_helper_sck(cc_op, cpu_env, o->in1);
> + gen_helper_sck(cc_op, cpu_env, o->in2);
> set_cc_static(s);
> return DISAS_NEXT;
> }
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH qemu v2] s390x: sck: load into a temporary not into in1
2022-01-27 10:32 ` Janosch Frank
@ 2022-01-27 10:45 ` David Hildenbrand
2022-01-28 10:01 ` Thomas Huth
0 siblings, 1 reply; 7+ messages in thread
From: David Hildenbrand @ 2022-01-27 10:45 UTC (permalink / raw)
To: Janosch Frank, Nico Boehr, qemu-devel
Cc: linux-s390, thuth, richard.henderson
On 27.01.22 11:32, Janosch Frank wrote:
> On 1/26/22 09:42, Nico Boehr wrote:
>> We previously loaded into in1, but in1 is not filled during
>> disassembly and hence always zero. This leads to an assertion failure:
>>
>> qemu-system-s390x: /home/nrb/qemu/include/tcg/tcg.h:654: temp_idx:
>> Assertion `n >= 0 && n < tcg_ctx->nb_temps' failed.`
>>
>> Instead, use in2_la2_m64a to load from storage into in2 and pass that to
>> the helper, which matches what we already do for SCKC.
>>
>> This fixes the SCK test I sent here under TCG:
>> <https://www.spinics.net/lists/kvm/msg265169.html>
>>
>> Suggested-by: David Hildenbrand <david@redhat.com>
>> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
>
> @David: Was this already broken when it was implemented?
> I.e. do we want a "Fixes: 9dc67537 ("s390x/tcg: implement SET CLOCK ")" tag?
That sounds about right.
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH qemu v2] s390x: sck: load into a temporary not into in1
2022-01-27 10:45 ` David Hildenbrand
@ 2022-01-28 10:01 ` Thomas Huth
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Huth @ 2022-01-28 10:01 UTC (permalink / raw)
To: David Hildenbrand, Janosch Frank, Nico Boehr, qemu-devel
Cc: linux-s390, richard.henderson
On 27/01/2022 11.45, David Hildenbrand wrote:
> On 27.01.22 11:32, Janosch Frank wrote:
>> On 1/26/22 09:42, Nico Boehr wrote:
>>> We previously loaded into in1, but in1 is not filled during
>>> disassembly and hence always zero. This leads to an assertion failure:
>>>
>>> qemu-system-s390x: /home/nrb/qemu/include/tcg/tcg.h:654: temp_idx:
>>> Assertion `n >= 0 && n < tcg_ctx->nb_temps' failed.`
>>>
>>> Instead, use in2_la2_m64a to load from storage into in2 and pass that to
>>> the helper, which matches what we already do for SCKC.
>>>
>>> This fixes the SCK test I sent here under TCG:
>>> <https://www.spinics.net/lists/kvm/msg265169.html>
>>>
>>> Suggested-by: David Hildenbrand <david@redhat.com>
>>> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
>>
>> @David: Was this already broken when it was implemented?
>> I.e. do we want a "Fixes: 9dc67537 ("s390x/tcg: implement SET CLOCK ")" tag?
>
> That sounds about right.
Thanks, queued to my s390x-next branch now:
https://gitlab.com/thuth/qemu/-/commits/s390x-next/
Thomas
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-01-28 10:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 8:42 [PATCH qemu v2] s390x: sck: load into a temporary not into in1 Nico Boehr
2022-01-26 8:42 ` Nico Boehr
2022-01-26 8:46 ` David Hildenbrand
2022-01-26 8:46 ` David Hildenbrand
2022-01-27 10:32 ` Janosch Frank
2022-01-27 10:45 ` David Hildenbrand
2022-01-28 10:01 ` Thomas Huth
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.