Commit 8a5a87d9 authored by Gleb Natapov's avatar Gleb Natapov Committed by Avi Kivity

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: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 9c5b1172
...@@ -246,9 +246,6 @@ static void drop_user_return_notifiers(void *ignore) ...@@ -246,9 +246,6 @@ static void drop_user_return_notifiers(void *ignore)
u64 kvm_get_apic_base(struct kvm_vcpu *vcpu) 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); EXPORT_SYMBOL_GPL(kvm_get_apic_base);
...@@ -256,10 +253,7 @@ EXPORT_SYMBOL_GPL(kvm_get_apic_base); ...@@ -256,10 +253,7 @@ EXPORT_SYMBOL_GPL(kvm_get_apic_base);
void kvm_set_apic_base(struct kvm_vcpu *vcpu, u64 data) void kvm_set_apic_base(struct kvm_vcpu *vcpu, u64 data)
{ {
/* TODO: reserve bits check */ /* TODO: reserve bits check */
if (irqchip_in_kernel(vcpu->kvm))
kvm_lapic_set_base(vcpu, data); kvm_lapic_set_base(vcpu, data);
else
vcpu->arch.apic_base = data;
} }
EXPORT_SYMBOL_GPL(kvm_set_apic_base); EXPORT_SYMBOL_GPL(kvm_set_apic_base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment