From nobody Mon Feb 9 20:10:16 2026 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; dkim=fail; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539896793622287.0973122348605; Thu, 18 Oct 2018 14:06:33 -0700 (PDT) Received: from localhost ([::1]:44692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDFV2-0002wE-Ev for importer@patchew.org; Thu, 18 Oct 2018 17:06:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDEyJ-0007Jj-M5 for qemu-devel@nongnu.org; Thu, 18 Oct 2018 16:32:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDEyI-0006M7-O9 for qemu-devel@nongnu.org; Thu, 18 Oct 2018 16:32:43 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:53353) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDEyG-0006FW-QF for qemu-devel@nongnu.org; Thu, 18 Oct 2018 16:32:41 -0400 Received: by mail-wm1-x330.google.com with SMTP id y11-v6so1571355wma.3 for ; Thu, 18 Oct 2018 13:32:35 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-231-174.clienti.tiscali.it. [78.12.231.174]) by smtp.gmail.com with ESMTPSA id a12-v6sm14270952wrr.71.2018.10.18.13.32.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Oct 2018 13:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7HUFIcgz90QHXPT1gTvJKrel7pgUOr2cR4wg3G1xNNs=; b=GDBzeEkctsSMq82uJQ81fa7qV4ZRSta7vQjwv5DYS0YdOO/OeQRV9UDQcPkz0R0J7L nSOwUBBOR4m1HYwvjL/N79sRuUXVD7TjcFBFGWaaOTDBezpdvZSpav5aQEfn56EZtcj+ K4HPNkB71CN49MVwVxTinUpijt1zGpz+mXUlLengWxAo3rozwuMOd/zmKeMTNLi/ulBA eCJ1EiPTQjbiUBq1y5ZP1cZqWyP6BBJ5AqHk7/KYkYnchwX8jGHYFge+7yp4lMgWhiNY GA6JI3Y/RvS3ELqWSDD0YUEV8/H6JJzI5YGlZCxzWYMbAR8WsUhtYr3vSpHGUf24MzU0 4M1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7HUFIcgz90QHXPT1gTvJKrel7pgUOr2cR4wg3G1xNNs=; b=oGY1+wYKAKha+RYekum4i4dnshoPfcdytGO8RqGWQtODuF/k5pLhgCLckkV8zOOaeF BWAEtciiWAIvDADRpG2P1oNIvbjLWHxDSdgos9+xMT8ajQyP5H5ZDDujFwPiGcC0/DbN /mFzVzYgGySuSkbYvUrALPYwFc/YVxyR1TjiSWdnG2X3q1pLwAqhiDHEzEZfjzoyvdQa HUU7xUc01cIjgFRlqROJCQup8YVsq4eJB/ajD6jeHpm+JJ6bKoN+fZaVj2EoDXpapKAI YyKCzhmZy8krnu8nglPPz3FKa2c88iisyErsix6zK7IelYi/HBIiuRlvSehz2ra9Tp4U yDGA== X-Gm-Message-State: ABuFfogzKHD7y8CYRULWHpEFqh4rwZV3ZII3lOZUin02MewAad6Nihn8 zdhlLalguLOePXnhhD+8WitWh8YZ X-Google-Smtp-Source: ACcGV62n40fkKAYN8v+56up/0AsqcaatnbVpzLFi2IjaioaI0o+9y/wXlEidm+EY/KJ7U2g5dlo4VA== X-Received: by 2002:a1c:8154:: with SMTP id c81-v6mr1825666wmd.140.1539894754375; Thu, 18 Oct 2018 13:32:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2018 22:31:42 +0200 Message-Id: <1539894735-14232-16-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1539894735-14232-1-git-send-email-pbonzini@redhat.com> References: <1539894735-14232-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::330 Subject: [Qemu-devel] [PULL 15/48] 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: Roman Bolshakov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Roman Bolshakov 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 Message-Id: <20181018143051.48508-1-r.bolshakov@yadro.com> Signed-off-by: Paolo Bonzini --- 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 2411188..aaa51d2 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 9f52bc4..e193022 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 1.8.3.1