All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Christoffer Dall <cdall@linaro.org>
Cc: julien.thierry@arm.com, kvm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org,
	marc.zyngier@arm.com
Subject: Re: [PATCH v3 0/3] KVM: arm64: single step emulation instructions
Date: Tue, 21 Nov 2017 12:12:58 +0000	[thread overview]
Message-ID: <874lpnygmt.fsf@linaro.org> (raw)
In-Reply-To: <20171120154131.GO28855@cbox>


Christoffer Dall <cdall@linaro.org> writes:

> Hi Alex,
>
> On Thu, Nov 16, 2017 at 03:39:18PM +0000, Alex Bennée wrote:
>> Hi,
>>
>> This is rev 3 of the series, practically the same than rev 2 but fixed
>> a return 1->0 in the kvm_run loop that Julien caught. I've added his
>> r-b tags to the other patches.
>>
>> As usual revision details bellow the --- in each patch.
>
> Thanks for taking care of this.
>
> I have applied the series and slightly tweaked the commit messages and
> commentary.
>
> Did we simply decide to not worry about exiting to userspace if we do
> fast-path emulation, such as for the errata workaround and GIC
> mashaling in switch.c ?

Hmm I'd forgotten about that - I figured it was all in handle_exit or
passed to userspace. So I guess in-hyp emulation is a 3rd class of
instruction emulation?

Which particular interface cases are we covering here?

I suspect if these are regions that are only accessed once the system is
up and running we are going to run into problems due to single stepping
while IRQs are enabled. But conceptually we just need to do the same
flag check after __skip_instr has done before deciding to fall out the
loop or goto again;

We would have to fake up HSR so handle_exit did the right thing on the
way out though. That seems a little icky....

>
> Thanks,
> -Christoffer
>
>>
>> Alex Bennée (3):
>>   kvm: arm debug: introduce helper for single-step
>>   kvm: arm64: handle single-stepping trapped instructions
>>   kvm: arm64: handle single-step of userspace mmio instructions
>>
>>  arch/arm/include/asm/kvm_host.h   |  5 +++++
>>  arch/arm64/include/asm/kvm_host.h |  1 +
>>  arch/arm64/kvm/debug.c            | 22 ++++++++++++++++++
>>  arch/arm64/kvm/handle_exit.c      | 47 +++++++++++++++++++++++++++------------
>>  virt/kvm/arm/arm.c                |  3 +++
>>  5 files changed, 64 insertions(+), 14 deletions(-)
>>
>> --
>> 2.15.0
>>


--
Alex Bennée

WARNING: multiple messages have this Message-ID (diff)
From: alex.bennee@linaro.org (Alex Bennée)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 0/3] KVM: arm64: single step emulation instructions
Date: Tue, 21 Nov 2017 12:12:58 +0000	[thread overview]
Message-ID: <874lpnygmt.fsf@linaro.org> (raw)
In-Reply-To: <20171120154131.GO28855@cbox>


Christoffer Dall <cdall@linaro.org> writes:

> Hi Alex,
>
> On Thu, Nov 16, 2017 at 03:39:18PM +0000, Alex Benn?e wrote:
>> Hi,
>>
>> This is rev 3 of the series, practically the same than rev 2 but fixed
>> a return 1->0 in the kvm_run loop that Julien caught. I've added his
>> r-b tags to the other patches.
>>
>> As usual revision details bellow the --- in each patch.
>
> Thanks for taking care of this.
>
> I have applied the series and slightly tweaked the commit messages and
> commentary.
>
> Did we simply decide to not worry about exiting to userspace if we do
> fast-path emulation, such as for the errata workaround and GIC
> mashaling in switch.c ?

Hmm I'd forgotten about that - I figured it was all in handle_exit or
passed to userspace. So I guess in-hyp emulation is a 3rd class of
instruction emulation?

Which particular interface cases are we covering here?

I suspect if these are regions that are only accessed once the system is
up and running we are going to run into problems due to single stepping
while IRQs are enabled. But conceptually we just need to do the same
flag check after __skip_instr has done before deciding to fall out the
loop or goto again;

We would have to fake up HSR so handle_exit did the right thing on the
way out though. That seems a little icky....

>
> Thanks,
> -Christoffer
>
>>
>> Alex Benn?e (3):
>>   kvm: arm debug: introduce helper for single-step
>>   kvm: arm64: handle single-stepping trapped instructions
>>   kvm: arm64: handle single-step of userspace mmio instructions
>>
>>  arch/arm/include/asm/kvm_host.h   |  5 +++++
>>  arch/arm64/include/asm/kvm_host.h |  1 +
>>  arch/arm64/kvm/debug.c            | 22 ++++++++++++++++++
>>  arch/arm64/kvm/handle_exit.c      | 47 +++++++++++++++++++++++++++------------
>>  virt/kvm/arm/arm.c                |  3 +++
>>  5 files changed, 64 insertions(+), 14 deletions(-)
>>
>> --
>> 2.15.0
>>


--
Alex Benn?e

  reply	other threads:[~2017-11-21 12:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16 15:39 [PATCH v3 0/3] KVM: arm64: single step emulation instructions Alex Bennée
2017-11-16 15:39 ` Alex Bennée
2017-11-16 15:39 ` [PATCH v3 1/3] kvm: arm debug: introduce helper for single-step Alex Bennée
2017-11-16 15:39   ` Alex Bennée
2017-11-16 15:39   ` Alex Bennée
2017-11-16 15:39 ` [PATCH v3 2/3] kvm: arm64: handle single-stepping trapped instructions Alex Bennée
2017-11-16 15:39   ` Alex Bennée
2017-11-16 15:39   ` Alex Bennée
2017-11-16 15:39 ` [PATCH v3 3/3] kvm: arm64: handle single-step of userspace mmio instructions Alex Bennée
2017-11-16 15:39   ` Alex Bennée
2017-11-16 15:39   ` Alex Bennée
2017-11-16 17:44   ` Julien Thierry
2017-11-16 17:44     ` Julien Thierry
2017-11-16 17:44     ` Julien Thierry
2017-11-20 15:41 ` [PATCH v3 0/3] KVM: arm64: single step emulation instructions Christoffer Dall
2017-11-20 15:41   ` Christoffer Dall
2017-11-21 12:12   ` Alex Bennée [this message]
2017-11-21 12:12     ` Alex Bennée
2017-11-21 12:43   ` Alex Bennée
2017-11-21 12:43     ` Alex Bennée
2017-11-21 13:10     ` Marc Zyngier
2017-11-21 13:10       ` Marc Zyngier
2017-11-22 11:46     ` Christoffer Dall
2017-11-22 11:46       ` Christoffer Dall

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=874lpnygmt.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=cdall@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=julien.thierry@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.