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>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 5 Feb 2020 21:26:48 +0800
From:   Wanpeng Li <kernellwp@...il.com>
To:     Vitaly Kuznetsov <vkuznets@...hat.com>
Cc:     LKML <linux-kernel@...r.kernel.org>, kvm <kvm@...r.kernel.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <sean.j.christopherson@...el.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>,
        Thadeu Lima de Souza Cascardo <cascardo@...onical.com>
Subject: Re: [PATCH] KVM: Pre-allocate 1 cpumask variable per cpu for both pv
 tlb and pv ipis

On Tue, 4 Feb 2020 at 22:36, Vitaly Kuznetsov <vkuznets@...hat.com> wrote:
>
> Wanpeng Li <kernellwp@...il.com> writes:
>
> >>
> >> Honestly, I'd simplify the check in kvm_alloc_cpumask() as
> >>
> >> if (!kvm_para_available())
> >>         return;
> >>
> >> and allocated masks for all other cases.
> >
> > This will waste the memory if pv tlb and pv ipis are not exposed which
> > are the only users currently.
> >
>
> My assumption is that the number of cases where we a) expose KVM b)
> don't expose IPIs and PV-TLB and c) care about 1 cpumask per cpu is
> relatively low. Ok, let's at least have a function for
>
>         if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
>             !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
>             kvm_para_has_feature(KVM_FEATURE_STEAL_TIME))
>
> as we now check it twice: in kvm_alloc_cpumask() and kvm_guest_init(),
> something like pv_tlb_flush_supported(). We can also do
> pv_ipi_supported() and probably others for consistency.

Will do.

    Wanpeng

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ