qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: [Qemu-devel] icbt on PPC440 after commit 01662f3e
Date: Sat, 2 Jun 2018 14:54:06 +0200 (CEST)	[thread overview]
Message-ID: <alpine.BSF.2.21.1806021437320.49196@zero.eik.bme.hu> (raw)

Hello,

I get an invalid instruction exception for the icbt instruction on the 
sam460ex machine (PPC440 core 460EX CPU) but I think this should not raise 
exception as it's valid on BookE that this CPU should support. Commit 
01662f3e PPC: Implement e500 (FSL) MMU has introduced an extended 
instruction type (type2) in PPC opcodes and changed 
taget/ppc/translate_init.c as:

@@ -9437,7 +9492,8 @@ static int create_ppc_opcodes (CPUPPCState *env, const ppc_def_t *def)

      fill_new_table(env->opcodes, 0x40);
      for (opc = opcodes; opc < &opcodes[ARRAY_SIZE(opcodes)]; opc++) {
-        if ((opc->handler.type & def->insns_flags) != 0) {
+        if (((opc->handler.type & def->insns_flags) != 0) ||
+            ((opc->handler.type2 & def->insns_flags2) != 0)) {
              if (register_insn(env->opcodes, opc) < 0) {
                  printf("*** ERROR initializing PowerPC instruction "
                         "0x%02x 0x%02x 0x%02x\n", opc->opc1, opc->opc2,


it also made this change in target/ppc/translate.c:

-GEN_HANDLER(mbar, 0x1F, 0x16, 0x1a, 0x001FF801, PPC_BOOKE),
-GEN_HANDLER(msync, 0x1F, 0x16, 0x12, 0x03FFF801, PPC_BOOKE),
-GEN_HANDLER2(icbt_440, "icbt", 0x1F, 0x16, 0x00, 0x03E00001, PPC_BOOKE),
+GEN_HANDLER_E(mbar, 0x1F, 0x16, 0x1a, 0x001FF801,
+              PPC_BOOKE, PPC2_BOOKE206),
+GEN_HANDLER_E(msync, 0x1F, 0x16, 0x12, 0x03FFF801,
+              PPC_BOOKE, PPC2_BOOKE206),
+GEN_HANDLER2_E(icbt_440, "icbt", 0x1F, 0x16, 0x00, 0x03E00001,
+               PPC_BOOKE, PPC2_BOOKE206),

If I revert this change to icbt_440 it works without exception but 
according to the above it should also work for either type == BOOKE _or_ 
type2 == BOOKE206 but I still get exception in that case. Any idea why is 
this not working as expected?

Thank you,
BALATON Zoltan

             reply	other threads:[~2018-06-02 12:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-02 12:54 BALATON Zoltan [this message]
2018-06-09 12:07 ` [Qemu-devel] [Qemu-ppc] icbt on PPC440 after commit 01662f3e BALATON Zoltan
2018-06-09 14:43   ` Philippe Mathieu-Daudé

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=alpine.BSF.2.21.1806021437320.49196@zero.eik.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=agraf@suse.de \
    --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).