From: Marc Zyngier Subject: Re: [PATCH V9 1/3] irq: Allow to pass the IRQF_TIMER flag with percpu irq request Date: Tue, 25 Apr 2017 14:22:04 +0100 Message-ID: References: <1493042494-14057-1-git-send-email-daniel.lezcano@linaro.org> <398f3f3d-c567-0f1f-1a43-9b8d5805d5fd@arm.com> <20170424185909.GD2137@mai> <92e2a022-93d4-d4f3-78af-c9b5d51bb867@arm.com> <20170424195948.GE2137@mai> <16042494-2e67-e1a5-b9f6-af57e349d8a7@arm.com> <20170425083451.GA16888@mai> <20170425094927.GB16888@mai> <20170425125103.GC16888@mai> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3E1E440C90 for ; Tue, 25 Apr 2017 09:19:22 -0400 (EDT) Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IU-l+99nSsfk for ; Tue, 25 Apr 2017 09:19:20 -0400 (EDT) Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B465340C54 for ; Tue, 25 Apr 2017 09:19:20 -0400 (EDT) In-Reply-To: <20170425125103.GC16888@mai> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu To: Daniel Lezcano Cc: linux-samsung-soc@vger.kernel.org, kernel@stlinux.com, kvm@vger.kernel.org, Vineet Gupta , Patrice Chotard , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, Javier Martinez Canillas , Kukjin Kim , linux-arm-kernel@lists.infradead.org, Paolo Bonzini , tglx@linutronix.de, linux-snps-arc@lists.infradead.org, kvmarm@lists.cs.columbia.edu List-Id: kvmarm@lists.cs.columbia.edu On 25/04/17 13:51, Daniel Lezcano wrote: > On Tue, Apr 25, 2017 at 11:21:21AM +0100, Marc Zyngier wrote: >> On 25/04/17 10:49, Daniel Lezcano wrote: >>> On Tue, Apr 25, 2017 at 10:10:12AM +0100, Marc Zyngier wrote: >> >> [...] >> >>>>> +static inline void setup_timings(struct irq_desc *desc, struct irqaction *act) >>>>> +{ >>>>> + /* >>>>> + * We don't need the measurement because the idle code already >>>>> + * knows the next expiry event. >>>>> + */ >>>>> + if (act->flags & __IRQF_TIMER) >>>>> + return; >>>> >>>> And that's where this is really wrong for the KVM guest timer. As I >>>> said, this timer is under complete control of the guest, and the rest of >>>> the system doesn't know about it. KVM itself will only find out when the >>>> vcpu does a VM exit for a reason or another, and will just save/restore >>>> the state in order to be able to give the timer to another guest. >>>> >>>> The idle code is very much *not* aware of anything concerning that guest >>>> timer. >>> >>> Just for my own curiosity, if there are two VM (VM1 and VM2). VM1 sets a timer1 >>> at