From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org, cota@braap.org, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 4/5] target/s390x: Exit after changing PSW mask
Date: Thu, 15 Jun 2017 10:00:03 +0100 [thread overview]
Message-ID: <87shj1mxrg.fsf@linaro.org> (raw)
In-Reply-To: <20170614194821.8754-5-rth@twiddle.net>
Richard Henderson <rth@twiddle.net> writes:
> Exit to cpu loop so we reevaluate cpu_s390x_hw_interrupts.
>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> target/alpha/translate.c | 2 +-
> target/s390x/translate.c | 14 ++++++++++----
> 2 files changed, 11 insertions(+), 5 deletions(-)
Aside from the stray alpha bit:
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>
> diff --git a/target/alpha/translate.c b/target/alpha/translate.c
> index a48e451..232af9e 100644
> --- a/target/alpha/translate.c
> +++ b/target/alpha/translate.c
> @@ -1207,7 +1207,7 @@ static ExitStatus gen_call_pal(DisasContext *ctx, int palcode)
> tcg_temp_free(tmp);
>
> /* Allow interrupts to be recognized right away. */
> - tcg_gen_movi_i64(cpu_pc, ctx.pc);
> + tcg_gen_movi_i64(cpu_pc, ctx->pc);
> return EXIT_PC_UPDATED_NOCHAIN;
>
> case 0x36:
> diff --git a/target/s390x/translate.c b/target/s390x/translate.c
> index 95f91d4..c9e3b81 100644
> --- a/target/s390x/translate.c
> +++ b/target/s390x/translate.c
> @@ -1174,6 +1174,8 @@ typedef enum {
> /* We are exiting the TB, but have neither emitted a goto_tb, nor
> updated the PC for the next instruction to be executed. */
> EXIT_PC_STALE,
> + /* We are exiting the TB to the main loop. */
> + EXIT_PC_STALE_NOCHAIN,
> /* We are ending the TB with a noreturn function call, e.g. longjmp.
> No following code will be executed. */
> EXIT_NORETURN,
> @@ -3796,7 +3798,8 @@ static ExitStatus op_ssm(DisasContext *s, DisasOps *o)
> {
> check_privileged(s);
> tcg_gen_deposit_i64(psw_mask, psw_mask, o->in2, 56, 8);
> - return NO_EXIT;
> + /* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */
> + return EXIT_PC_STALE_NOCHAIN;
> }
>
> static ExitStatus op_stap(DisasContext *s, DisasOps *o)
> @@ -4044,7 +4047,9 @@ static ExitStatus op_stnosm(DisasContext *s, DisasOps *o)
> } else {
> tcg_gen_ori_i64(psw_mask, psw_mask, i2 << 56);
> }
> - return NO_EXIT;
> +
> + /* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */
> + return EXIT_PC_STALE_NOCHAIN;
> }
>
> static ExitStatus op_stura(DisasContext *s, DisasOps *o)
> @@ -5794,6 +5799,7 @@ void gen_intermediate_code(CPUS390XState *env, struct TranslationBlock *tb)
> case EXIT_NORETURN:
> break;
> case EXIT_PC_STALE:
> + case EXIT_PC_STALE_NOCHAIN:
> update_psw_addr(&dc);
> /* FALLTHRU */
> case EXIT_PC_UPDATED:
> @@ -5805,14 +5811,14 @@ void gen_intermediate_code(CPUS390XState *env, struct TranslationBlock *tb)
> /* Exit the TB, either by raising a debug exception or by return. */
> if (do_debug) {
> gen_exception(EXCP_DEBUG);
> - } else if (use_exit_tb(&dc)) {
> + } else if (use_exit_tb(&dc) || status == EXIT_PC_STALE_NOCHAIN) {
> tcg_gen_exit_tb(0);
> } else {
> tcg_gen_lookup_and_goto_ptr(psw_addr);
> }
> break;
> default:
> - abort();
> + g_assert_not_reached();
> }
>
> gen_tb_end(tb, num_insns);
--
Alex Bennée
next prev parent reply other threads:[~2017-06-15 8:59 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-14 19:48 [Qemu-devel] [PATCH v2 0/5] Fixes for TCG hangs Richard Henderson
2017-06-14 19:48 ` [Qemu-devel] [PATCH v2 1/5] tcg: Refactor helper_lookup_tb_ptr Richard Henderson
2017-06-14 20:27 ` [Qemu-devel] [PATCH] tcg-runtime: increase hit rate of lookup_tb_ptr Emilio G. Cota
2017-06-15 1:21 ` Richard Henderson
2017-06-15 8:35 ` [Qemu-devel] [PATCH v2 1/5] tcg: Refactor helper_lookup_tb_ptr Alex Bennée
2017-06-16 20:19 ` Emilio G. Cota
2017-06-16 20:46 ` Richard Henderson
2017-06-14 19:48 ` [Qemu-devel] [PATCH v2 2/5] target/alpha: Use tcg_gen_lookup_and_goto_ptr Richard Henderson
2017-06-14 20:37 ` Emilio G. Cota
2017-06-15 1:21 ` Richard Henderson
2017-06-15 8:48 ` Alex Bennée
2017-06-15 20:55 ` Richard Henderson
2017-06-15 21:57 ` Philippe Mathieu-Daudé
2017-06-16 2:56 ` Richard Henderson
2017-06-14 19:48 ` [Qemu-devel] [PATCH v2 3/5] target/mips: Exit after enabling interrupts Richard Henderson
2017-06-15 8:57 ` Alex Bennée
2017-06-15 14:16 ` Paolo Bonzini
2017-06-15 21:19 ` Aurelien Jarno
2017-06-15 21:29 ` Richard Henderson
2017-06-14 19:48 ` [Qemu-devel] [PATCH v2 4/5] target/s390x: Exit after changing PSW mask Richard Henderson
2017-06-15 9:00 ` Alex Bennée [this message]
2017-06-14 19:48 ` [Qemu-devel] [PATCH v2 5/5] target/arm: Exit after clearing interrupt mask Richard Henderson
2017-06-14 20:33 ` [Qemu-devel] [PATCH] target/aarch64: exit to main loop after 'msr daifclr' Emilio G. Cota
2017-06-14 21:13 ` no-reply
2017-06-15 1:20 ` Richard Henderson
2017-06-15 5:19 ` Emilio G. Cota
2017-06-15 8:30 ` [Qemu-devel] [PATCH v2 5/5] target/arm: Exit after clearing interrupt mask Alex Bennée
2017-06-14 20:22 ` [Qemu-devel] [PATCH v2 0/5] Fixes for TCG hangs no-reply
2017-06-14 20:26 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87shj1mxrg.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=cota@braap.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).