Re: [PATCH 2/7] KVM: x86: inhibit APICv/AVIC when the guest and/or host changes either apic id or the apic base from their default values.
From: Chao Gao
Date: Tue Jun 07 2022 - 03:05:43 EST
On Mon, Jun 06, 2022 at 09:08:24PM +0300, Maxim Levitsky wrote:
>+ /*
>+ * For simplicity, the APIC acceleration is inhibited
>+ * first time either APIC ID or APIC base are changed by the guest
>+ * from their reset values.
>+ */
>+ APICV_INHIBIT_REASON_APIC_ID_MODIFIED,
>+ APICV_INHIBIT_REASON_APIC_BASE_MODIFIED,
>+
>+
Remove one newline.
> void kvm_apic_update_apicv(struct kvm_vcpu *vcpu)
>@@ -2666,6 +2683,8 @@ static int kvm_apic_state_fixup(struct kvm_vcpu *vcpu,
> icr = __kvm_lapic_get_reg64(s->regs, APIC_ICR);
> __kvm_lapic_set_reg(s->regs, APIC_ICR2, icr >> 32);
> }
>+ } else {
>+ kvm_lapic_xapic_id_updated(vcpu->arch.apic);
Strictly speaking, this is needed only for "set" cases.