All of lore.kernel.org
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 8/9] arm64: KVM: implement lazy world switch for debug registers
Date: Wed, 09 Jul 2014 12:18:30 +0100	[thread overview]
Message-ID: <87d2de7pbt.fsf@why.wild-wind.fr.eu.org> (raw)
In-Reply-To: <20140709094505.GD19801@cbox> (Christoffer Dall's message of "Wed, 9 Jul 2014 10:45:05 +0100")

On Wed, Jul 09 2014 at 10:45:05 am BST, Christoffer Dall <christoffer.dall@linaro.org> wrote:
> On Fri, Jun 20, 2014 at 02:00:06PM +0100, Marc Zyngier wrote:
>> Implement switching of the debug registers. While the number
>> of registers is massive, CPUs usually don't implement them all
>> (A57 has 6 breakpoints and 4 watchpoints, which gives us a total
>> of 22 registers "only").
>>
>> Also, we only save/restore them when MDSCR_EL1 has debug enabled,
>> or when we've flagged the debug registers as dirty. It means that
>> most of the time, we only save/restore MDSCR_EL1.
>>
>> Reviewed-by: Anup Patel <anup.patel@linaro.org>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>>  arch/arm64/kernel/asm-offsets.c |   1 +
>>  arch/arm64/kvm/hyp.S            | 462 +++++++++++++++++++++++++++++++++++++++-
>>  2 files changed, 457 insertions(+), 6 deletions(-)
>>

[...]

>> @@ -609,6 +1052,13 @@ __kvm_vcpu_return:
>>
>>       bl __restore_sysregs
>>       bl __restore_fpsimd
>> +
>> +     skip_debug_state x3, 1f
>> +     // Clear the dirty flag for the next run, as all the state has
>> +     // already been saved.
>> +     str     xzr, [x0, #VCPU_DEBUG_FLAGS]
>> +     bl      __restore_debug
>> +1:
>>       restore_host_regs
>>
>>       mov     x0, x1
>> --
>> 1.8.3.4
>>
>
> let's just try to remember the fact that we overwrite the entire bitmask
> here if we add more bits to that value some time:

I'll add a comment to that effect.

> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>

Thanks!

	M.
-- 
Without deviation from the norm, progress is not possible.

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <marc.zyngier@arm.com>
To: Christoffer Dall <christoffer.dall@linaro.org>
Cc: "linux-arm-kernel\@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"kvmarm\@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"kvm\@vger.kernel.org" <kvm@vger.kernel.org>,
	Anup Patel <anup.patel@linaro.org>
Subject: Re: [PATCH v3 8/9] arm64: KVM: implement lazy world switch for debug registers
Date: Wed, 09 Jul 2014 12:18:30 +0100	[thread overview]
Message-ID: <87d2de7pbt.fsf@why.wild-wind.fr.eu.org> (raw)
In-Reply-To: <20140709094505.GD19801@cbox> (Christoffer Dall's message of "Wed, 9 Jul 2014 10:45:05 +0100")

On Wed, Jul 09 2014 at 10:45:05 am BST, Christoffer Dall <christoffer.dall@linaro.org> wrote:
> On Fri, Jun 20, 2014 at 02:00:06PM +0100, Marc Zyngier wrote:
>> Implement switching of the debug registers. While the number
>> of registers is massive, CPUs usually don't implement them all
>> (A57 has 6 breakpoints and 4 watchpoints, which gives us a total
>> of 22 registers "only").
>>
>> Also, we only save/restore them when MDSCR_EL1 has debug enabled,
>> or when we've flagged the debug registers as dirty. It means that
>> most of the time, we only save/restore MDSCR_EL1.
>>
>> Reviewed-by: Anup Patel <anup.patel@linaro.org>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>>  arch/arm64/kernel/asm-offsets.c |   1 +
>>  arch/arm64/kvm/hyp.S            | 462 +++++++++++++++++++++++++++++++++++++++-
>>  2 files changed, 457 insertions(+), 6 deletions(-)
>>

[...]

>> @@ -609,6 +1052,13 @@ __kvm_vcpu_return:
>>
>>       bl __restore_sysregs
>>       bl __restore_fpsimd
>> +
>> +     skip_debug_state x3, 1f
>> +     // Clear the dirty flag for the next run, as all the state has
>> +     // already been saved.
>> +     str     xzr, [x0, #VCPU_DEBUG_FLAGS]
>> +     bl      __restore_debug
>> +1:
>>       restore_host_regs
>>
>>       mov     x0, x1
>> --
>> 1.8.3.4
>>
>
> let's just try to remember the fact that we overwrite the entire bitmask
> here if we add more bits to that value some time:

I'll add a comment to that effect.

> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>

Thanks!

	M.
-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2014-07-09 11:18 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 12:59 [PATCH v3 0/9] arm64: KVM: debug infrastructure support Marc Zyngier
2014-06-20 12:59 ` Marc Zyngier
2014-06-20 12:59 ` [PATCH v3 1/9] arm64: KVM: rename pm_fake handler to trap_raz_wi Marc Zyngier
2014-06-20 12:59   ` Marc Zyngier
2014-07-09  9:27   ` Christoffer Dall
2014-07-09  9:27     ` Christoffer Dall
2014-07-09  9:36     ` Marc Zyngier
2014-07-09  9:36       ` Marc Zyngier
2014-06-20 13:00 ` [PATCH v3 2/9] arm64: move DBG_MDSCR_* to asm/debug-monitors.h Marc Zyngier
2014-06-20 13:00   ` Marc Zyngier
2014-06-20 13:00 ` [PATCH v3 3/9] arm64: KVM: add trap handlers for AArch64 debug registers Marc Zyngier
2014-06-20 13:00   ` Marc Zyngier
2014-07-09  9:38   ` Christoffer Dall
2014-07-09  9:38     ` Christoffer Dall
2014-07-09 11:09     ` Marc Zyngier
2014-07-09 11:09       ` Marc Zyngier
2014-07-09 14:52       ` Christoffer Dall
2014-07-09 14:52         ` Christoffer Dall
2014-07-09 16:20         ` Marc Zyngier
2014-07-09 16:20           ` Marc Zyngier
2014-06-20 13:00 ` [PATCH v3 4/9] arm64: KVM: common infrastructure for handling AArch32 CP14/CP15 Marc Zyngier
2014-06-20 13:00   ` Marc Zyngier
2014-06-20 13:00 ` [PATCH v3 5/9] arm64: KVM: use separate tables for AArch32 32 and 64bit traps Marc Zyngier
2014-06-20 13:00   ` Marc Zyngier
2014-06-20 13:00 ` [PATCH v3 6/9] arm64: KVM: check ordering of all system register tables Marc Zyngier
2014-06-20 13:00   ` Marc Zyngier
2014-06-20 13:00 ` [PATCH v3 7/9] arm64: KVM: add trap handlers for AArch32 debug registers Marc Zyngier
2014-06-20 13:00   ` Marc Zyngier
2014-07-09  9:43   ` Christoffer Dall
2014-07-09  9:43     ` Christoffer Dall
2014-06-20 13:00 ` [PATCH v3 8/9] arm64: KVM: implement lazy world switch for " Marc Zyngier
2014-06-20 13:00   ` Marc Zyngier
2014-07-09  9:45   ` Christoffer Dall
2014-07-09  9:45     ` Christoffer Dall
2014-07-09 11:18     ` Marc Zyngier [this message]
2014-07-09 11:18       ` Marc Zyngier
2014-06-20 13:00 ` [PATCH v3 9/9] arm64: KVM: enable trapping of all " Marc Zyngier
2014-06-20 13:00   ` Marc Zyngier

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=87d2de7pbt.fsf@why.wild-wind.fr.eu.org \
    --to=marc.zyngier@arm.com \
    --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 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.