From nobody Sat Nov 1 22:19:03 2025 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527087072937816.4282210102043; Wed, 23 May 2018 07:51:12 -0700 (PDT) Received: from localhost ([::1]:33860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLV6Y-0007ma-9S for importer@patchew.org; Wed, 23 May 2018 10:51:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLUyl-0001gU-D2 for qemu-devel@nongnu.org; Wed, 23 May 2018 10:43:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLUyk-0000mL-Ds for qemu-devel@nongnu.org; Wed, 23 May 2018 10:43:03 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38578 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fLUyk-0000mD-7g for qemu-devel@nongnu.org; Wed, 23 May 2018 10:43:02 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C16404022909; Wed, 23 May 2018 14:43:01 +0000 (UTC) Received: from redhat.com (ovpn-124-180.rdu2.redhat.com [10.10.124.180]) by smtp.corp.redhat.com (Postfix) with SMTP id 31B44200BCBB; Wed, 23 May 2018 14:43:01 +0000 (UTC) Date: Wed, 23 May 2018 17:43:00 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1527086545-68024-8-git-send-email-mst@redhat.com> References: <1527086545-68024-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1527086545-68024-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 23 May 2018 14:43:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 23 May 2018 14:43:01 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 07/28] x86/cpu: use standard-headers/asm-x86.kvm_para.h 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: Peter Maydell , Eduardo Habkost , kvm@vger.kernel.org, Marcelo Tosatti , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Switch to the header we imported from Linux, this allows us to drop a hack in kvm_i386.h. More code will be dropped in the next patch. Signed-off-by: Michael S. Tsirkin --- include/sysemu/kvm.h | 1 - target/i386/cpu.h | 2 -- target/i386/kvm_i386.h | 6 ------ hw/i386/kvm/clock.c | 2 +- target/i386/cpu.c | 4 +--- target/i386/kvm.c | 4 ++-- 6 files changed, 4 insertions(+), 15 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 23669c4..0b64b8e 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -22,7 +22,6 @@ #ifdef NEED_CPU_H # ifdef CONFIG_KVM # include -# include # define CONFIG_KVM_IS_POSSIBLE # endif #else diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 8ac13f6..6645046 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -688,8 +688,6 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS]; #define CPUID_7_0_EDX_SPEC_CTRL (1U << 26) /* Speculation Control */ #define CPUID_7_0_EDX_SPEC_CTRL_SSBD (1U << 31) /* Speculative Store Bypa= ss Disable */ =20 -#define KVM_HINTS_DEDICATED (1U << 0) - #define CPUID_8000_0008_EBX_IBPB (1U << 12) /* Indirect Branch Predicti= on Barrier */ =20 #define CPUID_XSAVE_XSAVEOPT (1U << 0) diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h index 1de9876..e5df24c 100644 --- a/target/i386/kvm_i386.h +++ b/target/i386/kvm_i386.h @@ -30,12 +30,6 @@ #define kvm_pic_in_kernel() 0 #define kvm_ioapic_in_kernel() 0 =20 -/* These constants must never be used at runtime if kvm_enabled() is false. - * They exist so we don't need #ifdefs around KVM-specific code that alrea= dy - * checks kvm_enabled() properly. - */ -#define KVM_CPUID_FEATURES 0 - #endif /* CONFIG_KVM */ =20 bool kvm_allows_irq0_override(void); diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c index 7dac319..0bf1c60 100644 --- a/hw/i386/kvm/clock.c +++ b/hw/i386/kvm/clock.c @@ -26,7 +26,7 @@ #include "qapi/error.h" =20 #include -#include +#include "standard-headers/asm-x86/kvm_para.h" =20 #define TYPE_KVM_CLOCK "kvmclock" #define KVM_CLOCK(obj) OBJECT_CHECK(KVMClockState, (obj), TYPE_KVM_CLOCK) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index d95310f..9426041 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -40,9 +40,7 @@ #include "qom/qom-qobject.h" #include "sysemu/arch_init.h" =20 -#if defined(CONFIG_KVM) -#include -#endif +#include "standard-headers/asm-x86/kvm_para.h" =20 #include "sysemu/sysemu.h" #include "hw/qdev-properties.h" diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 0c656a9..6511329 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -18,7 +18,7 @@ #include =20 #include -#include +#include "standard-headers/asm-x86/kvm_para.h" =20 #include "qemu-common.h" #include "cpu.h" @@ -387,7 +387,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint= 32_t function, ret &=3D ~(1U << KVM_FEATURE_PV_UNHALT); } } else if (function =3D=3D KVM_CPUID_FEATURES && reg =3D=3D R_EDX) { - ret |=3D KVM_HINTS_DEDICATED; + ret |=3D 1U << KVM_HINTS_DEDICATED; found =3D 1; } =20 --=20 MST