From: Marc Zyngier <marc.zyngier@arm.com>
To: Christoffer Dall <cdall@kernel.org>
Cc: linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
Andre Przywara <Andre.Przywara@arm.com>,
kvmarm@lists.cs.columbia.edu, KVM General <kvm@vger.kernel.org>,
Eric Auger <eric.auger@redhat.com>
Subject: Re: [PATCH 1/2] KVM: arm/arm64: vgic: Don't populate multiple LRs with the same vintid
Date: Sat, 10 Mar 2018 13:57:59 +0000 [thread overview]
Message-ID: <86ina4av88.wl-marc.zyngier@arm.com> (raw)
In-Reply-To: <20180309213931.GE1917@lvm>
Hi Christoffer,
On Fri, 09 Mar 2018 21:39:31 +0000,
Christoffer Dall wrote:
>
> On Thu, Mar 08, 2018 at 06:39:20PM +0000, Marc Zyngier wrote:
> > Thinking of it a bit more: MI on EOI doesn't offer much more guarantee
> > in the way of priority ordering. Taking your example above: Even if
> > you generate a MI when EOIing the SGI, there is no guarantee that
> > you'll take the MI before you've acked the SPI.
>
> There's no guarantee, but at least you're attempting at processing the
> SGIs in first. It's the best we can do, but not completely correct,
> kinda thing...
>
> >
> > If you really want to offer that absolute guarantee that all the
> > multi-source SGIs of higher priority are delivered before anything
> > else, then you must make sure that only the SGIs are present in the
> > LRs, excluding any other interrupt on lower priority until you've
> > queued them all.
>
> Yes, that sucks! Might not be too hard to implement, it's basically an
> early out of the loop traversing the AP list, but just an annoying
> complication.
Yeah, it is a bit gross. The way I implemented it is by forcing the AP
list to be sorted if there is any multi-SGI in the pipeline, and early
out as soon as we see an interrupt of a lower priority than the first
multi-SGI. That way, we only have an overhead in the case that
combines multi-SGI and lower priority interrupts.
> > At that stage, I wonder if there is a point in doing anything at
> > all. The GICv2 architecture is too rubbish for words.
> >
>
> The case we do need to worry about is the guest processing all its
> interrupts and not exiting while there is actually still an SGI pending.
> At that point, we can either do it with the "no interrupts pending
> maintenance interrupt" or with the "EOI maintenance interrupt", and I
> think the latter at least gets us slightly closer to the architecture
> for a non-virtualized system.
I think that this is where we disagree. I don't see anything in the
architecture that mandates that we should present the SGIs before
anything else. All we need to do is to ensure that interrupts of
higher priority are presented before anything else. It is perfectly
acceptable for an implementation to deliver SGI0, then SPI3, and SGI0
(from another CPU) after that, as long as SPI3 isn't of lesser
priority than SGI0.
Another thing I dislike about using EOI for that is forces us to
propagate the knowledge of the multi-SGI horror further down the
stack, down to both implementations of vgic_populate_lr. NPIE allows
us to keep that knowledge local. But that's an orthogonal issue, and
we can further argue/bikeshed about the respective merits of both
solutions once we have something that fits the sorry state of the
GICv2 architecture ;-).
Thanks,
M.
--
Jazz is not dead, it just smell funny.
next prev parent reply other threads:[~2018-03-10 13:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 12:40 [PATCH 0/2] KVM: arm/arm64: GICv2-on-v3 fixes Marc Zyngier
2018-03-07 12:40 ` [PATCH 1/2] KVM: arm/arm64: vgic: Don't populate multiple LRs with the same vintid Marc Zyngier
2018-03-07 14:44 ` Andre Przywara
2018-03-07 23:34 ` Christoffer Dall
2018-03-08 10:19 ` Marc Zyngier
2018-03-08 13:40 ` Marc Zyngier
2018-03-08 16:02 ` Christoffer Dall
2018-03-08 17:04 ` Marc Zyngier
2018-03-08 18:39 ` Marc Zyngier
2018-03-09 21:39 ` Christoffer Dall
2018-03-10 13:57 ` Marc Zyngier [this message]
2018-03-11 1:51 ` Christoffer Dall
2018-03-07 12:40 ` [PATCH 2/2] kvm: arm/arm64: vgic-v3: Tighten synchronization for guests using v2 on v3 Marc Zyngier
2018-03-07 16:06 ` Andre Przywara
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=86ina4av88.wl-marc.zyngier@arm.com \
--to=marc.zyngier@arm.com \
--cc=Andre.Przywara@arm.com \
--cc=cdall@kernel.org \
--cc=eric.auger@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--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