From patchwork Thu Apr 26 16:26:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10366327 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 7FA87601D3 for ; Thu, 26 Apr 2018 16:27:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FBA71FF29 for ; Thu, 26 Apr 2018 16:27:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63CC528A14; Thu, 26 Apr 2018 16:27:37 +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 826511FF29 for ; Thu, 26 Apr 2018 16:27:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932210AbeDZQ1e (ORCPT ); Thu, 26 Apr 2018 12:27:34 -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 S932213AbeDZQ1N (ORCPT ); Thu, 26 Apr 2018 12:27:13 -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=lrZhv8JoRCy/liBRMH0AgztluC8X/yg5moDGX9cicG8=; b=LwoSzc40BiehxlhlNiNb3+BAAnI5DReui5HPmu9qzFT5ATxjjwt11K7qKfwpMgBQkFRLG1MbANEibJxJD64p9bSfXbkEFZ00erYlFymdFo76zJhtzcspVMJLsiUIRltRdyheEshqqqxB5IWNVCZJSGm1la6gUgMdCzeF/Hvn19Y= 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:05 +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 6/9] i386: Populate AMD Processor Cache Information for cpuid 0x8000001D Date: Thu, 26 Apr 2018 11:26:46 -0500 Message-Id: <1524760009-24710-7-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:JhWtjTm2v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fg76Id+Cglh5edd08ZeYviZ4XTDJmLmYjjP//ATbmsZNnAHB29E7aE0Amd0to1ZbVIaK5t6cYb9VT025tks+LQqbA6yFwNvd8NAUTJ8zYpfq/jACrWRHbO/8LYaDs+c9tUmVjHpDQ2n0vqUoqib5opcj6ILeMxV0xi8Ef7GnuAz1TGvdZZhlDIp7cw67Cn/9aR0OuuJlfaizawCgIbV5PmmYCrm6h/TdNutGXQNWK+nUD6mUlQaaJimu698Tv6dwtVC+VvVovBn9qAjtLpTX3AsbiN5/RwAkNPiRlEMR+Hiqn1yFAojacyOKlk27CU5W8GM1P0iTK3u1RTJ; 4:oXJG47Dcv7v5Fw5lMPM7B2vi40AC/ZSSKpJaZzeIlDu6Y8rkF25NJt6SBvWKTRHd32y8MKyJnmpEavTCs+VddpRaihie/2ZTtyz7OuLaVBfkYzEwYytd3OCj1IE/Ec3JAk6w13Hq2e2KRPHgNN4uUAaKi/3Fnpmh7Y4RwkLg/5Rk464yAVRAzGg8rwcaiHW2vh7ZJhny2I1NBrr1rCkEU3c4y0e1Hgrr4Lawize/KJPcxLet6QrAGS+boCv4X/VGRZCCCxTXsf93H18G+tPFWDL1mXz+4CvMRqXB5goC2H+4lJCwxwfFUN3+un78yeWF 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:0Oz/SN5SjzVXrvgaEuVrmO5zJjo/L6UeYMZRc95fd?= =?us-ascii?Q?6+cPmyP+Lxxpr97RZ9NTUCzD0Iq8Oi0lpUHGTejGI+N12u19mOueQhv1rd1g?= =?us-ascii?Q?lrRCUtZauepvH3RHHYIVApGzV86THE7FE+K465YYpmp77RVt+z9GBnLwHTs1?= =?us-ascii?Q?DeW+gOpxLDSKLGrdhXlMhKFzKqSykC++mgsw48B4EvDGhsIitcy+5ZmOmqrZ?= =?us-ascii?Q?xvgdgvhnKR0jv4qhXNfvY0oxZII/HYlcjyDNw99P6k3xq5ZUpgcxbL2tSr+s?= =?us-ascii?Q?VFQW775Rbh+RGFlo7SGnFPEnWh25CiVPzkLZdGwPw7tqwBwTjBX24VaM6X5o?= =?us-ascii?Q?hpHxZv6BGKArHTJ0iub/erfkCGHmGsR8G33CIviD+6VHPWXAVGVZPjkaPbj5?= =?us-ascii?Q?KWTYQscETgB7zUyUxkuCJ+fGiPqjhPFKtQFxGAzUuDH1rG3Lu9inrvOtuVeE?= =?us-ascii?Q?8Wbcfx2jCW9YcW4AIFe0H41+Tl5WVX20hJZ3cxOfXWO2voP/l2edAoJuO1Y1?= =?us-ascii?Q?d3zGoodc697GsGIB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5OguoPgpOqnEisF9CnGbiHPuo2AW X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2479; 6:ivrrZJ0AXIhaYBRMe0+rA4j9HVvIpbrgei+jOwtY86P7L6vLPCWcSFFbA/jMVtu5APpcnniHeYF+HPAqMXocnkB/ZurhM3b6IZU3tMUpiU37ibdsLDWswSLroFkh3HjIlg2MdX9L2yWQrLEPLKJjDOOgT53Adgl0mYSbtDtJemP+745goUrZULryEocJ+I0dArEUZJZk6h0ubOgPQOvf6vA9eD3+tSebQmqoyFW8KoL2T5ERXTLWZ16mdNJuwiyDwb+h8m5GD/rpLk1AHrsyuTl7du0xYmwIF5h1kGotGW4FGmM8mSkX1hZ17VaQ5xoI5Fx9FKj3y+X6VLAqPOeQfjs3FIBvJaGcf3lVzK1zOV1cE1AP2uc6V/JtKUVPbG/3PCwVAP1F4wZjT1Oj9n/3DO4NlpZcDSqa4CmpY1DwnEELRB4Iu0CRXMPafYysoOO9S5BBSFPzA2qmil9IPkO90A==; 5:w19bH/wWKsTHKUCzrrd5+5mD3R/xMg6tdA43zQnhEbns5FVOixLOz2Kpgs+OkDi0Va4JSBc8q5Bw/EqTjf7x2B+NARSIcB5CeBHKYElfU7d/+ONWLQ33BTpblxaLZZw02DKTfQLoUbuw8CU5VIhfU1vOtn35NmbRz0xr2lRZsjY=; 24:VIJCNIxeGPwaTLZCgWxi00ObNcJUcArbnVzMQv5eQkJ+grpPM6iUo+UHpR14njxXzURQnUiq95JjRu6YR0Xcy+6me2UkFPAWapWwLAcUYX8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2479; 7:wT53hLfvl0tv/9liK25rGNkSmD/Wl6zifC+ViAH08yStuXbMFGkt9g+mnRBPFE+mWNRc1xiey6RoGskwS6L32+pAg2ZUeyQWsjcysUSGSqJpAPi3BqFbrh7d/1UX0qsvMJRTjtyWQTelO1OVNvJ42SQBga0Hz/RZZva0fHI5wC0wSI/VtO/FT32nCqkOA2qDdRY7MYGlledzd1GDAlUYwWn6aROZ8cFHwBGsu82UkKrILMdCdk6AfJHeKeEv4WxF; 20:Z4gYZIvk/SZnZSA79NxpBYdMvmkNT+lOWoav4sLwPo+NoUGOzDZRetcz2qMa8oLpvbsutNMb0OMMRVGWC9k+9yuleAT8b9bAYjRsVNOt2+tDaP+zRE3oSbLfeb7P29ouOOIlXLX5I260unfTYe6HvltJHZ+8BtnIpuVqXd/kan+/r3Q9PWUhu5dye3Igzj5T+6CnUSN7klrpeEmCccltp5lFGoZ5xSY1N/tydcOyaNVUPLgvuCq8394b6ruKqN2e X-MS-Office365-Filtering-Correlation-Id: dc2db44b-40fa-4bdb-2459-08d5ab928ce0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 16:27:05.1117 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc2db44b-40fa-4bdb-2459-08d5ab928ce0 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 Add information for cpuid 0x8000001D leaf. Populate cache topology information for different cache types(Data Cache, Instruction Cache, L2 and L3) supported by 0x8000001D leaf. Please refer Processor Programming Reference (PPR) for AMD Family 17h Model for more details. Signed-off-by: Babu Moger Tested-by: Geoffrey McRae --- target/i386/cpu.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ target/i386/kvm.c | 29 ++++++++++++++++-- 2 files changed, 118 insertions(+), 3 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 56d2f0b..1024b09 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -307,6 +307,14 @@ static uint32_t encode_cache_cpuid80000005(CPUCacheInfo *cache) a == ASSOC_FULL ? 0xF : \ 0 /* invalid value */) +/* Definitions used on CPUID Leaf 0x8000001D */ +/* Number of logical cores in a complex */ +#define CORES_IN_CMPLX 4 +/* Number of logical processors sharing cache */ +#define NUM_SHARING_CACHE(threads) (threads ? \ + (((CORES_IN_CMPLX - 1) * 2) + 1) : \ + (CORES_IN_CMPLX - 1)) + /* * Encode cache info for CPUID[0x80000006].ECX and CPUID[0x80000006].EDX * @l3 can be NULL. @@ -336,6 +344,41 @@ static void encode_cache_cpuid80000006(CPUCacheInfo *l2, } } +/* Encode cache info for CPUID[8000001D] */ +static void encode_cache_cpuid8000001d(CPUCacheInfo *cache, int nr_threads, + uint32_t *eax, uint32_t *ebx, + uint32_t *ecx, uint32_t *edx) +{ + assert(cache->size == cache->line_size * cache->associativity * + cache->partitions * cache->sets); + + *eax = CACHE_TYPE(cache->type) | CACHE_LEVEL(cache->level) | + (cache->self_init ? CACHE_SELF_INIT_LEVEL : 0); + + /* L3 is shared among multiple cores */ + if (cache->level == 3) { + *eax |= (NUM_SHARING_CACHE(nr_threads - 1) << 14); + } else { + *eax |= ((nr_threads - 1) << 14); + } + + assert(cache->line_size > 0); + assert(cache->partitions > 0); + assert(cache->associativity > 0); + /* We don't implement fully-associative caches */ + assert(cache->associativity < cache->sets); + *ebx = (cache->line_size - 1) | + ((cache->partitions - 1) << 12) | + ((cache->associativity - 1) << 22); + + assert(cache->sets > 0); + *ecx = cache->sets - 1; + + *edx = (cache->no_invd_sharing ? CACHE_NO_INVD_SHARING : 0) | + (cache->inclusive ? CACHE_INCLUSIVE : 0) | + (cache->complex_indexing ? CACHE_COMPLEX_IDX : 0); +} + /* Definitions of the hardcoded cache entries we expose: */ /* L1 data cache: */ @@ -4013,6 +4056,55 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, *edx = 0; } break; + case 0x8000001D: + *eax = 0; + switch (count) { + case 0: /* L1 dcache info */ + if (env->cache_info.valid && !cpu->legacy_cache) { + encode_cache_cpuid8000001d(&env->cache_info.l1d_cache, + cs->nr_threads, + eax, ebx, ecx, edx); + } else { + encode_cache_cpuid8000001d(&l1d_cache_amd, cs->nr_threads, + eax, ebx, ecx, edx); + } + break; + case 1: /* L1 icache info */ + if (env->cache_info.valid && !cpu->legacy_cache) { + encode_cache_cpuid8000001d(&env->cache_info.l1i_cache, + cs->nr_threads, + eax, ebx, ecx, edx); + } else { + encode_cache_cpuid8000001d(&l1i_cache_amd, + cs->nr_threads, + eax, ebx, ecx, edx); + } + break; + case 2: /* L2 cache info */ + if (env->cache_info.valid && !cpu->legacy_cache) { + encode_cache_cpuid8000001d(&env->cache_info.l2_cache, + cs->nr_threads, + eax, ebx, ecx, edx); + } else { + encode_cache_cpuid8000001d(&l2_cache_amd, cs->nr_threads, + eax, ebx, ecx, edx); + } + break; + case 3: /* L3 cache info */ + if (env->cache_info.valid && !cpu->legacy_cache) { + encode_cache_cpuid8000001d(&env->cache_info.l3_cache, + cs->nr_threads, + eax, ebx, ecx, edx); + } else { + encode_cache_cpuid8000001d(&l3_cache, cs->nr_threads, + eax, ebx, ecx, edx); + } + break; + default: /* end of info */ + *eax = *ebx = *ecx = *edx = 0; + break; + } + break; case 0xC0000000: *eax = env->cpuid_xlevel2; *ebx = 0; diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 6c49954..6e66f9c 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -967,9 +967,32 @@ int kvm_arch_init_vcpu(CPUState *cs) } c = &cpuid_data.entries[cpuid_i++]; - c->function = i; - c->flags = 0; - cpu_x86_cpuid(env, i, 0, &c->eax, &c->ebx, &c->ecx, &c->edx); + switch (i) { + case 0x8000001d: + /* Query for all AMD cache information leaves */ + for (j = 0; ; j++) { + c->function = i; + c->flags = KVM_CPUID_FLAG_SIGNIFCANT_INDEX; + c->index = j; + cpu_x86_cpuid(env, i, j, &c->eax, &c->ebx, &c->ecx, &c->edx); + + if (c->eax == 0) { + break; + } + if (cpuid_i == KVM_MAX_CPUID_ENTRIES) { + fprintf(stderr, "cpuid_data is full, no space for " + "cpuid(eax:0x%x,ecx:0x%x)\n", i, j); + abort(); + } + c = &cpuid_data.entries[cpuid_i++]; + } + break; + default: + c->function = i; + c->flags = 0; + cpu_x86_cpuid(env, i, 0, &c->eax, &c->ebx, &c->ecx, &c->edx); + break; + } } /* Call Centaur's CPUID instructions they are supported. */