aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/lapic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r--arch/x86/kvm/lapic.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 9392f527f107..0664c138e860 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1212,6 +1212,21 @@ void kvm_lapic_set_eoi(struct kvm_vcpu *vcpu)
1212} 1212}
1213EXPORT_SYMBOL_GPL(kvm_lapic_set_eoi); 1213EXPORT_SYMBOL_GPL(kvm_lapic_set_eoi);
1214 1214
1215/* emulate APIC access in a trap manner */
1216void kvm_apic_write_nodecode(struct kvm_vcpu *vcpu, u32 offset)
1217{
1218 u32 val = 0;
1219
1220 /* hw has done the conditional check and inst decode */
1221 offset &= 0xff0;
1222
1223 apic_reg_read(vcpu->arch.apic, offset, 4, &val);
1224
1225 /* TODO: optimize to just emulate side effect w/o one more write */
1226 apic_reg_write(vcpu->arch.apic, offset, val);
1227}
1228EXPORT_SYMBOL_GPL(kvm_apic_write_nodecode);
1229
1215void kvm_free_lapic(struct kvm_vcpu *vcpu) 1230void kvm_free_lapic(struct kvm_vcpu *vcpu)
1216{ 1231{
1217 struct kvm_lapic *apic = vcpu->arch.apic; 1232 struct kvm_lapic *apic = vcpu->arch.apic;