summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGleb Natapov2012-08-05 14:58:26 +0200
committerAvi Kivity2012-08-06 15:20:03 +0200
commit8a5a87d9b7aef24bcdba763d8ee14982477b0a2e (patch)
tree806447c648a1a7661b8d44fb775f4341c778f033 /arch/x86/kvm/x86.c
parentKVM: let the error pfn not depend on error code (diff)
downloadkernel-qcow2-linux-8a5a87d9b7aef24bcdba763d8ee14982477b0a2e.tar.gz
kernel-qcow2-linux-8a5a87d9b7aef24bcdba763d8ee14982477b0a2e.tar.xz
kernel-qcow2-linux-8a5a87d9b7aef24bcdba763d8ee14982477b0a2e.zip
KVM: clean up kvm_(set|get)_apic_base
kvm_get_apic_base() needlessly checks irqchip_in_kernel although it does the same no matter what result of the check is. kvm_set_apic_base() also checks for irqchip_in_kernel, but kvm_lapic_set_base() can handle this case. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 7953a9e7cb17..3cafbb12ae05 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -246,20 +246,14 @@ static void drop_user_return_notifiers(void *ignore)
u64 kvm_get_apic_base(struct kvm_vcpu *vcpu)
{
- if (irqchip_in_kernel(vcpu->kvm))
- return vcpu->arch.apic_base;
- else
- return vcpu->arch.apic_base;
+ return vcpu->arch.apic_base;
}
EXPORT_SYMBOL_GPL(kvm_get_apic_base);
void kvm_set_apic_base(struct kvm_vcpu *vcpu, u64 data)
{
/* TODO: reserve bits check */
- if (irqchip_in_kernel(vcpu->kvm))
- kvm_lapic_set_base(vcpu, data);
- else
- vcpu->arch.apic_base = data;
+ kvm_lapic_set_base(vcpu, data);
}
EXPORT_SYMBOL_GPL(kvm_set_apic_base);