From nobody Sat Apr 5 07:19:51 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=1738870204; cv=pass; d=zohomail.com; s=zohoarc; b=H6pHpF3YUVx7+tGd+q6aCuwsC75DC9z6OUrZ++cth0BpDgXjon7P91q06+X7cieUeKFBSKLZ/ShBR/zHtbNQnov3Hg11IfsZXowW0uJq/bGiwSENsosTAgJCr0rUYJ4yc2S1PPTTCFvcoKtt1inJiKJfRKEr4F/kPmn+D0Pp7co= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1738870204; 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=enr+DHDvQqAFRHWpl+NJ7W+NDyzzeyjea5PAjr3elMY=; b=CROtQTeMblwj/8YpJIA5APvJiql/g0/5JrZi8ZNMcV0TGltlqAywidKxPJt8Sola8BUphB3ffy7QeZi52OUkOspCkhRyYVTJsn0EbSc/0wGsnYFJcyxa6X6gBTgxwGt74zoLMPqajYyA2+/NcXU0fkzACQR4fIJuEfxNfUe/k8Q= 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 1738870204131508.73632660291105; Thu, 6 Feb 2025 11:30:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tg7Yo-0004BW-0s; Thu, 06 Feb 2025 14:29:15 -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 1tg7Yf-0004B7-8T for qemu-devel@nongnu.org; Thu, 06 Feb 2025 14:29:05 -0500 Received: from mail-co1nam11on20606.outbound.protection.outlook.com ([2a01:111:f403:2416::606] helo=NAM11-CO1-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 1tg7Yb-000231-8P for qemu-devel@nongnu.org; Thu, 06 Feb 2025 14:29:03 -0500 Received: from CH2PR05CA0048.namprd05.prod.outlook.com (2603:10b6:610:38::25) by PH7PR12MB8154.namprd12.prod.outlook.com (2603:10b6:510:2b9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.25; Thu, 6 Feb 2025 19:28:54 +0000 Received: from CH3PEPF00000012.namprd21.prod.outlook.com (2603:10b6:610:38:cafe::d0) by CH2PR05CA0048.outlook.office365.com (2603:10b6:610:38::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8398.24 via Frontend Transport; Thu, 6 Feb 2025 19:28:54 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CH3PEPF00000012.mail.protection.outlook.com (10.167.244.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8445.2 via Frontend Transport; Thu, 6 Feb 2025 19:28:54 +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, 6 Feb 2025 13:28:52 -0600 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZBOS87oXBl1Oe/eroByCCynlc0M8C7ms3EjC+HaOXyr20IAOthKlp6YEnRFoZznF5kRv0jWXFM2KA+5t9cY5M0HhptQQo4L57B93zYEguKzE3x6pGL+twSTDVlxUDBuF0YhYZB9Xwh2PAvbc/NLyQUii7u68jka5GAw0qJ9tQZuQTsm8K5XOyFmlP70HflcgZm09+tFBx8Qhew69YP/9f26cqjfIFpWt4Pdc1rxuixsIYkx11l1HiotM9fNoDc6aVZQydDL2Nj49jS35dJa7LTReFpOE50lG+9wFpJ0ZKSyLJDI4ZCnAzVMr6KJuKTxvHS849eELf4Qae96AGiMmQg== 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=enr+DHDvQqAFRHWpl+NJ7W+NDyzzeyjea5PAjr3elMY=; b=EmYJEOAAhZEDta8I8pXYRTKj/aHkZQSTDq6GbAZNOw/yi/NgukT+PDjeapUy+3FExT3faBXcbx45G4/agSS+VTcCa78RREuzDFKu8AuazUKDx9DxEfQCXxYwcvYN5U3h7YulXO5PPbXegx+eZr34BIyVGd4xP3eiavsPnlpdbi01lvSJIz5MlOwmFzjvHvNmQ+fzCzjjuVB7/iQr+NL+s12TwH61P088hfZzyp6z1Yq0ma4DXdcvfphHfDObGNZYOja8C+BzlrWJMSPAGK2REvRt2zRELD7Q+v72XAX245MDINecZfAx0FSGxdBE+UgpRMGRBaV87V0DSiP9LwaIVQ== 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=enr+DHDvQqAFRHWpl+NJ7W+NDyzzeyjea5PAjr3elMY=; b=lgaRqJ9KyAG2PsKyMrBEAzBBc4Hh9LeqmJeNgtTRuFm6DPXJoLKy2KvVxvYDMSiTtj/NKyaM98ZkgE2hsJj9RGzIrltK5jcTneXM8DFU+hB/vkowxlnHObxgOOuXTq5Xe4E2eRvZM4BfGQqZe49ASJ8Jy7vt2sr4yP3PV0UWViI= 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 v5 1/6] target/i386: Update EPYC CPU model for Cache property, RAS, SVM feature bits Date: Thu, 6 Feb 2025 13:28:34 -0600 Message-ID: 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: CH3PEPF00000012:EE_|PH7PR12MB8154:EE_ X-MS-Office365-Filtering-Correlation-Id: a444005d-e31d-4484-9560-08dd46e47e9a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ukFxP/oiLw4uGNWGeWLwaSyi85sWHD0iEnpy6hiacBTWDMUUsJdgpsQiqoJb?= =?us-ascii?Q?hQ0C43+QuknAAzzuZPJchTjt0CGrPI4IBgUSkqCZJgRKgqSq35mw0Ck+XUEk?= =?us-ascii?Q?YcmpAZBhiq78lmbzSTLq5vGBYZrBYzUgbgnXnlaD5CnMVeUSJ7RBoFCJFatY?= =?us-ascii?Q?zx1byeokqD+NnF9S3KsojaLAvS6dOlCbAsscebLrPlG12i6Yrq+QT+4F7d+I?= =?us-ascii?Q?dWHHxPrU9w1TYo724bEmuf72zRLm7exUjH7XcK0ebsSjTKucmonjmfTmKUyT?= =?us-ascii?Q?HyDsxAsfEjip1dKCAV86Qc2x0kScQ2On+1APYBT4jfsKDXLBsmrxK9vdn0dZ?= =?us-ascii?Q?0pQ8jEHHQUhPvHLduki3TJWN6a6aHxbRtHkjBGXr2fgBFu03Kj2eSPShKCS/?= =?us-ascii?Q?MvofRVGGU4xTZ59m0gFBZ35zOE3IH2IMTykQ4vn7xkttcjto5YGvkJco/bvT?= =?us-ascii?Q?BPWDHH/FVxxoy7u3YfthoFEYbqIFHCBfF3ujDo45HOKDkliu2LidDaewGRMp?= =?us-ascii?Q?jR1qGYOV0VYOGB8Xf55jg7dVU44uqLy/u90iQl4DCnzG5NfIjypyk62Gk+0N?= =?us-ascii?Q?l0NtEp/GmZJ+82G+iUkydEUyUV35cTgma5tuAtAq4j43QxvI9UyF1cuJvePb?= =?us-ascii?Q?b0fCHf/nUQO0V2JOdKagmgUX7mAwA8idCtEz6aPbYcrcWIiGPbSjfN2rr7mL?= =?us-ascii?Q?Vg4XqxEmXRK+UGs+/SCpaFYzZuvNBiIFFtQ3qvGUiTmP3MnXFG2HxVfJate7?= =?us-ascii?Q?/bzj2+9Fbq+0dS/7GLkDHVi3c71Hb/P40JOZ8vSWa+3JyBB4+1zMtpPmtWrN?= =?us-ascii?Q?8exUfeVfnOjgE9Bkukkw6xTibhCibQ1C/86M4xGQuv7UeoYx6aWfck8f+U7M?= =?us-ascii?Q?b3b86vkuLrK2Gn16KPWg96wMnMJLK/R2y6YL2uO4D570iABXjd1D7za2jPOV?= =?us-ascii?Q?aL18WlwQf0d281+iMYKbgA/r5KWU4DcBoJReUpUMwWKHB7dyHbim2sGupI3j?= =?us-ascii?Q?28SN4CmjnCLyq6WVljhg/0iTfcbXIaX55KX7mbsLkwlBjbUWOZ+/wfOBX8jQ?= =?us-ascii?Q?vLnPoKFE1MkSZIQ/LeN2zNzhiM0Eu5BbsoJy9jiarhZV6KF42t5DVxLRjsim?= =?us-ascii?Q?6gl0uVqX5yRuQxtvElIaQ39B9+es67eedxpWwb2CmjxcOVLOs5jNYZ5Xwz8C?= =?us-ascii?Q?GDPyoM2DFv56W2D4eltYXjasWGvlnDTwKxYcELfNZs2PY2Nex/SiIgFzZOr7?= =?us-ascii?Q?SYHD+Y80eeB12RoYnRHffJn+4VZMcLm8XXtYMmq179CQTqhcoI6kL488oKZP?= =?us-ascii?Q?yb2L6XLJVpSAbl2o2ofsb3RrPP4wXPwXcnxEAqf167xUlV08HoNKHXAEwO76?= =?us-ascii?Q?sCNAFZAHxPc9XMjosgk0zwerkdUKx6Xb3LuGuVlRbNG998jwRkWnEBxI3+B5?= =?us-ascii?Q?Ff+y82ySinmAsvdmoMzwKEn0UxeicT+0hioCped0NmYLJhRiLtfZRqou/Tz2?= =?us-ascii?Q?UX8lVTLrkQXUuKI=3D?= 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)(36860700013)(1800799024)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2025 19:28:54.6245 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a444005d-e31d-4484-9560-08dd46e47e9a 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: CH3PEPF00000012.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8154 Received-SPF: permerror client-ip=2a01:111:f403:2416::606; envelope-from=Babu.Moger@amd.com; helo=NAM11-CO1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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: 1738870206629019000 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 b5dd60d281..94292bfaa2 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 1, + .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 1, + .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