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 */ } } },