lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue, 25 Feb 2020 09:26:29 +0000
From:   linmiaohe <linmiaohe@...wei.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
CC:     "rmuncrief@...anavance.com" <rmuncrief@...anavance.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>
Subject: Re: [PATCH] KVM: SVM: allocate AVIC data structures based on kvm_amd
 moduleparameter

Paolo Bonzini <pbonzini@...hat.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@...anavance.com
>Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=206579
>Signed-off-by: Paolo Bonzini <pbonzini@...hat.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@...wei.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ