Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3080500pxk; Tue, 15 Sep 2020 09:33:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1YFQ/NIz30B4eB+DtIaejq+FxZm++dwLnlmdEOgKJD8oJkd4bAm7C5fQ1BYj30KAT32sz X-Received: by 2002:a17:906:29ca:: with SMTP id y10mr20570968eje.327.1600187593078; Tue, 15 Sep 2020 09:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600187593; cv=none; d=google.com; s=arc-20160816; b=AqbHAtyKO55o1ZXCaLNp6wlO59E1AEgZ4nbvSs91gx9QuSnFVoTTt4LKsdN67G8g99 QzkxXL66MQzWTdYZzCgC27gC7cLAzwwOX62/jrw3bvnd67lRQnBVlwN3rUffXWqHOiBs B01ITe8VSD9V+DPp9VFpEdeLvJddvyS1FIAjCuDQJTkMmCSs/GTr7o11G7WqP5uLyutn asugM0WTEk+t8mKY/dUEFLmTqriHa81o9yzKKncKHdbNVTCo6DcwfH8GFXMR1tYKu0yB ELkdomJyKf06m2w91cMqTU0Q/62Qh++uluqgfHMu7C1Dm4QZrl/24KKtLayZPv3s+NUc f7aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=S7LOvCl7XUVBU80Y/PU+FTVOH70oxm6JnXxMde/HKVE=; b=arIzA82pYxufeKoNz8KvYkshA0FQVOoxpUdoJljcnsq+UReGjH7tzNUjzhhF+T6jWU yzvHoUhB1u0ORxPd/IplQvAstoLPIINuGvc9rM8lFWrD8ZAtdyIBgSEIv/C2L4X7u3Rx PnSr4w4jszAd9u7SPg5QHakgHGMzytsOwK0CdKht45WBSVFpQvoxssKuBLhKgUftOCP+ ajIdMgZSZ6kTju0ULzVyBFMpX+aGqETJ8vmWhTV7B3NLGJjo2+VNMXn7a1KBPfMIucUQ pGP15/YuQr7sd7C6Ou5oS9tM0oQQAvxKxxKbPIarrwuQE1QIQcpGkhAnDKeTmToURw7k 2Avg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LLEva9hW; 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 a26si9193008ejv.698.2020.09.15.09.32.48; Tue, 15 Sep 2020 09:33:13 -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=LLEva9hW; 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 S1727614AbgIOQ1Z (ORCPT + 99 others); Tue, 15 Sep 2020 12:27:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46021 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727454AbgIOPnR (ORCPT ); Tue, 15 Sep 2020 11:43:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600184596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=S7LOvCl7XUVBU80Y/PU+FTVOH70oxm6JnXxMde/HKVE=; b=LLEva9hWSkYksK8FihM07TdSQcZklvlTOQpA+T2fUuK1hpZykRTeUdtSDU6gZstkduG2W3 p1wHp/AcpDx0LicFCwmP7xLy0y3LYP9Etrst9GCnjuMAa1/cjyyIqdwS0JWXcrJi5IRq6g JFkW/j492lmhRNz5Xi5xgUJ7NIAxdjY= 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-409-HNLXfCHwMlOI095IlUogdg-1; Tue, 15 Sep 2020 11:43:12 -0400 X-MC-Unique: HNLXfCHwMlOI095IlUogdg-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 BA9D2CF983; Tue, 15 Sep 2020 15:43:10 +0000 (UTC) Received: from vitty.brq.redhat.com (unknown [10.40.195.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 120A119D61; Tue, 15 Sep 2020 15:43:07 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , "Dr . David Alan Gilbert" , Wei Huang , linux-kernel@vger.kernel.org Subject: [PATCH RFC 0/2] KVM: x86: allow for more CPUID entries Date: Tue, 15 Sep 2020 17:43:04 +0200 Message-Id: <20200915154306.724953-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 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