From patchwork Thu Jun 14 01:18:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Moger, Babu" X-Patchwork-Id: 929177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amdcloud.onmicrosoft.com header.i=@amdcloud.onmicrosoft.com header.b="L9SlyFIc"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 415m754Knfz9s01 for ; Thu, 14 Jun 2018 11:21:53 +1000 (AEST) Received: from localhost ([::1]:37630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTGxT-0003IV-81 for incoming@patchwork.ozlabs.org; Wed, 13 Jun 2018 21:21:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTGuV-0001Ff-7H for qemu-devel@nongnu.org; Wed, 13 Jun 2018 21:18:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTGuQ-0007hC-VM for qemu-devel@nongnu.org; Wed, 13 Jun 2018 21:18:47 -0400 Received: from mail-eopbgr700076.outbound.protection.outlook.com ([40.107.70.76]:10976 helo=NAM04-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTGuQ-0007gd-Eu for qemu-devel@nongnu.org; Wed, 13 Jun 2018 21:18:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ycf6jgf7FjMHxGTrRoKLskjxVhuL23imMtljuwNmgZA=; b=L9SlyFIcOqtt5F9AnexHh2FyF5Laizh6tnybzgcrzwJPZ1UzvykDElW6/Pe6ZiBbRL8JxTioANII8wQO3g0z3ZkMQVD764GgrEmZ/aovMmE6E5gkHpm09NnjvUoMkSNIqRxQVSbEa2rTmnMTxLw2v+N8XxQmy2yYFB0eZvbal+0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from linux-h3ml.amd.com (165.204.77.1) by SN1PR12MB2480.namprd12.prod.outlook.com (2603:10b6:802:29::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.14; Thu, 14 Jun 2018 01:18:39 +0000 From: Babu Moger To: mst@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, mtosatti@redhat.com Date: Wed, 13 Jun 2018 21:18:21 -0400 Message-ID: <1528939107-17193-1-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN4PR0201CA0064.namprd02.prod.outlook.com (2603:10b6:803:20::26) To SN1PR12MB2480.namprd12.prod.outlook.com (2603:10b6:802:29::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 154a3958-0d93-47ea-de03-08d5d194c307 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:SN1PR12MB2480; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2480; 3:6MHZ/7xAJuBGh5X/5fOZdSdw3a3n/K0d6UxgnUu0StWjOG5/zXRnEUfG0q1XzUKwq9Kma4znJsAAi6hnntevifhex8c0kMgpHUXzA/EY92UiSRbYgIGLLyGaA8SLYWrr3Sx48OfqPnd+TCd2nblAFgprpiDPJSMoazy/stwUSXmdO7MZzgcYz1yaui48k6IXGTxImRNRxd93reJurf9IqkFFtFxwa4qnJ9Rlxn5YQScixisf6pJlTO0ovnsLdi4t; 25:9rvpT40LXUdzhCLoFXCGkbfqWCflkmohphq7s2ir7r86lEMEdQwXgAijWNbw2rJe5qmiA+lIBm7hE65A8wzW40h5oPVHiDmvIhK8Tsydtsn1u/WbPXWK95ORt3H5IgrccuKW6VeWDYJFYnpPa2JSegQQ86lqH51mO5QPQi+BkzjjvoFvvtCTg/a4LKAltjyxHJ0R6kObXpwVxJNJgTcGAEaSnPE4JZ36uGDquG1mQNRW/FGmL36Elj3mIWADO9zkBrLlzrRzkLW0OtJkU/XRHYHoO4uzsC1jgrApcnbVBlAXjSHvorAI7R83ZSkDiGFDI/TX+Qn85E2zoelkcDuQSw==; 31:/XpwSTfju1gpgxoXvrnEC+zyU3QpQQ7p82R3Nac1iF2NrObCCh0jXw+UrA8eI+hmAYIxMHGFCx6P/qQWQCm/H5JTk/6r6AbtiIhl6m6KnQypNkRn2/hrwV740v8nEozXcDvl6eNjtlLx4VlJguA0KllowvOTSVyCuVItsBZoEBVMxzAHdUJHX1DP1l37/O/hX5ueNewYOl3d3K3ZbFOSqvZ1UpDo2GEo4H+jIZ1Qouk= X-MS-TrafficTypeDiagnostic: SN1PR12MB2480: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2480; 20:GAWdrJdviwix6A9DAlgYEbxOm42Nfl0qJFz45HMeSTfz1w6vBJPNuvn2Bvvjb4m6DoYFIs3if567lJH0vwpIKvVqEWXYFiMBtqVf4nkKBvG4WbH0s+RXUy5QnDwGL5wqNR5f0OUondiKU57luXFWmr2MZIxFSGpmTIFti4s9BB3Tfd4MRp0Zy+C6/MUwcOz92WlplppRRyJFevI+tJOKesy8U/3H0HfmhFejH/imcZ9YYD0H3oxRPtndW/1Ks3/0O0XjmLTRmFEFLRksR7XL6v7uJqY89Cwpc0vFFRRirs4F1tFZsLvNHJXYwm5ZoVTVEJVDRZDikLwqxnu4nny5SOSMdNXRy89FY2GN4FJ+sjWQlMH7xVlK4D9lYE1Bga5xaWhazKiGhGCyxAXtCOTgyvg+onvcNsKHTIn2sjgURHXrQor4USJUxtGYM+Nzwmf1XU/weFi7Mpuio5hNoqYf175JkJemGWRkOwrRJjR1CbpFMsCblHPeX1SQ9JDUHa1Q X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863)(226959686518644)(22074186197030)(166708455590820)(211254476889703)(83566789882024)(24339691489775); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231254)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:SN1PR12MB2480; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB2480; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2480; 4:pEmJzGYKWAGzVkScR2TkulnMBV/iW8FV2mErdWrYQ7nX0/jta5JdZKNevmKjhXbCbW4uILGRSBM3vuBzEuyDJALkztqSFY9ZQtWW84LV+2+N71TEWVUMr3LhP113Ht64OtK1nxucbyZM5703INOPNwMy+udZdhyCATVkjvPfFF78Gl6jX6EOVE5H0SQ/kuaqoa96PPL9lCq06H25Oi/Ct6fY9sf9YwYjOqWcE5OeV6sIIdcZRVwVeGmLdCiXyAuKs+CdplON3PzdFKUqPiUYTb5LhHz6W1q1Wcmv8WPNXBXsIyaay1RkOaFTa8VimvOkZPqiN7zNCxHeDlBdS065PMOJ3mLm01E67FPH+u7ww0NekIJkShOZO6CNTevVXwaB15nw9aFld074agf9WYlzUFNPc+cag+yJMdgbYr9WKIS68tHK0dgbpOUlofb2l9Mx5BEBXRbXaWPCzG0Oex0nzBOtm6HBxuOY02aRE1x0FUvF7aV7/NXHv/fgKS11xA/IgvcCBzXVUHAusG0VsVxuVg== X-Forefront-PRVS: 0703B549E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(366004)(376002)(39380400002)(189003)(199004)(68736007)(2906002)(966005)(25786009)(52116002)(7696005)(72206003)(4720700003)(956004)(23676004)(6666003)(2616005)(2870700001)(44832011)(486006)(53936002)(7416002)(476003)(6486002)(39060400002)(36756003)(478600001)(4326008)(6116002)(5660300001)(7736002)(305945005)(86362001)(8676002)(186003)(97736004)(66066001)(3846002)(53416004)(8936002)(16526019)(316002)(6306002)(386003)(26005)(81156014)(81166006)(59450400001)(50466002)(106356001)(50226002)(47776003)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB2480; H:linux-h3ml.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB2480; 23:Sx3OGdfFKDF/Sb1HWDT81UYXyT7HcMO9LL8l5SvgL?= Hh5jO8U0q0XdFI5o+GpOCrtY8XRiQ7uPv7gh41x0O11mmEaetOCONGWXMFpwqfJFb6BDmoiobck4FHbH3WVfI+ier/ciVaynMEsUU0slk6/+FLmsa5W6YDrGS5U5wo0FfjnMmBUqlNo87R6LMnrAqiUFOgTio106o46tD05w2c08ogW1jWeuxl9Bjl0XCv5n07osAR5lPqShufl9JwT0cFykHEOOKNPORZpF1IYmxaB09OZTBLcgWtRdNVb4gtscIJy4yVXR20GiGWgipsh/gb3K2at/jRLltcCJQhQVV/s1ZedDJmKzsMfPWXE+hUPv3SMaz5PhDqyYDLfaHvCYgq2+fMnL7l+u7gE1VtR4pdP026fGblCY3Lww2dARg9n2Cd5cF/r0CVeBzbLYvalathOpHqVlXwPgH5zXd5ITkeizmsECyLgJe5ydoM+rXV5o6K+kBpgHy7Ni7mHt97VneMKAjPE2YCdvwBTdwcByou2cz+aDlxd+u6M42KcKpERMxQNgWElL3CWylTFD5RwUGkVo6BpgfAkOuCItGzpDZi5pkuxohb0D2El215jWnwFDabAPPBHvQwovJCnDZMn/MlTdo1PDD+y3c0m5qmkxy7vVoDD8P7yFx6SMwq9ukUB/6Fu9chbLWAmDyKkbLdqqjntxPmnm1iaxClS8Cvnm6TLujXhf4ujfi/PmEi2O1oupuwByMOg3oZr/a8cr+W0G/0kQOJDTc7lA7VPt7ec04tHqbKB7qfrhiBliiEKI0BLz/lpAdKnAdIjEY1vS0Clncay3qp+p2i7wU7ZgXHbHLJOcg5fdIENvKFubmhL8grFIbFyCCxdS+Ww83ILh7lH2HdWtAOs+B74FTlLqZs80MyNu8Ju6GZntR6gT9LTxS9jhTZ+B416yY8U4L1FEe8Q+R4IJNoc2Au/fthXP+ehc/F+3ZC15UKx3SSRVFfdpK4pOYo89JFsc2xbzFcG3yfFg90rJWKSNpeczNrj9Faii+ncyw5aXLO+8FPKbcBl++xqVyIGsN7mA6MF1xxRtw9SaVvs/TL7f+fzDpZkLroXHiMWrm48cynHpqcFycB3saCqvR2P4gVFd09V4XVmtry3fGXDOTGdGKRn7XjDaV6ayc0zNnTK34PtQT4P/TVseNlv7aoADmYJ9+X/BM8twH48ZNep0h744hHiFzZYKN8GQcf/ZM34sHsOUemNNddp4IsPX2EHcDSIqUvx8FlqcARB6gg4 X-Microsoft-Antispam-Message-Info: u8/qxwygMm3c7dnp/ELCZfpmUJYETY0FKCfNikPQKTev8yiXoHC/AyCmfoWvZQwnwzgD4OSKgc6J9biGGIjfszW/WRha6MinSzjiSKZpqZK7VkRZPw7bLXDd9fKUkQk0yeCJtIW93n5++lIkO5H+fZYKm0DBUnxHPmM7eEQIBFiOh7tJY4JznY5udX9bV+lf X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2480; 6:LERyBCTJ+AAVle6DqxHDZ7C/yWTReyr7IZe/kcSYW/pewVxqL8D/oZ4s2TpauJUXubxonIZ2TaoDP12TnvM9PQDlP6f01hFPoHvJj77Kt1Wr8IrDlwuhYwwTMed5Ws0YX+x0YRrO/0g2R8jASB0P+hiFFC6V9sEM5Bv6ehyNH/WdjNXRK4XLcXCYie/jxRVIva8hyfcY+SoHQo6HgbU/2Tn2bJA+fP5lMuL0YxGYgr9KGh4sOgHepysmA+qMTsFK2gAZ493wqQY8xVGgJqi96yEl0TVdOeKvgHCtfZePdadRwlouatpoU1VH96DbTC+uM1b7sFq+bWB+apTQjIeOPuXgTbr7dNS7iVUJw5Z4m5+YvOWC1D1/h67j70s6jeAmM1N3V06UqRys0dJO1GMwwY5XE6ppzTM+Iv1rGOrGCrDX3v7WT4ZIylAUaTq+adU8xeY0QoqCmSawEyeYlZofxQ==; 5:C559chaOq24bXBmnfwsz8UwAPfxrPhPw1YA62Twb/KgE0A5Bb7QU+8fhQN6A2J7YrQgvYgEU3QKHKA3wUN0JZgS24D3s2FVBuKH+3TjuBfZQ7yVaIaFPJUeAv4vzSsJC5KzMmrDuh/mzZyIJ1/6rzWWnNEP3knYUGMLYCfVmWn4=; 24:mUAJ94h5rzatLucoJbULHIrLnDjfgoSsDut5HOS/Avl2klrVtsJabldrotTwFleUXM8R8wERPKFEBvB34V7+u6anjNfuF84wMg/Kd7apqT0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2480; 7:zVg+phRDRr82yqgHKvG4n36izoA4ae0PU1YH1/GnK8VOHV+P7wnL+Ru17BYdXPv+JyhD1IoZlHRpijZWy5iJO2shxTQygtvkF5sqikrvTHjPWNS69gwAPs2THe20WJBFO3C22Kqx3G1e1Xr7OJTaddlsyAZeGQZ4rUunRjMTKgqgOAgQ4+UugJu+M9udovDF7Wwm0zD/5FyFACBy0SGwD4ddQsyZBcgYeIBQBjCRhai1eXHGMPBQezsDedv1tVC2; 20:VaRpwkXFIrcTJFHpmGBjJCqydLEi8ydiMd20kfTCU/GVtbjxBLwxI1iPfB5Fhqzei0FJJuiIdes7ZmFXDnan52WOFzKKzBM7sYiTw6j5Vt6wu+Feaypmed/1G9XaU1Zbxd+1CXUxX3U2E7ZIZhZlFB/phTFJICgzBe2eIQN3StIQihMzOwkLTGUTShAA03mXuZYGrwH3T9h74zE91puH6YTQJNXA2tQ6nbsnn1x2BW3vXHngiilQ2x8dT7whoFU8 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 01:18:39.6878 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 154a3958-0d93-47ea-de03-08d5d194c307 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2480 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.70.76 Subject: [Qemu-devel] [PATCH v14 0/6] i386: Enable TOPOEXT to support hyperthreading on AMD CPU X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: geoff@hostfission.com, babu.moger@amd.com, kash@tripleback.net, qemu-devel@nongnu.org, kvm@vger.kernel.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This series enables the TOPOEXT feature for AMD CPUs. This is required to support hyperthreading on kvm guests. This addresses the issues reported in these bugs: https://bugzilla.redhat.com/show_bug.cgi?id=1481253 https://bugs.launchpad.net/qemu/+bug/1703506 v14: Patches are based off of Eduardo's git://github.com/ehabkost/qemu.git x86-next. Some of the patches are queued already. Submitting remaining series. Summary of changes. 1. Always set TOPOEXT feature in kvm_arch_get_supported_cpuid 2. Implemented topology_supports_topoext bit differently. Reason for this is, if we need to disable this feature before the x86_cpu_expand_features. But problem is nr_cores and nr_threads are not populated at this time. It is populated in qemu_init_vcpus. 3. Removed auto-topoext feature completely. The can cause lots of compatibility issues. v13: Patches are based off of Eduardo's git://github.com/ehabkost/qemu.git x86-next. Some of the patches are queued already. Submitting remaining series. Summary of changes. 1.Fixed the error format if the topology cannot be supported. 2.Fixed the compatibility issues with old cpu models and new machine types. Here is the discussion thread. Here is the discussion thread. https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg01239.html 3.I am still testing it. But sending it to get review feedback. v12: Patches are based off of Eduardo's git://github.com/ehabkost/qemu.git x86-next. Some of the patches are queued already. Submitting remaining series. Summary of changes. 1.Added more comments explaining CPUID_Fn8000001E bit definitions. 2.Split the patch into separate patch to check the topology. Moved the code to x86_cpu_realizefn. Display the error if topoext feature cannot be enabled. 3.Few more text corrections. v11: Patches are based off of Eduardo's git://github.com/ehabkost/qemu.git x86-next. Summary of changes. 1.Added more comments explaining different constants and variables. 2.Removed NUM_SHARING_CACHE macro and made the code simpler. 3.Changed the function name num_sharing_l3_cache to cores_in_core_complex. This function is actually finding the number of cores in a core complex. Purpose here is to re-use the code in couple more places. 4.Added new function nodes_in_socket to find number of nodes in the config. Purpose here is to re-use the code. 5.Used DIV_ROUND_UP wherever applicable. 6.Renamed few constants and functions to generic names. 7.Few more text corrections. v10: Based the patches on Eduardo's git://github.com/ehabkost/qemu.git x86-next Some of the earlier patches are already queued. So, submitting the rest of the series here. This series adds complete redesign of the cpu topology. Based on user given parameter, we try to build topology very close to the hardware. Maintains symmetry as much as possible. Added new function epyc_build_topology to build the topology based on user given nr_cores, nr_threads. Summary of changes. 1. Build the topology dinamically based on nr_cores and nr_threads 2. Added new epyc_build_topology to build the new topology. 3. Added new function num_sharing_l3_cache to calculate the L3 sharing 4. Added a check to verify the topology. Disabled the TOPOEXT if the topology cannot be built. v9: Based the patches on Eduardo's git://github.com/ehabkost/qemu.git x86-next tree. Following 3 patches from v8 are already queued. i386: Add cache information in X86CPUDefinition i386: Initialize cache information for EPYC family processors i386: Helpers to encode cache information consistently So, submitting the rest of the series here. Changes: 1. Included Eduardo's clean up patch 2. Added 2.13 machine types 3. Disabled topoext for 2.12 and below versions. 4. Added the assert to core_id as discussed. v8: Addressed feedback from Eduardo. Thanks Eduardo for being patient with me. Tested on AMD EPYC server and also did some basic testing on intel box. Summary of changes. 1. Reverted back l2 cache associativity. Kept it same as legacy. 2. Changed cache_info structure in X86CPUDefinition and CPUX86State to pointers. 3. Added legacy_cache property in PC_COMPAT_2_12 and initialized legacy_cache based on static cache_info availability. 4. Squashed patch 4 and 5 and applied it before patch 3. 5. Added legacy cache check for cpuid[2] and cpuid[4] for consistancy. 6. Simplified NUM_SHARING_CACHE definition for readability, 7. Removed assert for core_id as it appeared redundant. 8. Simplified encode_cache_cpuid8000001d little bit. 9. Few more minor changes v7: Rebased on top of latest tree after 2.12 release and done few basic tests. There are no changes except for few minor hunks. Hopefully this gets pulled into 2.13 release. Please review, let me know of any feedback. v6: 1.Fixed problem with patch#4(Add new property to control cache info). The parameter legacy_cache should be "on" by default on machine type "pc-q35-2.10". This was found by Alexandr Iarygin. 2.Fixed the l3 cache size for EPYC based machines(patch#3). Also, fixed the number of logical processors sharing the cache(patch#6). Only L3 cache is shared by multiple cores but not L1 or L2. This was a bug while decoding. This was found by Geoffrey McRae and he verified the fix. v5: In this series I tried to address the feedback from Eduardo Habkost. The discussion thread is here. https://patchwork.kernel.org/patch/10299745/ The previous thread is here. http://patchwork.ozlabs.org/cover/884885/ Reason for these changes. The cache properties for AMD family of processors have changed from previous releases. We don't want to display the new information on the old family of processors as this might cause compatibility issues. Changes: 1.Based the patches on top of Eduardo's(patch#1) patch. Changed few things. Moved the Cache definitions to cpu.h file. Changed the CPUID_4 names to generic names. 2.Added a new propery "legacy-cache" in cpu object(patch#2). This can be used to display the old property even if the host supports the new cache properties. 3.Added cache information in X86CPUDefinition and CPUX86State 4.Patch 6-7 changed quite a bit from previous version does to new approach. 5.Addressed few issues with CPUID_8000_001d and CPUID_8000_001E. v4: 1.Removed the checks under cpuid 0x8000001D leaf(patch #2). These check are not necessary. Found this during internal review. 2.Added CPUID_EXT3_TOPOEXT feature for all the 17 family(patch #4). This was found by Kash Pande during his testing. 3.Removed th hardcoded cpuid xlevel and dynamically extended if CPUID_EXT3_TOPOEXT is supported(Suggested by Brijesh Singh). v3: 1.Removed the patch #1. Radim mentioned that original typo problem is in linux kernel header. qemu is just copying those files. 2.In previous version, I used the cpuid 4 definitions for AMDs cpuid leaf 0x8000001D. CPUID 4 is very intel specific and we dont want to expose those details under AMD. I have renamed some of these definitions as generic. These changes are in patch#1. Radim, let me know if this is what you intended. 3.Added assert to for core_id(Suggested by Radim Krcmár). 4.Changed the if condition under "L3 cache info"(Suggested by Gary Hook). 5.Addressed few more text correction and code cleanup(Suggested by Thomas Lendacky). v2: Fixed few more minor issues per Gary Hook's comments. Thank you Gary. Removed the patch#1. We need to handle the instruction cache associativity seperately. It varies based on the cpu family. I will comeback to that later. Added two more typo corrections in patch#1 and patch#5. v1: Stanislav Lanci posted few patches earlier. https://patchwork.kernel.org/patch/10040903/ Rebased his patches with few changes. 1.Spit the patches into two, separating cpuid functions 0x8000001D and 0x8000001E (Patch 2 and 3). 2.Removed the generic non-intel check and made a separate patch with some changes(Patch 5). 3.Fixed L3_N_SETS_AMD(from 4096 to 8192) based on CPUID_Fn8000001D_ECX_x03. Added 2 more patches. Patch 1. Fixes cache associativity. Patch 4. Adds TOPOEXT feature on AMD EPYC CPU. Babu Moger (6): i386: Set TOPOEXT unconditionally for comapatibility i386: Enable TOPOEXT feature on AMD EPYC CPU i386: Disable TOPOEXT feature on pc-2.12 cpus: Add new function topology_supports_topoext i386: Disable TOPOEXT feature if it cannot be supported i386: Remove generic SMT thread check accel/tcg/user-exec-stub.c | 5 +++++ cpus.c | 13 +++++++++++++ include/hw/i386/pc.h | 4 ++++ include/qom/cpu.h | 9 +++++++++ target/i386/cpu.c | 45 ++++++++++++++++++++++++++++++++++++--------- target/i386/kvm.c | 6 ++++++ 6 files changed, 73 insertions(+), 9 deletions(-)