From patchwork Tue Apr 10 23:16:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10334503 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 1943D601A0 for ; Tue, 10 Apr 2018 23:16:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13E0928565 for ; Tue, 10 Apr 2018 23:16:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0812728569; Tue, 10 Apr 2018 23:16:34 +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 E4B952856A for ; Tue, 10 Apr 2018 23:16:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755308AbeDJXQ3 (ORCPT ); Tue, 10 Apr 2018 19:16:29 -0400 Received: from mail-by2nam01on0081.outbound.protection.outlook.com ([104.47.34.81]:40576 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755278AbeDJXQ1 (ORCPT ); Tue, 10 Apr 2018 19:16:27 -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=LZF8twBL3ubwtlrZUCjG2R5r3cxjlRFxo7i17lCSGBc=; b=lgVYy1NOMpjQ8OQwS2T2Jws8oeshMhISyptZHrS7jaN+5LBT0xETNMrqq0WKhYTavgtkycRV8PF3RsEF8ognPBX1zYTdK9SasgJtbp7du6WUiDHGRbqYGwkkCEDwMAtnpIjQV4GJZeMSLOvUkjy/5TKo77Kq2isoLHEx/GDhW0k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from linux-pyp0.amd.com (165.204.77.1) by CY4PR12MB1767.namprd12.prod.outlook.com (2603:10b6:903:122::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Tue, 10 Apr 2018 23:16:22 +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 v6 3/9] i386: Initialize cache information for EPYC family processors Date: Tue, 10 Apr 2018 19:16:03 -0400 Message-Id: <1523402169-113351-4-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1523402169-113351-1-git-send-email-babu.moger@amd.com> References: <1523402169-113351-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR2201CA0048.namprd22.prod.outlook.com (2603:10b6:301:16::22) To CY4PR12MB1767.namprd12.prod.outlook.com (2603:10b6:903:122::9) 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:CY4PR12MB1767; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1767; 3:71/VSsq/x1KvfbfhX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mr1pqsdKOmpYv4e19wONtdDYkrxnjMAKR6C7Z3n59wOyVTYr8x47ya9RFhTCCGWSpyOLfD7/S7to3MeJaLHuuA34xsbjHVehhGBBGzVZCPQlVpOZ8NjjYzN/CiqZ99ooFudUnQ7l6cchkdNZ7XBO8eQEKJEWSQl0Mhvux0aGxFOWtKJNKAjh+NJlkHb0aElBim4m3O7mmXrIPQUN/G5GSodCANcPkFPd5o2mZ1w/n2Z8j6RHUipn4IvMIy6ByG6WtkjKjNACOFTu6T32D7l/Zjf/hnojIlMBKGjC/IpuFGNF9KLhkWPH5N6NGc4camu2uP51ZphsiCNmX; 4:LUX4W266EdfxV1cBg85Wti0DTN7e11Afmt+ytiaqGRNgkZvRTi77N0De2XZ4+b2QZeYiLUF7xJtT48636N7hF87tpTHqWmWdQphKgfUtnUXhJCbuX4+NIG6DE5+QeuAT3evM4cjOFhWGkM+Lk3z5YJLPthPRXHR5uoRkIQnf9+gohHxWUJHgpPRMOE1cGo/pVbIJR0gXaSqFb+YSi7aKQHcfJUBCvI2oextgK/o0UPNbB+7k8cbNKG1ecKVyvXMZQnW8oRtynx7YbjnV8Mt7HqgjoH+Wvb47bPKp11ePaZSYqn0N2r46QsEBagNvBrAv 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)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY4PR12MB1767; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1767; X-Forefront-PRVS: 0638FD5066 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(39860400002)(39380400002)(396003)(199004)(189003)(476003)(2906002)(52116002)(26005)(86362001)(50466002)(50226002)(305945005)(5660300001)(186003)(48376002)(7736002)(16526019)(6666003)(25786009)(6116002)(446003)(11346002)(105586002)(4720700003)(2616005)(6486002)(4326008)(956004)(3846002)(66066001)(53416004)(8936002)(386003)(72206003)(478600001)(316002)(16586007)(8676002)(81156014)(81166006)(97736004)(36756003)(47776003)(76176011)(106356001)(7416002)(7696005)(51416003)(68736007)(53936002)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1767; H:linux-pyp0.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1767; 23:9LZgwo5InpXXTNh2Zzfm3eu1NjtKo9L2suAjFgbSH?= =?us-ascii?Q?DKs7GBefDvCJuPzRQQSHI1ggypOqpr98atlCSbh10Ka9s8fLaoVLIhcb3rOU?= =?us-ascii?Q?dB3o3A8RC2xYOnOaaCOAUCRMTEJekgChHnLxtgWa8mh2EeZXLgw2ymmiaa6R?= =?us-ascii?Q?ZXshymVrjfx/cXJbANnwWxChARTbIa3lHGUrREgZ6JsZ1YXnpifOtno1uiAd?= =?us-ascii?Q?zhueP8dlCIdlbtcB3QftNmIvjdG/qTuyu9/K6PeoUA1dXW/8eL6cy+A8kvb7?= =?us-ascii?Q?tHXQFUyUKVPUY7/JjBtJCU/dE/4aShLbFwMniuO62jzhs6uH4LBHy8NY0OLH?= =?us-ascii?Q?/Fy9FGGD9ElM56yTgwsjbAFinbjPD3WiKyUhS3tja8Up8ZNYAwVfee8To+71?= =?us-ascii?Q?xq4HCoUM4e4jODDIGxkYpUEhZYAkTVNa6cyowmUCmAhNTjb4H8dlhyH72W4H?= =?us-ascii?Q?V3zDbuhYWthxV1hsUoDpKPYhoWsM+jnQTefvgP1j8e7CZnRmVPwbr33QUbPJ?= =?us-ascii?Q?oABaH8ycMn7pZSTR/FDZ5nOK/L+efr5HrpU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X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1767; 6:pLtFBFDeCzDrHxsGaI1YZfVYiEt0JLbmnXgz13f+ounSUgiRGQE6yg520SijJav6pBddNQeNSefkWQTMHvvTMv2lzDtNmR13pJxt0INbrLogDCs+aRvqedkgIA4PlmMWq1wLIZAKupDwjVZGJFasqTRwvq8NS48hspHAp/GZfeH8XFIZxMeXDJpTi+lQLETW8z0ft6t72y6S2zzzCVSCvvG1XN8YXU5G+dK2/WjXVv3OptohDZWkUKzbN1pbxo4nFZOpNVhZd9EpkxHTtAz7Vmmi6BZhMxgVlUhAqzqLxLmb5FIlDopkaG3HK4YzIL4qdipy/IFZPdAbEHopEQd2tEnnBtm75/tz/EAzV5t0f/YVk4FN2x6giamheHOK80/fIWMRji4q0d2cGkzIe5SJO3YdqPpAkzZoDkG/4YWAMRwkL2XaYFnJjpwQKMJQm0ji/y1mqfxACQiEfuN9E97WQw==; 5:l1x+zcTHWb3SQ8xAP3PBaO1Nky3V6r0QLiCtAM7Ff0CzM7iUr3tx0pTug0NGnGzDInNcCH1+8YvDZbDpEPw9QCsyQoV9MhBU786op0RMWTGvjPW9eeFEpaS6un1F/ITB9PrWmQn6qe80lCbRInnPJ5MPnQoQlRryDwYV6cKfLr0=; 24:N+1scDA1OJQmelvG2ChZpB0oN1eLGZqnZVWZqBW6iwX9lMSiTBR+smG5QN3/VKEH5lHboqkCHExrqXYVClCZoqloBKITL5G8xbXbPVJakZ8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1767; 7:5q7j43df5Uy++wMXtezIq7QTcltW1u5fbj4IxEoisdfzS0mPjBhOUC1aYW4qfaVujXbTuOWuUt5Fw579u5V6FMFJhIzXCLc3vO/Jjkys1eXEsjkeGzjxCmDLxlD7BjNHhKCwHjqXYvM9TsByigB+C1wBzrjdYxkFfM5RA55LG4cpJBgc8K9nEDahPHvSv4nAN2ix4OadNNTSkKDkgIwY3PIrkhww1e05g7h5Y7s3jq5YDMnKGuBpciOFZWylZ9Fj; 20:1beFRmpQcvArS6tTjep9K4ZRrIxH93SfcWZM5Mkrj2osOeGbJOCckgo4a52zPPU6CDI/G4rR8gi5lNwUleyDI5K868urxJw3YlnoxKsM2SGz32o4Upu/nk34GYhUEJJwHKt1fF5pWSuUc2E0Z1hL6VJxEjPbJNFcEKwo0vFfgf3SOeqxPzu+8gXOrgeJJST2brPWgh7FNPeJHAv47WgnaIq+FN7uymV//lDZ8BoSOQrKjM3/GZeMWHMHYEq3+tO+ X-MS-Office365-Filtering-Correlation-Id: f0297390-4c62-442a-e224-08d59f391388 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2018 23:16:22.2170 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f0297390-4c62-442a-e224-08d59f391388 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1767 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 8c84fa2..3b2a19a 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2295,6 +2295,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", @@ -2341,6 +2389,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, + }, }, };