From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14C25174C9 for ; Tue, 11 Jul 2023 07:57:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9ADC5C433C8; Tue, 11 Jul 2023 07:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689062249; bh=PeiBl+SvBw4RmV6deEOb87G9ctjLk2SqXS+cG7jO66c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GW/6GClwDJ9ulR4iggNNj+8qn19a4nSBJSe0lvJ9ci87CAw8RAfFyyODGUCPZdyS/ TGFHEPG5IUbr+WXQP3nXVBQn2MVaxlM25Eq3jjjZ5xSvME8qVLFJcvLGXAbI3l8DUv awe42JBCki1i58sM6EKR2Yo12bpvdZKl6jcVfvjpROFi1a5Jy3+b/Zk/LXJLk6FgYK zMhAY4uSq+md06ehFkSqCxsli9zWLUxcHmDgqwCG1qsaRCxMG8tXYqyYlJ9g0m/xuX EQMSgjVEYLqxGMaZ6ljBlpuZeNxZRpo3C0Aty1xv6T4lj0ChdS6jNH5LTQHmrDFU94 R7hBSGpdGbltA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qJ8FT-00C2qU-HX; Tue, 11 Jul 2023 08:57:27 +0100 Date: Tue, 11 Jul 2023 08:57:27 +0100 Message-ID: <86h6qax4m0.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: kvmarm@lists.linux.dev, James Morse , Suzuki K Poulose , Zenghui Yu , stable@vger.kernel.org, Xiang Chen Subject: Re: [PATCH] KVM: arm64: vgic-v4: Consistently request doorbell irq for blocking vCPU In-Reply-To: References: <20230710175553.1477762-1-oliver.upton@linux.dev> <86jzv6x66q.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oliver.upton@linux.dev, kvmarm@lists.linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, stable@vger.kernel.org, chenxiang66@hisilicon.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Tue, 11 Jul 2023 08:26:54 +0100, Oliver Upton wrote: > > On Tue, Jul 11, 2023 at 08:23:25AM +0100, Marc Zyngier wrote: > > On Mon, 10 Jul 2023 18:55:53 +0100, > > Oliver Upton wrote: > > > > > > Xiang reports that VMs occasionally fail to boot on GICv4.1 systems when > > > running a preemptible kernel, as it is possible that a vCPU is blocked > > > without requesting a doorbell interrupt. > > > > > > The issue is that any preemption that occurs between vgic_v4_put() and > > > schedule() on the block path will mark the vPE as nonresident and *not* > > > request a doorbell irq. > > > > It'd be worth spelling out. You need to go via *three* schedule() > > calls: one to be preempted (with DB set), one to be made resident > > again, and then the final one in kvm_vcpu_halt(), clearing the DB on > > vcpu_put() due to the bug. > > Yeah, a bit lazy in the wording. What I had meant to imply was > preemption happening after the doorbell is set up and before the thread > has an opportunity to explicitly schedule out. Perhaps I should just say > that. Yup. And it is the transition via a new 'resident' state that blows it. No need to repost for that, just amend it locally. Thanks, M. -- Without deviation from the norm, progress is not possible.