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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59A81C433F5 for ; Tue, 28 Sep 2021 22:13:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B55A6138B for ; Tue, 28 Sep 2021 22:13:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243060AbhI1WOh (ORCPT ); Tue, 28 Sep 2021 18:14:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243047AbhI1WOf (ORCPT ); Tue, 28 Sep 2021 18:14:35 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2AA0C061745 for ; Tue, 28 Sep 2021 15:12:55 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id q23so202354pfs.9 for ; Tue, 28 Sep 2021 15:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mlGjiTQKkKxj4KcXOOnDVYyCs2ZSFatBALPcwummKQM=; b=jNRMWegrFCxfd1N3NSKKno4QA4WsToa8zhOgjhCTO9pYDJCneH2oOgqg6dFx8DO9WF fwg1HEPb3KvCAeF3bRE0/7Ymnd8Dfky61i04gYYvZL7w8j6q8Y/ySOjvayDVBN4iOWxC +FGF2ioFURjwyLWgi9QR0Ok/CwEElNFeuVoB9sT6QJJNTKVvZ0sDmvGthThk9iVZyaDD F1ZENnMgH4SFf4Va3ys/kvLX4q8l6AVlrCj4ZEeSj63wNA0C7PdNfwD7gNXfs0xY8fuO bpPRJE2F3EWvgtBjP8eZIeX/TGj2enUv06ukSy0MfjiC+Vq77zG/0ySvIBOJhAHJ8ZTc 80iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mlGjiTQKkKxj4KcXOOnDVYyCs2ZSFatBALPcwummKQM=; b=upfX5haWnqt5Mf3/VVTYMNvAbS/lKZD3Mob7+Uen4R4g/9wvAc2q6lbTLH7pk4aYP2 psVI8UtktN5j72zpBRtFbsC2rVqRuzZcdVoJ9fGw6yG7HqZ7D0QjG+aZmH6dG+fXbd/g 4Pf3UBlhHrPESzjj5NjqSbInew8vkgXR3rk+h+uhTwikU0ELY8DjJbYp5KgVV3I6PrJ0 Eqy4izRNaLvmQuPPLJFKUjy5H2YLjhSoVDYcqq+mW0pd5WsYPJVaTZxnpj/PCLj1x7YE lRFxlvLIdmW5ni7TrooL6jMy5lG1aT1U3iAdKCYspbySMKY5liA6Z6PyBGNZm5OHH+Ba V71Q== X-Gm-Message-State: AOAM532zGkPAm+boA6ToCtLvPGiW67FdIJUrDsOvcNXJikVz6mwuX/ck aE22huAWxgnSuHkJ3dxx7oX72A== X-Google-Smtp-Source: ABdhPJwMJ6PXu1iYzvoK+xsmZtCnYCHuS4ke1upsonClun/Rtn4gUyNzkh7CQWduaPHweqPWa/7aGA== X-Received: by 2002:aa7:83c4:0:b0:44b:bc59:1a46 with SMTP id j4-20020aa783c4000000b0044bbc591a46mr2781583pfn.77.1632867175070; Tue, 28 Sep 2021 15:12:55 -0700 (PDT) Received: from google.com (254.80.82.34.bc.googleusercontent.com. [34.82.80.254]) by smtp.gmail.com with ESMTPSA id q6sm104284pjd.26.2021.09.28.15.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 15:12:54 -0700 (PDT) Date: Tue, 28 Sep 2021 22:12:50 +0000 From: David Matlack To: Sean Christopherson Cc: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, Jing Zhang Subject: Re: [PATCH 13/14] KVM: x86: Directly block (instead of "halting") UNINITIALIZED vCPUs Message-ID: References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-14-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210925005528.1145584-14-seanjc@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 24, 2021 at 05:55:27PM -0700, Sean Christopherson wrote: > Go directly to kvm_vcpu_block() when handling the case where userspace > attempts to run an UNINITIALIZED vCPU. The vCPU isn't halted and its time > spent in limbo arguably should not be factored into halt-polling as the > behavior of the VM at this point is not at all indicative of the behavior > of the VM once it is up and running, i.e. executing HLT in idle tasks. > > Note, because this case is encountered only on the first run of an AP vCPU, > vcpu->halt_poll_ns is guaranteed to be '0', and so KVM will not attempt > halt-polling, i.e. this really only affects the post-block bookkeeping. > > Signed-off-by: Sean Christopherson Reviewed-by: David Matlack > --- > arch/x86/kvm/x86.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 0d71c73a61bb..b444f9315766 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -10127,7 +10127,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) > r = -EINTR; > goto out; > } > - kvm_vcpu_halt(vcpu); > + kvm_vcpu_block(vcpu); > if (kvm_apic_accept_events(vcpu) < 0) { > r = 0; > goto out; > -- > 2.33.0.685.g46640cef36-goog > 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 376F9C433F5 for ; Tue, 28 Sep 2021 22:14:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 04DA26128E for ; Tue, 28 Sep 2021 22:14:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 04DA26128E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=JBNV4yUcuRMMzKU/P3QRctc9WnWBbKEKsgBw2cgW1Go=; b=wQ+0ePLs2skBv4 jdNs8SBrcj/a21yPk71Y2O+TedeFBbMsvMxY3EJ40e8ktnazg0HeANHDJPLeQhUHrAOwVquTyc2+4 vMPSwQnadocEMCRr4EO20CiCwNvJ271opJljB+zl7TOENR3sjozTa8CSAHA10pwlWA9asciR7dZSH osJOoQgSoDeZc+ppObcTinYVnBN8Mxd8dgYXBDljm/s54zQ5lAktU9oiphmULq76hi7IWH3hUtble VnKCzjy2kFVXcMefyKdMQDLcrUc4oExE8jaApfPEBTFosWhEDY1/v/CyZP4EACtZB3tLjKClwtZg2 DreG0EAciSNrvn0v/JMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVLLR-008zTL-If; Tue, 28 Sep 2021 22:13:02 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVLLM-008zSP-J8 for linux-arm-kernel@lists.infradead.org; Tue, 28 Sep 2021 22:12:58 +0000 Received: by mail-pg1-x52c.google.com with SMTP id y186so602255pgd.0 for ; Tue, 28 Sep 2021 15:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mlGjiTQKkKxj4KcXOOnDVYyCs2ZSFatBALPcwummKQM=; b=jNRMWegrFCxfd1N3NSKKno4QA4WsToa8zhOgjhCTO9pYDJCneH2oOgqg6dFx8DO9WF fwg1HEPb3KvCAeF3bRE0/7Ymnd8Dfky61i04gYYvZL7w8j6q8Y/ySOjvayDVBN4iOWxC +FGF2ioFURjwyLWgi9QR0Ok/CwEElNFeuVoB9sT6QJJNTKVvZ0sDmvGthThk9iVZyaDD F1ZENnMgH4SFf4Va3ys/kvLX4q8l6AVlrCj4ZEeSj63wNA0C7PdNfwD7gNXfs0xY8fuO bpPRJE2F3EWvgtBjP8eZIeX/TGj2enUv06ukSy0MfjiC+Vq77zG/0ySvIBOJhAHJ8ZTc 80iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mlGjiTQKkKxj4KcXOOnDVYyCs2ZSFatBALPcwummKQM=; b=xN/u2fesBY8eSRlPFa/RYAirPnfm8phCRvqsVPiZBtKxw8B4lZ2IykDhi46KXo2vHS d8rIvu3EU/8+vRrRAQ+NH/HCRYQdJE6iyRPwGzxCX6Lu76V3OFdcVLrzktR85eu4oRa8 tRprxUMwvUGI8rD1yYfQbCVJTVWYiYy+LiyGnmfnOW7H72aNAp8FaEAYWYIRr8LZnVHl yGj98xKiqtDewyJI2dM3rYAl1s1gx4YuCzuptP0qqX49GH/gppA6srGbGaQGl0QAVNLb tw+9pKQFN+T4UloGE7Bs/fe7daAAozYh+tt45Z46q18fHFVYekCF7WJFBAIVDIMNUhwk 6cwg== X-Gm-Message-State: AOAM531te7/6NvRhDdzNkb68cjFcUf9kba5CfwGlGigjF7zr7z9XQdFh W/I11vEaaxChAOwsTMqlYubRYA== X-Google-Smtp-Source: ABdhPJwMJ6PXu1iYzvoK+xsmZtCnYCHuS4ke1upsonClun/Rtn4gUyNzkh7CQWduaPHweqPWa/7aGA== X-Received: by 2002:aa7:83c4:0:b0:44b:bc59:1a46 with SMTP id j4-20020aa783c4000000b0044bbc591a46mr2781583pfn.77.1632867175070; Tue, 28 Sep 2021 15:12:55 -0700 (PDT) Received: from google.com (254.80.82.34.bc.googleusercontent.com. [34.82.80.254]) by smtp.gmail.com with ESMTPSA id q6sm104284pjd.26.2021.09.28.15.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 15:12:54 -0700 (PDT) Date: Tue, 28 Sep 2021 22:12:50 +0000 From: David Matlack To: Sean Christopherson Cc: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, Jing Zhang Subject: Re: [PATCH 13/14] KVM: x86: Directly block (instead of "halting") UNINITIALIZED vCPUs Message-ID: References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-14-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210925005528.1145584-14-seanjc@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210928_151256_659333_98E15D1B X-CRM114-Status: GOOD ( 22.64 ) 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, Sep 24, 2021 at 05:55:27PM -0700, Sean Christopherson wrote: > Go directly to kvm_vcpu_block() when handling the case where userspace > attempts to run an UNINITIALIZED vCPU. The vCPU isn't halted and its time > spent in limbo arguably should not be factored into halt-polling as the > behavior of the VM at this point is not at all indicative of the behavior > of the VM once it is up and running, i.e. executing HLT in idle tasks. > > Note, because this case is encountered only on the first run of an AP vCPU, > vcpu->halt_poll_ns is guaranteed to be '0', and so KVM will not attempt > halt-polling, i.e. this really only affects the post-block bookkeeping. > > Signed-off-by: Sean Christopherson Reviewed-by: David Matlack > --- > arch/x86/kvm/x86.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 0d71c73a61bb..b444f9315766 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -10127,7 +10127,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) > r = -EINTR; > goto out; > } > - kvm_vcpu_halt(vcpu); > + kvm_vcpu_block(vcpu); > if (kvm_apic_accept_events(vcpu) < 0) { > r = 0; > goto out; > -- > 2.33.0.685.g46640cef36-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22429C433EF for ; Wed, 29 Sep 2021 07:12:51 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id C8BB76137E for ; Wed, 29 Sep 2021 07:12:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C8BB76137E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 62BCE4B14C; Wed, 29 Sep 2021 03:12:50 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com 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 1M2oDUzk7o90; Wed, 29 Sep 2021 03:12:49 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 1FAF84B163; Wed, 29 Sep 2021 03:12:42 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 58FAB4086C for ; Tue, 28 Sep 2021 18:12:57 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu 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 RDsgX0KjS3fV for ; Tue, 28 Sep 2021 18:12:56 -0400 (EDT) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 4269940191 for ; Tue, 28 Sep 2021 18:12:56 -0400 (EDT) Received: by mail-pg1-f172.google.com with SMTP id 66so125773pgc.9 for ; Tue, 28 Sep 2021 15:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mlGjiTQKkKxj4KcXOOnDVYyCs2ZSFatBALPcwummKQM=; b=jNRMWegrFCxfd1N3NSKKno4QA4WsToa8zhOgjhCTO9pYDJCneH2oOgqg6dFx8DO9WF fwg1HEPb3KvCAeF3bRE0/7Ymnd8Dfky61i04gYYvZL7w8j6q8Y/ySOjvayDVBN4iOWxC +FGF2ioFURjwyLWgi9QR0Ok/CwEElNFeuVoB9sT6QJJNTKVvZ0sDmvGthThk9iVZyaDD F1ZENnMgH4SFf4Va3ys/kvLX4q8l6AVlrCj4ZEeSj63wNA0C7PdNfwD7gNXfs0xY8fuO bpPRJE2F3EWvgtBjP8eZIeX/TGj2enUv06ukSy0MfjiC+Vq77zG/0ySvIBOJhAHJ8ZTc 80iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mlGjiTQKkKxj4KcXOOnDVYyCs2ZSFatBALPcwummKQM=; b=haxKozDdvXdN8V89wfkr7xf9kAL8nPOmzxwELxzdJIzd2985LAAWYSAOLpzx13CuKn 2mFq7YFlhhzxS79AJAhsvkp62pNPRr94UyC29agLe/AFgkxMwLLqW7wLjlVinbBMBjVJ EEpDUYZnBje3wkb1xSPUwU9+iqzYbShv1W1eQ/tGjkM0D+BdTDyDfHAnarRa4At5gUwO 8H4drYet8l33nt9l+hw+HpOSssM0PYpksHwGC4yVMv00Deoku6HxbeWTKDV7S0ln/qf2 fIksa+CDAlKGCigv4CDZQtvYlLqERigvjUR7PAzbxlKKy6g9FZUyQqMcIMfbwzgHAgUA xSww== X-Gm-Message-State: AOAM531XITpzqJnIvnwtF7dRAdCXlD9PxX/5rZxSQq3nXxKZ0foHaZPI KwxMoZDWfKjScbo30WRq7YZOnA== X-Google-Smtp-Source: ABdhPJwMJ6PXu1iYzvoK+xsmZtCnYCHuS4ke1upsonClun/Rtn4gUyNzkh7CQWduaPHweqPWa/7aGA== X-Received: by 2002:aa7:83c4:0:b0:44b:bc59:1a46 with SMTP id j4-20020aa783c4000000b0044bbc591a46mr2781583pfn.77.1632867175070; Tue, 28 Sep 2021 15:12:55 -0700 (PDT) Received: from google.com (254.80.82.34.bc.googleusercontent.com. [34.82.80.254]) by smtp.gmail.com with ESMTPSA id q6sm104284pjd.26.2021.09.28.15.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 15:12:54 -0700 (PDT) Date: Tue, 28 Sep 2021 22:12:50 +0000 From: David Matlack To: Sean Christopherson Subject: Re: [PATCH 13/14] KVM: x86: Directly block (instead of "halting") UNINITIALIZED vCPUs Message-ID: References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-14-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210925005528.1145584-14-seanjc@google.com> X-Mailman-Approved-At: Wed, 29 Sep 2021 03:12:40 -0400 Cc: Wanpeng Li , kvm@vger.kernel.org, David Hildenbrand , linux-kernel@vger.kernel.org, Paul Mackerras , Claudio Imbrenda , kvmarm@lists.cs.columbia.edu, Janosch Frank , Marc Zyngier , Joerg Roedel , Huacai Chen , Christian Borntraeger , Aleksandar Markovic , kvm-ppc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jim Mattson , Cornelia Huck , linux-mips@vger.kernel.org, Paolo Bonzini , Vitaly Kuznetsov X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Fri, Sep 24, 2021 at 05:55:27PM -0700, Sean Christopherson wrote: > Go directly to kvm_vcpu_block() when handling the case where userspace > attempts to run an UNINITIALIZED vCPU. The vCPU isn't halted and its time > spent in limbo arguably should not be factored into halt-polling as the > behavior of the VM at this point is not at all indicative of the behavior > of the VM once it is up and running, i.e. executing HLT in idle tasks. > > Note, because this case is encountered only on the first run of an AP vCPU, > vcpu->halt_poll_ns is guaranteed to be '0', and so KVM will not attempt > halt-polling, i.e. this really only affects the post-block bookkeeping. > > Signed-off-by: Sean Christopherson Reviewed-by: David Matlack > --- > arch/x86/kvm/x86.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 0d71c73a61bb..b444f9315766 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -10127,7 +10127,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu) > r = -EINTR; > goto out; > } > - kvm_vcpu_halt(vcpu); > + kvm_vcpu_block(vcpu); > if (kvm_apic_accept_events(vcpu) < 0) { > r = 0; > goto out; > -- > 2.33.0.685.g46640cef36-goog > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm