From: Oliver Upton <oliver.upton@linux.dev>
To: Marc Zyngier <maz@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>,
kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
kvm@vger.kernel.org, James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Reiji Watanabe <reijiw@google.com>,
nd@arm.com
Subject: Re: [PATCH v2] KVM: arm64: timers: Convert per-vcpu virtual offset to a global value
Date: Tue, 28 Feb 2023 19:22:04 +0000 [thread overview]
Message-ID: <Y/5UXKoK38fENlkb@linux.dev> (raw)
In-Reply-To: <87sfepha41.wl-maz@kernel.org>
On Tue, Feb 28, 2023 at 07:18:38PM +0000, Marc Zyngier wrote:
> On Tue, 28 Feb 2023 11:26:07 +0000,
> Joey Gouly <joey.gouly@arm.com> wrote:
> >
> > Hi Marc,
> >
> > On Fri, Feb 24, 2023 at 07:16:40PM +0000, Marc Zyngier wrote:
> > > Having a per-vcpu virtual offset is a pain. It needs to be synchronized
> > > on each update, and expands badly to a setup where different timers can
> > > have different offsets, or have composite offsets (as with NV).
> > >
> > > So let's start by replacing the use of the CNTVOFF_EL2 shadow register
> > > (which we want to reclaim for NV anyway), and make the virtual timer
> > > carry a pointer to a VM-wide offset.
> > >
> > > This simplifies the code significantly. It also addresses two terrible bugs:
> > >
> > > - The use of CNTVOFF_EL2 leads to some nice offset corruption
> > > when the sysreg gets reset, as reported by Joey.
> > >
> > > - The kvm mutex is taken from a vcpu ioctl, which goes against
> > > the locking rules...
> > >
> > > Reported-by: Joey Gouly <joey.gouly@arm.com>
> > > Reviewed-by: Reiji Watanabe <reijiw@google.com>
> > > Signed-off-by: Marc Zyngier <maz@kernel.org>
> > > Link: https://lore.kernel.org/r/20230224173915.GA17407@e124191.cambridge.arm.com
> >
> > Fixes my mismatched timer offset issues.
> >
> > Tested-by: Joey Gouly <joey.gouly@arm.com>
>
> Thanks for having given it a go. Hopefully Oliver will be able to send
> this to as a fix shortly.
Absolutely, I have this queued up. Thanks for testing the patch Joey.
Want to see if I can get push access to the kvmarm repository in time,
otherwise I'll send a pull to you Marc.
--
Thanks,
Oliver
WARNING: multiple messages have this Message-ID (diff)
From: Oliver Upton <oliver.upton@linux.dev>
To: Marc Zyngier <maz@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>,
kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
kvm@vger.kernel.org, James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Reiji Watanabe <reijiw@google.com>,
nd@arm.com
Subject: Re: [PATCH v2] KVM: arm64: timers: Convert per-vcpu virtual offset to a global value
Date: Tue, 28 Feb 2023 19:22:04 +0000 [thread overview]
Message-ID: <Y/5UXKoK38fENlkb@linux.dev> (raw)
In-Reply-To: <87sfepha41.wl-maz@kernel.org>
On Tue, Feb 28, 2023 at 07:18:38PM +0000, Marc Zyngier wrote:
> On Tue, 28 Feb 2023 11:26:07 +0000,
> Joey Gouly <joey.gouly@arm.com> wrote:
> >
> > Hi Marc,
> >
> > On Fri, Feb 24, 2023 at 07:16:40PM +0000, Marc Zyngier wrote:
> > > Having a per-vcpu virtual offset is a pain. It needs to be synchronized
> > > on each update, and expands badly to a setup where different timers can
> > > have different offsets, or have composite offsets (as with NV).
> > >
> > > So let's start by replacing the use of the CNTVOFF_EL2 shadow register
> > > (which we want to reclaim for NV anyway), and make the virtual timer
> > > carry a pointer to a VM-wide offset.
> > >
> > > This simplifies the code significantly. It also addresses two terrible bugs:
> > >
> > > - The use of CNTVOFF_EL2 leads to some nice offset corruption
> > > when the sysreg gets reset, as reported by Joey.
> > >
> > > - The kvm mutex is taken from a vcpu ioctl, which goes against
> > > the locking rules...
> > >
> > > Reported-by: Joey Gouly <joey.gouly@arm.com>
> > > Reviewed-by: Reiji Watanabe <reijiw@google.com>
> > > Signed-off-by: Marc Zyngier <maz@kernel.org>
> > > Link: https://lore.kernel.org/r/20230224173915.GA17407@e124191.cambridge.arm.com
> >
> > Fixes my mismatched timer offset issues.
> >
> > Tested-by: Joey Gouly <joey.gouly@arm.com>
>
> Thanks for having given it a go. Hopefully Oliver will be able to send
> this to as a fix shortly.
Absolutely, I have this queued up. Thanks for testing the patch Joey.
Want to see if I can get push access to the kvmarm repository in time,
otherwise I'll send a pull to you Marc.
--
Thanks,
Oliver
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-02-28 19:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-24 19:16 [PATCH v2] KVM: arm64: timers: Convert per-vcpu virtual offset to a global value Marc Zyngier
2023-02-24 19:16 ` Marc Zyngier
2023-02-28 11:26 ` Joey Gouly
2023-02-28 11:26 ` Joey Gouly
2023-02-28 19:18 ` Marc Zyngier
2023-02-28 19:18 ` Marc Zyngier
2023-02-28 19:22 ` Oliver Upton [this message]
2023-02-28 19:22 ` Oliver Upton
2023-03-11 21:36 ` Oliver Upton
2023-03-11 21:36 ` Oliver Upton
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=Y/5UXKoK38fENlkb@linux.dev \
--to=oliver.upton@linux.dev \
--cc=james.morse@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=nd@arm.com \
--cc=reijiw@google.com \
--cc=suzuki.poulose@arm.com \
--cc=yuzenghui@huawei.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.