lapic.c (1e0ad70cc1957b9050368e433b1061a2cd1ce543) | lapic.c (e462755cae2bf8297a663278935ad4d59812d2f3) |
---|---|
1 2/* 3 * Local APIC virtualization 4 * 5 * Copyright (C) 2006 Qumranet, Inc. 6 * Copyright (C) 2007 Novell 7 * Copyright (C) 2007 Intel 8 * Copyright 2009 Red Hat, Inc. and/or its affiliates. --- 192 unchanged lines hidden (view full) --- 201 if (old) 202 kfree_rcu(old, rcu); 203 204 kvm_vcpu_request_scan_ioapic(kvm); 205} 206 207static inline void apic_set_spiv(struct kvm_lapic *apic, u32 val) 208{ | 1 2/* 3 * Local APIC virtualization 4 * 5 * Copyright (C) 2006 Qumranet, Inc. 6 * Copyright (C) 2007 Novell 7 * Copyright (C) 2007 Intel 8 * Copyright 2009 Red Hat, Inc. and/or its affiliates. --- 192 unchanged lines hidden (view full) --- 201 if (old) 202 kfree_rcu(old, rcu); 203 204 kvm_vcpu_request_scan_ioapic(kvm); 205} 206 207static inline void apic_set_spiv(struct kvm_lapic *apic, u32 val) 208{ |
209 u32 prev = kvm_apic_get_reg(apic, APIC_SPIV); | 209 bool enabled = val & APIC_SPIV_APIC_ENABLED; |
210 211 apic_set_reg(apic, APIC_SPIV, val); | 210 211 apic_set_reg(apic, APIC_SPIV, val); |
212 if ((prev ^ val) & APIC_SPIV_APIC_ENABLED) { 213 if (val & APIC_SPIV_APIC_ENABLED) { | 212 213 if (enabled != apic->sw_enabled) { 214 apic->sw_enabled = enabled; 215 if (enabled) { |
214 static_key_slow_dec_deferred(&apic_sw_disabled); 215 recalculate_apic_map(apic->vcpu->kvm); 216 } else 217 static_key_slow_inc(&apic_sw_disabled.key); 218 } 219} 220 221static inline void kvm_apic_set_id(struct kvm_lapic *apic, u8 id) --- 1130 unchanged lines hidden (view full) --- 1352 if (!vcpu->arch.apic) 1353 return; 1354 1355 hrtimer_cancel(&apic->lapic_timer.timer); 1356 1357 if (!(vcpu->arch.apic_base & MSR_IA32_APICBASE_ENABLE)) 1358 static_key_slow_dec_deferred(&apic_hw_disabled); 1359 | 216 static_key_slow_dec_deferred(&apic_sw_disabled); 217 recalculate_apic_map(apic->vcpu->kvm); 218 } else 219 static_key_slow_inc(&apic_sw_disabled.key); 220 } 221} 222 223static inline void kvm_apic_set_id(struct kvm_lapic *apic, u8 id) --- 1130 unchanged lines hidden (view full) --- 1354 if (!vcpu->arch.apic) 1355 return; 1356 1357 hrtimer_cancel(&apic->lapic_timer.timer); 1358 1359 if (!(vcpu->arch.apic_base & MSR_IA32_APICBASE_ENABLE)) 1360 static_key_slow_dec_deferred(&apic_hw_disabled); 1361 |
1360 if (!(kvm_apic_get_reg(apic, APIC_SPIV) & APIC_SPIV_APIC_ENABLED)) | 1362 if (!apic->sw_enabled) |
1361 static_key_slow_dec_deferred(&apic_sw_disabled); 1362 1363 if (apic->regs) 1364 free_page((unsigned long)apic->regs); 1365 1366 kfree(apic); 1367} 1368 --- 595 unchanged lines hidden --- | 1363 static_key_slow_dec_deferred(&apic_sw_disabled); 1364 1365 if (apic->regs) 1366 free_page((unsigned long)apic->regs); 1367 1368 kfree(apic); 1369} 1370 --- 595 unchanged lines hidden --- |