Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3204001pxk; Tue, 15 Sep 2020 12:51:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKaE1eeCGOk1M+2HlR5y8G6PmOd/QYV2Eh8zMYSu2tV12dUtcQIlafvGturQPVxH2DoDsN X-Received: by 2002:a17:906:3955:: with SMTP id g21mr22130359eje.69.1600199480915; Tue, 15 Sep 2020 12:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600199480; cv=none; d=google.com; s=arc-20160816; b=FfMYrzoQZmr7/578lCspl25eR+1u34axsQ5WK1rS9IEJTec+cMmJ+Hoe79bJ0ddel+ 3aVVZ8wfOXJTUswZhJDfKhBjpcx5YGCFGYm6up2DiBABRGApoUiE3nCtZkgAsQqcYH2z hjr9qcHtCpxDaHdh/3GIFfsRT1mJG+AVlKObzRdPa6o9UkeU2hgeGLRQIREkqc6MHNin U7bQ34l6/+6sU024FvSWF+1JtlLwnwpuLAA97OhtlEF0vps+NVYmU6TT7C2csUuuEK5z e1GGZQR5QiJ28gT9VZHPc/owD9B6BQloBhAWHEDV1nlbMbQGR2mrkilOCqKnzrCZdxBR oFpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yPmPv3nS4j+ToD69H4u95r5JbLwmp3gKNTOHEJVtB3U=; b=Xqifjz2P9oEKK9rJPaT0HtoYlBlb4EpWvQgQzvsvKKwmRUcOuZPr0DEy1ABdNdUEks exyw5MEuDUSwerJ7GT8M0jyHgNkshIyVbUaIRTlm/9lkIqpjK+cXJ+hOGVvwco9qP6mL elm8zZ+LNxyghJK+QS4jv57MIjvyuPgMpGEhMbICdFjmBiKB9lbAeeTDyW6mHkHIa+m+ Zrr39alhR/wTIdzQx8aqL5RjyqbyynOhVspy1Q4umsYG18/SKUREPDIdAbm57ZjnbaZO t4/Vs8oCspykzpbS6SZ25DtRu/FxTencUDHxWZtPdnlZSXXJba6X3SWLQoPXo7gKT1pA gKng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=g1VkcBS2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi26si10195740ejb.361.2020.09.15.12.50.58; Tue, 15 Sep 2020 12:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=g1VkcBS2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726485AbgIOTtM (ORCPT + 99 others); Tue, 15 Sep 2020 15:49:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:49140 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727841AbgIORLS (ORCPT ); Tue, 15 Sep 2020 13:11:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600189823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yPmPv3nS4j+ToD69H4u95r5JbLwmp3gKNTOHEJVtB3U=; b=g1VkcBS2N1zAhWh/Aep31F13wuSx0KehOjZquDJvr6SCFPoH6S4DN1l1PowItB4UfuGX7s HPrBC1g2DujMA6Hj11/duqiBCnO2vBCnKoHf1dP8GBOgHMdOtCDs4IjrNJAaYSgGkk9FGI Wglt4c4KL8Ane8zFDND0AScM91i0FAc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-362-I4E89CNxMemVJZk38H5rlQ-1; Tue, 15 Sep 2020 12:51:54 -0400 X-MC-Unique: I4E89CNxMemVJZk38H5rlQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 48AEA18C9F57; Tue, 15 Sep 2020 16:51:36 +0000 (UTC) Received: from work-vm (ovpn-115-25.ams2.redhat.com [10.36.115.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 758F719D61; Tue, 15 Sep 2020 16:51:34 +0000 (UTC) Date: Tue, 15 Sep 2020 17:51:31 +0100 From: "Dr. David Alan Gilbert" To: Vitaly Kuznetsov Cc: kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson , Wanpeng Li , Jim Mattson , Wei Huang , linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 0/2] KVM: x86: allow for more CPUID entries Message-ID: <20200915165131.GC2922@work-vm> References: <20200915154306.724953-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200915154306.724953-1-vkuznets@redhat.com> User-Agent: Mutt/1.14.6 (2020-07-11) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Vitaly Kuznetsov (vkuznets@redhat.com) wrote: > With QEMU and newer AMD CPUs (namely: Epyc 'Rome') the current limit for > KVM_MAX_CPUID_ENTRIES(80) is reported to be hit. Last time it was raised > from '40' in 2010. We can, of course, just bump it a little bit to fix > the immediate issue but the report made me wonder why we need to pre- > allocate vcpu->arch.cpuid_entries array instead of sizing it dynamically. > This RFC is intended to feed my curiosity. > > Very mildly tested with selftests/kvm-unit-tests and nothing seems to > break. I also don't have access to the system where the original issue > was reported but chances we're fixing it are very good IMO as just the > second patch alone was reported to be sufficient. > > Reported-by: Dr. David Alan Gilbert Oh nice, I was just going to bump the magic number :-) Anyway, this seems to work for me, so: Tested-by: Dr. David Alan Gilbert > Vitaly Kuznetsov (2): > KVM: x86: allocate vcpu->arch.cpuid_entries dynamically > KVM: x86: bump KVM_MAX_CPUID_ENTRIES > > arch/x86/include/asm/kvm_host.h | 4 +-- > arch/x86/kvm/cpuid.c | 55 ++++++++++++++++++++++++--------- > arch/x86/kvm/x86.c | 1 + > 3 files changed, 43 insertions(+), 17 deletions(-) > > -- > 2.25.4 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK