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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Mar 2020 07:17:21 -0800
From:   Sean Christopherson <sean.j.christopherson@...el.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, Xiaoyao Li <xiaoyao.li@...el.com>
Subject: Re: [PATCH v2 01/66] KVM: x86: Return -E2BIG when
 KVM_GET_SUPPORTED_CPUID hits max entries

On Tue, Mar 03, 2020 at 03:16:16PM +0100, Paolo Bonzini wrote:
> On 03/03/20 00:56, Sean Christopherson wrote:
> > (KVM hard caps CPUID 0xD at a single sub-leaf).
> 
> Hmm... no it doesn't?
> 
>                 for (idx = 1, i = 1; idx < 64; ++idx) {
>                         u64 mask = ((u64)1 << idx);
>                         if (*nent >= maxnent)
>                                 goto out;
> 
>                         do_host_cpuid(&entry[i], function, idx);
>                         if (idx == 1) {
>                                 entry[i].eax &= kvm_cpuid_D_1_eax_x86_features;
>                                 cpuid_mask(&entry[i].eax, CPUID_D_1_EAX);
>                                 entry[i].ebx = 0;
>                                 if (entry[i].eax & (F(XSAVES)|F(XSAVEC)))
>                                         entry[i].ebx =
>                                                 xstate_required_size(supported,
>                                                                      true);
>                         } else {
>                                 if (entry[i].eax == 0 || !(supported & mask))
>                                         continue;
>                                 if (WARN_ON_ONCE(entry[i].ecx & 1))
>                                         continue;
>                         }
>                         entry[i].ecx = 0;
>                         entry[i].edx = 0;
>                         ++*nent;
>                         ++i;
>                 }

Ah rats, I was thinking of CPUID 0x7 when I wrote that.  Maybe just reword
it to "(KVM hard caps the number of CPUID 0xD sub-leafs)."?

> I still think the patch is correct, what matters is that no KVM in
> existence supports enough processor features to reach 100 or so subleaves.

Powered by blists - more mailing lists