From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7ECB6C433F5 for ; Mon, 20 Dec 2021 16:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b1RRmJtf+SKQ/TVBBb50VROh1Hwy6vh6ebQ+J/sQxnw=; b=MYZ9keeQiXbkEX wborzGdD7V/kg0V1d1ZDpRM8SSSrAb88KsGC1lfsq4LIKxXAOjPgxqM5jP3/VJCyy6DnPO0Zcuo94 82+LQwpz6tTQ2xDehtfRwxHGE5SBTPCNgOLgB2A3+0425+xmsZffeVEotd2VSsUYZYN4UWcSsSY0b SNOQrxkfX+exUcaA8QJiyJ5BP1PN+w3foegcvUdxVh1uQD9ZjVCHboseE4/Csz9fKHxwcWnvH5djt 6zq/HYxPFiLi/qdRks+XO5FGsYr1zBhGQwf/JXvkN0tvn1E1GHqjthvJUC274u10mwdkP9oJUkDpB lUNoRcuCMOeBhExQWwMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzLF1-003ERo-6l; Mon, 20 Dec 2021 16:10:23 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzLEy-003EQm-4x for linux-arm-kernel@lists.infradead.org; Mon, 20 Dec 2021 16:10:21 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D7890B80F1A; Mon, 20 Dec 2021 16:10:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C5B2C36AE2; Mon, 20 Dec 2021 16:10:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640016617; bh=7PXWoZ2KL+Ig9fI0vXCHFwz904irEuyU5Cq7Elp6Brs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=snS/I7FVuziSrqgP6ZfsuWLXBqwO3TFWdwCd4KlUP6kHrZWdPjZAlak431ccSc7f1 0xnqlXiaU+m0GPCfzw/4KCwQ459s/JxMMzdjDxIrMFLS5KEMefBAOKnyoZPgGN+57V yZDDQP23LRiRQ/o/aZyzqYRdFaGRSf5VdUan7u8zkjnPHO8Cm1f0I1QKtnbzSOGUxu NC67Go7+vGw+kXMpWvVJ8/SuItVhWPC3+ozfgBw1dgP2EPBocMzWN2YmpUspl4aOBt z35OcWYjFQT47Rm0ZytD8ly2w/1ym3LoU/4GGMFkBYnX4YLXv22meHX9G/bmZIunHh LV4S87CL0Kfvg== Date: Mon, 20 Dec 2021 17:10:14 +0100 From: Frederic Weisbecker To: Mark Rutland Cc: Nicolas Saenz Julienne , maz , Will Deacon , paulmck , linux-arm-kernel , rcu , Thomas Gleixner , kvmarm@lists.cs.columbia.edu, linux-kernel Subject: Re: Possible nohz-full/RCU issue in arm64 KVM Message-ID: <20211220161014.GC918551@lothringen> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211220_081020_349933_D6DBB59D X-CRM114-Status: GOOD ( 23.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Dec 17, 2021 at 01:21:39PM +0000, Mark Rutland wrote: > On Fri, Dec 17, 2021 at 12:51:57PM +0100, Nicolas Saenz Julienne wrote: > > Hi All, > > Hi, > > > arm64's guest entry code does the following: > > > > int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) > > { > > [...] > > > > guest_enter_irqoff(); > > > > ret = kvm_call_hyp_ret(__kvm_vcpu_run, vcpu); > > > > [...] > > > > local_irq_enable(); > > > > /* > > * We do local_irq_enable() before calling guest_exit() so > > * that if a timer interrupt hits while running the guest we > > * account that tick as being spent in the guest. We enable > > * preemption after calling guest_exit() so that if we get > > * preempted we make sure ticks after that is not counted as > > * guest time. > > */ > > guest_exit(); > > [...] > > } > > > > > > On a nohz-full CPU, guest_{enter,exit}() delimit an RCU extended quiescent > > state (EQS). Any interrupt happening between local_irq_enable() and > > guest_exit() should disable that EQS. Now, AFAICT all el0 interrupt handlers > > do the right thing if trggered in this context, but el1's won't. Is it > > possible to hit an el1 handler (for example __el1_irq()) there? > > I think you're right that the EL1 handlers can trigger here and won't exit the > EQS. > > I'm not immediately sure what we *should* do here. What does x86 do for an IRQ > taken from a guest mode? I couldn't spot any handling of that case, but I'm not > familiar enough with the x86 exception model to know if I'm looking in the > right place. This is one of the purposes of rcu_irq_enter(). el1 handlers don't call irq_enter()? Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel