Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2918635pxb; Fri, 8 Oct 2021 19:16:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQ1+65xCbP0SlA5ary9wrgEmfyORBO1XZ9GSLhFnSI9Ekcs/q1AJsGtFGDtSkTZwl81jk1 X-Received: by 2002:a05:6402:21ea:: with SMTP id ce10mr19768095edb.328.1633745789317; Fri, 08 Oct 2021 19:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633745789; cv=none; d=google.com; s=arc-20160816; b=erV6U6EXDWemZpyFLJWAmmfioyZpn256OQ835YV7IXDHG4iAFQhIdLi45CHmx5wkhQ hB/QL2HlAtiwMYCUoSFz/WHL9pLlO0ZrrhyelDwFh4dQuP9yzD/gOIXCvE5FVXvOQ1i/ FmbSbnkFrISkEMftrDjnqRdU3nexkbX9hq8UYoY7pz13IOr9KyEvvt+ODx8w/QBfjEpD hDN2kzOuhQbxv4+M6MIWsbwiszavZuGAnjB0Z9l4InmHOjhz3fgDrURCn1okAREFMywT BK68Xl3gyyo+U0kHq0hG6ASOtDOo+q/1jSHruFwrz2ti72pCBU056EQjO9MGETXnqcO7 eiLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:reply-to:dkim-signature; bh=w/H4oIWp6aPNo76SoohcXjeRifcTKNkaEcXswmTfvS8=; b=poEpIVvrEpXdfeNLa7CrGT/KhyVCW2VCCrRrDtwk+vleDdIzsj8B+tvvUroRORmyHo yjXutnjF43SG5P/439wrDR8BO+ocImWYxzJy9t8e3BSfZ6wunBRyUsTiY6PO8WvFK1mI 9+dM3Itu09umT9okwAJWUQH18La8ditmTjjt9A/zkZf/mAF7h4Az+Y02A5Cav5clpqvi W/9yhI3RYgkuNZSNXmrpX7/gCvtnlGMCpLb8KcCKnzXme1c/AkvcbWV5Y9Km11j+zueS NOgD3YgjPKQpgS9oGgr3h6COVx5cjUVSHwPnYaedm8CBSgzVZcO133BN2cV3wf1alba9 ifxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Awo1Fquk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si1616968ejd.610.2021.10.08.19.16.04; Fri, 08 Oct 2021 19:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Awo1Fquk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244557AbhJICP6 (ORCPT + 99 others); Fri, 8 Oct 2021 22:15:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244323AbhJICPf (ORCPT ); Fri, 8 Oct 2021 22:15:35 -0400 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59729C0617A3 for ; Fri, 8 Oct 2021 19:13:24 -0700 (PDT) Received: by mail-qk1-x749.google.com with SMTP id h4-20020a05620a244400b004334ede5036so9804596qkn.13 for ; Fri, 08 Oct 2021 19:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=reply-to:date:in-reply-to:message-id:mime-version:references :subject:from:to:cc; bh=w/H4oIWp6aPNo76SoohcXjeRifcTKNkaEcXswmTfvS8=; b=Awo1FqukPn/eCDkoZYrOLJ78QMIWErLo3T1JPAM+azHfyRwj0C0I0SMNEn5GIB2txU M8xcuGBE4Pj+vf0eSl8CB+c5E5sQbuIMe89aP9EQE621aganA5V6HDgjMAcaBpBwJFVX C3SGKwbSwf16LR8Vkae/cgYp5NG8CH1ijTNN50Rr4HoNERkD2EJxcY2vp85daVtbnuQv ioYQxPegF+Cfcf+3bUPz5AVa6rlii3Hi3Y38Qqp1tDmmH+PsFzX9zPNBKfVsQyV5sVUN 4rGOba9XFbRiNbe1iaNvpJun8hhwygJEEzJPw9IjWbImWyRqKAUCmWW3EdcHL3Zmyd05 +drw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:date:in-reply-to:message-id :mime-version:references:subject:from:to:cc; bh=w/H4oIWp6aPNo76SoohcXjeRifcTKNkaEcXswmTfvS8=; b=ycr000UmyxqtYzP+/Zs9DuBAboGCbJgZGZx5UoNH+NFm3WbnGAwogPpK1JaItg1zSk lTDMM7TvRPT1etMjatNv7OVTjio0/6lHIGwZgyZPfsGDOV4GPU6/zQM6OkGRErDAHzIv cOBecfDfH9Wp8i663d+Ezy2AvUN3QoMcm4hqVP5TSrC1QKs5IvC2yQGeZOfOQ0QXtPZ6 3H/f9RWdks7QpYIa9DqvAipfD9me+ypgLbWjzwxBXvLvZZ7mvTFFEtkrYBWBvI0D4KUc 7zLUmKlWJnfO6NsTyoSELSdok1HTIepKi//hUj8+QELmcUkDgIc1UT2DQNievnzNFhzT kU3A== X-Gm-Message-State: AOAM530XR9ydU76SYVlNzRgPQcdafbBG/IqmULwPAfcIRkqBnbGReTls qpGORYa0npd3O6EwWNqjYoBq/gGBBBk= X-Received: from seanjc798194.pdx.corp.google.com ([2620:15c:90:200:e39b:6333:b001:cb]) (user=seanjc job=sendgmr) by 2002:ac8:4b57:: with SMTP id e23mr1849346qts.328.1633745603486; Fri, 08 Oct 2021 19:13:23 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 8 Oct 2021 19:12:10 -0700 In-Reply-To: <20211009021236.4122790-1-seanjc@google.com> Message-Id: <20211009021236.4122790-18-seanjc@google.com> Mime-Version: 1.0 References: <20211009021236.4122790-1-seanjc@google.com> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog Subject: [PATCH v2 17/43] KVM: x86: Directly block (instead of "halting") UNINITIALIZED vCPUs From: Sean Christopherson To: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Paolo Bonzini Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , Atish Patra , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Sean Christopherson , 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, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, David Matlack , Oliver Upton , Jing Zhang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Go directly to kvm_vcpu_block() when handling the case where userspace attempts to run an UNINITIALIZED vCPU. The vCPU is not halted, nor is it likely that halt-polling will be successful in this case. Reviewed-by: David Matlack Signed-off-by: Sean Christopherson --- 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 e6c17bbed25c..cd51f100e906 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -10133,7 +10133,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.882.g93a45727a2-goog