Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2124967rdb; Mon, 20 Nov 2023 02:43:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/OstaqDyKz2u78iBeWKzaJKptlyOMeOallVbtUT7BFKdev6ySnhJA1p5sbS4ZF+hVomlM X-Received: by 2002:a05:6808:159c:b0:3b2:e520:dfab with SMTP id t28-20020a056808159c00b003b2e520dfabmr9980470oiw.44.1700477027702; Mon, 20 Nov 2023 02:43:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700477027; cv=none; d=google.com; s=arc-20160816; b=TxX77VFJmEAm7puV8Pcbm3EDv2CkSLDAGxrLe+sHcmxQQwoYM+/lS8dUdQSPs7ZUMV XLCRS8A6LUv6//+X61Gv+uCx4A39AORPDIyRQ636Z7FkeF88Zi6ySDfjk4VCZIg8oK6H 7bPtdwnRCamUHwLoLS/OB8h4Pbo1zseAW1rbzzYlIG0MM5Hsegapx2S3W/Vx8zWkMgED ZPy++wKe0TxoJAei3QjB4xq0JcZOcn3/qUx/i6YxpEJhgYTtJgK2OdVfl7P0hhwwW9O8 3K+Fz9Fv4IyKou1skLp1Q+PYLhhQnydjIxqQmCzPfaU5Ja/208UWpLrmMx55aebUgDJ5 Hylw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yzXdjJi9RjfbfwlazGXHhTPOTMqVKlD/3fBQemKkWac=; fh=yRofEPOsMYSFYi/7/f3tXB782BWAy0107oR1j5aafGk=; b=slx19wyc/OrcQeuI/UGvQa0vbSi+LrNQNDvvcC3KFCQyD0gcGrZS9tN/SYxMosT7no kLAwhXNda5YM7mYu5a/W2iiSB+UI+yk+LdZwcM1d6ATX5233veuz/ye1QpBvsH+Uhive KBbvB/wFYaz8N52aC1W80Dtv7jrac8U8ETJ2oPnGExrP/x36aLPSpQJfLXE7LjP5aQcm veFFGLojcBG+WCoNi78M/kcrVgEczVb7EmgH10jMUCEPvq6VIsocB/F1sxy8Xysw3bkX eRayaVjdcW0FD9rCnKn64yqu/ztRseQPBanodx1RkdoWIIQEiiXU/ohz8SDetPICLVCe Aniw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=J6YbZer+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id j10-20020a63550a000000b005bd6784a9fasi7546867pgb.676.2023.11.20.02.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 02:43:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=J6YbZer+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 1DF4080AD952; Mon, 20 Nov 2023 02:43:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233183AbjKTKn2 (ORCPT + 99 others); Mon, 20 Nov 2023 05:43:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233169AbjKTKmz (ORCPT ); Mon, 20 Nov 2023 05:42:55 -0500 Received: from mail.alien8.de (mail.alien8.de [IPv6:2a01:4f9:3051:3f93::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D574D7A for ; Mon, 20 Nov 2023 02:42:38 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id CDCA640E01BB; Mon, 20 Nov 2023 10:42:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=fail (4096-bit key) reason="fail (body has been altered)" header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rW2bzRskiw9H; Mon, 20 Nov 2023 10:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1700476943; bh=8VW8eysMQa0djm7KxcVc0hk/6wK18+5mMT7sLtuADpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J6YbZer+M5FkO4bn0RIg9PcN+Yjh3s844hrgbxqz6puXqQdjBpqQhIkpVggr0Vnyt cKXlVYe6rBAKPez1gdRt31UwV5eWPy1zxo4MEN55IihCAYQLZodXRIusx291aXbdtH FeIMr8sCGgnQO44Mtl+9wDLdkm3QovhX4FviixpYsZlaLy0PtiG7IplyanfjJweHl1 W0ut6GI/7X8KobjRJMvOHA6a0jmGED7mVF9XaJeaX2OzFTIfB06j+ESQYQTk1BsJWQ wVigJgfWcQxsNhwK09TiYpXWV/n74QlrOz1tQxpA+ub0oDH0o9tuWQdfwNV/ydvOQZ xtos10Jf+LHmgCL4CozhobDiRKCUgelrHUnwfSJ0WX4HV4b6TqusEchQWox4jyMmG6 dSQIkTprKRRvbRPOmfL2L2V0qj15hE8tiNFPaj/kelDuiRv3237qNhkuiAR31i3gLn pCTWbAkWDY110pm0vip5xAxkfs/45fQmm9ckF6g7c5FNk4xf89U4qNTmU0Q9BNlEzs LoQFpKWEVSUuZoaHwl/oV+T3oH/Q/p4/lbI5HlXhWMAOyk7P3sNKBmdltLbqKCf7Z/ F2YvxTiU122d99UotKkDkZGgXFPpHlpGZ9RtSsZ6Gb9Ccrho5L+uHal6qKzRYvIQCQ kX3zGIWv+6tDJXD8V3kRgksQ= Received: from zn.tnic (pd95304da.dip0.t-ipconnect.de [217.83.4.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id A97EC40E01AF; Mon, 20 Nov 2023 10:42:21 +0000 (UTC) From: Borislav Petkov To: X86 ML Cc: LKML Subject: [PATCH 06/13] x86/CPU/AMD: Rename init_amd_zn() to init_amd_zen_common() Date: Mon, 20 Nov 2023 11:41:45 +0100 Message-ID: <20231120104152.13740-7-bp@alien8.de> X-Mailer: git-send-email 2.42.0.rc0.25.ga82fb66fed25 In-Reply-To: <20231120104152.13740-1-bp@alien8.de> References: <20231120104152.13740-1-bp@alien8.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 02:43:42 -0800 (PST) From: "Borislav Petkov (AMD)" Call it from all Zen init functions. Signed-off-by: Borislav Petkov (AMD) --- arch/x86/kernel/cpu/amd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index f43a70d495da..8d90f5f6b0d9 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -1017,7 +1017,7 @@ void init_spectral_chicken(struct cpuinfo_x86 *c) #endif } =20 -static void init_amd_zn(struct cpuinfo_x86 *c) +static void init_amd_zen_common(void) { #ifdef CONFIG_NUMA node_reclaim_distance =3D 32; @@ -1026,6 +1026,7 @@ static void init_amd_zn(struct cpuinfo_x86 *c) =20 static void init_amd_zen(struct cpuinfo_x86 *c) { + init_amd_zen_common(); fix_erratum_1386(c); =20 /* Fix up CPUID bits, but only if not virtualised. */ @@ -1035,16 +1036,20 @@ static void init_amd_zen(struct cpuinfo_x86 *c) if (!cpu_has(c, X86_FEATURE_CPB)) set_cpu_cap(c, X86_FEATURE_CPB); } + } =20 static void init_amd_zen2(struct cpuinfo_x86 *c) { + init_amd_zen_common(); init_spectral_chicken(c); fix_erratum_1386(c); } =20 static void init_amd_zen3(struct cpuinfo_x86 *c) { + init_amd_zen_common(); + if (!cpu_has(c, X86_FEATURE_HYPERVISOR)) { /* * Zen3 (Fam19 model < 0x10) parts are not susceptible to @@ -1058,6 +1063,7 @@ static void init_amd_zen3(struct cpuinfo_x86 *c) =20 static void init_amd_zen4(struct cpuinfo_x86 *c) { + init_amd_zen_common(); } =20 static bool cpu_has_zenbleed_microcode(void) @@ -1135,9 +1141,6 @@ static void init_amd(struct cpuinfo_x86 *c) case 0x12: init_amd_ln(c); break; case 0x15: init_amd_bd(c); break; case 0x16: init_amd_jg(c); break; - case 0x17: - fallthrough; - case 0x19: init_amd_zn(c); break; } =20 if (boot_cpu_has(X86_FEATURE_ZEN)) --=20 2.42.0.rc0.25.ga82fb66fed25