From nobody Fri May 3 23:02:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1572572827; cv=none; d=zoho.com; s=zohoarc; b=EtlwYSvsyBn3sGzmNjTlfpWdkHLVLZ+8ctk+BSzavcsuv2dYOz4JNNm7/Rz28hkT/d0n+ys0UWccP1xg9pKijWaXXSnftBrvWNeApQ+877r4sRy5fz+jZooV8W1keuVW1DdbgJJMN9WWHC/uMU7KffexvFcYzE6jhfir2k/pTeg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572572827; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=XlX+ty09UZXuTBafYrin8vn3SGnHni9qVyulXPg+M7o=; b=cFNg83m+NQ4kEPBVlMJWSejFVsKDMo5RrhMSwN0c+ONict65cnYigOSOwoDuv8jTnJmnqbIHxuqH4PsbcuIpBU/ejOX7zFf1vPsUIUFjPDtVjVxl99EkPeLs6FiAlAtMPNJeH6IoIcCXEMj81TOpXB+pcy4ZuW0DrAAueH5yYaI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157257282725514.314151897803413; Thu, 31 Oct 2019 18:47:07 -0700 (PDT) Received: from localhost ([::1]:55294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQM1o-00073L-KQ for importer@patchew.org; Thu, 31 Oct 2019 21:47:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37431) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQM0u-0006Uw-0e for qemu-devel@nongnu.org; Thu, 31 Oct 2019 21:46:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQM0r-00055r-S5 for qemu-devel@nongnu.org; Thu, 31 Oct 2019 21:46:07 -0400 Received: from mga04.intel.com ([192.55.52.120]:28146) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iQM0q-0004td-Li for qemu-devel@nongnu.org; Thu, 31 Oct 2019 21:46:05 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2019 18:46:00 -0700 Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by FMSMGA003.fm.intel.com with ESMTP; 31 Oct 2019 18:45:58 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,253,1569308400"; d="scan'208";a="206283499" From: Wei Yang To: pbonzini@redhat.com, mtosatti@redhat.com, rth@twiddle.net, ehabkost@redhat.com Subject: [PATCH] target/i386: return directly from hyperv_init_vcpu() if hyperv not enabled Date: Fri, 1 Nov 2019 09:45:28 +0800 Message-Id: <20191101014528.14505-1-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, Wei Yang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If hyperv is not enabled, related features are not set or enabled. No extra work to do, return directly. --- First time touch hyperv, hope my understanding is correct. Signed-off-by: Wei Yang --- target/i386/kvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index bfd09bd441..6532904f0c 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -1365,6 +1365,9 @@ static int hyperv_init_vcpu(X86CPU *cpu) Error *local_err =3D NULL; int ret; =20 + if (!hyperv_enabled(cpu)) + return 0; + if (cpu->hyperv_passthrough && hv_passthrough_mig_blocker =3D=3D NULL)= { error_setg(&hv_passthrough_mig_blocker, "'hv-passthrough' CPU flag prevents migration, use expl= icit" --=20 2.17.1