From patchwork Thu Apr 26 16:26:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10366323 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 43B2C6032C for ; Thu, 26 Apr 2018 16:27:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 350DC28520 for ; Thu, 26 Apr 2018 16:27:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2975A28604; Thu, 26 Apr 2018 16:27:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CD4C28520 for ; Thu, 26 Apr 2018 16:27:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932264AbeDZQ1P (ORCPT ); Thu, 26 Apr 2018 12:27:15 -0400 Received: from mail-sn1nam01on0058.outbound.protection.outlook.com ([104.47.32.58]:3008 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932135AbeDZQ1H (ORCPT ); Thu, 26 Apr 2018 12:27:07 -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; bh=5/tCxPTRnV2VhNpqenvJex6S5oshV7Vf1DXQe3GX2mY=; b=0I3Ky7FQxkFb1h7cNwkfa+Jttpr1m4nz+HT5uC25U3Q4tpdYCbIXR+Yoa7C9fdoPPYFLoFIFoNNc83JFE8qPvD/j9dSmdN96KBw1Y88SWADFRT/R/3vrVHCEpJY2CVHr7zmM4kfTN4iu9+DeYWlZJoCdq8hs0vFvv6+fD/3lIkc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from bmoger-ubuntu.amd.com (165.204.78.1) by SN1PR12MB2479.namprd12.prod.outlook.com (2603:10b6:802:29::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Thu, 26 Apr 2018 16:27:01 +0000 From: Babu Moger To: mst@redhat.com, marcel@redhat.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, mtosatti@redhat.com Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, kash@tripleback.net, geoff@hostfission.com, babu.moger@amd.com Subject: [PATCH v7 3/9] i386: Initialize cache information for EPYC family processors Date: Thu, 26 Apr 2018 11:26:43 -0500 Message-Id: <1524760009-24710-4-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524760009-24710-1-git-send-email-babu.moger@amd.com> References: <1524760009-24710-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: CY4PR1801CA0020.namprd18.prod.outlook.com (2603:10b6:910:74::33) To SN1PR12MB2479.namprd12.prod.outlook.com (2603:10b6:802:29::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:SN1PR12MB2479; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2479; 3:56Uoofko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a9p01x5CIgPiXA6MaYYUb5qmKZUyGYJDC+YVwH5Qqpgo94ozengX11CG2RZEhogk2WL/hS3MtXs5fh7lPYvXkFeP1P3YK3WJrhYUpMgZwHnDAMh5I43eu+gJQZTDkX5P2TDq4gHDqjY06IOeSq3fJmErDu5nSdI9PLr+7sJcNXtNRVbUHXQtmpF8P1zFhj18MJTb5PskIALHd15rq9ImMdSuaCSnmpXEvdmjZbITsurauA6Nw61aO1BewFPfvm9e/bDr6alRmwv5m2lKbW1XLY8hpg2xK3qyRSGGUfsLWFenWK6610nqWixS7BmITkSplQFQmniJqc3KuGCIEa7bDG; 4:RpZZTg7CDTJmHE1V/uEuUd8Oa6pZaVAiu5lgAbSU8FkPF+sh2/qSWaUkheuGkvy5mtHcnuBdPLg5LHQ00BWgy4Pqfsy2rWGXF/ZieZ1WZzXP6jJZR5pMw71OJkFMcEmCDETkVk38Ft9wPnhaOyTpQCKCJ6Xa6DGI2ed0qnLEaBbcuA0elO4kvjnItaOSLVq/kssx38JCzqUiuG11UnST/eA5wxejo9eAVgBIw0cXiXSmi+aU6l9mYROJQof28rJ0nk4uyXsNPUPBnrIjHNDVhN/Lg1Z2m569gV13Hckekt60uY/ws3IFGPWK8gLBLkQ1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231232)(944501410)(52105095)(6055026)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:SN1PR12MB2479; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB2479; X-Forefront-PRVS: 0654257CF5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(366004)(376002)(396003)(39860400002)(346002)(189003)(199004)(68736007)(8676002)(2906002)(6116002)(76176011)(8936002)(5660300001)(316002)(3846002)(4326008)(81156014)(50226002)(81166006)(386003)(956004)(16526019)(7416002)(52116002)(476003)(97736004)(186003)(25786009)(86362001)(446003)(7696005)(11346002)(51416003)(26005)(48376002)(36756003)(16586007)(47776003)(53416004)(486006)(44832011)(106356001)(7736002)(575784001)(6666003)(72206003)(2616005)(6486002)(105586002)(66066001)(478600001)(305945005)(53936002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB2479; H:bmoger-ubuntu.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; SN1PR12MB2479; 23:c9xQJSrieu7xp6KU7UgdtiQ2U35pUqCJAIatF/quN?= =?us-ascii?Q?c3EfizEzdRo1/mawiWmhdpvXrOvLgUdctA0qhQz2l+Fi7ItsRNZ0BSTcufEG?= =?us-ascii?Q?QZEJ9of+UTQcvCEf8fZwZ5icQclZdt8rFy0z82QWuNjk4JPizvGNDRP1q+Q1?= =?us-ascii?Q?q29H6or1vAlqU1K3d96rbUYXPv6QYHCg8eoERrBRl5eb5MTZ+HBTBAHUSQvk?= =?us-ascii?Q?S/68GUwVARhSDp68ZXblsYPo4BN9GInuCMyPW15gg9DDR2vEn43I7NIMsft6?= =?us-ascii?Q?Nei+vmiurEn+pP6q5r4UwARbcYDkmmXkAbq6uUGyGC4YwsZIDiTTxGt0mTMw?= =?us-ascii?Q?P6Trxd34xvIrA0UHQ8/Ehgof9VLeKRC4rVKF4CHUceJM1887FICT6W06cJia?= =?us-ascii?Q?6WOF4i3aHbDy+owwKoxaRPyuwIrauTSzdK5DZqB57P3KhE9xs+pcCe/mdrxL?= =?us-ascii?Q?db15oCsmyrGBXAVvA95700pb307JOk3AZr1oNzQh9E9X1mwE9U/iq70gWI9R?= =?us-ascii?Q?V3+B+1lLBE03hNWkxSKdiW9AnnVx3kq+yX42AgtOnC58skDHBar5Kts52tiO?= =?us-ascii?Q?pmMIKrklcYhffY5+HtwtIZITR6eKxuVHTO+bnFRhD+QEelrAJrSOzJdDM452?= =?us-ascii?Q?ZNuw1zMOHnAyx88F9AHDrgXwxmoyXRBj5+OIg8GRLKDo2kHz+xfHzCKhfY8x?= =?us-ascii?Q?LJ8eWItL2SXddPWBKjheHsA4fgMS7vkB8dHZfX2RtC55fq2D1ox67F3xuAbb?= =?us-ascii?Q?R7KYRURpTDMplJqLQhuePipLZIdltRkK+ChfzqY38bwXiPb1IDWaFMrnT3ly?= =?us-ascii?Q?SXYhprMAbTL0vgOBebhjeHqebcz1vZrjCXL6UL5qBpCWblhyO5rUrWpr7z7l?= =?us-ascii?Q?5c2AF146CWB8xI3vV6GOuqyrRHhzbyQFDR9JC49nZTA7FTeSWSCyKE/fQnXe?= =?us-ascii?Q?Gh7UtqlKA8coNvnP/9M1D3a1stlee2e3lTy2z9Zim2ajR6fJilSiGnLp1hjF?= =?us-ascii?Q?kPpnfZOKrelmimkjipBhhB5vYESMUQFtwt6w6ABK5J+aEhwiC3PBWId2S47a?= =?us-ascii?Q?MADebR0WLOwBQCBQfWuuyAzKttGE57UYzDvM+ZSKGSQ2SYCsp9LKAsNgtKHJ?= =?us-ascii?Q?EWUu2LI9bBpNbu0hZHFG0f/nABG3d0qNqvDJFdPg7WZYY+sXULlGKoyleVO5?= =?us-ascii?Q?yTIIKePx564dElX1yhuqY7k0Kti3pRRO3MS7ntpR/HofPShxFV+yNU3JcifR?= =?us-ascii?Q?2OnP0YVUaTvtLC+rZQ=3D?= X-Microsoft-Antispam-Message-Info: gg7Ps74CUsn17rw/A7xKjbmzHdnUt46NXVa28ovQ76k9SUXvY68V+8fectpHv1MBeO79STk6ezWsi4VGgqKSWV+q9/3XkAICaEZ6G1Yk+QL0DJfWIrZkLdRXuul+k/bqYlPp4FAhuRNcxYXg9wcQ1cbskMdgSlL+nk1KbCPE2yJ2APcPOejIdGH63pQaaMiL X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2479; 6:C6aS1Z452+XIKzCbbgA5k5lfdweec/JaDoWRgnRRFvWFFI3UqteOw6G2SrrQV8Ygv3pd76cJuu5qNQ2MINiYrSWEvjbawCP1e9VnOBK32vOAakWSu4eAewxIla69IGo1pRjEZ3e8xcX7YzZIgnD/Lb08JcIld4ilILatVry3QBJ1L4GUH/3Esvw1zS44MGUQkI2OuKayMMUf8DglnCD0VUI/XNN96RTKdtFyXWO3khapKDmTJ+MM5NR4iqLh7HEBA2OAHtVFgBSzLAT7mXWhyY68YknvtsUJBC4sO0cXoTGLcMIvAbOPlnFzqCbVAemiZwi4MPvDA/T3AA7fLOe/N89ohNU0k2ExRStxdPp68fqmNM8VawYUBbDnRozQVdeH5ulz+8axsuEJUvmN5xz8GFi2qA0wMJPcREEojv+SXG7rEt8nbDP713Fm9/Ue/W1TjQ3wtgQoPU0je3VYcJmRGg==; 5:F3QZoDLAr1apDyblEki4Oaw+nYDdwFGNXc+VQN9pcNJ7cqD5CdLS4VT3JcXAEDeNC8dvFCZV2YCrYT6U5FbtmGdQ+T83NJVw0R1a730eyPMvb1UjWLB/whsxnU2pUrcW69o4FOGa+w/3BtK2HGV/HNRgweiMXz8aR/LBT/STo4c=; 24:YK5tVqwomntbX6bgFFLmIDintpu9sZEA7IvwmwnEQcP90WkM0JjnWJLj6dQApvAz5/S2RKBJV5uf4jxrU193MFhGrAsmacEIrO45LNadTtg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2479; 7:99kdkbrnw1X93/ji80au4m6cynws4ouZhGBGxah+of/lFNACaJ3V/pfbWhj9Ky2GLY8Wf1h3k4EobU+vcoOHY+5WVt5VitHeSPHzZVeOMzClU00/fYJhGmPTLoP9es6A9yuc5CIZhv/pTzBCguFLZMBIjAyJAlocyl2XyJKV/6CKwS6g62/HasErXzOOZOl6v60bhGAiVI9vNg2G8ZkgZu3B4+MzhwvzaPgvm7Vbsl4Yr+pKaxJejk3fM2gPFgT2; 20:LWX6iIcgEH1zadOl+teQRZKibZHumzUylM3MukNogXJEPFAo4CaqBIwxNz+9IbvMDTN3aWV1lAtpX8eFhm8NwIy6Uu/RQ873tX22bCc3DYBIO63b5+75vADPo4AGFz2M4s6HCRFLIaHIOLewBDnajUwmawrq6CjMVD1qUW9FbfgloivPAK9OO3rk1OrsSuVNc8/sgr+xPoDxn8tY2IZuUKrSRL4MkqnI5ojy6Ik+kmYI+Vrei1AKPkYvWYoTqV98 X-MS-Office365-Filtering-Correlation-Id: 11c509c5-eea1-4d78-7617-08d5ab928acc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 16:27:01.6273 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11c509c5-eea1-4d78-7617-08d5ab928acc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2479 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Initialize pre-determined cache information for EPYC processors. Signed-off-by: Babu Moger Tested-by: Geoffrey McRae --- target/i386/cpu.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a518a0f..5d88363 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2302,6 +2302,54 @@ static X86CPUDefinition builtin_x86_defs[] = { CPUID_6_EAX_ARAT, .xlevel = 0x8000000A, .model_id = "AMD EPYC Processor", + .cache_info.valid = 1, + .cache_info.l1d_cache = { + .type = DCACHE, + .level = 1, + .size = 32 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 64, + .lines_per_tag = 1, + .self_init = 1, + .no_invd_sharing = true, + }, + .cache_info.l1i_cache = { + .type = ICACHE, + .level = 1, + .size = 64 * KiB, + .line_size = 64, + .associativity = 4, + .partitions = 1, + .sets = 256, + .lines_per_tag = 1, + .self_init = 1, + .no_invd_sharing = true, + }, + .cache_info.l2_cache = { + .type = UNIFIED_CACHE, + .level = 2, + .size = 512 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 1024, + .lines_per_tag = 1, + }, + .cache_info.l3_cache = { + .type = UNIFIED_CACHE, + .level = 3, + .size = 8 * MiB, + .line_size = 64, + .associativity = 16, + .partitions = 1, + .sets = 8192, + .lines_per_tag = 1, + .self_init = true, + .inclusive = true, + .complex_indexing = true, + }, }, { .name = "EPYC-IBPB", @@ -2348,6 +2396,54 @@ static X86CPUDefinition builtin_x86_defs[] = { CPUID_6_EAX_ARAT, .xlevel = 0x8000000A, .model_id = "AMD EPYC Processor (with IBPB)", + .cache_info.valid = 1, + .cache_info.l1d_cache = { + .type = DCACHE, + .level = 1, + .size = 32 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 64, + .lines_per_tag = 1, + .self_init = 1, + .no_invd_sharing = true, + }, + .cache_info.l1i_cache = { + .type = ICACHE, + .level = 1, + .size = 64 * KiB, + .line_size = 64, + .associativity = 4, + .partitions = 1, + .sets = 256, + .lines_per_tag = 1, + .self_init = 1, + .no_invd_sharing = true, + }, + .cache_info.l2_cache = { + .type = UNIFIED_CACHE, + .level = 2, + .size = 512 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 1024, + .lines_per_tag = 1, + }, + .cache_info.l3_cache = { + .type = UNIFIED_CACHE, + .level = 3, + .size = 8 * MiB, + .line_size = 64, + .associativity = 16, + .partitions = 1, + .sets = 8192, + .lines_per_tag = 1, + .self_init = true, + .inclusive = true, + .complex_indexing = true, + }, }, };