summaryrefslogtreecommitdiffstats
path: root/target-i386
diff options
context:
space:
mode:
authorJan Kiszka2012-01-31 19:17:52 +0100
committerMarcelo Tosatti2012-02-08 18:57:50 +0100
commit3d4b26494fdce89354dac49ef909356ccda77914 (patch)
tree50dae556e5fd2b3a18cd29731ee85c599d2b9260 /target-i386
parentkvm: Allow to set shadow MMU size (diff)
downloadqemu-3d4b26494fdce89354dac49ef909356ccda77914.tar.gz
qemu-3d4b26494fdce89354dac49ef909356ccda77914.tar.xz
qemu-3d4b26494fdce89354dac49ef909356ccda77914.zip
kvm: Implement kvm_irqchip_in_kernel like kvm_enabled
To both avoid that kvm_irqchip_in_kernel always has to be paired with kvm_enabled and that the former ends up in a function call, implement it like the latter. This means keeping the state in a global variable and defining kvm_irqchip_in_kernel as a preprocessor macro. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/kvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 445c06082c..981192ddf8 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -1356,7 +1356,7 @@ static int kvm_get_apic(CPUState *env)
struct kvm_lapic_state kapic;
int ret;
- if (apic && kvm_enabled() && kvm_irqchip_in_kernel()) {
+ if (apic && kvm_irqchip_in_kernel()) {
ret = kvm_vcpu_ioctl(env, KVM_GET_LAPIC, &kapic);
if (ret < 0) {
return ret;
@@ -1372,7 +1372,7 @@ static int kvm_put_apic(CPUState *env)
DeviceState *apic = env->apic_state;
struct kvm_lapic_state kapic;
- if (apic && kvm_enabled() && kvm_irqchip_in_kernel()) {
+ if (apic && kvm_irqchip_in_kernel()) {
kvm_put_apic_state(apic, &kapic);
return kvm_vcpu_ioctl(env, KVM_SET_LAPIC, &kapic);