qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Richard Henderson <richard.henderson@linaro.org>,
	David Hildenbrand <david@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>,
	qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
	Harold Grovesteen <h.grovsteen@tx.rr.com>,
	Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Subject: Re: [PATCH 01/12] target/s390x: Handle branching to odd addresses
Date: Fri, 10 Mar 2023 20:34:10 +0100	[thread overview]
Message-ID: <f75b53839aebc414c45da99b7b9e6fccef72b2d2.camel@linux.ibm.com> (raw)
In-Reply-To: <ac8534ad-6cf5-6ba6-d1a5-10f4135490b2@linaro.org>

On Fri, 2023-03-10 at 11:24 -0800, Richard Henderson wrote:
> On 3/10/23 09:42, Ilya Leoshkevich wrote:
> > @@ -381,6 +382,14 @@ static inline int cpu_mmu_index(CPUS390XState
> > *env, bool ifetch)
> >   static inline void cpu_get_tb_cpu_state(CPUS390XState* env,
> > target_ulong *pc,
> >                                           target_ulong *cs_base,
> > uint32_t *flags)
> >   {
> > +    if (env->psw.addr & 1) {
> > +        /*
> > +         * Instructions must be at even addresses.
> > +         * This needs to be checked before address translation.
> > +         */
> > +        env->int_pgm_ilen = 2; /* see s390_cpu_tlb_fill() */
> > +        tcg_s390_program_interrupt(env, PGM_SPECIFICATION, 0);
> > +    }
> 
> This is incorrect placement.  You can't raise an exception from all
> of the places from 
> which this is called.
> 
> You need to do this at the start of s390x_tr_translate_insn.
> Compare aarch64_tr_translate_insn and the test for (pc & 3).
> 
> 
> r~

The problem is that it's too late - for non-mapped memory we would get
a translation exception instead of a specification exception.

I see the following call sites:

- HELPER(lookup_tb_ptr) - for helpers the exceptions should work;
- cpu_exec_loop(), cpu_exec_step_atomic - these are wrapped in setjmp,
  so it should be ok too?
- tb_check_watchpoint() - is this the problematic one?

Am I missing something?


  reply	other threads:[~2023-03-10 19:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 17:42 [PATCH 00/12] target/s390x: Handle unaligned accesses Ilya Leoshkevich
2023-03-10 17:42 ` [PATCH 01/12] target/s390x: Handle branching to odd addresses Ilya Leoshkevich
2023-03-10 19:24   ` Richard Henderson
2023-03-10 19:34     ` Ilya Leoshkevich [this message]
2023-03-10 19:54       ` Richard Henderson
2023-03-10 17:42 ` [PATCH 02/12] target/s390x: Handle EXECUTE of " Ilya Leoshkevich
2023-03-10 19:31   ` Richard Henderson
2023-03-10 17:42 ` [PATCH 03/12] target/s390x: Handle LGRL from non-aligned addresses Ilya Leoshkevich
2023-03-10 19:26   ` Richard Henderson
2023-03-10 17:42 ` [PATCH 04/12] target/s390x: Handle LRL and LGFRL " Ilya Leoshkevich
2023-03-10 19:28   ` Richard Henderson
2023-03-10 17:42 ` [PATCH 05/12] target/s390x: Handle LLGFRL " Ilya Leoshkevich
2023-03-10 19:28   ` Richard Henderson
2023-03-10 17:42 ` [PATCH 06/12] target/s390x: Handle CRL and CGFRL with " Ilya Leoshkevich
2023-03-10 19:32   ` Richard Henderson
2023-03-10 17:42 ` [PATCH 07/12] target/s390x: Handle CGRL and CLGRL " Ilya Leoshkevich
2023-03-10 19:32   ` Richard Henderson
2023-03-10 17:42 ` [PATCH 08/12] target/s390x: Handle CLRL and CLGFRL " Ilya Leoshkevich
2023-03-10 19:33   ` Richard Henderson
2023-03-10 17:42 ` [PATCH 09/12] target/s390x: Handle STRL to " Ilya Leoshkevich
2023-03-10 19:33   ` Richard Henderson
2023-03-10 17:42 ` [PATCH 10/12] target/s390x: Handle STGRL " Ilya Leoshkevich
2023-03-10 19:34   ` Richard Henderson
2023-03-10 17:42 ` [PATCH 11/12] target/s390x: Update do_unaligned_access() comment Ilya Leoshkevich
2023-03-10 19:34   ` Richard Henderson
2023-03-10 17:42 ` [PATCH 12/12] tests/tcg/s390x: Test unaligned accesses Ilya Leoshkevich

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=f75b53839aebc414c45da99b7b9e6fccef72b2d2.camel@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=h.grovsteen@tx.rr.com \
    --cc=nsg@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /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).