From: cdall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/5] KVM: arm/arm64: vgic-v2: Do not use Active+Pending state for a HW interrupt
Date: Tue, 2 May 2017 22:56:35 +0200 [thread overview]
Message-ID: <20170502205635.GA4421@cbox> (raw)
In-Reply-To: <20170502133041.10980-4-marc.zyngier@arm.com>
On Tue, May 02, 2017 at 02:30:39PM +0100, Marc Zyngier wrote:
> When an interrupt is injected with the HW bit set (indicating that
> deactivation should be propagated to the physical distributor),
> special care must be taken so that we never mark the corresponding
> LR with the Active+Pending state (as the pending state is kept in
> the physycal distributor).
>
> Cc: stable at vger.kernel.org
> Fixes: 140b086dd197 ("KVM: arm/arm64: vgic-new: Add GICv2 world switch backend")
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
> ---
> virt/kvm/arm/vgic/vgic-v2.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/virt/kvm/arm/vgic/vgic-v2.c b/virt/kvm/arm/vgic/vgic-v2.c
> index a65757aab6d3..504b4bd0d651 100644
> --- a/virt/kvm/arm/vgic/vgic-v2.c
> +++ b/virt/kvm/arm/vgic/vgic-v2.c
> @@ -149,6 +149,13 @@ void vgic_v2_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr)
> if (irq->hw) {
> val |= GICH_LR_HW;
> val |= irq->hwintid << GICH_LR_PHYSID_CPUID_SHIFT;
> + /*
> + * Never set pending+active on a HW interrupt, as the
> + * pending state is kept at the physical distributor
> + * level.
> + */
> + if (irq->active && irq_is_pending(irq))
> + val &= ~GICH_LR_PENDING_BIT;
> } else {
> if (irq->config == VGIC_CONFIG_LEVEL)
> val |= GICH_LR_EOI;
> --
> 2.11.0
>
next prev parent reply other threads:[~2017-05-02 20:56 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 13:30 [PATCH 0/5] KVM/ARM: Fixes for 4.12-rc1 Marc Zyngier
2017-05-02 13:30 ` [PATCH 1/5] arm64: KVM: Do not use stack-protector to compile EL2 code Marc Zyngier
2017-05-02 14:40 ` Catalin Marinas
2017-05-02 14:48 ` Ard Biesheuvel
2017-05-02 14:50 ` Marc Zyngier
2017-05-11 16:02 ` Marc Zyngier
2017-05-11 16:11 ` Ard Biesheuvel
2017-05-11 16:36 ` Ard Biesheuvel
2017-05-11 16:42 ` Marc Zyngier
2017-05-11 17:01 ` Ard Biesheuvel
2017-05-12 15:07 ` Marc Zyngier
2017-05-02 13:30 ` [PATCH 2/5] arm: KVM: Do not use stack-protector to compile HYP code Marc Zyngier
2017-05-02 13:30 ` [PATCH 3/5] KVM: arm/arm64: vgic-v2: Do not use Active+Pending state for a HW interrupt Marc Zyngier
2017-05-02 20:56 ` Christoffer Dall [this message]
2017-05-02 13:30 ` [PATCH 4/5] KVM: arm/arm64: vgic-v3: " Marc Zyngier
2017-05-02 20:56 ` Christoffer Dall
2017-05-02 13:30 ` [PATCH 5/5] KVM: arm/arm64: vgic-v3: Use PREbits to infer the number of ICH_APxRn_EL2 registers Marc Zyngier
2017-05-15 9:30 ` Christoffer Dall
2017-05-02 14:44 ` [PATCH 0/5] KVM/ARM: Fixes for 4.12-rc1 Paolo Bonzini
2017-05-02 15:00 ` Marc Zyngier
2017-05-02 17:15 ` Christoffer Dall
2017-05-15 9:33 ` Christoffer Dall
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=20170502205635.GA4421@cbox \
--to=cdall@linaro.org \
--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).