[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fcfb997f-ab6c-d7c3-2856-22470ce62329@redhat.com>
Date: Wed, 22 Jan 2020 16:51:40 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Cc: rkrcmar@...hat.com, joro@...tes.org, vkuznets@...hat.com,
rkagan@...tuozzo.com, graf@...zon.com, jschoenh@...zon.de,
karahmed@...zon.de, rimasluk@...zon.com, jon.grimm@....com
Subject: Re: [PATCH v5 03/18] kvm: x86: Introduce APICv inhibit reason bits
A couple slight improvements, after which get_enable_apicv is unused.
Paolo
On 14/11/19 21:15, Suravee Suthikulpanit wrote:
> @@ -6848,6 +6848,7 @@ static int vmx_vm_init(struct kvm *kvm)
> break;
> }
> }
> + kvm_apicv_init(kvm, vmx_get_enable_apicv(kvm));
> return 0;
> }
>
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 01f60d6cd881..d011ffaec7ee 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -6852,7 +6852,7 @@ static int vmx_vm_init(struct kvm *kvm)
break;
}
}
- kvm_apicv_init(kvm, vmx_get_enable_apicv(kvm));
+ kvm_apicv_init(kvm, enable_apicv);
return 0;
}
> @@ -9347,10 +9364,11 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
> goto fail_free_pio_data;
>
> if (irqchip_in_kernel(vcpu->kvm)) {
> - vcpu->arch.apicv_active = kvm_x86_ops->get_enable_apicv(vcpu->kvm);
> r = kvm_create_lapic(vcpu, lapic_timer_advance_ns);
> if (r < 0)
> goto fail_mmu_destroy;
> + if (kvm_apicv_activated(vcpu->kvm))
> + vcpu->arch.apicv_active = kvm_x86_ops->get_enable_apicv(vcpu->kvm);
> } else
> static_key_slow_inc(&kvm_no_apic_vcpu);
>
>
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 6c62abb4fdd9..cc9f84527a55 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -9236,7 +9236,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
if (r < 0)
goto fail_mmu_destroy;
if (kvm_apicv_activated(vcpu->kvm))
- vcpu->arch.apicv_active = kvm_x86_ops->get_enable_apicv(vcpu->kvm);
+ vcpu->arch.apicv_active = true;
} else
static_key_slow_inc(&kvm_no_apic_vcpu);
Powered by blists - more mailing lists