Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp68358pxk; Tue, 15 Sep 2020 20:52:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaR/iUclIMgANdLk5aPVXIv77K/dTJVa2Gxd0vb04KAJCw1idL9HkydzjmsyhWf6OIK7bW X-Received: by 2002:a17:906:bc98:: with SMTP id lv24mr24283341ejb.411.1600228352754; Tue, 15 Sep 2020 20:52:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1600228352; cv=pass; d=google.com; s=arc-20160816; b=cUWHRPbLJ6WdL4MxpXb1OkHhRqsfM0Pr6Ox6wRDsmx460oMYVIcdcborad+3ed1B8b /TEqHGo5grXOISYLHXVJbpTwir67DaBg38IazHPglOsXcx6G/1jRZOM9PrPRXMcVFpzh I0NUUgEJxZQipzeCKs8RspZk9ndK0F+13v94na5nU4BDgx9I11iVDcLuCi4LYU/+Sztv 1XSP1OuirnTHd3+UqttUB4UWkRGmgyrXwEoUkhcE8xhgHP0xU/4Fqtewymw1WSrOnonx vWUtogS5kamoIUWtu8mgGUEiFz7iRXE+dfO58GNG/GqcGb7uYbEZE3ankqtOcRl73css OF3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:importance:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature; bh=WZ/D+Q/kmxLiYd4w8gULC0EeonEBJFusdeCRLhEqmXk=; b=uCvOIlCeHpFyWfqeJwMxx/EUQCNvOVlDdIGotr5hnxs+To5gKTRZ9+emD0uLLa+MfQ gWOBTYRlkJfIWRaRlhH6R/0dG+YeWz2paZCxnTzipSNfDU8qGh2P4AImAZvVsdJVxUJr WlyMThEuPrwH4IbRV/FIQPLFRRISgvu3vxhavCeqarOf3ekOOpmJBp51cxiRgQWWHlVf zmeDaAe8r0bqBWEiIGgJ9FS2Zy4+7SPA/1ewDb7B7nBMfNSKTthMInuHMzBL82Bzt2B2 pEWSf6X32murW8JOxIJvJWLKxbrY+j7a03NamC6rqJcl/dsJ/dIFJOFTX8/UHm5tNSHD orsg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b="OqZ/dV7f"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b19si11018764ejd.451.2020.09.15.20.52.10; Tue, 15 Sep 2020 20:52:32 -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=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b="OqZ/dV7f"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726544AbgIPDtP (ORCPT + 99 others); Tue, 15 Sep 2020 23:49:15 -0400 Received: from mail-eopbgr700085.outbound.protection.outlook.com ([40.107.70.85]:21633 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726486AbgIPDtK (ORCPT ); Tue, 15 Sep 2020 23:49:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nnz8h2XonpjJwQ+91YXLmhi5B5HkqFrJTLjCA3qQdcyvSwCaUPYN6cebgxMJCM8CFh6a+0K5t1tAIXRrMUFbOuczqxE9f9HePTrcd52xBTOZOY6sQBGtqNG3czyvUVNLgwCmWZisq41IaMsp/u2MB9S9mnh559Njv7CLSaoQER1F4GuUx5sRKReNOKA+ZV6faAJr123yDtjiGzqjtcbGmG7BhXlX4ChLbj9KVxbYpNSkX3bM67+xIQdBd4GGrnAwMzW4P5anJKw490cB4jVrn0DMC/T1jjunmZdUe5j0ymitfeiupUa6OyFYgzD2aZK5jOKd2u4/RJzOaXL5PlELsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WZ/D+Q/kmxLiYd4w8gULC0EeonEBJFusdeCRLhEqmXk=; b=F29z9NyNSpDtEN0bkYMdeRew8/xSGeX2InDkDWnVirMX6YA5jDOSvmMOEl3XxWwgUr6+sDwWJetk27lydVI6poauE8G+MZKbgYq9SXIB4biCBQPmllffQMguG6nTObUpryWUeudAS3/GanPBU5WH8/E4ufzsy584sOtCmsh742X8Gk21IzNlVFTP1VNWwvE2w717x09+8VD9HWWKXCGtCMI+Kb4+j7eJpdkyv/cqnfGsbdQfm5FwVW8QVqMM3MFIkmYKw0aFXa0DQm8uSdaeTSH6EudNIsuo4FjLdMgw0n+WnuA2xe2r1gnA7mFexXO4pNP1NApV7rvk69FS+Zr8bg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WZ/D+Q/kmxLiYd4w8gULC0EeonEBJFusdeCRLhEqmXk=; b=OqZ/dV7fOcsbxjo5j8/bcmy4pUw8cXqgNuiUUZclafszmCndf62GJzsoE4h4hYp9DP2asrkBkg3BPoRAt/p2SHhTiVC2yFIS2VcpdwSr1eoShIKMpYSAaYFIZIjujVRBcJuiTP56QL3LPiqnCA5wi9sSL15fOZZ3vQT9cWWoaHk= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=amd.com; Received: from CY4PR12MB1494.namprd12.prod.outlook.com (2603:10b6:910:f::22) by CY4PR1201MB0215.namprd12.prod.outlook.com (2603:10b6:910:1d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Wed, 16 Sep 2020 03:49:08 +0000 Received: from CY4PR12MB1494.namprd12.prod.outlook.com ([fe80::9067:e60d:5698:51d8]) by CY4PR12MB1494.namprd12.prod.outlook.com ([fe80::9067:e60d:5698:51d8%12]) with mapi id 15.20.3391.011; Wed, 16 Sep 2020 03:49:08 +0000 Date: Tue, 15 Sep 2020 22:49:05 -0500 From: Wei Huang To: "Dr. David Alan Gilbert" Cc: Vitaly Kuznetsov , 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: <20200916034905.GA508748@weilap> References: <20200915154306.724953-1-vkuznets@redhat.com> <20200915165131.GC2922@work-vm> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200915165131.GC2922@work-vm> X-ClientProxiedBy: MN2PR01CA0008.prod.exchangelabs.com (2603:10b6:208:10c::21) To CY4PR12MB1494.namprd12.prod.outlook.com (2603:10b6:910:f::22) Importance: high MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost (24.55.15.93) by MN2PR01CA0008.prod.exchangelabs.com (2603:10b6:208:10c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.11 via Frontend Transport; Wed, 16 Sep 2020 03:49:07 +0000 X-Priority: 1 (Highest) X-MSMail-Priority: High X-Originating-IP: [24.55.15.93] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3cd52300-2c18-488c-d81d-08d859f376e5 X-MS-TrafficTypeDiagnostic: CY4PR1201MB0215: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nA+gc7Tsuiz3vv5+wFVjSXjDyuZSZ4+wVtiGNF+Xe5vgXZ2QjpZepA3CGVqJi2/BPZawafWhuBJnNlJA1NXwDTgx9S8ZG3l5bnHsamW2oSzp69TRIV1cv8vRJUHnT7purFou1N5tlEVV4yFM8D3DtK3xyw3lzEV3XuxfPXtHN6ZyLYM6oa4srswHWna/LX+tac2gwxZtOMuYQBTMde3r4fruvejRvYNpHTKpW7BpJ1e5vGt954WRn3XRHYF1R96NJqjiSnSVTuqC3AGHVSEmzks+J9Kt9nKc+6vNBeUa+pgB1zHj6/roTeHFEOq0c9WhDiLDE+rVeh26fG1peAUZMCb5UR9n0K8+xGH6tKNcu8kdzF9lKIYnyfDmHAeQZiWh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR12MB1494.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(7916004)(39860400002)(366004)(396003)(376002)(346002)(136003)(83380400001)(6486002)(16526019)(186003)(66946007)(478600001)(66476007)(66556008)(26005)(52116002)(54906003)(6496006)(33716001)(8676002)(8936002)(4326008)(6916009)(956004)(9686003)(33656002)(2906002)(86362001)(5660300002)(1076003)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: DduOcOfHhAHGl+yT6reauo6b4Nmq1EYHIpwW2URmjcB/nYvENHtoS+UzGPA1L3Pec/FK1cBDXMjc4RPUyeTfdOkIEAXvKLdeeYEIOW998/SiRZFJWbdDB2YeCuN8QTeGAoi5gHRwxIX4zBpkjaU88ct3zhNC4Go053vZzX5Gz+XiG3ROdM6Lnr1cllZdwC5osafkiTwzgrcigusRzbAqVQaTntHStVuJbaE0ETa0JvsFcpLSWpY0AK2K+dnFC3U/Yef2RPViSwaDQE4vnIpkl80NST+MH+Ku1SilWJSN7Zp2/B0EdKxLMJ9eSpir1j5ylBFVG7Yca6zWD+ba1EQE3wVkKvw2Qf4J+DYc55OrtkdZDz7Ov7mkgaT6HQMWpbs4xbSEoNE33dCvF8Wol4iMHcmM82H6ECeQst1qajMejResr+KcMfFWpZe4HVoGGpnvI6lfCINYUNFAkWxha+jbIrggZkjoG4b9lbe1qk90fsRkYsAknnQ8SQcuKGtIoIDwEoMrFyGwsgR3DFjAfKwR47O7/AQtWc2plojxRoYmOPLbWJgDdcFOdbSeUoVwXXl09Ei2gqvHJF+k1sQ2XNHvblV84WvJu4i+bTX5zC81NHVUXSEW0hm4MM9ySVBl+KVa00b07DtoUX8gPqRhH8x80Q== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3cd52300-2c18-488c-d81d-08d859f376e5 X-MS-Exchange-CrossTenant-AuthSource: CY4PR12MB1494.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 03:49:08.2053 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Lv6nzlFY2ijUfWwDOhnZhoyAOc67bMpzufQzJYakoeiiX4wt2P+CvU2QAH2+Z2sT X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/15 05:51, Dr. David Alan Gilbert wrote: > * Vitaly Kuznetsov (vkuznets@redhat.com) wrote: > > With QEMU and newer AMD CPUs (namely: Epyc 'Rome') the current limit for Could you elaborate on this limit? On Rome, I counted ~35 CPUID functions which include Fn0000_xxxx, Fn4000_xxxx and Fn8000_xxxx. > > 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 > I tested on two platforms and the patches worked fine. So no objection on the design. Tested-by: Wei Huang > > 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 >