From nobody Wed Nov 5 13:38:29 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1497468305632341.3232052101873; Wed, 14 Jun 2017 12:25:05 -0700 (PDT) Received: from localhost ([::1]:50527 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLDua-0008M3-5R for importer@patchew.org; Wed, 14 Jun 2017 15:25:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLDrb-0005u6-I9 for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:22:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLDrZ-0000PH-HM for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:21:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36906) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dLDrZ-0000P0-Ai for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:21:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 63BE685542 for ; Wed, 14 Jun 2017 19:21:56 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-84.ams2.redhat.com [10.36.116.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8369796FC2; Wed, 14 Jun 2017 19:21:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 63BE685542 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 63BE685542 From: Thomas Huth To: qemu-devel@nongnu.org, Paolo Bonzini Date: Wed, 14 Jun 2017 21:21:50 +0200 Message-Id: <1497468113-2874-2-git-send-email-thuth@redhat.com> In-Reply-To: <1497468113-2874-1-git-send-email-thuth@redhat.com> References: <1497468113-2874-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 14 Jun 2017 19:21:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/4] include/exec/poison: Add missing TARGET defines 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: , 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 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since we've got some new CPU targets in QEMU during the last months and years, we've got some new TARGET_xxx defines now which should be marked as poisoned for common code. Signed-off-by: Thomas Huth --- include/exec/poison.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/exec/poison.h b/include/exec/poison.h index 3ca7929..9356d5f 100644 --- a/include/exec/poison.h +++ b/include/exec/poison.h @@ -12,17 +12,28 @@ #pragma GCC poison TARGET_CRIS #pragma GCC poison TARGET_LM32 #pragma GCC poison TARGET_M68K +#pragma GCC poison TARGET_MICROBLAZE #pragma GCC poison TARGET_MIPS +#pragma GCC poison TARGET_ABI_MIPSO32 #pragma GCC poison TARGET_MIPS64 +#pragma GCC poison TARGET_ABI_MIPSN64 +#pragma GCC poison TARGET_MOXIE +#pragma GCC poison TARGET_NIOS2 #pragma GCC poison TARGET_OPENRISC #pragma GCC poison TARGET_PPC #pragma GCC poison TARGET_PPCEMB #pragma GCC poison TARGET_PPC64 #pragma GCC poison TARGET_ABI32 +#pragma GCC poison TARGET_S390X #pragma GCC poison TARGET_SH4 #pragma GCC poison TARGET_SPARC #pragma GCC poison TARGET_SPARC64 +#pragma GCC poison TARGET_TRICORE +#pragma GCC poison TARGET_UNICORE32 +#pragma GCC poison TARGET_XTENSA =20 +#pragma GCC poison TARGET_NAME +#pragma GCC poison TARGET_SUPPORTS_MTTCG #pragma GCC poison TARGET_WORDS_BIGENDIAN #pragma GCC poison BSWAP_NEEDED =20 --=20 1.8.3.1 From nobody Wed Nov 5 13:38:29 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1497468215634305.9549346710429; Wed, 14 Jun 2017 12:23:35 -0700 (PDT) Received: from localhost ([::1]:50523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLDt6-0007Bq-4t for importer@patchew.org; Wed, 14 Jun 2017 15:23:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLDrb-0005u7-Qa for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:22:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLDra-0000Pe-Tj for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:21:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42662) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dLDra-0000PR-NL for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:21:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9F1C1883A4 for ; Wed, 14 Jun 2017 19:21:57 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-84.ams2.redhat.com [10.36.116.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA73B6031C; Wed, 14 Jun 2017 19:21:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9F1C1883A4 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9F1C1883A4 From: Thomas Huth To: qemu-devel@nongnu.org, Paolo Bonzini Date: Wed, 14 Jun 2017 21:21:51 +0200 Message-Id: <1497468113-2874-3-git-send-email-thuth@redhat.com> In-Reply-To: <1497468113-2874-1-git-send-email-thuth@redhat.com> References: <1497468113-2874-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 14 Jun 2017 19:21:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/4] include/exec/poison: Mark some CONFIG defines as poisoned, too 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: , 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 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" These are defined in config-target.h and thus should never be used in common code. Signed-off-by: Thomas Huth --- include/exec/poison.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/exec/poison.h b/include/exec/poison.h index 9356d5f..5ffed4d 100644 --- a/include/exec/poison.h +++ b/include/exec/poison.h @@ -61,5 +61,25 @@ #pragma GCC poison CPU_INTERRUPT_TGT_INT_1 #pragma GCC poison CPU_INTERRUPT_TGT_INT_2 =20 +#pragma GCC poison CONFIG_ALPHA_DIS +#pragma GCC poison CONFIG_ARM_A64_DIS +#pragma GCC poison CONFIG_ARM_DIS +#pragma GCC poison CONFIG_CRIS_DIS +#pragma GCC poison CONFIG_I386_DIS +#pragma GCC poison CONFIG_LM32_DIS +#pragma GCC poison CONFIG_M68K_DIS +#pragma GCC poison CONFIG_MICROBLAZE_DIS +#pragma GCC poison CONFIG_MIPS_DIS +#pragma GCC poison CONFIG_MOXIE_DIS +#pragma GCC poison CONFIG_NIOS2_DIS +#pragma GCC poison CONFIG_PPC_DIS +#pragma GCC poison CONFIG_S390_DIS +#pragma GCC poison CONFIG_SH4_DIS +#pragma GCC poison CONFIG_SPARC_DIS +#pragma GCC poison CONFIG_XTENSA_DIS + +#pragma GCC poison CONFIG_LINUX_USER +#pragma GCC poison CONFIG_VHOST_NET + #endif #endif --=20 1.8.3.1 From nobody Wed Nov 5 13:38:29 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1497468369885905.173741170798; Wed, 14 Jun 2017 12:26:09 -0700 (PDT) Received: from localhost ([::1]:50535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLDvc-0000Wh-I6 for importer@patchew.org; Wed, 14 Jun 2017 15:26:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLDrc-0005uM-RV for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:22:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLDrb-0000QA-Vh for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:22:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39112) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dLDrb-0000Pk-PU for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:21:59 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CE56AC0587C0 for ; Wed, 14 Jun 2017 19:21:58 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-84.ams2.redhat.com [10.36.116.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id F264796FD2; Wed, 14 Jun 2017 19:21:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CE56AC0587C0 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CE56AC0587C0 From: Thomas Huth To: qemu-devel@nongnu.org, Paolo Bonzini Date: Wed, 14 Jun 2017 21:21:52 +0200 Message-Id: <1497468113-2874-4-git-send-email-thuth@redhat.com> In-Reply-To: <1497468113-2874-1-git-send-email-thuth@redhat.com> References: <1497468113-2874-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 14 Jun 2017 19:21:58 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/4] include/hw/i386/pc.h: Move CONFIG_KVM related definitions to kvm_i386.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: , 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 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" pc.h is included from common code (where is CONFIG_KVM is not available), so the #defines that depend on CONFIG_KVM should not be declared here to avoid that anybody is using them in a wrong way. Signed-off-by: Thomas Huth --- hw/i386/pc_q35.c | 1 + include/hw/i386/pc.h | 13 ------------- target/i386/kvm_i386.h | 13 +++++++++++++ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 1523ef3..8f696b7 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -36,6 +36,7 @@ #include "hw/timer/mc146818rtc.h" #include "hw/xen/xen.h" #include "sysemu/kvm.h" +#include "kvm_i386.h" #include "hw/kvm/clock.h" #include "hw/pci-host/q35.h" #include "exec/address-spaces.h" diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index d071c9c..a31f7aa 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -20,19 +20,6 @@ =20 #define HPET_INTCAP "hpet-intcap" =20 -#ifdef CONFIG_KVM -#define kvm_pit_in_kernel() \ - (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) -#define kvm_pic_in_kernel() \ - (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) -#define kvm_ioapic_in_kernel() \ - (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) -#else -#define kvm_pit_in_kernel() 0 -#define kvm_pic_in_kernel() 0 -#define kvm_ioapic_in_kernel() 0 -#endif - /** * PCMachineState: * @acpi_dev: link to ACPI PM device that performs ACPI hotplug handling diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h index bfce427..ac33f39 100644 --- a/target/i386/kvm_i386.h +++ b/target/i386/kvm_i386.h @@ -15,6 +15,19 @@ =20 #define kvm_apic_in_kernel() (kvm_irqchip_in_kernel()) =20 +#ifdef CONFIG_KVM +#define kvm_pit_in_kernel() \ + (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) +#define kvm_pic_in_kernel() \ + (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) +#define kvm_ioapic_in_kernel() \ + (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split()) +#else +#define kvm_pit_in_kernel() 0 +#define kvm_pic_in_kernel() 0 +#define kvm_ioapic_in_kernel() 0 +#endif + bool kvm_allows_irq0_override(void); bool kvm_has_smm(void); bool kvm_has_adjust_clock_stable(void); --=20 1.8.3.1 From nobody Wed Nov 5 13:38:29 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149746822714475.38425146938903; Wed, 14 Jun 2017 12:23:47 -0700 (PDT) Received: from localhost ([::1]:50525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLDtJ-0007M6-Vv for importer@patchew.org; Wed, 14 Jun 2017 15:23:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLDre-0005uu-Il for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:22:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLDrd-0000Qh-Ax for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:22:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36966) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dLDrd-0000QM-29 for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:22:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1441085541 for ; Wed, 14 Jun 2017 19:22:00 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-84.ams2.redhat.com [10.36.116.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3609D6031C; Wed, 14 Jun 2017 19:21:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1441085541 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1441085541 From: Thomas Huth To: qemu-devel@nongnu.org, Paolo Bonzini Date: Wed, 14 Jun 2017 21:21:53 +0200 Message-Id: <1497468113-2874-5-git-send-email-thuth@redhat.com> In-Reply-To: <1497468113-2874-1-git-send-email-thuth@redhat.com> References: <1497468113-2874-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 14 Jun 2017 19:22:00 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/4] include/exec/poison: Mark CONFIG_KVM as poisoned, too 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: , 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 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We unfortunately need some additional "#ifndef NEED_CPU_H" fuzz in include/sysemu/kvm.h for this, so that the header can still be included from common code (which is done all over the place), but now we can finally be sure that nobody uses this define in a wrong place anymore. Signed-off-by: Thomas Huth --- hw/acpi/ich9.c | 1 - include/exec/poison.h | 1 + include/sysemu/kvm.h | 37 +++++++++++++++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 5c279bb..c5d8646 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -33,7 +33,6 @@ #include "sysemu/sysemu.h" #include "hw/acpi/acpi.h" #include "hw/acpi/tco.h" -#include "sysemu/kvm.h" #include "exec/address-spaces.h" =20 #include "hw/i386/ich9.h" diff --git a/include/exec/poison.h b/include/exec/poison.h index 5ffed4d..540fc70 100644 --- a/include/exec/poison.h +++ b/include/exec/poison.h @@ -80,6 +80,7 @@ =20 #pragma GCC poison CONFIG_LINUX_USER #pragma GCC poison CONFIG_VHOST_NET +#pragma GCC poison CONFIG_KVM =20 #endif #endif diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 1e91613..8cc57e4 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -19,6 +19,8 @@ #include "exec/memattrs.h" #include "hw/irq.h" =20 +#ifdef NEED_CPU_H + #ifdef CONFIG_KVM #include #include @@ -39,6 +41,8 @@ #define KVM_FEATURE_CLOCKSOURCE_STABLE_BIT 0 #endif =20 +#endif /* NEED_CPU_H */ + extern bool kvm_allowed; extern bool kvm_kernel_irqchip; extern bool kvm_split_irqchip; @@ -55,7 +59,8 @@ extern bool kvm_direct_msi_allowed; extern bool kvm_ioeventfd_any_length_allowed; extern bool kvm_msi_use_devid; =20 -#if defined CONFIG_KVM || !defined NEED_CPU_H +#if !defined(NEED_CPU_H) + #define kvm_enabled() (kvm_allowed) /** * kvm_irqchip_in_kernel: @@ -178,6 +183,31 @@ extern bool kvm_msi_use_devid; #define kvm_msi_devid_required() (kvm_msi_use_devid) =20 #else + +#ifdef CONFIG_KVM + +/* + * Same definitions again, but we need to keep them separate + * since CONFIG_KVM is poisoned without NEED_CPU_H + */ +#define kvm_enabled() (kvm_allowed) +#define kvm_irqchip_in_kernel() (kvm_kernel_irqchip) +#define kvm_irqchip_is_split() (kvm_split_irqchip) +#define kvm_async_interrupts_enabled() (kvm_async_interrupts_allowed) +#define kvm_halt_in_kernel() (kvm_halt_in_kernel_allowed) +#define kvm_eventfds_enabled() (kvm_eventfds_allowed) +#define kvm_irqfds_enabled() (kvm_irqfds_allowed) +#define kvm_resamplefds_enabled() (kvm_resamplefds_allowed) +#define kvm_msi_via_irqfd_enabled() (kvm_msi_via_irqfd_allowed) +#define kvm_gsi_routing_enabled() (kvm_gsi_routing_allowed) +#define kvm_gsi_direct_mapping() (kvm_gsi_direct_mapping) +#define kvm_readonly_mem_enabled() (kvm_readonly_mem_allowed) +#define kvm_direct_msi_enabled() (kvm_direct_msi_allowed) +#define kvm_ioeventfd_any_length_enabled() (kvm_ioeventfd_any_length_allow= ed) +#define kvm_msi_devid_required() (kvm_msi_use_devid) + +#else + #define kvm_enabled() (0) #define kvm_irqchip_in_kernel() (false) #define kvm_irqchip_is_split() (false) @@ -193,7 +223,10 @@ extern bool kvm_msi_use_devid; #define kvm_direct_msi_enabled() (false) #define kvm_ioeventfd_any_length_enabled() (false) #define kvm_msi_devid_required() (false) -#endif + +#endif /* CONFIG_KVM */ + +#endif /* NEED_CPU_H */ =20 struct kvm_run; struct kvm_lapic_state; --=20 1.8.3.1