Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp885958pxb; Wed, 27 Oct 2021 14:28:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOwqM3kv2CryajQbtkCeC1liymcFX4pLJbSGebFmz00en7ggXxFW2zUsWMPU5QIbzyyyND X-Received: by 2002:a17:906:6b0c:: with SMTP id q12mr136764ejr.0.1635370106219; Wed, 27 Oct 2021 14:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635370106; cv=none; d=google.com; s=arc-20160816; b=W/q/QLkhqsIc+cmgtW6B1EDcJwhZfReCy6xP8rlUusaD1pv8419fd+eufn7NyUm8jl q31wLp3mMHQu8RqqYlpsD3uIkO2Hx9cpyJGucge1SMk1sMHGP/tqLXlcMMj9kFE+enKc MJoQQeuM8ZEeH5T5kmA9lKx1t4GMYuVsYaXdzzuteIxSHCN9PvOA8+W5HvgbM2MIX2aI tduqNqVyzBn0rTSphr9wAOgGiponvGzDfxZ/hIlvzso7Hv+4lzYRzp/rcGWBSniTrM4F wofAyfRZsnfueoatpLpQJgmhL2DSKOa90BqpFe0ldNcXfgdnghdceF/k4j+9thnhCU0L CBUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=2qYSlrAKosDph82rxsiEzXsE5XvhQyE8fCwSEfLlqVs=; b=YzAr2ffmkWFnyyr3d+z0TxYrOtdGGhE7mFqb5BYrO04qa/ZUNPyNtjuVnJ2foyKuni t5z9IK6awWFOX5IMg6luutrEc/C1INvRYwtCMoaMtzfza7hBrR/Wu9VKGh4x8gaXbJpa 0o0aK4zA4IH0gVGIx4N5eyYOXIbHsgBruzeOceOpE7YPpz0nnQEkmZ4YqqU5X46hmAyo 1gZ6MpHNPHY3xoqc+y6TNkXch23m1S2tHlcJpPAIWVV07nwOi/yiY0A0WdLFED/Pqmbz m35l8skMgHXYvQ/rJryBQb5UIrgdKMFR9a4In07FPdzfGviYGuC+3Ur8QfqK9p57U48Z 90UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="ggc/KW4M"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di14si1330383ejc.710.2021.10.27.14.28.02; Wed, 27 Oct 2021 14:28:26 -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=@redhat.com header.s=mimecast20190719 header.b="ggc/KW4M"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239092AbhJ0OtZ (ORCPT + 97 others); Wed, 27 Oct 2021 10:49:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:44937 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239033AbhJ0OtT (ORCPT ); Wed, 27 Oct 2021 10:49:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635346013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2qYSlrAKosDph82rxsiEzXsE5XvhQyE8fCwSEfLlqVs=; b=ggc/KW4MZshSLWng6TuBX5BMmt7YiHtqq6koVo7+5qB42Lg751fYvVjvP7DGS1CSxCGISe J6tUl7Q27dW+UcIjYM2V8Bi+YKO+1663psmd5GcQ8WQReIiVDIAkQdcabza/70+WGDdWWU EHUPGfniRMBWBPqaB78LiySTrNw1Ix0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-207-3bmBenbzNJ6u5q4NMmEIWA-1; Wed, 27 Oct 2021 10:46:50 -0400 X-MC-Unique: 3bmBenbzNJ6u5q4NMmEIWA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6798A9F92C; Wed, 27 Oct 2021 14:46:46 +0000 (UTC) Received: from starship (unknown [10.40.194.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52BDC60843; Wed, 27 Oct 2021 14:46:35 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2 17/43] KVM: x86: Directly block (instead of "halting") UNINITIALIZED vCPUs From: Maxim Levitsky To: Sean Christopherson , 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 , 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 Date: Wed, 27 Oct 2021 17:46:34 +0300 In-Reply-To: <20211009021236.4122790-18-seanjc@google.com> References: <20211009021236.4122790-1-seanjc@google.com> <20211009021236.4122790-18-seanjc@google.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-10-08 at 19:12 -0700, Sean Christopherson wrote: > 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; Makes sense. Reviewed-by: Maxim Levitsky Best regards, Maxim levitsky