qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Otubo <otubo@redhat.com>
To: qemu-trivial@nongnu.org
Cc: thuth@redhat.com
Subject: [Qemu-trivial] [PATCH] qemu-system-tricore: segfault when entering "x 0" on the monitor
Date: Thu, 27 Jul 2017 14:37:10 +0200	[thread overview]
Message-ID: <20170727123710.29817-1-otubo@redhat.com> (raw)

Starting Qemu with "qemu-system-tricore -nographic -M tricore_testboard
-S" and entering "x 0" at the monitor prompt leads to Segmentation
fault. This happens because tricore_cpu_get_phys_page_debug() is not
implemented yet, this is a temporary workaround to avoid the crash do
just abort the execution with exit(1).

Signed-off-by: Eduardo Otubo <otubo@redhat.com>
---
 target/tricore/cpu.c | 10 ++++++++++
 target/tricore/cpu.h |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c
index 08f50e2ba7..822c7f4092 100644
--- a/target/tricore/cpu.c
+++ b/target/tricore/cpu.c
@@ -22,6 +22,15 @@
 #include "cpu.h"
 #include "qemu-common.h"
 #include "exec/exec-all.h"
+#include "qemu/error-report.h"
+
+hwaddr tricore_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr,
+                                         MemTxAttrs *attrs)
+{
+    error_report("function cpu_get_phys_page_attrs_debug not"
+                    "implemented, aborting");
+    exit(1);
+}
 
 static inline void set_feature(CPUTriCoreState *env, int feature)
 {
@@ -176,6 +185,7 @@ static void tricore_cpu_class_init(ObjectClass *c, void *data)
     cc->dump_state = tricore_cpu_dump_state;
     cc->set_pc = tricore_cpu_set_pc;
     cc->synchronize_from_tb = tricore_cpu_synchronize_from_tb;
+    cc->get_phys_page_attrs_debug = tricore_cpu_get_phys_page_attrs_debug;
 }
 
 static void cpu_register(const TriCoreCPUInfo *info)
diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h
index a3493a123c..c374ed3213 100644
--- a/target/tricore/cpu.h
+++ b/target/tricore/cpu.h
@@ -224,6 +224,9 @@ static inline TriCoreCPU *tricore_env_get_cpu(CPUTriCoreState *env)
 #define ENV_OFFSET offsetof(TriCoreCPU, env)
 
 hwaddr tricore_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+hwaddr tricore_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr,
+                                         MemTxAttrs *attrs);
+
 void tricore_cpu_dump_state(CPUState *cpu, FILE *f,
                             fprintf_function cpu_fprintf, int flags);
 
-- 
2.13.3



             reply	other threads:[~2017-07-27 14:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27 12:37 Eduardo Otubo [this message]
2017-07-27 13:36 ` [Qemu-trivial] [PATCH] qemu-system-tricore: segfault when entering "x 0" on the monitor Thomas Huth
  -- strict thread matches above, loose matches on Subject: below --
2017-07-27 14:30 Eduardo Otubo
2017-07-28  6:11 ` Thomas Huth

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=20170727123710.29817-1-otubo@redhat.com \
    --to=otubo@redhat.com \
    --cc=qemu-trivial@nongnu.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).