qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Michael Neuling" <mikey@neuling.org>, <qemu-ppc@nongnu.org>
Cc: <qemu-devel@nongnu.org>, "Fabiano Rosas" <farosas@suse.de>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>
Subject: Re: [PATCH v2 6/6] target/ppc: Implement HEIR SPR
Date: Sun, 02 Apr 2023 12:48:06 +1000	[thread overview]
Message-ID: <CRLXE4JYYFU8.1IVDQRK6W5BMF@bobo> (raw)
In-Reply-To: <56482fa613790ede02b1fe086639ae33678d1481.camel@neuling.org>

On Wed Mar 29, 2023 at 3:51 PM AEST, Michael Neuling wrote:
> Nick,
>
> > +    case POWERPC_EXCP_HV_EMU:
> > +        env->spr[SPR_HEIR] = insn;
> > +        if (is_prefix_excp(env, insn)) {
> > +            uint32_t insn2 = ppc_ldl_code(env, env->nip + 4);
> > +            env->spr[SPR_HEIR] |= (uint64_t)insn2 << 32;
>
> Are inst and inst2 in the right locations here? I think you might need
> insn in the top half and insn2 in the bottom.
>
> I wrote the little test case below. I'd expect GPR0 and GPR1 to end up
> with the same value, but they don't with this code

You're right. I was a bit confused becaue the prefix instructions are
treated as two words, so ld (insn) in little endian doesn't match
HEIR, for example.

The ISA uses the term "image", but that's only really defined for 4
byte instructions AFAIKS. You can deduce though,

  There may be circumstances in which the suffix cannot be loaded [...]
  In such circumstances, bits 32:63 are set to 0s.

So prefix word goes in the high bits. Real P10 agrees, so does
systemsim. I'll fix and re-send.

Is there any better semantics in the ISA or should I raise an issue to
clarify instruction image for prefix?

Thanks,
Nick


      reply	other threads:[~2023-04-02  2:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 13:12 [PATCH v2 1/6] target/ppc: Fix width of some 32-bit SPRs Nicholas Piggin
2023-03-27 13:12 ` [PATCH v2 2/6] target/ppc: Better CTRL SPR implementation Nicholas Piggin
2023-03-27 13:12 ` [PATCH v2 3/6] target/ppc: Fix instruction loading endianness in alignment interrupt Nicholas Piggin
2023-03-31 21:27   ` Fabiano Rosas
2023-05-23 18:11   ` Anushree Mathur
2023-03-27 13:12 ` [PATCH v2 4/6] target/ppc: Alignment faults do not set DSISR in ISA v3.0 onward Nicholas Piggin
2023-03-31 21:25   ` Fabiano Rosas
2023-03-27 13:12 ` [PATCH v2 5/6] target/ppc: Add SRR1 prefix indication to interrupt handlers Nicholas Piggin
2023-03-31 21:26   ` Fabiano Rosas
2023-03-27 13:12 ` [PATCH v2 6/6] target/ppc: Implement HEIR SPR Nicholas Piggin
2023-03-29  5:51   ` Michael Neuling
2023-04-02  2:48     ` Nicholas Piggin [this message]

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=CRLXE4JYYFU8.1IVDQRK6W5BMF@bobo \
    --to=npiggin@gmail.com \
    --cc=danielhb413@gmail.com \
    --cc=farosas@suse.de \
    --cc=mikey@neuling.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /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).