qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
To: peter.maydell@linaro.org
Cc: qemu-devel@nongnu.org, joserz@linux.vnet.ibm.com,
	bharata@linux.vnet.ibm.com, nikunj@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 2/2] risu_ppc64le: distinguish real illegal instruction
Date: Mon, 13 Feb 2017 14:29:12 +0530	[thread overview]
Message-ID: <1486976352-549-2-git-send-email-nikunj@linux.vnet.ibm.com> (raw)
In-Reply-To: <1486976352-549-1-git-send-email-nikunj@linux.vnet.ibm.com>

While executing qemu_ppc64le, found an issue that the real illegal
instructions are handled as risu_op which results in wrong info at the
master end. Even the master needs to distinguish real illegal
instructions versus risu_op.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
---
 risu_ppc64le.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/risu_ppc64le.c b/risu_ppc64le.c
index 9c1fafd..54a9bcb 100644
--- a/risu_ppc64le.c
+++ b/risu_ppc64le.c
@@ -55,7 +55,6 @@ int send_register_info(int sock, void *uc)
     switch (op) {
     case OP_COMPARE:
     case OP_TESTEND:
-    default:
         return send_data_pkt(sock, &ri, sizeof(ri));
     case OP_SETMEMBLOCK:
         memblock = (void*)ri.gregs[0];
@@ -66,6 +65,11 @@ int send_register_info(int sock, void *uc)
     case OP_COMPAREMEM:
         return send_data_pkt(sock, memblock, MEMBLOCKLEN);
         break;
+    default:
+      fprintf(stderr, "apprentice: Unhandled instruction\n");
+      fprintf(stderr, "  faulting insn        0x%x\n", ri.faulting_insn);
+      fprintf(stderr, "  insn addr            0x%" PRIx64 "\n\n", ri.nip);
+      return -1;
     }
     return 0;
 }
@@ -85,7 +89,6 @@ int recv_and_compare_register_info(int sock, void *uc)
     switch (op) {
     case OP_COMPARE:
     case OP_TESTEND:
-    default:
         if (recv_data_pkt(sock, &apprentice_ri, sizeof(apprentice_ri))) {
             packet_mismatch = 1;
             resp = 2;
@@ -113,6 +116,11 @@ int recv_and_compare_register_info(int sock, void *uc)
         }
         send_response_byte(sock, resp);
         break;
+    default:
+      fprintf(stderr, "master: Unhandled instruction\n");
+      fprintf(stderr, "  faulting insn    0x%x\n", master_ri.faulting_insn);
+      fprintf(stderr, "  insn addr        0x%" PRIx64 "\n\n", master_ri.nip);
+      return -1;
     }
     return resp;
 }
-- 
2.7.4

  reply	other threads:[~2017-02-13  9:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13  8:59 [Qemu-devel] [PATCH 1/2] risu_ppc64le: fix the typo nb => rb Nikunj A Dadhania
2017-02-13  8:59 ` Nikunj A Dadhania [this message]
2017-02-24 16:03   ` [Qemu-devel] [PATCH 2/2] risu_ppc64le: distinguish real illegal instruction Peter Maydell
2017-02-27  5:33     ` Nikunj A Dadhania
2017-02-27 10:15       ` Peter Maydell
2017-02-24 16:01 ` [Qemu-devel] [PATCH 1/2] risu_ppc64le: fix the typo nb => rb Peter Maydell
2017-02-27  5:35   ` Nikunj A Dadhania

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=1486976352-549-2-git-send-email-nikunj@linux.vnet.ibm.com \
    --to=nikunj@linux.vnet.ibm.com \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=joserz@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@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).