From patchwork Fri Dec 2 19:47:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 1711570 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=P3UZ8sNu; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NP3QM6Lf9z23yd for ; Sat, 3 Dec 2022 06:48:10 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1C0k-0002bB-3g; Fri, 02 Dec 2022 14:47:50 -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 1p1C0i-0002ao-3K for qemu-devel@nongnu.org; Fri, 02 Dec 2022 14:47:48 -0500 Received: from mail-bn1nam02on20631.outbound.protection.outlook.com ([2a01:111:f400:7eb2::631] helo=NAM02-BN1-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 1p1C0f-0004fo-R4 for qemu-devel@nongnu.org; Fri, 02 Dec 2022 14:47:47 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VWtsMTL+kRctq0cmY134vYtk38dT8Qg0RJz23v2Tm47+TYKcTXesbPNOvRy3GmLwRA94puU/4iXCfkT0YKfQFRMHi7cOiS+z3YR84HmhX449QEgSNhR/RyE4CNR34qpgIRxm2reYvad5j+ucC2PAZ92T3L6XneNwIow0TKy4LZNhTBN4t1cxORMekNmRNXpK83t/fhNIMb8ACJn7K3WuI7p8/Xercw4UJZZxe2ERIN8JoTkYSWaMNVFrMLpOPPFvVVHPTvGHF6d8B9QKo87G2sbMeeEhDyKB2Z9qASph2hG+6RMJhdhhlTEi/G+LOu2nxECgiXdKg3MEoO249RNAww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=qMazTAYRqbSTnaRIEEhec7Xbfh7ocx1Pe/rEqwsYOd8=; b=UajD9LroYw0absX6TxTSmw2aJkxl/AZKXfDbKu0rL12Mnqhrb42LzyWxJVv1VrXJdND0Dx+BK38mReomRAJGcNot4JcpQrlb/P67FZObTN3HzjVVHzFnV1RBMsQhQA5femYfAiBolUA8BBYPifkHP+q1z+SQNjRLR6pZxLjZFEsW9u8cFwGZU6AkkYewhgCtnr8w21m1jucOWQoY3EcW2pHfRTXzjVsm/SKBKz0mAl/s4kMhJD4w2FJOdcdYkQc1wfzyuc3GOOwx4t1hevNi0RWNWohQscLPoWsYfc9BU7JMrQ+l/8rToqVnTiluE5Tq3WwfdnuDnjFPCuiyapAKlA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org 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 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=qMazTAYRqbSTnaRIEEhec7Xbfh7ocx1Pe/rEqwsYOd8=; b=P3UZ8sNuyUfBYwAJweprd2gMVELporC/b3XI4gWS6s2iuDMzhU5odNAIAiVPuMRWkry2BaX513iROCsyGZmpNUY6LDMuEFpn3Dwzt3kwhk+bvOr5k1zuG+/FoAcQoBGaJbHaR9c/6uX7RHirLp9nupzjnF0sH0nc/JvloW5Km1g= Received: from DS7PR07CA0010.namprd07.prod.outlook.com (2603:10b6:5:3af::29) by IA1PR12MB7494.namprd12.prod.outlook.com (2603:10b6:208:41a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.23; Fri, 2 Dec 2022 19:47:39 +0000 Received: from CY4PEPF0000B8EC.namprd05.prod.outlook.com (2603:10b6:5:3af:cafe::46) by DS7PR07CA0010.outlook.office365.com (2603:10b6:5:3af::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.10 via Frontend Transport; Fri, 2 Dec 2022 19:47:39 +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 CY4PEPF0000B8EC.mail.protection.outlook.com (10.167.241.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.11 via Frontend Transport; Fri, 2 Dec 2022 19:47:39 +0000 Received: from [127.0.1.1] (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.2375.34; Fri, 2 Dec 2022 13:47:37 -0600 Subject: [PATCH 5/5] target/i386: Add missing feature bits in EPYC-Milan model From: Babu Moger To: CC: , , , , , , , , , , Date: Fri, 2 Dec 2022 13:47:37 -0600 Message-ID: <167001045745.62456.2099841557167523615.stgit@bmoger-ubuntu> In-Reply-To: <167001034454.62456.7111414518087569436.stgit@bmoger-ubuntu> References: <167001034454.62456.7111414518087569436.stgit@bmoger-ubuntu> User-Agent: StGit/1.1.dev103+g5369f4c MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000B8EC:EE_|IA1PR12MB7494:EE_ X-MS-Office365-Filtering-Correlation-Id: 207d70a1-902f-4f7a-5cfe-08dad49e11ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jxmSUBKx5i8x2BeA5ES0ygkqPyQ1Vek0NK3azru3KqusjijTC6hvrdp39obIuGOIEjhvGEUDFebXFk+567zO4FmLzba6NYF6lvSAH7NIZfHXOvt84Xa2ZbfK6S6UJ+WlSt+K6sd5uWzOZ9Q5XTwy6fRYxa9WR89FwEIaSSWk2orZTJ0/LbAQ7krUTss0yde0N2K6IkndNqvCEo41MSF+u3gvEYAwnWulfFcQrzGnV7J92MK88TTBB/adectB9FuJJv5jS9ZPlKss6tR+f7T1Rhy/nWaUpVtQ/e7bW1aAjAQUv9GuadeMqIa0xu3oX8+aeMBlB2zKJpp3VvLCZTZ1oijONPxCAYqC+QKrXGk0xe4YQoyarx0tKCnXGTrJIT6GSPjPSNAgZmvZV48QjxIpFqvHFx980xdTHhiF1kQxe4uC849YH6c7ei8k5uTZCvZFPrwRfjq/1nNxwq/zUsHDjDzFNCYXL8t6Ny2AY5Yy5tDPFmKajGB92UHQ486SqZYFdy/i9fs3MulH3s7OMZO8pxDCj+WyW+93KaZfj9Qks5OTicRLfN3e8HDVcmqH3AUaxVfBvOEfSSkjcApKzhB+kIQQqc57uqlPSeea0pYbOK3/sR6NCJ3I+1JMGJr6Bwpa3GMrIW/5aRA8YpC+LazCejh/OEAUATsAJ7DZFyzBQ5uctBSLJrkZY+K+0jJ4MAka0o62D7xs6UL5sbyUX2M/aHsK0xrwsNL3o/w+0l1pCXqxK7Bn4EDi+VXng56Ynzcw9oBo0wAwPkQBICbJNWtKCzY1NGBScYYQf9FuJHiMchcHWhNddMnCFVE5EO6xqfZKzoOhlHg/9+4fjbaD68RmJw== 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:(13230022)(4636009)(7916004)(39860400002)(136003)(346002)(376002)(396003)(451199015)(36840700001)(40470700004)(46966006)(40480700001)(40460700003)(186003)(2906002)(86362001)(356005)(7416002)(16526019)(478600001)(966005)(81166007)(36860700001)(8936002)(44832011)(26005)(316002)(70586007)(5660300002)(33716001)(41300700001)(6916009)(4326008)(70206006)(16576012)(54906003)(8676002)(82740400003)(9686003)(336012)(103116003)(82310400005)(83380400001)(47076005)(426003)(71626007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2022 19:47:39.3648 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 207d70a1-902f-4f7a-5cfe-08dad49e11ca 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: CY4PEPF0000B8EC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7494 Received-SPF: softfail client-ip=2a01:111:f400:7eb2::631; envelope-from=Babu.Moger@amd.com; helo=NAM02-BN1-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, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org And the following feature bits for EPYC-Milan model and bump the version. vaes : Vector VAES(ENC|DEC), VAES(ENC|DEC)LAST instruction support vpclmulqdq : Vector VPCLMULQDQ instruction support stibp-always-on : Single Thread Indirect Branch Prediction Mode has enhanced performance and may be left Always on amd-psfd : Predictive Store Forward Disable no-nested-data-bp : Processor ignores nested data breakpoints lfence-always-serializing : LFENCE instruction is always serializing null-select-clears-base : Null Selector Clears Base. When this bit is set, a null segment load clears the segment base These new features will be added in EPYC-Milan-v2. The -cpu help output after the change. x86 EPYC-Milan (alias configured by machine type) x86 EPYC-Milan-v1 AMD EPYC-Milan Processor x86 EPYC-Milan-v2 AMD EPYC-Milan Processor The documentation for the features are available in the links below. a. Processor Programming Reference (PPR) for AMD Family 19h Model 01h, Revision B1 Processors b. SECURITY ANALYSIS OF AMD PREDICTIVE STORE FORWARDING c. AMD64 Architecture Programmer’s Manual Volumes 1–5 Publication No. Revision 40332 4.05 Date October 2022 Link: https://www.amd.com/system/files/TechDocs/55898_B1_pub_0.50.zip Link: https://www.amd.com/system/files/documents/security-analysis-predictive-store-forwarding.pdf Link: https://www.amd.com/system/files/TechDocs/40332_4.05.pdf Signed-off-by: Babu Moger --- target/i386/cpu.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index e9175da92f..54549a5127 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1921,6 +1921,56 @@ static const CPUCaches epyc_milan_cache_info = { }, }; +static const CPUCaches epyc_milan_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, + .no_invd_sharing = true, + }, + .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, + .no_invd_sharing = true, + }, + .l2_cache = &(CPUCacheInfo) { + .type = UNIFIED_CACHE, + .level = 2, + .size = 512 * KiB, + .line_size = 64, + .associativity = 8, + .partitions = 1, + .sets = 1024, + .lines_per_tag = 1, + }, + .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, + .inclusive = true, + .complex_indexing = false, + }, +}; + /* The following VMX features are not supported by KVM and are left out in the * CPU definitions: * @@ -4270,6 +4320,26 @@ static const X86CPUDefinition builtin_x86_defs[] = { .xlevel = 0x8000001E, .model_id = "AMD EPYC-Milan Processor", .cache_info = &epyc_milan_cache_info, + .versions = (X86CPUVersionDefinition[]) { + { .version = 1 }, + { + .version = 2, + .props = (PropValue[]) { + { "model-id", + "AMD EPYC-Milan-v2 Processor" }, + { "vaes", "on" }, + { "vpclmulqdq", "on" }, + { "stibp-always-on", "on" }, + { "amd-psfd", "on" }, + { "no-nested-data-bp", "on" }, + { "lfence-always-serializing", "on" }, + { "null-select-clears-base", "on" }, + { /* end of list */ } + }, + .cache_info = &epyc_milan_v2_cache_info + }, + { /* end of list */ } + } }, };