linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: alex.bennee@linaro.org (Alex Bennée)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] KVM: arm64: don't single-step for non-emulated faults
Date: Thu, 08 Nov 2018 12:26:16 +0000	[thread overview]
Message-ID: <87sh0b69hz.fsf@linaro.org> (raw)
In-Reply-To: <CAFEAcA8mKCTeswpiznVWR3kSfVfjbot1aTSfemFVNjzXYdSJwA@mail.gmail.com>


Peter Maydell <peter.maydell@linaro.org> writes:

> On 7 November 2018 at 17:39, Peter Maydell <peter.maydell@linaro.org> wrote:
>> On 7 November 2018 at 17:10, Alex Benn?e <alex.bennee@linaro.org> wrote:
>>> Not all faults handled by handle_exit are instruction emulations. For
>>> example a ESR_ELx_EC_IABT will result in the page tables being updated
>>> but the instruction that triggered the fault hasn't actually executed
>>> yet. We use the simple heuristic of checking for a changed PC before
>>> seeing if kvm_arm_handle_step_debug wants to claim we stepped an
>>> instruction.
>>>
>>> Signed-off-by: Alex Benn?e <alex.bennee@linaro.org>
>>
>> What's the rationale for this change? Presumably it's fixing
>> something, but the commit message doesn't really say what...
>>
>> This feels to me like it's working around the fact that
>> we've separated two things ("advance pc (or set it if we're
>> going to make the guest take an exception)" and "notice that
>> we have completed a single step") that should be handled
>> at one point in the code.
>
> ...so for instance if your guest PC is at the entrypoint for
> an exception, and you singlestep and take the same exception
> again, this should count as a single step completed, even
> though the PC has not changed. Granted, that's a little
> contrived, but it can happen in cases where the guest gets
> completely confused and is sitting in a tight loop taking
> exceptions because there's no ram at the vector table
> address, or whatever.

The alternative I thought of as I was hacking^H^H^H^H^H^H carefully
engineering this was to expand arm_exit_handlers[] and tag each handler
that was an instruction emulation and gate on that.

--
Alex Benn?e

  reply	other threads:[~2018-11-08 12:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 17:10 [RFC PATCH] KVM: arm64: don't single-step for non-emulated faults Alex Bennée
2018-11-07 17:39 ` Peter Maydell
2018-11-07 17:53   ` Peter Maydell
2018-11-08 12:26     ` Alex Bennée [this message]
2018-11-07 18:01 ` Mark Rutland
2018-11-07 18:08   ` Mark Rutland
2018-11-08 12:40     ` Alex Bennée
2018-11-08 13:51       ` Mark Rutland
2018-11-08 14:28         ` Alex Bennée
2018-11-08 14:38           ` Peter Maydell
2018-11-09 11:56             ` Mark Rutland
2018-11-09 12:24               ` Alex Bennée
2018-11-09 12:49                 ` Mark Rutland
2018-11-09 12:56                   ` Peter Maydell
2018-11-09 13:29                     ` Mark Rutland

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=87sh0b69hz.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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).