qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Ortiz <sameo@linux.intel.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Richard Henderson <richard.henderson@linaro.org>,
	qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 04/13] target: arm: Move all interrupt and exception handlers into their own file
Date: Tue, 27 Nov 2018 16:35:51 +0100	[thread overview]
Message-ID: <20181127153551.GC4393@caravaggio> (raw)
In-Reply-To: <CAFEAcA9wvrnshOTYz-jZ0n6m7SfusYY+bnB-iPnQuVNqqdg5Ww@mail.gmail.com>

On Tue, Nov 20, 2018 at 01:45:03PM +0000, Peter Maydell wrote:
> On 13 November 2018 at 16:52, Samuel Ortiz <sameo@linux.intel.com> wrote:
> > Most of them are TCG dependent so we want to be able to not build them
> > in order to support TCG disablement with ARM.
> >
> > Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
> > Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > Reviewed-by: Robert Bradford <robert.bradford@intel.com>
> > ---
> >  target/arm/excp_helper.c | 550 +++++++++++++++++++++++++++++++++++++++
> >  target/arm/helper.c      | 531 -------------------------------------
> >  target/arm/Makefile.objs |   2 +-
> >  3 files changed, 551 insertions(+), 532 deletions(-)
> >  create mode 100644 target/arm/excp_helper.c
> 
> You'll find that you need to rebase as there is a recent change
> that your moved copies are missing: commit e24ad484909e7.
> (I have just discovered git diff's --color-moved option which
> is great for checking this sort of code-movement patch.)
> 
> What is your plan for dealing with the way that the KVM code
> for injecting a breakpoint exception into the guest works
> by calling the do_interrupt code ?
> (see target/arm/kvm64.c:kvm_arm_handle_debug(),
> which calls cc->do_interrupt(cs).) This patch moves those
> functions to a file which won't be compiled and a later one
> in the series seems to stop cc->do_interrupt being set at all
> if CONFIG_TCG is not defined. That will result in QEMU crashing
> when it tries to inject an exception, won't it?
Yes, indeed.
So it seems we need to inject an exception back into the guest when
doing hardware assisted debugging and when we have not set any
breakpoint from QEMU. So it's essentially handling the debugging from
the guest case.
Would returning an error when that happens be an acceptable solution? So
when building qemu for arm64 with TCG disabled, one would basically no
longer be able to debug from the guest. Something along those lines:


diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
index 0a502091e7..3e8a871272 100644
--- a/target/arm/kvm64.c
+++ b/target/arm/kvm64.c
@@ -1079,6 +1079,11 @@ bool kvm_arm_handle_debug(CPUState *cs, struct kvm_debug_exit_arch *debug_exit)
                      __func__, debug_exit->hsr, env->pc);
     }
 
+    if (!tcg_enabled()) {
+        error_report("guest debugging not supported");
+        return false;
+    }
+
     /* If we are not handling the debug exception it must belong to
      * the guest. Let's re-use the existing TCG interrupt code to set
      * everything up properly.

  reply	other threads:[~2018-11-27 15:36 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13 16:52 [Qemu-devel] [PATCH 00/13] Support disabling TCG on ARM Samuel Ortiz
2018-11-13 16:52 ` [Qemu-devel] [PATCH 01/13] target: arm: Add copyright boilerplate Samuel Ortiz
2018-11-13 16:58   ` Peter Maydell
2018-11-13 17:00     ` Philippe Mathieu-Daudé
2018-11-13 23:29     ` Samuel Ortiz
2018-11-13 16:52 ` [Qemu-devel] [PATCH 02/13] target: arm: Remove unused headers Samuel Ortiz
2018-11-13 17:01   ` Peter Maydell
2018-11-13 18:02     ` Philippe Mathieu-Daudé
2018-11-13 18:07       ` Peter Maydell
2018-11-13 18:10         ` Philippe Mathieu-Daudé
2018-11-13 23:28       ` Samuel Ortiz
2018-11-13 16:52 ` [Qemu-devel] [PATCH 03/13] target: arm: Move all v7m helpers into their own file Samuel Ortiz
2018-11-20 13:54   ` Peter Maydell
2018-11-20 19:26     ` Philippe Mathieu-Daudé
2018-11-27 11:45     ` Samuel Ortiz
2018-11-13 16:52 ` [Qemu-devel] [PATCH 04/13] target: arm: Move all interrupt and exception handlers " Samuel Ortiz
2018-11-20 13:45   ` Peter Maydell
2018-11-27 15:35     ` Samuel Ortiz [this message]
2018-11-27 15:46       ` Peter Maydell
2018-11-28 10:40         ` Samuel Ortiz
2018-11-28 11:39           ` Peter Maydell
2018-11-28 13:57             ` Samuel Ortiz
2018-11-28 15:00               ` Samuel Ortiz
2018-11-20 14:03   ` Peter Maydell
2018-11-13 16:52 ` [Qemu-devel] [PATCH 05/13] target: arm: Move the DC ZVA helper into op_helper Samuel Ortiz
2018-11-13 16:52 ` [Qemu-devel] [PATCH 06/13] target: arm: Make ARM TLB filling routine static Samuel Ortiz
2018-11-13 16:52 ` [Qemu-devel] [PATCH 07/13] target: arm: Remove the LDST headers Samuel Ortiz
2018-11-20 14:00   ` Peter Maydell
2018-11-13 16:52 ` [Qemu-devel] [PATCH 08/13] target: arm: Move all VFP helpers into their own file Samuel Ortiz
2018-11-13 16:52 ` [Qemu-devel] [PATCH 09/13] target: arm: Move CPU state dumping routines to helper.c Samuel Ortiz
2018-11-13 16:52 ` [Qemu-devel] [PATCH 10/13] target: arm: Move watchpoints APIs " Samuel Ortiz
2018-11-13 16:52 ` [Qemu-devel] [PATCH 11/13] target: arm: Define TCG dependent functions when TCG is enabled Samuel Ortiz
2018-11-20 14:09   ` Peter Maydell
2018-11-13 16:52 ` [Qemu-devel] [PATCH 12/13] target: arm: Makefile cleanup Samuel Ortiz
2018-11-13 16:52 ` [Qemu-devel] [PATCH 13/13] target: arm: Do not build TCG objects when TCG is off Samuel Ortiz
2018-11-14 11:56 ` [Qemu-devel] [PATCH 00/13] Support disabling TCG on ARM no-reply

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=20181127153551.GC4393@caravaggio \
    --to=sameo@linux.intel.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).