From: Marc Zyngier <maz@kernel.org>
To: Zenghui Yu <yuzenghui@huawei.com>
Cc: Oliver Upton <oliver.upton@linux.dev>, <kvmarm@lists.linux.dev>,
James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Eric Auger <eric.auger@redhat.com>
Subject: Re: [PATCH] KVM: arm64: vgic-v3: Don't load pending state when enabling LPIs on RD
Date: Thu, 07 Mar 2024 10:09:02 +0000 [thread overview]
Message-ID: <86o7bq1hhd.wl-maz@kernel.org> (raw)
In-Reply-To: <db2920fd-9fe8-1ff4-3f00-34dc4afdcdd5@huawei.com>
Hi Zenghui,
On Thu, 07 Mar 2024 09:00:42 +0000,
Zenghui Yu <yuzenghui@huawei.com> wrote:
>
> So I've tested it with kvm-unit-tests and got failure with the
> its-pending-migration case:
>
> INFO: gicv3: its-pending-migration: Migration complete
> INFO: gicv3: its-pending-migration: expected 128 LPIs on PE #30, 0 observed
> FAIL: gicv3: its-pending-migration: 128 LPIs on both PE0 and PE1 after
> migration
> SUMMARY: 1 tests, 1 unexpected failures
>
> where the guest SW directly writes to the pending table when
> GICR_CTLR.EnableLPIs == 0. I seriously doubt there is any use case like
> that in real world. But not sure whether it is a funky behaviour from
> the architectural perspective.
Right, so this is *exactly* the thing I was worried about. A mapping
has been established, the interrupt wasn't pending, all good. Now, an
interrupt lands while GICR_CTLR.EnableLPIs == 0.
The spec says (4.7.3 "Effect of disabling interrupts")
"When GICR_CTLR.EnableLPIs == 0, LPIs are never set pending."
which to me is a pretty damning indication that we shouldn't take
these bits into account.
Of course, there is a grey area, in the sense that when we restore an
LPI via the restore interface, we are actually consuming pending bits
before EnableLPIs is set to 1.
But I would tend to draw the line between an interrupt that is
restored as part of rebuilding the KVM state, and an interrupt that is
forcefully injected behind our back.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2024-03-07 10:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-28 0:01 [PATCH] KVM: arm64: vgic-v3: Don't load pending state when enabling LPIs on RD Oliver Upton
2024-03-07 9:00 ` Zenghui Yu
2024-03-07 10:09 ` Marc Zyngier [this message]
2024-03-07 12:13 ` Zenghui Yu
2024-03-07 12:33 ` Zenghui Yu
2024-03-07 13:50 ` Marc Zyngier
2024-03-10 15:27 ` Zenghui Yu
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=86o7bq1hhd.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=eric.auger@redhat.com \
--cc=james.morse@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=oliver.upton@linux.dev \
--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.