From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] ARM: KVM: arch_timers: zero CNTVOFF upon return to host
Date: Thu, 4 Apr 2013 16:38:18 +0100 [thread overview]
Message-ID: <20130404153818.GA23725@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <CAEDV+gJVq9N-ASm=m58q6umRhLo2aNn6iQNbecTXG9zejWiZCg@mail.gmail.com>
On Thu, Apr 04, 2013 at 04:27:50PM +0100, Christoffer Dall wrote:
> On Thu, Apr 4, 2013 at 2:29 AM, Mark Rutland <mark.rutland@arm.com> wrote:
> > Hi Christoffer,
> >
> > On Thu, Apr 04, 2013 at 12:39:27AM +0100, Christoffer Dall wrote:
> >> On Wed, Mar 27, 2013 at 10:11 AM, Mark Rutland <mark.rutland@arm.com> wrote:
> >> > To use the virtual counters from the host, we need to ensure that
> >> > CNTVOFF doesn't change unexpectedly. When we change to a guest, we
> >> > replace the host's CNTVOFF, but we don't restore it when returning to
> >> > the host.
> >> >
> >> > As the host sets CNTVOFF to zero, and never changes it, we can simply
> >> > zero CNTVOFF when returning to the host. This patch adds said zeroing to
> >> > the return to host path.
> >> >
> >> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> >> > Acked-by: Marc Zyngier <marc.zyngier@arm.com>
> >> > Cc: Christoffer Dall <cdall@cs.columbia.edu>
> >> > ---
> >> > arch/arm/kvm/interrupts_head.S | 4 ++++
> >> > 1 file changed, 4 insertions(+)
> >> >
> >> > diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S
> >> > index 3c8f2f0..d43cfb5 100644
> >> > --- a/arch/arm/kvm/interrupts_head.S
> >> > +++ b/arch/arm/kvm/interrupts_head.S
> >> > @@ -497,6 +497,10 @@ vcpu .req r0 @ vcpu pointer always in r0
> >> > add r5, vcpu, r4
> >> > strd r2, r3, [r5]
> >> >
> >> > + @ Ensure host CNTVCT == CNTPCT
> >> > + mov r2, #0
> >> > + mcrr p15, 4, r2, r2, c14 @ CNTVOFF
> >> > +
> >> > 1:
> >> > #endif
> >> > @ Allow physical timer/counter access for the host
> >> > --
> >> > 1.8.1.1
> >> >
> >> >
> >>
> >> looks good to me.
> >>
> >> Merged into kvm-arm-fixes.
> >
> > As this patch depends on the previous patch (which sets CNTVOFF to 0 in the hyp
> > stub), and the rest of the patches depend on both this patch and the previous
> > for correct operation, the series really needs to be taken together.
> >
>
> I don't see why this patch depends on the prior patches, I see it the
> other way around.
The patch itself doesn't stricly depend on the others, but the description
does: "As the host sets CNTVOFF to zero" - this is only true once the previous
patch has been applied. As the later patches have a dependence on this patch, I
don't think it makes sense for it to go in on its own -- if anything it makes
it more difficult to apply the rest of the series as it now has a dependence on
or conflict with kvm-arm-fixes.
>
> > Would you be able to give your ack instead?
>
> But sure, I definitely ack the patch.
Cheers.
Mark.
next prev parent reply other threads:[~2013-04-04 15:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-27 17:11 [PATCH 0/5] arm: arch_timer cleanups and niceties for 3.10 Mark Rutland
2013-03-27 17:11 ` [PATCH 1/5] ARM: hyp: initialize CNTVOFF to zero Mark Rutland
2013-03-27 17:11 ` [PATCH 2/5] ARM: KVM: arch_timers: zero CNTVOFF upon return to host Mark Rutland
2013-04-03 23:39 ` Christoffer Dall
2013-04-04 9:29 ` Mark Rutland
2013-04-04 15:27 ` Christoffer Dall
2013-04-04 15:38 ` Mark Rutland [this message]
2013-03-27 17:11 ` [PATCH 3/5] clocksource: arch_timer: use virtual counters Mark Rutland
2013-03-27 17:11 ` [PATCH 4/5] arm: fix up ARM_ARCH_TIMER selects Mark Rutland
2013-03-27 19:47 ` Stephen Warren
2013-04-02 13:28 ` Mark Rutland
2013-03-27 17:11 ` [PATCH 5/5] ARM: arch_timer: stop virtual timer when booted in HYP mode Mark Rutland
2013-03-27 17:51 ` [PATCH 0/5] arm: arch_timer cleanups and niceties for 3.10 Santosh Shilimkar
2013-04-02 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=20130404153818.GA23725@e106331-lin.cambridge.arm.com \
--to=mark.rutland@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 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).