linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] KVM: arm/arm64: Fix arch timers with userspace irqchips
Date: Wed, 31 Jan 2018 14:28:07 +0000	[thread overview]
Message-ID: <2417c8c5-e09c-a2fb-a4c5-b04cc39b35a5@arm.com> (raw)
In-Reply-To: <20180131121425.7252-1-christoffer.dall@linaro.org>

On 31/01/18 12:14, Christoffer Dall wrote:
> When introducing support for irqchip in userspace we needed a way to
> mask the timer signal to prevent the guest continuously exiting due to a
> screaming timer.
> 
> We did this by disabling the corresponding percpu interrupt on the
> host interrupt controller, because we cannot rely on the host system
> having a GIC, and therefore cannot make any assumptions about having an
> active state to hide the timer signal.
> 
> Unfortunately, when introducing this feature, it became entirely
> possible that a VCPU which belongs to a VM that has a userspace irqchip
> can disable the vtimer irq on the host on some physical CPU, and then go
> away without ever enabling the vtimer irq on that physical CPU again.
> 
> This means that using irqchips in userspace on a system that also
> supports running VMs with an in-kernel GIC can prevent forward progress
> from in-kernel GIC VMs.
> 
> Later on, when we started taking virtual timer interrupts in the arch
> timer code, we would also leave this timer state active for userspace
> irqchip VMs, because we leave it up to a VGIC-enabled guest to
> deactivate the hardware IRQ using the HW bit in the LR.
> 
> Both issues are solved by only using the enable/disable trick on systems
> that do not have a host GIC which supports the active state, because all
> VMs on such systems must use irqchips in userspace.  Systems that have a
> working GIC with support for an active state use the active state to
> mask the timer signal for both userspace and in-kernel irqchips.
> 
> Cc: Alexander Graf <agraf@suse.de>
> Cc: <stable@vger.kernel.org> # v4.12+
> Fixes: d9e139778376 ("KVM: arm/arm64: Support arch timers with a userspace gic")
> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
-- 
Jazz is not dead. It just smells funny...

      reply	other threads:[~2018-01-31 14:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 12:14 [PATCH v2] KVM: arm/arm64: Fix arch timers with userspace irqchips Christoffer Dall
2018-01-31 14:28 ` Marc Zyngier [this message]

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=2417c8c5-e09c-a2fb-a4c5-b04cc39b35a5@arm.com \
    --to=marc.zyngier@arm.com \
    --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).