linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Julia Cartwright <julia@ni.com>
Cc: Julien Thierry <julien.thierry@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"linux-rt-users@vger.kernel.org" <linux-rt-users@vger.kernel.org>,
	"marc.zyngier@arm.com" <marc.zyngier@arm.com>,
	"bigeasy@linutronix.de" <bigeasy@linutronix.de>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v3 1/3] KVM: arm/arm64: vgic: Make vgic_irq->irq_lock a raw_spinlock
Date: Fri, 1 Feb 2019 17:55:43 +0000	[thread overview]
Message-ID: <6eeb2d94-cdda-006b-f32f-7857b61b3eaa@arm.com> (raw)
In-Reply-To: <20190201173650.GC29111@jcartwri.amer.corp.natinst.com>

Hi Julia,

On 01/02/2019 17:36, Julia Cartwright wrote:
> On Fri, Feb 01, 2019 at 03:30:58PM +0000, Julien Grall wrote:
>> Hi Julien,
>>
>> On 07/01/2019 15:06, Julien Thierry wrote:
>>> vgic_irq->irq_lock must always be taken with interrupts disabled as
>>> it is used in interrupt context.
>>
>> I am a bit confused with the reason here. The code mention that ap_list_lock
>> could be taken from the timer interrupt handler interrupt. I assume it
>> speaks about the handler kvm_arch_timer_handler. Looking at the
>> configuration of the interrupt, the flag IRQF_NO_THREAD is not set, so the
>> interrupt should be threaded when CONFIG_PREEMPT_FULL is set. If my
>> understanding is correct, this means the interrupt thread would sleep if it
>> takes the spinlock.
>>
>> Did I miss anything? Do you have an exact path where the vGIC is actually
>> called from an interrupt context?
> 
> The part you're missing is that percpu interrupts are not force
> threaded:
> 
> 	static int irq_setup_forced_threading(struct irqaction *new)
> 	{
> 		if (!force_irqthreads)
> 			return 0;
> 		if (new->flags & (IRQF_NO_THREAD | IRQF_PERCPU | IRQF_ONESHOT))
> 			return 0;
> 	
> 		/* ...*/
> 	}

Thank you for the pointer! I think it would be worth mentioning in the commit 
message that per-cpu interrupts are not threaded.

Best regards,

-- 
Julien Grall

  reply	other threads:[~2019-02-01 17:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 15:06 [PATCH v3 0/3] KVM: arm/arm64: vgic: Use raw_spinlock for locks taken in IRQ context Julien Thierry
2019-01-07 15:06 ` [PATCH v3 1/3] KVM: arm/arm64: vgic: Make vgic_irq->irq_lock a raw_spinlock Julien Thierry
2019-02-01 15:30   ` Julien Grall
2019-02-01 17:36     ` Julia Cartwright
2019-02-01 17:55       ` Julien Grall [this message]
2019-01-07 15:06 ` [PATCH v3 2/3] KVM: arm/arm64: vgic: Make vgic_dist->lpi_list_lock " Julien Thierry
2019-01-07 15:06 ` [PATCH v3 3/3] KVM: arm/arm64: vgic: Make vgic_cpu->ap_list_lock " Julien Thierry

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=6eeb2d94-cdda-006b-f32f-7857b61b3eaa@arm.com \
    --to=julien.grall@arm.com \
    --cc=bigeasy@linutronix.de \
    --cc=julia@ni.com \
    --cc=julien.thierry@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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).