From: Jan Kiszka <jan.kiszka@siemens.com> To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com> Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org Subject: [PATCH 04/12] kvm: Drop CONFIG_KVM_PARA Date: Wed, 8 Jun 2011 16:10:58 +0200 [thread overview] Message-ID: <6402554490c9fbb815fe21313ec2b1f3e17a26c7.1307542247.git.jan.kiszka@siemens.com> (raw) In-Reply-To: <cover.1307542247.git.jan.kiszka@siemens.com> In-Reply-To: <cover.1307542247.git.jan.kiszka@siemens.com> The kvm_para.h header is now always available. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- configure | 1 - hw/kvmclock.c | 9 --------- target-i386/kvm.c | 26 +------------------------- 3 files changed, 1 insertions(+), 35 deletions(-) diff --git a/configure b/configure index 0e1dc46..ed54db9 100755 --- a/configure +++ b/configure @@ -3218,7 +3218,6 @@ case "$target_arch2" in \( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \) -o \ \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then echo "CONFIG_KVM=y" >> $config_target_mak - echo "CONFIG_KVM_PARA=y" >> $config_target_mak if test $vhost_net = "yes" ; then echo "CONFIG_VHOST_NET=y" >> $config_target_mak fi diff --git a/hw/kvmclock.c b/hw/kvmclock.c index 004c4ad..692ad18 100644 --- a/hw/kvmclock.c +++ b/hw/kvmclock.c @@ -17,8 +17,6 @@ #include "kvm.h" #include "kvmclock.h" -#if defined(CONFIG_KVM_PARA) && defined(KVM_CAP_ADJUST_CLOCK) - #include <linux/kvm.h> #include <linux/kvm_para.h> @@ -120,10 +118,3 @@ static void kvmclock_register_device(void) } device_init(kvmclock_register_device); - -#else /* !(CONFIG_KVM_PARA && KVM_CAP_ADJUST_CLOCK) */ - -void kvmclock_create(void) -{ -} -#endif /* !(CONFIG_KVM_PARA && KVM_CAP_ADJUST_CLOCK) */ diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 1ae2d61..0efcf97 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -18,6 +18,7 @@ #include <sys/utsname.h> #include <linux/kvm.h> +#include <linux/kvm_para.h> #include "qemu-common.h" #include "sysemu.h" @@ -29,10 +30,6 @@ #include "hw/apic.h" #include "ioport.h" -#ifdef CONFIG_KVM_PARA -#include <linux/kvm_para.h> -#endif -// //#define DEBUG_KVM #ifdef DEBUG_KVM @@ -62,9 +59,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = { static bool has_msr_star; static bool has_msr_hsave_pa; -#if defined(CONFIG_KVM_PARA) && defined(KVM_CAP_ASYNC_PF) static bool has_msr_async_pf_en; -#endif static int lm_capable_kernel; static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max) @@ -92,7 +87,6 @@ static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max) return cpuid; } -#ifdef CONFIG_KVM_PARA struct kvm_para_features { int cap; int feature; @@ -118,7 +112,6 @@ static int get_para_features(CPUState *env) return features; } -#endif uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, @@ -128,9 +121,7 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, int i, max; uint32_t ret = 0; uint32_t cpuid_1_edx; -#ifdef CONFIG_KVM_PARA int has_kvm_features = 0; -#endif max = 1; while ((cpuid = try_get_cpuid(env->kvm_state, max)) == NULL) { @@ -140,11 +131,9 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, for (i = 0; i < cpuid->nent; ++i) { if (cpuid->entries[i].function == function && cpuid->entries[i].index == index) { -#ifdef CONFIG_KVM_PARA if (cpuid->entries[i].function == KVM_CPUID_FEATURES) { has_kvm_features = 1; } -#endif switch (reg) { case R_EAX: ret = cpuid->entries[i].eax; @@ -177,12 +166,10 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, qemu_free(cpuid); -#ifdef CONFIG_KVM_PARA /* fallback for older kernels */ if (!has_kvm_features && (function == KVM_CPUID_FEATURES)) { ret = get_para_features(env); } -#endif return ret; } @@ -377,9 +364,7 @@ int kvm_arch_init_vcpu(CPUState *env) uint32_t limit, i, j, cpuid_i; uint32_t unused; struct kvm_cpuid_entry2 *c; -#ifdef CONFIG_KVM_PARA uint32_t signature[3]; -#endif env->cpuid_features &= kvm_arch_get_supported_cpuid(env, 1, 0, R_EDX); @@ -397,7 +382,6 @@ int kvm_arch_init_vcpu(CPUState *env) cpuid_i = 0; -#ifdef CONFIG_KVM_PARA /* Paravirtualization CPUIDs */ memcpy(signature, "KVMKVMKVM\0\0\0", 12); c = &cpuid_data.entries[cpuid_i++]; @@ -418,8 +402,6 @@ int kvm_arch_init_vcpu(CPUState *env) has_msr_async_pf_en = c->eax & (1 << KVM_FEATURE_ASYNC_PF); #endif -#endif - cpu_x86_cpuid(env, 0, 0, &limit, &unused, &unused, &unused); for (i = 0; i <= limit; i++) { @@ -931,12 +913,10 @@ static int kvm_put_msrs(CPUState *env, int level) kvm_msr_entry_set(&msrs[n++], MSR_KVM_SYSTEM_TIME, env->system_time_msr); kvm_msr_entry_set(&msrs[n++], MSR_KVM_WALL_CLOCK, env->wall_clock_msr); -#if defined(CONFIG_KVM_PARA) && defined(KVM_CAP_ASYNC_PF) if (has_msr_async_pf_en) { kvm_msr_entry_set(&msrs[n++], MSR_KVM_ASYNC_PF_EN, env->async_pf_en_msr); } -#endif } #ifdef KVM_CAP_MCE if (env->mcg_cap) { @@ -1172,11 +1152,9 @@ static int kvm_get_msrs(CPUState *env) #endif msrs[n++].index = MSR_KVM_SYSTEM_TIME; msrs[n++].index = MSR_KVM_WALL_CLOCK; -#if defined(CONFIG_KVM_PARA) && defined(KVM_CAP_ASYNC_PF) if (has_msr_async_pf_en) { msrs[n++].index = MSR_KVM_ASYNC_PF_EN; } -#endif #ifdef KVM_CAP_MCE if (env->mcg_cap) { @@ -1253,11 +1231,9 @@ static int kvm_get_msrs(CPUState *env) } #endif break; -#if defined(CONFIG_KVM_PARA) && defined(KVM_CAP_ASYNC_PF) case MSR_KVM_ASYNC_PF_EN: env->async_pf_en_msr = msrs[i].data; break; -#endif } } -- 1.7.1
WARNING: multiple messages have this Message-ID (diff)
From: Jan Kiszka <jan.kiszka@siemens.com> To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com> Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 04/12] kvm: Drop CONFIG_KVM_PARA Date: Wed, 8 Jun 2011 16:10:58 +0200 [thread overview] Message-ID: <6402554490c9fbb815fe21313ec2b1f3e17a26c7.1307542247.git.jan.kiszka@siemens.com> (raw) In-Reply-To: <cover.1307542247.git.jan.kiszka@siemens.com> In-Reply-To: <cover.1307542247.git.jan.kiszka@siemens.com> The kvm_para.h header is now always available. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> --- configure | 1 - hw/kvmclock.c | 9 --------- target-i386/kvm.c | 26 +------------------------- 3 files changed, 1 insertions(+), 35 deletions(-) diff --git a/configure b/configure index 0e1dc46..ed54db9 100755 --- a/configure +++ b/configure @@ -3218,7 +3218,6 @@ case "$target_arch2" in \( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \) -o \ \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then echo "CONFIG_KVM=y" >> $config_target_mak - echo "CONFIG_KVM_PARA=y" >> $config_target_mak if test $vhost_net = "yes" ; then echo "CONFIG_VHOST_NET=y" >> $config_target_mak fi diff --git a/hw/kvmclock.c b/hw/kvmclock.c index 004c4ad..692ad18 100644 --- a/hw/kvmclock.c +++ b/hw/kvmclock.c @@ -17,8 +17,6 @@ #include "kvm.h" #include "kvmclock.h" -#if defined(CONFIG_KVM_PARA) && defined(KVM_CAP_ADJUST_CLOCK) - #include <linux/kvm.h> #include <linux/kvm_para.h> @@ -120,10 +118,3 @@ static void kvmclock_register_device(void) } device_init(kvmclock_register_device); - -#else /* !(CONFIG_KVM_PARA && KVM_CAP_ADJUST_CLOCK) */ - -void kvmclock_create(void) -{ -} -#endif /* !(CONFIG_KVM_PARA && KVM_CAP_ADJUST_CLOCK) */ diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 1ae2d61..0efcf97 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -18,6 +18,7 @@ #include <sys/utsname.h> #include <linux/kvm.h> +#include <linux/kvm_para.h> #include "qemu-common.h" #include "sysemu.h" @@ -29,10 +30,6 @@ #include "hw/apic.h" #include "ioport.h" -#ifdef CONFIG_KVM_PARA -#include <linux/kvm_para.h> -#endif -// //#define DEBUG_KVM #ifdef DEBUG_KVM @@ -62,9 +59,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = { static bool has_msr_star; static bool has_msr_hsave_pa; -#if defined(CONFIG_KVM_PARA) && defined(KVM_CAP_ASYNC_PF) static bool has_msr_async_pf_en; -#endif static int lm_capable_kernel; static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max) @@ -92,7 +87,6 @@ static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max) return cpuid; } -#ifdef CONFIG_KVM_PARA struct kvm_para_features { int cap; int feature; @@ -118,7 +112,6 @@ static int get_para_features(CPUState *env) return features; } -#endif uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, @@ -128,9 +121,7 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, int i, max; uint32_t ret = 0; uint32_t cpuid_1_edx; -#ifdef CONFIG_KVM_PARA int has_kvm_features = 0; -#endif max = 1; while ((cpuid = try_get_cpuid(env->kvm_state, max)) == NULL) { @@ -140,11 +131,9 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, for (i = 0; i < cpuid->nent; ++i) { if (cpuid->entries[i].function == function && cpuid->entries[i].index == index) { -#ifdef CONFIG_KVM_PARA if (cpuid->entries[i].function == KVM_CPUID_FEATURES) { has_kvm_features = 1; } -#endif switch (reg) { case R_EAX: ret = cpuid->entries[i].eax; @@ -177,12 +166,10 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, qemu_free(cpuid); -#ifdef CONFIG_KVM_PARA /* fallback for older kernels */ if (!has_kvm_features && (function == KVM_CPUID_FEATURES)) { ret = get_para_features(env); } -#endif return ret; } @@ -377,9 +364,7 @@ int kvm_arch_init_vcpu(CPUState *env) uint32_t limit, i, j, cpuid_i; uint32_t unused; struct kvm_cpuid_entry2 *c; -#ifdef CONFIG_KVM_PARA uint32_t signature[3]; -#endif env->cpuid_features &= kvm_arch_get_supported_cpuid(env, 1, 0, R_EDX); @@ -397,7 +382,6 @@ int kvm_arch_init_vcpu(CPUState *env) cpuid_i = 0; -#ifdef CONFIG_KVM_PARA /* Paravirtualization CPUIDs */ memcpy(signature, "KVMKVMKVM\0\0\0", 12); c = &cpuid_data.entries[cpuid_i++]; @@ -418,8 +402,6 @@ int kvm_arch_init_vcpu(CPUState *env) has_msr_async_pf_en = c->eax & (1 << KVM_FEATURE_ASYNC_PF); #endif -#endif - cpu_x86_cpuid(env, 0, 0, &limit, &unused, &unused, &unused); for (i = 0; i <= limit; i++) { @@ -931,12 +913,10 @@ static int kvm_put_msrs(CPUState *env, int level) kvm_msr_entry_set(&msrs[n++], MSR_KVM_SYSTEM_TIME, env->system_time_msr); kvm_msr_entry_set(&msrs[n++], MSR_KVM_WALL_CLOCK, env->wall_clock_msr); -#if defined(CONFIG_KVM_PARA) && defined(KVM_CAP_ASYNC_PF) if (has_msr_async_pf_en) { kvm_msr_entry_set(&msrs[n++], MSR_KVM_ASYNC_PF_EN, env->async_pf_en_msr); } -#endif } #ifdef KVM_CAP_MCE if (env->mcg_cap) { @@ -1172,11 +1152,9 @@ static int kvm_get_msrs(CPUState *env) #endif msrs[n++].index = MSR_KVM_SYSTEM_TIME; msrs[n++].index = MSR_KVM_WALL_CLOCK; -#if defined(CONFIG_KVM_PARA) && defined(KVM_CAP_ASYNC_PF) if (has_msr_async_pf_en) { msrs[n++].index = MSR_KVM_ASYNC_PF_EN; } -#endif #ifdef KVM_CAP_MCE if (env->mcg_cap) { @@ -1253,11 +1231,9 @@ static int kvm_get_msrs(CPUState *env) } #endif break; -#if defined(CONFIG_KVM_PARA) && defined(KVM_CAP_ASYNC_PF) case MSR_KVM_ASYNC_PF_EN: env->async_pf_en_msr = msrs[i].data; break; -#endif } } -- 1.7.1
next prev parent reply other threads:[~2011-06-08 14:11 UTC|newest] Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-06-08 14:10 [PATCH 00/12] [uq/master] Import linux headers and some cleanups Jan Kiszka 2011-06-08 14:10 ` [Qemu-devel] " Jan Kiszka 2011-06-08 14:10 ` [PATCH 01/12] Add kernel header update script Jan Kiszka 2011-06-08 14:10 ` [Qemu-devel] " Jan Kiszka 2011-06-08 14:33 ` Peter Maydell 2011-06-08 14:33 ` [Qemu-devel] " Peter Maydell 2011-06-08 14:39 ` Jan Kiszka 2011-06-08 14:39 ` [Qemu-devel] " Jan Kiszka 2011-06-08 14:51 ` Peter Maydell 2011-06-08 14:51 ` [Qemu-devel] " Peter Maydell 2011-06-08 15:06 ` [PATCH v2 " Jan Kiszka 2011-06-08 15:06 ` [Qemu-devel] " Jan Kiszka 2011-06-08 15:57 ` Peter Maydell 2011-06-08 15:57 ` [Qemu-devel] " Peter Maydell 2011-06-08 16:22 ` [PATCH v3 " Jan Kiszka 2011-06-08 16:22 ` [Qemu-devel] " Jan Kiszka 2011-06-08 17:30 ` Peter Maydell 2011-06-08 17:30 ` [Qemu-devel] " Peter Maydell 2011-06-08 14:10 ` [PATCH 02/12] Import kernel headers Jan Kiszka 2011-06-08 14:10 ` [Qemu-devel] " Jan Kiszka 2011-06-08 14:10 ` [PATCH 03/12] Switch build system to accompanied " Jan Kiszka 2011-06-08 14:10 ` [Qemu-devel] " Jan Kiszka 2011-06-14 11:11 ` Alexander Graf 2011-06-14 11:11 ` [Qemu-devel] " Alexander Graf 2011-06-14 11:21 ` Jan Kiszka 2011-06-14 11:21 ` [Qemu-devel] " Jan Kiszka 2011-06-14 11:28 ` Alexander Graf 2011-06-14 11:28 ` [Qemu-devel] " Alexander Graf 2011-06-14 11:32 ` Jan Kiszka 2011-06-14 11:32 ` [Qemu-devel] " Jan Kiszka 2011-06-22 20:51 ` Stefan Weil 2011-06-22 20:51 ` [Qemu-devel] " Stefan Weil 2011-06-22 21:37 ` Jan Kiszka 2011-06-22 21:37 ` [Qemu-devel] " Jan Kiszka 2011-06-23 5:37 ` Stefan Weil 2011-06-23 5:37 ` [Qemu-devel] " Stefan Weil 2011-06-23 7:18 ` Jan Kiszka 2011-06-23 7:18 ` [Qemu-devel] " Jan Kiszka 2011-06-23 8:05 ` [PATCH] Fix fallouts from Linux header inclusion Jan Kiszka 2011-06-23 8:05 ` [Qemu-devel] " Jan Kiszka 2011-06-23 10:59 ` Andreas Färber 2011-06-23 10:59 ` Andreas Färber 2011-06-23 15:14 ` Stefan Weil 2011-06-23 15:14 ` [Qemu-devel] " Stefan Weil 2011-06-26 18:01 ` Blue Swirl 2011-06-26 18:01 ` Blue Swirl 2011-06-08 14:10 ` Jan Kiszka [this message] 2011-06-08 14:10 ` [Qemu-devel] [PATCH 04/12] kvm: Drop CONFIG_KVM_PARA Jan Kiszka 2011-06-08 14:10 ` [PATCH 05/12] kvm: ppc: Drop CONFIG_KVM_PPC_PVR Jan Kiszka 2011-06-08 14:10 ` [Qemu-devel] " Jan Kiszka 2011-06-14 11:06 ` Alexander Graf 2011-06-14 11:06 ` [Qemu-devel] " Alexander Graf 2011-06-08 14:11 ` [PATCH 06/12] kvm: Drop useless zero-initializations Jan Kiszka 2011-06-08 14:11 ` [Qemu-devel] " Jan Kiszka 2011-06-08 14:11 ` [PATCH 07/12] kvm: Drop KVM_CAP build dependencies Jan Kiszka 2011-06-08 14:11 ` [Qemu-devel] " Jan Kiszka 2011-06-14 11:05 ` Alexander Graf 2011-06-14 11:05 ` [Qemu-devel] " Alexander Graf 2011-06-14 11:07 ` Jan Kiszka 2011-06-14 11:07 ` [Qemu-devel] " Jan Kiszka 2011-06-14 11:17 ` Alexander Graf 2011-06-14 11:17 ` [Qemu-devel] " Alexander Graf 2011-06-14 11:19 ` Jan Kiszka 2011-06-14 11:19 ` [Qemu-devel] " Jan Kiszka 2011-06-14 11:25 ` Alexander Graf 2011-06-14 11:25 ` [Qemu-devel] " Alexander Graf 2011-06-08 14:11 ` [PATCH 08/12] kvm: x86: " Jan Kiszka 2011-06-08 14:11 ` [Qemu-devel] " Jan Kiszka 2011-06-08 14:11 ` [PATCH 09/12] kvm: ppc: " Jan Kiszka 2011-06-08 14:11 ` [Qemu-devel] " Jan Kiszka 2011-06-10 18:32 ` Eduardo Habkost 2011-06-10 18:32 ` Eduardo Habkost 2011-06-11 7:45 ` Jan Kiszka 2011-06-11 7:45 ` [Qemu-devel] " Jan Kiszka 2011-06-14 11:07 ` Alexander Graf 2011-06-14 11:07 ` [Qemu-devel] " Alexander Graf 2011-06-08 14:11 ` [PATCH 10/12] kvm: Clean up stubs Jan Kiszka 2011-06-08 14:11 ` [Qemu-devel] " Jan Kiszka 2011-06-08 14:11 ` [PATCH 11/12] kvm: x86: Pass KVMState to kvm_arch_get_supported_cpuid Jan Kiszka 2011-06-08 14:11 ` [Qemu-devel] " Jan Kiszka 2011-06-09 17:33 ` Eduardo Habkost 2011-06-09 17:33 ` Eduardo Habkost 2011-06-09 17:41 ` Jan Kiszka 2011-06-09 18:08 ` Eduardo Habkost 2011-06-09 18:08 ` Eduardo Habkost 2011-06-09 19:53 ` Jan Kiszka 2011-06-08 14:11 ` [PATCH 12/12] Remove unneeded kvm.h from cpu-exec.c Jan Kiszka 2011-06-08 14:11 ` [Qemu-devel] " Jan Kiszka 2011-06-20 18:24 ` [PATCH 00/12] [uq/master] Import linux headers and some cleanups Marcelo Tosatti 2011-06-20 18:24 ` [Qemu-devel] " Marcelo Tosatti
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=6402554490c9fbb815fe21313ec2b1f3e17a26c7.1307542247.git.jan.kiszka@siemens.com \ --to=jan.kiszka@siemens.com \ --cc=avi@redhat.com \ --cc=kvm@vger.kernel.org \ --cc=mtosatti@redhat.com \ --cc=qemu-devel@nongnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.