From patchwork Thu Nov 14 20:36:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 13875596 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12FBED6A22E for ; Thu, 14 Nov 2024 20:37:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBgaM-0007SB-KR; Thu, 14 Nov 2024 15:37:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBgaL-0007RR-9l for qemu-devel@nongnu.org; Thu, 14 Nov 2024 15:37:01 -0500 Received: from mail-dm3nam02on20614.outbound.protection.outlook.com ([2a01:111:f403:2405::614] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBgaJ-0001Xs-9z for qemu-devel@nongnu.org; Thu, 14 Nov 2024 15:37:01 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bxNHDkeJEXKzPqZvrHRZ8WX+zZnxlLrWRpLNX9mCJcKhZZK5FAKEo0B+FQrgcUoJee9/+32JleLbY96spNKh3QE3CJDi/Y91a4qgjbD5Cdv5v6JM7P6ugj/FoELf4o3umM8prqAs0ZJ3NFFC81ANPmsS53QAPTK/5/+yF81nCT9DESrjk/s/db0hjetXqRdS2nve7Wm859W4YOJCcwOYtFv9ZVBQS27wr8E7DmylcgkJpfRb3S5jHTWE7WtvmEWjSm1RQu/RWMeiKSvBrvx0LdMo6zDxhOvR5wfaeyn/fA5rJ4LUr5HXacyn/eqCU3UDy9TPShPrAFk76N5QjBt2sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=m+X/vBEGWBm37xJRg8XgisVKKEk1HfiD7C/rN/hd+0w=; b=sQxnfD/aMGKso1oOlVd5fRDkbyIENv5muvWArg5FC5QwP1PPJG0njIoHyX3OkOHqTZ2LTvI7E9Y2t7GchfmShIcz4o8GmosM6Jq1U0B8mY6Qk6rhfEuZHS5HBA+a9L02UargorN/5AC8LHCIVawY+LAl7wGmGH7ijJxlA/WNkYP8KgTtki+ZMSTnzMCz6HFnRHX0EkvqflRCLnZzPWk97rJVKG+vQ2rbgYu/nMXsmKi9yWTCcbVZ4dQ4GOHRkByH3apF7dFsfkA7r9Csv1WqA2WEcWK0BZyBcWxqToAELrhaMTbs+7R5FYqRUzPU/YLMAB8x1sEa3DlppCMQvoTqlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m+X/vBEGWBm37xJRg8XgisVKKEk1HfiD7C/rN/hd+0w=; b=va15nKHMguFSXz8ytLFMNhNRJhnfhqffCWqXD7w90gTou00tPaGOuycb2VDnYUAqNK37HRyuf59VG69UvMlbZuOnHK1fVe8ZSBlWhfI/NLCor36+/USq/hI5V0r4TT3RBU5osIiXO2NLwPOA15oomKlrqz0agRlmO/tjrMTdzpI= Received: from MN0P221CA0002.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:52a::26) by SA0PR12MB4397.namprd12.prod.outlook.com (2603:10b6:806:93::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17; Thu, 14 Nov 2024 20:36:45 +0000 Received: from BN2PEPF000055E0.namprd21.prod.outlook.com (2603:10b6:208:52a:cafe::8a) by MN0P221CA0002.outlook.office365.com (2603:10b6:208:52a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17 via Frontend Transport; Thu, 14 Nov 2024 20:36:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN2PEPF000055E0.mail.protection.outlook.com (10.167.245.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8182.1 via Frontend Transport; Thu, 14 Nov 2024 20:36:45 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 14 Nov 2024 14:36:44 -0600 From: Babu Moger To: CC: , , Subject: [PATCH v4 1/5] target/i386: Update EPYC CPU model for Cache property, RAS, SVM feature bits Date: Thu, 14 Nov 2024 14:36:28 -0600 Message-ID: <6528e2424b99948b165c2938b5ade9f32e1f0aa8.1731616198.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000055E0:EE_|SA0PR12MB4397:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c2a3dcc-3820-4040-cb89-08dd04ec0e1a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: 8GuHGqh+TqH4Ao8Y9ZRjuIpNMWxfO3PGmcVKxhfiw7lBkEV611Xqp02vhIHc8zIgNVS9resx0518ylhEYL7w11DADyYV2G2aOOrFij9rcZbX/MxCjsAciaytubmq+zPLFA0YllywD7uEhh3UsyOSEIQ9kox/GGPMqwSM7Ag9X9B/PPolJ3Rt2FAfYl9xDWxh5sS3bw3AnTUs942JYA50VULOT78cVTE9BVSHM9AP2xyeZ1eOfz6+2wiZhIVZ8ey2rkyzuHdv+j+TP/nNpdwFpLBH1dW9uM4o4YgtRJM0VWCLun5M8yq4kpuAd/M4Ba37dNRIEv0a5KhYMnm0akMP4kq8eMWwdt0VD6FSg+6FNCqWwgpOT3WZDwOI7ygN+TDrFpeHqjJEtjZ4rUKp0FqrtAj0obsvWKsxpRDxaHBJ3t7whahKvLah8cvV/ZAYYuBkk8LB/Usv6ETT5TByHPyKCmmh4TsCMJ/WCXX7lZwYaI52oKsvQynWUJh9v7J+GdVT+vuUVtWYMwIkvTmlNKf0+vLOeNHtNFgqgTsJOIm5d9IPhUxIyCZDOboRGCYm5zUJO/zBDqXI5mZlSxPLI29RKxgGPodI1HZCuBpohFHzY+3ymeuVrk3HsBnmoZgN1cIladrVOP6MSHsM/FX8Q/mVk8woK0BGbcoKI7nLjb0Uzc1j89IPsHnsTTPVonBxS62+VVIEscHXyxwKSrdtWEuLOfrJ2xvObidcItSz/OcKxupSOAE/N+azMkr7RFbRs08ZwG+K5v5L7OPk/9EIpKazB2LeF526CaRbMxMSwQW8eES5jhVV1hjZX7E5p/XJZPRG7hBTdEekd4aJvfWL/nYHPO1Jq5K5vEkF2FAeOncsoF74jxI0X6X32vWaogvRDgjW8FtlMtsPCtkFd1eRE0t1/vqwJZMb20JHhI5WMbU0t8lMLheQCudPrSUXvcTXqh7VnnG27ZXq2kq/IQtnsD1kIkhbiw01AUCfRcz5xEs9s9LwDVWDqmgb4VtihalPzAbHb9U3mgH+U+a/17ZdwDrFuXtzbx3cNBCkWdGq805ELdlR3vvb2oCUfkwybb1/AhRebB6mGyWd7VRrMCg3JtvfHIablYhyimzr1BWvKRk1hmPppDR6K+RBs5MWf7TmXpAT4QyTAByYxt/btTJCXBBvwjbOrCbwgaXApX38AW0LTj9EONxbZMCAwG4eEbwL1LTuNSnSXp4V8LUgEh9KAI+iXdz1PmxLPd1V+36PBVKfWI4m3oVyMj1CsYK74rtTVy8jV3tVVwGO9j6xAPOK5ewMPiiy2+O84d9WZ8c3RvFP0PUKbtbr9BuiXVJ1JLXO5kAtWSUa62fd3qp7eDP/+k5O8MJaIvf++q0xMGHD1df44oM4jX4Vm+4lsvNpO2q4smI4HYk5MVJQ7QzsFUdu1U5TOA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 20:36:45.1251 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c2a3dcc-3820-4040-cb89-08dd04ec0e1a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055E0.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4397 Received-SPF: permerror client-ip=2a01:111:f403:2405::614; envelope-from=Babu.Moger@amd.com; helo=NAM02-DM3-obe.outbound.protection.outlook.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Found that some of the cache properties are not set correctly for EPYC models. l1d_cache.no_invd_sharing should not be true. l1i_cache.no_invd_sharing should not be true. L2.self_init should be true. L2.inclusive should be true. L3.inclusive should not be true. L3.no_invd_sharing should be true. Fix the cache properties. Also add the missing RAS and SVM features bits on AMD EPYC CPU models. The SVM feature bits are used in nested guests. succor : Software uncorrectable error containment and recovery capability. overflow-recov : MCA overflow recovery support. lbrv : LBR virtualization tsc-scale : MSR based TSC rate control vmcb-clean : VMCB clean bits flushbyasid : Flush by ASID pause-filter : Pause intercept filter pfthreshold : PAUSE filter threshold v-vmsave-vmload : Virtualized VMLOAD and VMSAVE vgif : Virtualized GIF Signed-off-by: Babu Moger --- target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 58c96eafea..a632c8030c 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2181,6 +2181,60 @@ static CPUCaches epyc_v4_cache_info = { }, }; +static CPUCaches epyc_v5_cache_info = { + .l1d_cache = &(CPUCacheInfo) { + .type = DATA_CACHE, + .level = 1, + .size = 32 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 64, + .lines_per_tag = 1, + .self_init = 1, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l1i_cache = &(CPUCacheInfo) { + .type = INSTRUCTION_CACHE, + .level = 1, + .size = 64 * KiB, + .line_size = 64, + .associativity = 4, + .partitions = 1, + .sets = 256, + .lines_per_tag = 1, + .self_init = 1, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l2_cache = &(CPUCacheInfo) { + .type = UNIFIED_CACHE, + .level = 2, + .size = 512 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 1024, + .lines_per_tag = 1, + .self_init = true, + .inclusive = true, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l3_cache = &(CPUCacheInfo) { + .type = UNIFIED_CACHE, + .level = 3, + .size = 8 * MiB, + .line_size = 64, + .associativity = 16, + .partitions = 1, + .sets = 8192, + .lines_per_tag = 1, + .self_init = true, + .no_invd_sharing = true, + .complex_indexing = false, + .share_level = CPU_TOPOLOGY_LEVEL_DIE, + }, +}; + static const CPUCaches epyc_rome_cache_info = { .l1d_cache = &(CPUCacheInfo) { .type = DATA_CACHE, @@ -5053,6 +5107,25 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, .cache_info = &epyc_v4_cache_info }, + { + .version = 5, + .props = (PropValue[]) { + { "overflow-recov", "on" }, + { "succor", "on" }, + { "lbrv", "on" }, + { "tsc-scale", "on" }, + { "vmcb-clean", "on" }, + { "flushbyasid", "on" }, + { "pause-filter", "on" }, + { "pfthreshold", "on" }, + { "v-vmsave-vmload", "on" }, + { "vgif", "on" }, + { "model-id", + "AMD EPYC-v5 Processor" }, + { /* end of list */ } + }, + .cache_info = &epyc_v5_cache_info + }, { /* end of list */ } } }, From patchwork Thu Nov 14 20:36:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 13875595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75A22D6A22D for ; Thu, 14 Nov 2024 20:37:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBgaP-0007Tc-NN; Thu, 14 Nov 2024 15:37:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBgaL-0007RT-FW for qemu-devel@nongnu.org; Thu, 14 Nov 2024 15:37:01 -0500 Received: from mail-dm6nam04on20615.outbound.protection.outlook.com ([2a01:111:f403:2409::615] helo=NAM04-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBgaJ-0001Z9-Ek for qemu-devel@nongnu.org; Thu, 14 Nov 2024 15:37:01 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bgnmpJmGKheasmfu+ibQBMx16kUEUsfZlouvkmWNF+W8SdfWsrq/wzRdIKkJIB9h3MAdB7frmZwJWbTJkFOxcIBMPmBf01ZGzLLAT11xyN13LYR/mstn0omqKTO1XOZp+TumPJxCs1WeXUU3k3OftrT2bYYFNuX5gxLSgq3FkgoGfgOxNXU0bLki6Lmg15zb2DjXWKAy+vndve9KriC59YrY911OCBNBuIWLuAiR8gXyyrGBD+1CC/HM4kKjWuvGnd3qK0Rbit+9bIpobXMe5Ohzn+6zXNXUFPRSbLiwv+jNmr34bHh6Gn3Kj0CRGdb75njfSsb95jV7qUyDy9N59Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=f1qCFo5HHGmXv0An1bPJ0Zv90ocVHv2NL/5ezb5QsDs=; b=QNtYCtHENQD/3Jx1+2T6a2ZBFgOxJwzRId4eRIpn8VVVdqqQY0xrd3+hBiiqDnnf42CeOWAA3kZ/Sjao7WiO8Pm3GxJjbl9T03RPAX0ArOOkfR3htgM5/fDGa6VB3xfUfa3SHmJ4PsuDObxqtUVSpuqlrx1mb5uj1tplHfcad3Lo7baq2Es7hdyGvOmclo9qQLDMrwrQOD96wITX4hpyIfyzJYEJyhw1ceZnwa8pXIavn536TyMWsevMUzpHNp0iMRv62f1PUMMjD0qpGLq6p9YkAjJA/TD9QMzziYvai4hCb9t5vERvE4JM2r5FY457720vHFQRbPNQ5BnxhQ1JGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f1qCFo5HHGmXv0An1bPJ0Zv90ocVHv2NL/5ezb5QsDs=; b=AaHz6oBGt4LTE0muJXrImcm9NNebU4l7xnMe7+0GFWH41SSSqWrLPzTylcGkE+gPtHM6mq3aFFRX+sttWYacQ1bWiA/urk7AbUXB9hJYQ4FvQof/KU9E7xHVzmvGsWIJeitqq+tj7cJmEw6BHiT/Jfwm7D0LZzW8VsFE0ySrmHw= Received: from BN1PR10CA0006.namprd10.prod.outlook.com (2603:10b6:408:e0::11) by IA0PR12MB7555.namprd12.prod.outlook.com (2603:10b6:208:43d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.18; Thu, 14 Nov 2024 20:36:52 +0000 Received: from BN2PEPF000055E1.namprd21.prod.outlook.com (2603:10b6:408:e0:cafe::f6) by BN1PR10CA0006.outlook.office365.com (2603:10b6:408:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17 via Frontend Transport; Thu, 14 Nov 2024 20:36:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN2PEPF000055E1.mail.protection.outlook.com (10.167.245.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8182.1 via Frontend Transport; Thu, 14 Nov 2024 20:36:52 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 14 Nov 2024 14:36:51 -0600 From: Babu Moger To: CC: , , Subject: [PATCH v4 2/5] target/i386: Update EPYC-Rome CPU model for Cache property, RAS, SVM feature bits Date: Thu, 14 Nov 2024 14:36:29 -0600 Message-ID: <3ef7eb6664c816cbdfcaf561da567e7d0f43e5d0.1731616198.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000055E1:EE_|IA0PR12MB7555:EE_ X-MS-Office365-Filtering-Correlation-Id: f0e905a6-231f-4c65-ba2a-08dd04ec1236 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: 4CFqdI57kH2b+zUbicCfcfBvkn+6lHwtY83w5STO/mon/cxuMdqynctTjTvzdwlIu7ysF2RuH4GFvJnGcZkcMJL+tLFTjQF0pGe00yhEkE9U8njvf5ow6pYk7/TvRzebLgow8sf50r1KYfhtQZo49XfgInPSntT+PdOU3VO8YGLwKKYTU/meAxvl6TUHJJr0mRyr3UQ2oSDrxRTR/CoDyQpMOQPbcB/tO2qHPyGGwi1FdqF35s1e07I4HJYuQkYCHcbL7nPH/K/rpT5gwVAMQDF9D02j0y83ZL1cNgrINMMrsyXP9JbE0d/TIcVkzfvV0mbtMjC/otCEmgtU9lEPihhdnTJqV2EjggJVK8m3eogJjRNHmYjjCB6MxADN8lcJmkLh5eFfEG9GG60r8GK6kJahQSMB6rkcILaF76rvnz9CDlF4pdIQ/cktFNePcDoJ3OU7VsFkk7ebqiM26y9m8tLZvyUYigXU7yiacuoNyxuHGMkw/ckMkXQ63UpI6w5kinz5fYGO2cGCmzN7WQax0irKri0FZTIMDn6AEY6jTvfE6gr0mGn2A8lEdRZ2XEzwJDKdlHkW46ZqdCB1dCzSEy0/njGol+U6Lbt8vrpUXxhUVS6VEgwnwm593jBehcBxK0nUWnkvnY5h1Ff6mQO68Ifmj6FiYn7sj2jQpYq7iyRqabJ1UW+XqQ7OIH+ZT4oIrcurM90wf1TU1sRsOiV2RULSfs5tRqLJJTt0pUJVKIQRZrqDl0Mykb6yfBDhUYemgKMQvm4khiqgtlFkADOw3jwhs0A1dKA6kWXmY0/CBXhGGgGirnt8R8mvgEiU/zXoeEFykk7N9JCTRapSTRDi62BNQCUkNBSSrgfIIGFfQ14UsjEmqU3c7Qj1g/Koazg9Xfs91QzD0tVjfPfnEFAdqFkko9rNV0eyf3WH00PCxUpl/guSCb+spmHFw9QabW46HRC0tGstPOZXCfCZWoWarWydPvdRwZzwFLOglpKaaD5f47JHAsnfMBimpJpmSLNhDbSNqsoiU+/dzxxJnLA5BA8c7tJVN7sm6RzT/SIBV+tjFu7ihyZCXxZPTe41unfszvynXp0QtckRmXii/MvwavbJ0GZhGFGqUGLgm08ej2eJ52bGXYVcu+WglNpCYR+MdtSj8mw9f1Y0HieTaq+KqJrnSL2uxDbU2CxUmNKFqEs8BZZKiMNigKVGq53Mich3CVmKxhpIKU5eNTsiWjKBt+zWaziUlfNvR1MUMFsqthFwCLMYSgFtzyAbjldpEAPet05QIxcwiS5tINiX1uMi5IZmrGSPc5JkTVtORums0m/QP1JgqnKzDO8GE3T4HiSW6PR94a9TKhA2BWvgUWEkmSihDp2F+RcvOCLprkgAOyiWh+PmMjdMc5RdG0JM1WNjfpy0lJU98pb7977Ltm0NTw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 20:36:52.0148 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f0e905a6-231f-4c65-ba2a-08dd04ec1236 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055E1.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7555 Received-SPF: permerror client-ip=2a01:111:f403:2409::615; envelope-from=Babu.Moger@amd.com; helo=NAM04-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Found that some of the cache properties are not set correctly for EPYC models. l1d_cache.no_invd_sharing should not be true. l1i_cache.no_invd_sharing should not be true. L2.self_init should be true. L2.inclusive should be true. L3.inclusive should not be true. L3.no_invd_sharing should be true. Fix these cache properties. Also add the missing RAS and SVM features bits on AMD EPYC-Rome. The SVM feature bits are used in nested guests. succor : Software uncorrectable error containment and recovery capability. overflow-recov : MCA overflow recovery support. lbrv : LBR virtualization tsc-scale : MSR based TSC rate control vmcb-clean : VMCB clean bits flushbyasid : Flush by ASID pause-filter : Pause intercept filter pfthreshold : PAUSE filter threshold v-vmsave-vmload : Virtualized VMLOAD and VMSAVE vgif : Virtualized GIF Signed-off-by: Babu Moger --- target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a632c8030c..c21b232e75 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2343,6 +2343,60 @@ static const CPUCaches epyc_rome_v3_cache_info = { }, }; +static const CPUCaches epyc_rome_v5_cache_info = { + .l1d_cache = &(CPUCacheInfo) { + .type = DATA_CACHE, + .level = 1, + .size = 32 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 64, + .lines_per_tag = 1, + .self_init = 1, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l1i_cache = &(CPUCacheInfo) { + .type = INSTRUCTION_CACHE, + .level = 1, + .size = 32 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 64, + .lines_per_tag = 1, + .self_init = 1, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l2_cache = &(CPUCacheInfo) { + .type = UNIFIED_CACHE, + .level = 2, + .size = 512 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 1024, + .lines_per_tag = 1, + .self_init = true, + .inclusive = true, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l3_cache = &(CPUCacheInfo) { + .type = UNIFIED_CACHE, + .level = 3, + .size = 16 * MiB, + .line_size = 64, + .associativity = 16, + .partitions = 1, + .sets = 16384, + .lines_per_tag = 1, + .self_init = true, + .no_invd_sharing = true, + .complex_indexing = false, + .share_level = CPU_TOPOLOGY_LEVEL_DIE, + }, +}; + static const CPUCaches epyc_milan_cache_info = { .l1d_cache = &(CPUCacheInfo) { .type = DATA_CACHE, @@ -5264,6 +5318,25 @@ static const X86CPUDefinition builtin_x86_defs[] = { { /* end of list */ } }, }, + { + .version = 5, + .props = (PropValue[]) { + { "overflow-recov", "on" }, + { "succor", "on" }, + { "lbrv", "on" }, + { "tsc-scale", "on" }, + { "vmcb-clean", "on" }, + { "flushbyasid", "on" }, + { "pause-filter", "on" }, + { "pfthreshold", "on" }, + { "v-vmsave-vmload", "on" }, + { "vgif", "on" }, + { "model-id", + "AMD EPYC-Rome-v5 Processor" }, + { /* end of list */ } + }, + .cache_info = &epyc_rome_v5_cache_info + }, { /* end of list */ } } }, From patchwork Thu Nov 14 20:36:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 13875598 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 409D8D6A221 for ; Thu, 14 Nov 2024 20:38:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBgac-0007bx-Nf; Thu, 14 Nov 2024 15:37:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBgaR-0007Wq-OE for qemu-devel@nongnu.org; Thu, 14 Nov 2024 15:37:09 -0500 Received: from mail-sn1nam02on20611.outbound.protection.outlook.com ([2a01:111:f403:2406::611] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBgaO-0001m6-Am for qemu-devel@nongnu.org; Thu, 14 Nov 2024 15:37:05 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sJbiAadD1YgxpfN904GHsb8O4iHjB2sVd9J4FeklsTuN0mX3elGBn2Ln0Jt1FiUN8J5DkspN5WEc76KpnQD7ytjshqXK/k/5ToaaixwMv5cCd++UH728MbhY2QYg74apj9ZMLJz8hTX3ml9sCML49kyvY4JkmsUzmDL7nHqkm+vIBlzMwc0KWMRyxHAYmsFX3nI/kq6R575dQd263q1R3KvH1ORheryNbVLce5CgPkYqrQ5T0rnY2Jjk6XKCp8hPD8wFbiqHtCKe6xpyqAK/jldvQ017TmiosBa18Sy9//lYThWCYu0GibtO69CrysR4hypgWzEIT1nf+dKiT7Hr4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KEcinZ9flLyZTr//gLMdTQcANxNQX3YMcAMHPxvaAMc=; b=NAoLgiIDOYxgfVNkVI78P/5mxusAl1a5SJTm8B2dn/DN8QsdKvTSxYX5eudlns5tdInvWpmB/78+r+N8NZUpjBcWWvhPQiQMvDB/cA0BmAacb4scTRwR8G9peIDSXT+OCswza112G/d8hLFF9s0yEJ7lnxcpVc1kSxwqWKii5HCvpYy59LhGdwFjzRUJPnPvnH2nqopIGjvDokozIHvFzo4U2Pz+FAGnUVAJp5ctFiSwHz9qxVUzqv3CXXpOPb7gbls2mYXVexTYnoINCyCBP4UZR7en9g1UHEIlIzPv87O8ia2IfxTn4dbcLgns1kkR7lB9xu/a/rn6j0mEydetDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KEcinZ9flLyZTr//gLMdTQcANxNQX3YMcAMHPxvaAMc=; b=nfHKm2z4qUtlURLubE0VT6b1eNjRWuAG6EYmgZgdVPvYxecLRh0SN6irFFIPpAuhkBl6SfAXdnffcYjQBI5ec9K4RK1/PPj4oy+RR0T7m2QkFmP1YQaJ5Pwu3dyNomUzKg8tda+2/jSydNxR8o7dB1yS2kMj6X7lPN9VyyVNG8g= Received: from BL1PR13CA0161.namprd13.prod.outlook.com (2603:10b6:208:2bd::16) by MN2PR12MB4286.namprd12.prod.outlook.com (2603:10b6:208:199::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.19; Thu, 14 Nov 2024 20:36:59 +0000 Received: from BN2PEPF000055DD.namprd21.prod.outlook.com (2603:10b6:208:2bd:cafe::53) by BL1PR13CA0161.outlook.office365.com (2603:10b6:208:2bd::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.18 via Frontend Transport; Thu, 14 Nov 2024 20:36:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN2PEPF000055DD.mail.protection.outlook.com (10.167.245.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8182.1 via Frontend Transport; Thu, 14 Nov 2024 20:36:58 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 14 Nov 2024 14:36:58 -0600 From: Babu Moger To: CC: , , Subject: [PATCH v4 3/5] target/i386: Update EPYC-Milan CPU model for Cache property, RAS, SVM feature bits Date: Thu, 14 Nov 2024 14:36:30 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000055DD:EE_|MN2PR12MB4286:EE_ X-MS-Office365-Filtering-Correlation-Id: fb7adeea-09f5-479e-9778-08dd04ec164d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: JjX3zUVbWIjy7bNGa1MuLChMJ1yF7gm+/5TiG3oyKiAPm+EKcVwM9oYudLfQV0mJyASaInBI+YNMNJRyjKVEYVcnxSoD8tMj65DxZesNaoa3/JaSypN8VR/Br7B1wG5UbdgHGeM4dWVXLbHOf+qkLi79fWgOGKf6EijpigPq9JtLJ9pWJvMoKg1hXn0LBg+hr+tIHdYaGgm56bt/BaC98cne832BczYFK1BFbgWnWEcFBdcWaqy14hYbqrKlXWnhsETYYR1R6w4EI8KO0VGvpknb3tUDST/bosutITlALunVfoZoOoHaBdGkk9X+oVfNk55KSix25sYkysWYIIW6dGt6lydyrT2pQqI1Xqqtk/56v5SsvKt3lHFl1e2aGepYvv6D1saznniW30gNq3yt7xb7bTqH4yXadddsn4HPwgn4a5Th5uTHv6MK+zDqfBft1c3zW2C4x6lAwJ/PYJJqzUmNJCUVwQV3R9/rypkEVUVpjMeVG7ZJa4sk1M7vmL26HPnH0ovLVjmHSAbl/mrA4GzEJw9JcF8FkO+Hx82zLcIJ6NOBorxEZRd5kt8/Aie4csGUs8Rk6uy2Lr9d8h1XB7LfP+qaGy47Xc+NZu18B6lWGJA3NxeCO3wKlX31QruDLzFOrHtlP7DPvjoMn5B76fK4K2tm8UHnFrA3D4vMt+4ZJw/iOYzt9ZLZO3/0teavgWRb9s9M8AvJvoysIt3Vfu6kmK8PyqeJuB+E51OYLdqn7FsqnIWD+otUsKQD1urIltMFCO2Vl1cT1IMO2VVNUxc0POT0ezVfJeMJm/Kf9HBRW3gZYqde+TZtrmTzJVtdlOLIbv1NB6vXm++HKwC0NwbUxP4mzYCYjGhKDPliG4vaKBUMGfKgaWYAHOHWZSXbZzHPpWgdTFm09fVDMibrRX0AaQ/+bIqOFiAB1Nmq8TVuWEYKTV8OYP0Eo4WvttHDEOLIqQpmpQuXrFbMCYO3nO/1cKadtH19TQMMj7Ik+92YUFaKkXgBtweo2BQcaOFEObJB+GIHUmrh699WUIub5R1BN77kQerHUs4rKfaT1C8nOOGy9Z1IXDIrDjpk6NsIkSAmjDxOsM3xqN7iXrv/6lXnT2iz/LbVO/Nk0/NLyK+m5hVZ4lhRxqH5kQ+HVGvvtdHWNfMRz3TnDolA5bI6+P/PNvuPyYeWlac0zSv9hcwMzwZcnXwXyaA8S1Cq20HjiCyHfBme/cg4p/L3Sokbg8xXmdZ6TQligG54vduD2tQ7wfgryj30/x0sco9/QsS2ViIoGNR+nelp4+C6mROhwT2vXksPtz9BO8kWxZvYFW3Ve0FuMPPe5El9bGXanQHw8oGXwQLGoR0scfCaCYNtIBqVP0MnfrTAuK86HcRBKbIA9u72AjboQNP3UDObtLmp5E9hvsih+GgwnhAwrRTLaQ== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 20:36:58.8785 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fb7adeea-09f5-479e-9778-08dd04ec164d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055DD.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4286 Received-SPF: permerror client-ip=2a01:111:f403:2406::611; envelope-from=Babu.Moger@amd.com; helo=NAM02-SN1-obe.outbound.protection.outlook.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Found that some of the cache properties are not set correctly for EPYC models. l1d_cache.no_invd_sharing should not be true. l1i_cache.no_invd_sharing should not be true. L2.self_init should be true. L2.inclusive should be true. L3.inclusive should not be true. L3.no_invd_sharing should be true. Fix these cache properties. Also add the missing RAS and SVM features bits on AMD EPYC-Milan model. The SVM feature bits are used in nested guests. succor : Software uncorrectable error containment and recovery capability. overflow-recov : MCA overflow recovery support. lbrv : LBR virtualization tsc-scale : MSR based TSC rate control vmcb-clean : VMCB clean bits flushbyasid : Flush by ASID pause-filter : Pause intercept filter pfthreshold : PAUSE filter threshold v-vmsave-vmload : Virtualized VMLOAD and VMSAVE vgif : Virtualized GIF Signed-off-by: Babu Moger --- target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c21b232e75..4a4e9b81d8 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2505,6 +2505,60 @@ static const CPUCaches epyc_milan_v2_cache_info = { }, }; +static const CPUCaches epyc_milan_v3_cache_info = { + .l1d_cache = &(CPUCacheInfo) { + .type = DATA_CACHE, + .level = 1, + .size = 32 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 64, + .lines_per_tag = 1, + .self_init = 1, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l1i_cache = &(CPUCacheInfo) { + .type = INSTRUCTION_CACHE, + .level = 1, + .size = 32 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 64, + .lines_per_tag = 1, + .self_init = 1, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l2_cache = &(CPUCacheInfo) { + .type = UNIFIED_CACHE, + .level = 2, + .size = 512 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 1024, + .lines_per_tag = 1, + .self_init = true, + .inclusive = true, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l3_cache = &(CPUCacheInfo) { + .type = UNIFIED_CACHE, + .level = 3, + .size = 32 * MiB, + .line_size = 64, + .associativity = 16, + .partitions = 1, + .sets = 32768, + .lines_per_tag = 1, + .self_init = true, + .no_invd_sharing = true, + .complex_indexing = false, + .share_level = CPU_TOPOLOGY_LEVEL_DIE, + }, +}; + static const CPUCaches epyc_genoa_cache_info = { .l1d_cache = &(CPUCacheInfo) { .type = DATA_CACHE, @@ -5412,6 +5466,25 @@ static const X86CPUDefinition builtin_x86_defs[] = { }, .cache_info = &epyc_milan_v2_cache_info }, + { + .version = 3, + .props = (PropValue[]) { + { "overflow-recov", "on" }, + { "succor", "on" }, + { "lbrv", "on" }, + { "tsc-scale", "on" }, + { "vmcb-clean", "on" }, + { "flushbyasid", "on" }, + { "pause-filter", "on" }, + { "pfthreshold", "on" }, + { "v-vmsave-vmload", "on" }, + { "vgif", "on" }, + { "model-id", + "AMD EPYC-Milan-v3 Processor" }, + { /* end of list */ } + }, + .cache_info = &epyc_milan_v3_cache_info + }, { /* end of list */ } } }, From patchwork Thu Nov 14 20:36:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 13875597 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1FFD4D6A22C for ; Thu, 14 Nov 2024 20:37:58 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBgah-0007dC-S8; Thu, 14 Nov 2024 15:37:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBgaa-0007bj-PJ for qemu-devel@nongnu.org; Thu, 14 Nov 2024 15:37:18 -0500 Received: from mail-bn8nam11on2060a.outbound.protection.outlook.com ([2a01:111:f403:2414::60a] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBgaW-0001mK-AZ for qemu-devel@nongnu.org; Thu, 14 Nov 2024 15:37:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=imgbMVQJhCRmUivn6+cucbzgyNQ3lgmjr5+7WdYjd/pp3p557v9N15mWw25qePmXB0DJbi9iKd4qG6iP4om+DZcnKzG2SXl+eWZsuE+5CpDfEIT6wouFCc2dD5n24y2ZbD/oU3p2Nu0ICSwSs1/+UWKL9PvUs9xBgdPNorWIxOlZFQi93Ms5xEw16ibQiOanVwHADwEr4Vp7EiUBP91uO1RyqH25nVaUtZRD5MHEhtSBR4v8pUgMRC1PruEYyFNSwqG/E9wRET5U99DPPCcwvi2gW00TulHIPpztMbGQgJ2c2q55YfXsoa4yWuI/nFtC/nFV5AO7vddBJzR53ziNSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xXc3UYcXqqOn6qQ0hrlHUtlgGaASMlynTNnWXp+x17E=; b=uXZk4qE2NqtqxSDdpFWmMoi35RdUl3SISNlGcdzbbDTUKViYQYqQPaN1glx3h7/odm7dDExmeqrJoPfsrKh6rBRHowTTTZ1u8UdUCqOM8RhrHyjBfRF3dU97EB+2tDbhD/WT+BwR5zlldSFeNuUEamjWHPKYYeFzERL2fwhABrFDIVc+7OMkzI9KcC1qJKH7eT4VZevnPvcHCYpzee27m4DZfaNyvyscq8AH6FI8jOC7AMzHnab9asnshYM0JgY4lqlZ3pDPlkaYQFF861ksBdyhM/L8aMimKhiSKKCb5Y2fSXXsEXhA8SeoiSKvIRO4911fmYhDA8ipPqDf0X68dQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xXc3UYcXqqOn6qQ0hrlHUtlgGaASMlynTNnWXp+x17E=; b=waWrgb9FWuMze0+g1+p5s3ysRf2ELFtEuc0r163J5FLZ17DivjOu9i76Y6fjNEoRBGuhXjoNiAzOcVBk38/D5Qf1Zq6z/XI6epxt9B/Mxjw1OEB6txKxe/a16zbYjCdN1CRylRdaSRloUmUYR559rQkirkHfeUuLW/vnOmdhERw= Received: from BN1PR10CA0008.namprd10.prod.outlook.com (2603:10b6:408:e0::13) by SA3PR12MB8048.namprd12.prod.outlook.com (2603:10b6:806:31e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Thu, 14 Nov 2024 20:37:06 +0000 Received: from BN2PEPF000055E1.namprd21.prod.outlook.com (2603:10b6:408:e0:cafe::92) by BN1PR10CA0008.outlook.office365.com (2603:10b6:408:e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17 via Frontend Transport; Thu, 14 Nov 2024 20:37:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN2PEPF000055E1.mail.protection.outlook.com (10.167.245.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8182.1 via Frontend Transport; Thu, 14 Nov 2024 20:37:05 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 14 Nov 2024 14:37:05 -0600 From: Babu Moger To: CC: , , Subject: [PATCH v4 4/5] target/i386: Add feature that indicates WRMSR to BASE reg is non-serializing Date: Thu, 14 Nov 2024 14:36:31 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000055E1:EE_|SA3PR12MB8048:EE_ X-MS-Office365-Filtering-Correlation-Id: 4860d559-da3c-4731-12b7-08dd04ec1a6d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: q0tQ+Nk+eCcev2xbSQYxFSo9m+UEmQEYk2njhVOwp5qo/ySVreRXJ9amIhRKV4e3ExzlCWJuDfeo2UKW5HsCh/vqYR8tJcme/oIk+qUhkpfCvRKOKWP8mmgmSsd4F47HUYB0KzLT80XFQoANGpZhkA51FwSVnwuHe8fxEFLWzG5c2uOuSdq07Hjy79Fk1qdGZLFtrD1KR5rzWKiOL1la7twpGHwxKDSFKApMFdtpuSeRix7Hn6cLZTwxrrW4Omzzo6nkqdGjSK3huPX1crLTQ0ejSwmAmagZn0qlyCgav5AtJVv/0E9wOV/TsvcW8cBUzSntTgnuzVIjaeIzUYwpV0YTgKPuAtbVwY0qum78ZfDTXZuMLn/tP/s3OomQqIT+0gbDj7B0Ez/m6dtJyW9BvowAcfBUryO84HuZeZFCMEWM1+uyYpbMHrN/rCGbtFKyHgyrMn0zYVFwPj1Xwa34FdKJCktvZcXywj+K2/heugkUgyEHTqMm7gpMBJL3UIf9asCvMkv8cU294KWmDih43wlSs2OLje5LcPZJN85ZZ79ybJFrMrVgDtDzAQ2EJziwg4NUtKfAYfZpNw5O8bUddXNkwaSXZ0/daHMGKbPavU/k+ICPg+NXvLXpoUwRn30wXow7Eww45uMIzMwEj3VVs1nKswRtdFhCDbyNQpD6SvMpwZX2+Q8wMmMvgM6AE4Iu/zqDHVhuUzTXTfTCtwl6fJuDp3R8eWxgqQscx/KSHJ6cSoKKAPLFP4xhcxPN1v3eBsdCP6AQydyqufxo8sr8oJiy7GNRMUdn/TI2ltyqRgxBhnmxZlpHFKjFMZI2VuwfncYDFxu0TwI1/286+QlJgE9mWJnoias5vulvQjGRRrMiaI8+/nUPOznNSv111x2/P9S2jl9QVs50CZn1n6dpLMrXa1Z1C99+V5Ovm28snC64T/dPsh7542sfIAeM/plw7LRLQCbncfocF2i8TNWqZVZC8dA3UPQPcMzJdekzrjrIPjwKjfyvAYmHk558WAewDtrdq8YbkmMfSi/nPso1joXFJVZN1cEo2jVqWNLved801cpBsoRH4tBRWhCDzIpgP7lExBjOR7rswZWqueU0OJ906/m1wyqZy0pL/vwGBL2dfn3xA4skCL3IjVsG61OeF5OeUphFfTR6HY3HJwGchyoMMWl7LYSAYu18xo4gvJaGdl0GIb6bjZrY+wW7JYYKohIU0EqBEjVf28hR3S2ywDBezBWa+OEvzf2rs2KZ/pNt90bR9ZnhLIl7vArVS1KwdIWmRPiBFLsI8WB40lB/RufCeEZkM1zSPHBYMNCozySivitc9nqS3yMWLRX/mSXED12D9QmJV26RCN+U/FH3PnuR71TNP3MEhy2+fKRxS5xPCz5eYx96uWAGGPrlDsMmcTXSD3DCga6F7rpH2ay+9g== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 20:37:05.7947 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4860d559-da3c-4731-12b7-08dd04ec1a6d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055E1.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8048 Received-SPF: permerror client-ip=2a01:111:f403:2414::60a; envelope-from=Babu.Moger@amd.com; helo=NAM11-BN8-obe.outbound.protection.outlook.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Add the CPUID bit indicates that a WRMSR to MSR_FS_BASE, MSR_GS_BASE, or MSR_KERNEL_GS_BASE is non-serializing. CPUID_Fn80000021_EAX Bit Feature description 1 FsGsKernelGsBaseNonSerializing. WRMSR to FS_BASE, GS_BASE and KernelGSbase are non-serializing. Link: https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/57238.zip Signed-off-by: Babu Moger --- target/i386/cpu.c | 2 +- target/i386/cpu.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4a4e9b81d8..107ecd2bde 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1235,7 +1235,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = { [FEAT_8000_0021_EAX] = { .type = CPUID_FEATURE_WORD, .feat_names = { - "no-nested-data-bp", NULL, "lfence-always-serializing", NULL, + "no-nested-data-bp", "fs-gs-base-ns", "lfence-always-serializing", NULL, NULL, NULL, "null-sel-clr-base", NULL, "auto-ibrs", NULL, NULL, NULL, NULL, NULL, NULL, NULL, diff --git a/target/i386/cpu.h b/target/i386/cpu.h index b65eedb617..12dafc9b32 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1032,6 +1032,8 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w); /* Processor ignores nested data breakpoints */ #define CPUID_8000_0021_EAX_NO_NESTED_DATA_BP (1U << 0) +/* WRMSR to FS_BASE, GS_BASE, or KERNEL_GS_BASE is non-serializing */ +#define CPUID_8000_0021_EAX_FS_GS_BASE_NS (1U << 1) /* LFENCE is always serializing */ #define CPUID_8000_0021_EAX_LFENCE_ALWAYS_SERIALIZING (1U << 2) /* Null Selector Clears Base */ From patchwork Thu Nov 14 20:36:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 13875599 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94DD8D6A22C for ; Thu, 14 Nov 2024 20:38:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBgaq-0007ez-Cc; Thu, 14 Nov 2024 15:37:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBgai-0007eA-TK for qemu-devel@nongnu.org; Thu, 14 Nov 2024 15:37:24 -0500 Received: from mail-dm6nam10on20623.outbound.protection.outlook.com ([2a01:111:f403:2413::623] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBgag-0001mx-HU for qemu-devel@nongnu.org; Thu, 14 Nov 2024 15:37:24 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XiWf4/ZP8c3jDBuxGS3AzJLz6350gvuiEWw6I7YvCoPuzMt39r5fUGUtK8BmVseU2yWjEiPoXz8UKqInSFdWyf7Hna5adA8ZQ2NVA/7cV+m13GdU7V91S0ky0shwPRjBLu8j/JpjPDaDyMBBcHlJbT6JjoqAeHn5meAWDIeYPotou0YiMXJuY3r+DwxVZrtRpXouIp+NArK8Eh/yHS2cXAZBME36tqWesXXq7u8ZRlt/ZND2KK0XybPd3dW/KJtDYrRJ88IBRST7n8Sz5nAejhDXJgORlcVdrZQDNC3oqFxF4CLbbtu/6BiwqnKd8yrjJYvSOSIYb0KDfX/HOlEKhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CAS2GIiFdwPhEw47XkJUVk4kdgQ5vv57fwT8KP/qQcs=; b=tPQv029k41UKHNrJ+EyToaKF5c82GzMDs6iJGUmyK2+zotpZ6j/Gv+POftJI4tw9D6oo1PeFSh7wqZ4Pcu0A17S9LiERlkik77g2tO6OCU7kVe5T+stZ+xXm3DeMHjuXexkUp2idAAxgmtMU+MMlkZuwlPYB4E0eMi33up9GMSbPPjV1PC4sOYyZL03VHKJCIQxIqAntz9yRnNvcaOrIQAad5KwpBl1ORqzYBynxYQYDT/HW09toe6ZjJQlnHboFUg9WvAW7fCSMy1yoYiy/NtpOEsOWesS537yhBQCaGQZzFRuzU7AFKbPRz/qVgnPKCgoXAjaVPEdgo3hBbdOaHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CAS2GIiFdwPhEw47XkJUVk4kdgQ5vv57fwT8KP/qQcs=; b=VvFSZDn26nxu+6LQgEBK8scc/Z7JUYqB9D7MNX8oe1lVG+gzvOefikeFQjLQsxsPkmd76N6+O/yBYwkqWyGxQLFV3XwtH4jtwIGWadvI5Jaiheu+0ozfoJULeh7PSx7mMf5ZrfpxANHifL9GBE9uzntUqyKhyBNOOZHHUsa8ADU= Received: from BL1PR13CA0174.namprd13.prod.outlook.com (2603:10b6:208:2bd::29) by CY8PR12MB7538.namprd12.prod.outlook.com (2603:10b6:930:95::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.19; Thu, 14 Nov 2024 20:37:13 +0000 Received: from BN2PEPF000055DD.namprd21.prod.outlook.com (2603:10b6:208:2bd:cafe::e8) by BL1PR13CA0174.outlook.office365.com (2603:10b6:208:2bd::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.16 via Frontend Transport; Thu, 14 Nov 2024 20:37:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN2PEPF000055DD.mail.protection.outlook.com (10.167.245.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8182.1 via Frontend Transport; Thu, 14 Nov 2024 20:37:12 +0000 Received: from bmoger-ubuntu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 14 Nov 2024 14:37:12 -0600 From: Babu Moger To: CC: , , Subject: [PATCH v4 5/5] target/i386: Update EPYC-Genoa for Cache property, perfmon-v2, RAS and SVM feature bits Date: Thu, 14 Nov 2024 14:36:32 -0600 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000055DD:EE_|CY8PR12MB7538:EE_ X-MS-Office365-Filtering-Correlation-Id: d846ff2d-2d50-416f-ec89-08dd04ec1e83 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: EDPrg/2EeTDoIw0ZmDAkAEp97z0j4PYYLTNzwVsPhAygPs25h4D/8ocJyFflCGXDFecM96wTLrvEiIKYZT6ZXTcZsm2JvkkBEjoaNFPhRDrvaV5yalUkdF/ii6fHQjSMtGX5dVfHYZEEH/JichES+fUAs41n4ei0uUV87p2hhR+zGcusUekSCjkWN+dgEub0N2t44GZtBkn71Fwx3RkLkmpC1zvxFG428AH0VI/WPOBdEqkyyZMV0AIQFpyR2HyRdfAnVxZ2i2YzA5QN40vvrHXHF6WqanVS291rqshjQ89OjTNoYf/ezmFOaCoXedIaoSw//p5dRLvdeb+mg07NSGIcl+0vcI1OzVniHXGXtPHszQFNnfUaDNY28UiJ0OfeGmyHCtfl4PUbviUuUDgPKQXdYAb255fxvpqspKB4hJtKOxGPJAa+c6l7nLsQE2XTKo4bpdsq6390qni7QfHXHqa41ardEa0UPWrGx554uidoHDD40a1cUDHR9siyLSc3LbigExai+QEnvodu5uUM/WhrcDcR47dCQeP7WYkYiFSngQevAlODZp9deCM1f2tKrM3mko6WWtgcZ1BW5Pmm3QVntNP6V9+v+u7BLHpuTxTTUw3XI5t8UfjQoOdxU3I9c3aNaVVvugwMqm1P6FciNMXQRUtZtBb7QvGSOtBsjt9OtEMylVai+m5bu+NdUmV0LoUSKDqvEeyK7l6BfA9yBWHppRReksyrQgkalm/enmTtO3hQIdu/UMiRtKwnKXYZPX4Ac8txDci3Xevd3EzR3sUe+1LoRMGsQTYd8dgA+xEvvd+Fq7CkHx4yKQHBxb13c9Ivs7D1XoU2HADPQBrDD5NRPRwZ5V+f0aZC75mKV9ZuHoA/8zs0Xx3ffM5gqq9s01lUS8RRu8pbe1C64+X63yB7gXWSmBnQuY2UhUSGuTv17G1TP5n0TCddny5BXG9m1cG3TN4boG+wieV9vthrNjZ1RedC9SbEwv7mb3OFMbJSV7JgD2aVhI4aBoWHQwzVea2/2tOyHO1HLdiuBYj53fVQhlQqE5QrxptJVVnRGcqqdjMaRFEZxCQuJt4/ex6IG+rjTSTnLcvNL27QL0gMQtpgJNEB4XDszMgkXayqfVGjG/ozsHB/FA/ksJ0zQee1ss9Nn9/ST6p71CpqDgHd18S0SnzOCUz/sTK3pNW8ZV3n+XOSgkhXeGwWGZSHepCYNYn6Ra3r7hefdITLGDH6h4+X6Sf0IKI6QQd6DwaNsKPiuX7h1jsWJEiwa2b1W95urkW91Baqd0Du/C3c05dgf5oviPOxfwVJWeceZT8BE8R85UBnURhODmvJGE2wSKue27TwKZmJS8iDk+Y8mnEuJ5iwnGiHdVWtPqZGzEt58ZX4q9BF1B8jNMJ5kwygsfuc8dB6VV3bIPbtWFxHktTX3w== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 20:37:12.6566 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d846ff2d-2d50-416f-ec89-08dd04ec1e83 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055DD.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7538 Received-SPF: permerror client-ip=2a01:111:f403:2413::623; envelope-from=Babu.Moger@amd.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.122, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Found that some of the cache properties are not set correctly for EPYC models. l1d_cache.no_invd_sharing should not be true. l1i_cache.no_invd_sharing should not be true. L2.self_init should be true. L2.inclusive should be true. L3.inclusive should not be true. L3.no_invd_sharing should be true. Fix these cache properties. Also add the missing RAS and SVM features bits on AMD EPYC-Genoa model. The SVM feature bits are used in nested guests. perfmon-v2 : Allow guests to make use of the PerfMonV2 features. succor : Software uncorrectable error containment and recovery capability. overflow-recov : MCA overflow recovery support. lbrv : LBR virtualization tsc-scale : MSR based TSC rate control vmcb-clean : VMCB clean bits flushbyasid : Flush by ASID pause-filter : Pause intercept filter pfthreshold : PAUSE filter threshold v-vmsave-vmload: Virtualized VMLOAD and VMSAVE vgif : Virtualized GIF fs-gs-base-ns : WRMSR to {FS,GS,KERNEL_GS}_BASE is non-serializing The feature details are available in APM listed below [1]. [1] AMD64 Architecture Programmer's Manual Volume 2: System Programming Publication # 24593 Revision 3.41. Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537 Signed-off-by: Babu Moger --- target/i386/cpu.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 107ecd2bde..1d241fcd13 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2613,6 +2613,59 @@ static const CPUCaches epyc_genoa_cache_info = { }, }; +static const CPUCaches epyc_genoa_v2_cache_info = { + .l1d_cache = &(CPUCacheInfo) { + .type = DATA_CACHE, + .level = 1, + .size = 32 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 64, + .lines_per_tag = 1, + .self_init = 1, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l1i_cache = &(CPUCacheInfo) { + .type = INSTRUCTION_CACHE, + .level = 1, + .size = 32 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 64, + .lines_per_tag = 1, + .self_init = 1, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l2_cache = &(CPUCacheInfo) { + .type = UNIFIED_CACHE, + .level = 2, + .size = 1 * MiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 2048, + .lines_per_tag = 1, + .self_init = true, + .inclusive = true, + .share_level = CPU_TOPOLOGY_LEVEL_CORE, + }, + .l3_cache = &(CPUCacheInfo) { + .type = UNIFIED_CACHE, + .level = 3, + .size = 32 * MiB, + .line_size = 64, + .associativity = 16, + .partitions = 1, + .sets = 32768, + .lines_per_tag = 1, + .self_init = true, + .no_invd_sharing = true, + .complex_indexing = false, + .share_level = CPU_TOPOLOGY_LEVEL_DIE, + }, +}; /* The following VMX features are not supported by KVM and are left out in the * CPU definitions: * @@ -5559,6 +5612,31 @@ static const X86CPUDefinition builtin_x86_defs[] = { .xlevel = 0x80000022, .model_id = "AMD EPYC-Genoa Processor", .cache_info = &epyc_genoa_cache_info, + .versions = (X86CPUVersionDefinition[]) { + { .version = 1 }, + { + .version = 2, + .props = (PropValue[]) { + { "overflow-recov", "on" }, + { "succor", "on" }, + { "lbrv", "on" }, + { "tsc-scale", "on" }, + { "vmcb-clean", "on" }, + { "flushbyasid", "on" }, + { "pause-filter", "on" }, + { "pfthreshold", "on" }, + { "v-vmsave-vmload", "on" }, + { "vgif", "on" }, + { "fs-gs-base-ns", "on" }, + { "perfmon-v2", "on" }, + { "model-id", + "AMD EPYC-Genoa-v2 Processor" }, + { /* end of list */ } + }, + .cache_info = &epyc_genoa_v2_cache_info + }, + { /* end of list */ } + } }, };