[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bb769da2-0e38-ff1b-bd40-9cfed1c84b88@amazon.com>
Date: Mon, 19 Aug 2019 12:28:29 +0200
From: Alexander Graf <graf@...zon.com>
To: "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>
CC: "pbonzini@...hat.com" <pbonzini@...hat.com>,
"rkrcmar@...hat.com" <rkrcmar@...hat.com>,
"joro@...tes.org" <joro@...tes.org>,
"jschoenh@...zon.de" <jschoenh@...zon.de>,
"karahmed@...zon.de" <karahmed@...zon.de>,
"rimasluk@...zon.com" <rimasluk@...zon.com>,
"Grimm, Jon" <Jon.Grimm@....com>
Subject: Re: [PATCH v2 09/15] svm: Add support for activate/deactivate AVIC at
runtime
On 15.08.19 18:25, Suthikulpanit, Suravee wrote:
> Add necessary logics for supporting activate/deactivate AVIC at runtime.
>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
> ---
> arch/x86/kvm/svm.c | 27 +++++++++++++++++++++++++--
> 1 file changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> index 47f2439..cfa4b13 100644
> --- a/arch/x86/kvm/svm.c
> +++ b/arch/x86/kvm/svm.c
> @@ -385,6 +385,7 @@ struct amd_svm_iommu_ir {
> static void svm_flush_tlb(struct kvm_vcpu *vcpu, bool invalidate_gpa);
> static void svm_complete_interrupts(struct vcpu_svm *svm);
> static bool svm_get_enable_apicv(struct kvm *kvm);
> +static inline void avic_post_state_restore(struct kvm_vcpu *vcpu);
>
> static int nested_svm_exit_handled(struct vcpu_svm *svm);
> static int nested_svm_intercept(struct vcpu_svm *svm);
> @@ -2343,6 +2344,10 @@ static void svm_vcpu_blocking(struct kvm_vcpu *vcpu)
>
> static void svm_vcpu_unblocking(struct kvm_vcpu *vcpu)
> {
> + if (kvm_check_request(KVM_REQ_APICV_ACTIVATE, vcpu))
> + kvm_vcpu_activate_apicv(vcpu);
> + if (kvm_check_request(KVM_REQ_APICV_DEACTIVATE, vcpu))
> + kvm_vcpu_deactivate_apicv(vcpu);
> avic_set_running(vcpu, true);
> }
>
> @@ -5182,10 +5187,19 @@ static void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu)
> struct vcpu_svm *svm = to_svm(vcpu);
> struct vmcb *vmcb = svm->vmcb;
>
> - if (kvm_vcpu_apicv_active(vcpu))
> + if (kvm_vcpu_apicv_active(vcpu)) {
> + /**
> + * During AVIC temporary deactivation, guest could update
> + * APIC ID, DFR and LDR registers, which would not be trapped
> + * by avic_unaccelerated_ccess_interception(). In this case,
typo
Alex
Powered by blists - more mailing lists