From nobody Fri Apr 4 05:16:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1740766097; cv=pass; d=zohomail.com; s=zohoarc; b=D6pdG83LBwvFOsJ5Sulq7f6vFpvd6zfMBkMt1i6w2cL/fihgnqsqk64zgnGyNzjjYvKASmFurelzpOkn5dw5p7JRW+a5abpWDv0SO5MQpFd/nGACjeqUnv6BlaoB9rNYZDykZVlfcdIJO4zkb0VdnRngi6sEbOjoP+3b6Zd0taE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1740766097; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=aWn12FJGh/GHZYdIwhvqHLwqDpV8jfI8J1LlIkT28s0=; b=jt919GS4pmEPeQXfCUfUBswslBrXnnlxDmgW3qT0hvYbvqAfcvoMvpWTFtD/U9XBdf6J0eKSuh/lXuFXSfl3WS+qE459Y9bfZmbHbwS5ZdbASzQhHgO6pd4pWl45vHNHmrtdGGcldzoyxOt0NMnrTQcYB483lOylW5rwZ00x5Sk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1740766097175984.9448424962122; Fri, 28 Feb 2025 10:08:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1to4lv-0005bT-6D; Fri, 28 Feb 2025 13:07:39 -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 1to4ln-0005Yb-NU for qemu-devel@nongnu.org; Fri, 28 Feb 2025 13:07:32 -0500 Received: from mail-mw2nam12on20603.outbound.protection.outlook.com ([2a01:111:f403:200a::603] helo=NAM12-MW2-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 1to4ll-0002OL-CY for qemu-devel@nongnu.org; Fri, 28 Feb 2025 13:07:31 -0500 Received: from CYXPR03CA0034.namprd03.prod.outlook.com (2603:10b6:930:d2::9) by DM4PR12MB6471.namprd12.prod.outlook.com (2603:10b6:8:ba::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8489.19; Fri, 28 Feb 2025 18:07:21 +0000 Received: from CY4PEPF0000EE3D.namprd03.prod.outlook.com (2603:10b6:930:d2:cafe::6c) by CYXPR03CA0034.outlook.office365.com (2603:10b6:930:d2::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8489.18 via Frontend Transport; Fri, 28 Feb 2025 18:07:21 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EE3D.mail.protection.outlook.com (10.167.242.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8489.16 via Frontend Transport; Fri, 28 Feb 2025 18:07:21 +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; Fri, 28 Feb 2025 12:07:20 -0600 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZkLi4u+7k7FLBhehrr7Y/7Lk3+VHCrZ3GIjLFrevVashLBvDhTcQyTWlMkjeBi0J+OGAV/XOQc5QJ6UJ1yZhaLtdsIY4wrynSCZQlKvuIUvw6sZvpxQP+1ZEhdBCDvZkw+VL9q5ueBAsmAthTwyVKA7RFdavk61yZzK9KosNUbJKrws4YBNekTmE2zzUgFjoi8/aGPMnK9VnUKTDkwx6hsUq06zwKopooANVp9JaZpA3BbW7RoghL4tAqu3sdjAPa3q6A277xAFnKOZXORJCBFIa9ueLriS2Yf93oCkcyCZj2zIk5XbO4TlLHX90i1fjCe/JemYtTbvHRBf9tDeQrw== 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=aWn12FJGh/GHZYdIwhvqHLwqDpV8jfI8J1LlIkT28s0=; b=CHwn94C+AA36KwuMI9dUROj3skPtLoDViyeKuIBcnIfHDpHp3Zf+wYHfrTWWcvjDECre+Vgs3/k5Clw3WyjZduZbsHP3RD1l+QCWbTNoeuKYmNpWs1rpdH1VGSMWoWKorkey9XOvaEPx9LY1Awhqi6sNJRs1Q0Ibd64D/3AOLtXivZV7+KJjCK0N1nH5ldBkj8tzLFw7UEGZkTGD3Vh382Jv7wPErBK6rG8hcs7uhGbIbn5fxypmHZc0Uf5x9PnPdl9QP7Uszk48iA24SOSU5gi3j13ZUv44NJoLmUwFMULrf66De8g6NRahlfFFedcLe4o5apzQpCxNcg04xnWhQg== 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=aWn12FJGh/GHZYdIwhvqHLwqDpV8jfI8J1LlIkT28s0=; b=V9XzMuHjw+AYC1uZWx/ubLTqvNHBJQRRM3dLZ4aP5Y2pxw34JZAMhrrLAO3BnqhrzSZacuBmY9r4/i55bsPv0Vo3wWNgWtBkfwn0IAxX/P5UGls7CaSCnwLrSsP5BzU5Lz88+wSftUFKip8o9kmZVA69Wr7JyyaHUZ9POnh7aX0= 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 (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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 From: Babu Moger To: CC: , , , Subject: [PATCH v6 1/6] target/i386: Update EPYC CPU model for Cache property, RAS, SVM feature bits Date: Fri, 28 Feb 2025 12:07:01 -0600 Message-ID: <8ecfd8751d58811b18fd918a6d13e859217156d4.1740766026.git.babu.moger@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: CY4PEPF0000EE3D:EE_|DM4PR12MB6471:EE_ X-MS-Office365-Filtering-Correlation-Id: cc1e641c-a97f-4c3f-9689-08dd5822bf2c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?rjbpuf/LTvXdQbaoP/hNPrW4ctJMcv//7aa/f8/rz9Y0bIvUZhP2CsdIvy/+?= =?us-ascii?Q?Fh7zjGg5sf0ggMkUtqILZftSPMXjiVF+5BiHmDpI70jCUH+kRL7rQmPKjAsx?= =?us-ascii?Q?0pYf59rN0gE4arJ3Cq4A3vV2BQVQNBRhUMMiQb+VTmO+/OpmHwckwkfQcTHO?= =?us-ascii?Q?9B8D5GZ1fRl2LauJxFBAcEevkVgxzRL5wjhFTnS1jAzpDyog07u6PwQ/8Y8c?= =?us-ascii?Q?6WoFyOS4KVJkkcr/CnpCo4jSRL+fD2AhiIkHsSEWJarBGW8GXX90Dhn8LwG/?= =?us-ascii?Q?uDPpQ/+UCoObMMy+9c5D5sNKZPpvG6vsYn4464HDvdlkn1gUe2upxSSmXFpU?= =?us-ascii?Q?LfrT+/+0JQi6aG3Y0SpCJsH6AxCQ0QpLsBQP6KPyecJ/9o38ZQ/wceVo7AJD?= =?us-ascii?Q?0nF2VGvfEJpy6czArMJSG42plWamYBPKXoFEnmnQvDYByuQSmKo1buPIYBhA?= =?us-ascii?Q?MKfUM7H5Mvk9/V/UNRlYJpCcIs+d/ZuAcEEN/4P7DCJt1xbeCOf6/qa+OO2A?= =?us-ascii?Q?cIeHKBjtap8Nhf6XfAxkL+eaikM/vAUWE4WboFpDOS33llroO1ZSRkWxb65T?= =?us-ascii?Q?sTgO6rOY2j5ySpCDM6Gp271uSYsy032jryehEtyYZNOgZN20ElgleyLGcb9R?= =?us-ascii?Q?zB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: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)(36860700013)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2025 18:07:21.4418 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc1e641c-a97f-4c3f-9689-08dd5822bf2c 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: CY4PEPF0000EE3D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6471 Received-SPF: permerror client-ip=2a01:111:f403:200a::603; envelope-from=Babu.Moger@amd.com; helo=NAM12-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.444, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1740766100406019100 Content-Type: text/plain; charset="utf-8" Found that some of the cache properties are not set correctly for EPYC mode= ls. 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 Reviewed-by: Maksim Davydov Reviewed-by: Zhao Liu --- target/i386/cpu.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 72ab147e85..7908b90b77 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2180,6 +2180,60 @@ static CPUCaches epyc_v4_cache_info =3D { }, }; =20 +static CPUCaches epyc_v5_cache_info =3D { + .l1d_cache =3D &(CPUCacheInfo) { + .type =3D DATA_CACHE, + .level =3D 1, + .size =3D 32 * KiB, + .line_size =3D 64, + .associativity =3D 8, + .partitions =3D 1, + .sets =3D 64, + .lines_per_tag =3D 1, + .self_init =3D true, + .share_level =3D CPU_TOPOLOGY_LEVEL_CORE, + }, + .l1i_cache =3D &(CPUCacheInfo) { + .type =3D INSTRUCTION_CACHE, + .level =3D 1, + .size =3D 64 * KiB, + .line_size =3D 64, + .associativity =3D 4, + .partitions =3D 1, + .sets =3D 256, + .lines_per_tag =3D 1, + .self_init =3D true, + .share_level =3D CPU_TOPOLOGY_LEVEL_CORE, + }, + .l2_cache =3D &(CPUCacheInfo) { + .type =3D UNIFIED_CACHE, + .level =3D 2, + .size =3D 512 * KiB, + .line_size =3D 64, + .associativity =3D 8, + .partitions =3D 1, + .sets =3D 1024, + .lines_per_tag =3D 1, + .self_init =3D true, + .inclusive =3D true, + .share_level =3D CPU_TOPOLOGY_LEVEL_CORE, + }, + .l3_cache =3D &(CPUCacheInfo) { + .type =3D UNIFIED_CACHE, + .level =3D 3, + .size =3D 8 * MiB, + .line_size =3D 64, + .associativity =3D 16, + .partitions =3D 1, + .sets =3D 8192, + .lines_per_tag =3D 1, + .self_init =3D true, + .no_invd_sharing =3D true, + .complex_indexing =3D false, + .share_level =3D CPU_TOPOLOGY_LEVEL_DIE, + }, +}; + static const CPUCaches epyc_rome_cache_info =3D { .l1d_cache =3D &(CPUCacheInfo) { .type =3D DATA_CACHE, @@ -5207,6 +5261,25 @@ static const X86CPUDefinition builtin_x86_defs[] =3D= { }, .cache_info =3D &epyc_v4_cache_info }, + { + .version =3D 5, + .props =3D (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 =3D &epyc_v5_cache_info + }, { /* end of list */ } } }, --=20 2.34.1