From: linmiaohe <linmiaohe@huawei.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "rmuncrief@humanavance.com" <rmuncrief@humanavance.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH] KVM: SVM: allocate AVIC data structures based on kvm_amd moduleparameter
Date: Tue, 25 Feb 2020 09:26:29 +0000 [thread overview]
Message-ID: <1e573a529ff149f9858ae1c809ddb8c0@huawei.com> (raw)
Paolo Bonzini <pbonzini@redhat.com> writes:
>Even if APICv is disabled at startup, the backing page and ir_list need to be initialized in case they are needed later. The only case in which this can be skipped is for userspace irqchip, and that must be done because avic_init_backing_page dereferences vcpu->arch.apic (which is NULL for userspace irqchip).
>
>Tested-by: rmuncrief@humanavance.com
>Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=206579
>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>---
> arch/x86/kvm/svm.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index ad3f5b178a03..bd02526300ab 100644
>--- a/arch/x86/kvm/svm.c
>+++ b/arch/x86/kvm/svm.c
>@@ -2194,8 +2194,9 @@ static void svm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) static int avic_init_vcpu(struct vcpu_svm *svm) {
> int ret;
>+ struct kvm_vcpu *vcpu = &svm->vcpu;
>
>- if (!kvm_vcpu_apicv_active(&svm->vcpu))
>+ if (!avic || !irqchip_in_kernel(vcpu->kvm))
> return 0;
>
> ret = avic_init_backing_page(&svm->vcpu);
>--
>1.8.3.1
>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
next reply other threads:[~2020-02-25 9:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-25 9:26 linmiaohe [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-02-25 7:54 [PATCH] KVM: SVM: allocate AVIC data structures based on kvm_amd moduleparameter Paolo Bonzini
2020-02-25 13:45 ` Vitaly Kuznetsov
2020-02-25 14:01 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1e573a529ff149f9858ae1c809ddb8c0@huawei.com \
--to=linmiaohe@huawei.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rmuncrief@humanavance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox