From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 07/10] KVM: arm/arm64: vgic: Allow HW interrupts for non-shared devices
Date: Mon, 14 Sep 2015 13:11:38 +0200 [thread overview]
Message-ID: <20150914111138.GF15712@cbox> (raw)
In-Reply-To: <55EFF0BC.8090200@linaro.org>
Hi Eric,
On Wed, Sep 09, 2015 at 10:41:32AM +0200, Eric Auger wrote:
[...]
> I tried to integrate into the updated state machine for non shared
> mapped IRQ but I fail.
What exactly do you mean when you refer to 'updated state machine' ?
>
> 1) The first problem encountered is how to reset the level of the IRQ
> (since its completion is not trapped). I added this reset in
> process_queued_irq. I think this was the most natural place since at
> sink time we get aware the IRQ is deactivated at physical distributor
> level. However I observe failures in vgic_validate_injection. I think
> there is due to a race between update_irq_pending and sync. As soon as
> the guest EOI's the virtual IRQ (and also the pIRQ), a new physical IRQ
> hits and gets injected by irqfd. This injection can happen before the
> sync. So I would be tempted to keep my current strategy of ignoring the
> validate_injection in case of non-shared mapped IRQ and not model the
> level state. The vIRQ directly comes from the HW so it must be valid
> (guest deactivated the previous occurence).
I'm a bit confused about what we are talking about here?
Are you asking about how we should deal with forwarded, level-triggered,
non-shared interrupts?
If that's the case, here are my high-level thoughts:
- We should not maintain a virtual line state, because this is
maintained in hardware
- Ideally we sample the physical distributor pending state at the
important points (sync/flush).
- Sampling the physical state may be slow/difficult, so we may
choose an optimization, for example cache the pending state when the
host ISR runs and clear the pending state when the interrupt is
injected and not care about spurious interrupts if the signal is
lowered after it's raised.
>
> 2) can_sample.
> once the above problem fixed, next issue is the can_sample failure.
> Queued state also is reset in process_queued_irq and can_sample fails.
> Same punishment. So currently the only manner I found to make this work
> and sample the IRQ only once is to use the pending state which I reset
> when I queue the IRQ.
So queued means that we don't sample the virtual line state, yes? If
so, then it would make sense to always set the state as queued for
injected forwarded non-shared level-triggered interrupts.
Does this help?
-Christoffer
next prev parent reply other threads:[~2015-09-14 11:11 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-10 13:20 [PATCH v3 00/10] ARM IRQ forward control based on IRQ bypass manager Eric Auger
2015-08-10 13:20 ` [PATCH v3 01/10] VFIO: platform: registration of a dummy IRQ bypass producer Eric Auger
2015-08-12 18:56 ` Alex Williamson
2015-08-17 15:17 ` Eric Auger
2015-08-10 13:20 ` [PATCH v3 02/10] VFIO: platform: test forwarded state when selecting the IRQ handler Eric Auger
2015-08-10 13:20 ` [PATCH v3 03/10] VFIO: platform: single handler using function pointer Eric Auger
2015-08-12 18:56 ` Alex Williamson
2015-08-17 15:25 ` Eric Auger
2015-08-10 13:20 ` [PATCH v3 04/10] VFIO: platform: add vfio_platform_set_automasked Eric Auger
2015-08-12 18:56 ` Alex Williamson
2015-08-17 15:38 ` Eric Auger
2015-08-18 17:44 ` Alex Williamson
2015-08-31 11:43 ` Antonios Motakis
2015-08-31 14:54 ` Alex Williamson
2015-08-10 13:20 ` [PATCH v3 05/10] VFIO: platform: add vfio_platform_is_active Eric Auger
2015-08-12 18:56 ` Alex Williamson
2015-08-17 15:39 ` Eric Auger
2015-09-02 19:29 ` Christoffer Dall
2015-08-10 13:21 ` [PATCH v3 06/10] VFIO: platform: add irq bypass producer management Eric Auger
2015-08-12 18:56 ` Alex Williamson
2015-08-17 15:51 ` Eric Auger
2015-09-02 19:32 ` Christoffer Dall
2015-08-10 13:21 ` [PATCH v3 07/10] KVM: arm/arm64: vgic: Allow HW interrupts for non-shared devices Eric Auger
2015-09-02 19:42 ` Christoffer Dall
2015-09-08 12:04 ` Eric Auger
2015-09-14 10:59 ` Christoffer Dall
2015-09-09 8:41 ` Eric Auger
2015-09-14 11:11 ` Christoffer Dall [this message]
2015-08-10 13:21 ` [PATCH v3 08/10] KVM: arm/arm64: vgic: support irqfd injection of a forwarded IRQ Eric Auger
2015-08-10 13:21 ` [PATCH v3 09/10] KVM: arm/arm64: vgic: forwarding control Eric Auger
2015-09-02 19:58 ` Christoffer Dall
2015-09-14 9:29 ` Eric Auger
2015-09-14 11:24 ` Christoffer Dall
2015-08-10 13:21 ` [PATCH v3 10/10] KVM: arm/arm64: implement IRQ bypass consumer functions Eric Auger
2015-09-02 19:58 ` [PATCH v3 00/10] ARM IRQ forward control based on IRQ bypass manager 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=20150914111138.GF15712@cbox \
--to=christoffer.dall@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).