[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/4] include/hw/i386/pc.h: Move CONFIG_KVM relat
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 3/4] include/hw/i386/pc.h: Move CONFIG_KVM related definitions to kvm_i386.h |
Date: |
Thu, 15 Jun 2017 10:04:54 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
On 14/06/2017 21:21, Thomas Huth wrote:
> 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 <address@hidden>
> ---
> 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(-)
Please move the ones in includes/sysemu/kvm.h in this patch, too.
Thanks,
Paolo
> 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 @@
>
> #define HPET_INTCAP "hpet-intcap"
>
> -#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 @@
>
> #define kvm_apic_in_kernel() (kvm_irqchip_in_kernel())
>
> +#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);
>
- [Qemu-devel] [PATCH 0/4] Poison some more target-specific defines, Thomas Huth, 2017/06/14
- [Qemu-devel] [PATCH 2/4] include/exec/poison: Mark some CONFIG defines as poisoned, too, Thomas Huth, 2017/06/14
- [Qemu-devel] [PATCH 1/4] include/exec/poison: Add missing TARGET defines, Thomas Huth, 2017/06/14
- [Qemu-devel] [PATCH 3/4] include/hw/i386/pc.h: Move CONFIG_KVM related definitions to kvm_i386.h, Thomas Huth, 2017/06/14
- Re: [Qemu-devel] [PATCH 3/4] include/hw/i386/pc.h: Move CONFIG_KVM related definitions to kvm_i386.h,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 4/4] include/exec/poison: Mark CONFIG_KVM as poisoned, too, Thomas Huth, 2017/06/14
- Re: [Qemu-devel] [PATCH 0/4] Poison some more target-specific defines, no-reply, 2017/06/14