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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 BA478C433FE for ; Fri, 30 Sep 2022 12:37:20 +0000 (UTC) Received: from localhost ([::1]:46694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oeFGZ-0007na-HJ for qemu-devel@archiver.kernel.org; Fri, 30 Sep 2022 08:37:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeFAw-0005Nw-Mg; Fri, 30 Sep 2022 08:31:31 -0400 Received: from ams.source.kernel.org ([145.40.68.75]:42790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeFAu-00035r-Bd; Fri, 30 Sep 2022 08:31:30 -0400 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 A4428B8271C; Fri, 30 Sep 2022 12:31:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58949C433C1; Fri, 30 Sep 2022 12:31:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664541078; bh=N4GyIeMxKmEL4Hw5rJ8L7AwCbUmYIOZB1pZfiNoF+uY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jK+XtVTGitsNsOpzC8RazBAPbsiE0a4oqewvEssLGBgt0aAcj0+wo9gxTBdXqyZCG svd9m3QXOz3WK+81byNQvkhk1L8HzZa7yYnzQWoHJnwr4T8jdSpQGYlkgXw0g9ctzU fD4hUtzoMa/9T0RY56TXGTTSSq35sCkjuybx9lrNoC+w2qcC4mZasO4pU3GYjQ8du9 tb1pE1QMoSrVUZeAAQ7/l8tBZNN4zylyW4Uz3FJSefEY+yBOc7igPSyhZjPvnJERlf 89h1PRsjb2ik3sr3SHcWkU/lNygiMD+NY4XNnieMk1/mqKkkV4E0sUU9AwWwYjkNEW 1aCaME29OPFEg== 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 1oeFAh-00Dlan-Vc; Fri, 30 Sep 2022 13:31:16 +0100 Date: Fri, 30 Sep 2022 13:31:15 +0100 Message-ID: <867d1l6o30.wl-maz@kernel.org> From: Marc Zyngier To: Peter Maydell Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Vitaly Chikunov , Eric Auger , Paolo Bonzini Subject: Re: [PATCH v3] target/arm/kvm: Retry KVM_CREATE_VM call if it fails EINTR In-Reply-To: <20220930113824.1933293-1-peter.maydell@linaro.org> References: <20220930113824.1933293-1-peter.maydell@linaro.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/27.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) 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: peter.maydell@linaro.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org, vt@altlinux.org, eric.auger@redhat.com, pbonzini@redhat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Received-SPF: pass client-ip=145.40.68.75; envelope-from=maz@kernel.org; helo=ams.source.kernel.org X-Spam_score_int: -71 X-Spam_score: -7.2 X-Spam_bar: ------- X-Spam_report: (-7.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Fri, 30 Sep 2022 12:38:24 +0100, Peter Maydell wrote: > > Occasionally the KVM_CREATE_VM ioctl can return EINTR, even though > there is no pending signal to be taken. In commit 94ccff13382055 > we added a retry-on-EINTR loop to the KVM_CREATE_VM call in the > generic KVM code. Adopt the same approach for the use of the > ioctl in the Arm-specific KVM code (where we use it to create a > scratch VM for probing for various things). > > For more information, see the mailing list thread: > https://lore.kernel.org/qemu-devel/8735e0s1zw.wl-maz@kernel.org/ > > Reported-by: Vitaly Chikunov > Signed-off-by: Peter Maydell > --- > The view in the thread seems to be that this is a kernel bug (because > in QEMU's case there shouldn't be a signal to be delivered at this > point because of our signal handling strategy); so I've adopted the > same "just retry-on-EINTR for this specific ioctl" approach that > commit 94ccff13 did, rather than, for instance, something wider like > "make kvm_ioctl() and friends always retry on EINTR". > > v2: correctly check for -1 and errno is EINTR... > v3: really correctly check errno. This time for sure! > --- > target/arm/kvm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.