From nobody Thu May 2 23:33:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=yadro.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539873205634505.292631537332; Thu, 18 Oct 2018 07:33:25 -0700 (PDT) Received: from localhost ([::1]:42682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gD9Ma-0006ug-G3 for importer@patchew.org; Thu, 18 Oct 2018 10:33:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gD9KM-0005QK-1z for qemu-devel@nongnu.org; Thu, 18 Oct 2018 10:31:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gD9KG-0006O7-8P for qemu-devel@nongnu.org; Thu, 18 Oct 2018 10:31:03 -0400 Received: from mta-01.yadro.com ([89.207.88.251]:57260) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gD9KC-0006Au-Ew for qemu-devel@nongnu.org; Thu, 18 Oct 2018 10:30:58 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id 4D04441908; Thu, 18 Oct 2018 14:30:54 +0000 (UTC) Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N_chelSz6uZ4; Thu, 18 Oct 2018 17:30:53 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 7C2054120A; Thu, 18 Oct 2018 17:30:53 +0300 (MSK) Received: from localhost (172.17.128.60) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Thu, 18 Oct 2018 17:30:53 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:mime-version:x-mailer:message-id:date :date:subject:subject:from:from:received:received:received; s= mta-01; t=1539873053; x=1541687454; bh=YwFc5P+IxXgCQM1RMNjeceta3 y9aYi4+8HRftW0vOEw=; b=gz1BqpUCU8ZBVClqvgPr2ep33EvO55m5xBNdxU05N B5baN+3Z/SzNdqblt2WXHAKB19SVC5q77+a4/wsGz64/eWPm3cI18rB9Bnyqvv9K 7Lb3ua47vnHqP9Y9xTiMV6qdl8A9geP9pi84LBRCTuyOHqcG5uQLpUM20KKd51dH aA= X-Virus-Scanned: amavisd-new at yadro.com From: Roman Bolshakov To: Date: Thu, 18 Oct 2018 17:30:51 +0300 Message-ID: <20181018143051.48508-1-r.bolshakov@yadro.com> X-Mailer: git-send-email 2.17.1 (Apple Git-112) MIME-Version: 1.0 X-Originating-IP: [172.17.128.60] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 89.207.88.251 Subject: [Qemu-devel] [PATCH] i386: hvf: Remove hvf_disabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Roman Bolshakov , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" accel_init_machine sets *(acc->allowed) to true if acc->init_machine(ms) succeeds. There's no need to have both hvf_allowed and hvf_disabled. Signed-off-by: Roman Bolshakov Reviewed-by: Peter Maydell --- include/sysemu/hvf.h | 4 ++-- target/i386/hvf/hvf.c | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h index 241118845c..aaa51d2c51 100644 --- a/include/sysemu/hvf.h +++ b/include/sysemu/hvf.h @@ -17,7 +17,7 @@ #include "exec/memory.h" #include "sysemu/accel.h" =20 -extern int hvf_disabled; +extern bool hvf_allowed; #ifdef CONFIG_HVF #include #include @@ -26,7 +26,7 @@ extern int hvf_disabled; #include "hw/hw.h" uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx, int reg); -#define hvf_enabled() !hvf_disabled +#define hvf_enabled() (hvf_allowed) #else #define hvf_enabled() 0 #define hvf_get_supported_cpuid(func, idx, reg) 0 diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index 9f52bc413a..e193022c03 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -73,7 +73,6 @@ #include "target/i386/cpu.h" =20 HVFState *hvf_state; -int hvf_disabled =3D 1; =20 static void assert_hvf_ok(hv_return_t ret) { @@ -604,11 +603,6 @@ int hvf_init_vcpu(CPUState *cpu) return 0; } =20 -void hvf_disable(int shouldDisable) -{ - hvf_disabled =3D shouldDisable; -} - static void hvf_store_events(CPUState *cpu, uint32_t ins_len, uint64_t idt= vec_info) { X86CPU *x86_cpu =3D X86_CPU(cpu); @@ -934,7 +928,7 @@ int hvf_vcpu_exec(CPUState *cpu) return ret; } =20 -static bool hvf_allowed; +bool hvf_allowed; =20 static int hvf_accel_init(MachineState *ms) { @@ -942,7 +936,6 @@ static int hvf_accel_init(MachineState *ms) hv_return_t ret; HVFState *s; =20 - hvf_disable(0); ret =3D hv_vm_create(HV_VM_DEFAULT); assert_hvf_ok(ret); =20 --=20 2.17.1 (Apple Git-112)