Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2124727rdb; Mon, 20 Nov 2023 02:43:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnClDukqC5neiZXy2gcVuKBEEPN8epdD1IUzDUKazhZOs+CgwDoH2e5YJrQZGxblhf3c8R X-Received: by 2002:a05:6a00:2391:b0:6c3:74d6:595a with SMTP id f17-20020a056a00239100b006c374d6595amr6047256pfc.13.1700476993443; Mon, 20 Nov 2023 02:43:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700476993; cv=none; d=google.com; s=arc-20160816; b=dkyfl+mb7J5tDfnHi2dGvit6GvIPkIA6ecHfrphO7e7NKyA1TTFvZLQXC9K+kYGxEc ss2Wlvlgi+7SP+FTOOl4FMGJEyYDuXGMjNQl5PCyrbvj882ImIBH+sWZzt3vw9VAWE0g DYIi7L3SxEar2C0WO/LSNtnabwTeuAKC/x2c+4wz5N+j3Kay3r6bmvLu2hC2jk9exNK/ OH9HsG1J3WcfOq3p8H80l9ijxET8PN0YhTnhVqRCq6O14Y3YJdCDmR6KQpeik3jAo9g3 f+AJGDiJDW4DqyF5odHeLVWJHdGJEWZDLa+TVlKFKxm1G5bX+qAnRyQO5knSPj2C9vpD ZiWw== 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=l1nIdAEZdHL3F+eJVPsdEqc3ItXpnRUgVSuHeUUAucQ=; fh=yRofEPOsMYSFYi/7/f3tXB782BWAy0107oR1j5aafGk=; b=xhz+wkhbC0PACEAislLu0PnBRQG/w4hRovFi1dQiMs9l5POUOcQa5PEdRPFU2H+F+g OJC7l580cahrXUEenMEfOYjukJ+ix41DOasOf+L9S99bda7rmdI1+pLEjj4i5jtfCHU0 Y6lOLSMiz9pdBb/aKtatBGib++WATOmaUWiEWlw/7BwFt2Ml8qt50URQ3r3dvg0xMlPv tMisfuypB5zKetrP/oWEdwwsR2Zo6B8rg4s19yppmylI5yUTjWUMwVDbtYRv/EKbOslo P44s3yUJgs4Yio2w0+V7DkMKnZrLdCmrg09vMmk6JFNlzxN+2ZGdhxGmU7UAikx7UJcN tOcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=dyMvxKwq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id 195-20020a6302cc000000b005b8eb9d7ff1si7802840pgc.762.2023.11.20.02.43.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 02:43:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@alien8.de header.s=alien8 header.b=dyMvxKwq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 587A480B1F99; Mon, 20 Nov 2023 02:43:03 -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 S233110AbjKTKmg (ORCPT + 99 others); Mon, 20 Nov 2023 05:42:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233200AbjKTKm2 (ORCPT ); Mon, 20 Nov 2023 05:42:28 -0500 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73FD3C5 for ; Mon, 20 Nov 2023 02:42:24 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id ACD9340E01A4; Mon, 20 Nov 2023 10:42:22 +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 KxakAPnY9eKD; Mon, 20 Nov 2023 10:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1700476940; bh=Ak+9T+Upn9tPqHpt7fwMUcIjPgnr6VqaxzGs8MwZUrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dyMvxKwqFiKuRmklu5eZT5TFr2VTiFJdgHnlCBvFowIn9DDapnd57dV3yYhcDlzVI 5kqa90ZBRtBKcgXM2kt6+XJIp8ydcz25ERNVXmHxpITq4qc3xMY8qeDGITwmmuXVcR G0gAqkyoIlBrlqqt5C+83vJbR/mTG/h/7gD1KldYUEdgFmuhhhB0GiUWNm+jhBykl9 4RAisLkfEWjhgfyhdvtR2Lmr+0NS3vSKjbbjml9tjbVN41A4BYXykT4fWknfWwQOrO 92+33eTGAU4Pqg7UN0FeVTIPmyRmUcdHIUvJRyPPxX+VNHlnDzkQ3SBqkhm7U1MuBV GeCsN4bE3B6HP3hvDuE4fZRrRKCjfTYKbtI4v6VOqQUtgyNyowxKFReGIXGSMjhCpy NhyS/IoxJjMUmVT5yrCxNiDDo42WfjMfMybnoEghEmFtXTnzrG+ChViL1LP8ZgUM+p CMATVR0jugzSAFRsdbFXbs4t8B86n/jCQfNSobuAqs36dbGRIP5U9pgAdF5yJSCthj t191OMF6Nes6KwbulI1xRY2CLr0s4mSjpUD4WDXNmsKjYj0ws+W/cmHBBqpuJ4Xrdv b3QqPOQuj8+1aohYyID0RoobnL4gWBJaZh2GSOW5WUdZ2pBWMyoGXrTAOaGRPOMea3 Ep7APjk59w/aYT57VcRArH9Y= 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 600AD40E0031; Mon, 20 Nov 2023 10:42:18 +0000 (UTC) From: Borislav Petkov To: X86 ML Cc: LKML Subject: [PATCH 05/13] x86/CPU/AMD: Call the spectral chicken in the Zen2 init function Date: Mon, 20 Nov 2023 11:41:44 +0100 Message-ID: <20231120104152.13740-6-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:03 -0800 (PST) From: "Borislav Petkov (AMD)" No functional change. Signed-off-by: Borislav Petkov (AMD) --- arch/x86/kernel/cpu/amd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 6d87c43e4ee9..f43a70d495da 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -1007,10 +1007,8 @@ void init_spectral_chicken(struct cpuinfo_x86 *c) * * This suppresses speculation from the middle of a basic block, i.e. i= t * suppresses non-branch predictions. - * - * We use STIBP as a heuristic to filter out Zen2 from the rest of F17H */ - if (!cpu_has(c, X86_FEATURE_HYPERVISOR) && cpu_has(c, X86_FEATURE_AMD_S= TIBP)) { + if (!cpu_has(c, X86_FEATURE_HYPERVISOR)) { if (!rdmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, &value)) { value |=3D MSR_ZEN2_SPECTRAL_CHICKEN_BIT; wrmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, value); @@ -1041,6 +1039,7 @@ static void init_amd_zen(struct cpuinfo_x86 *c) =20 static void init_amd_zen2(struct cpuinfo_x86 *c) { + init_spectral_chicken(c); fix_erratum_1386(c); } =20 @@ -1136,7 +1135,7 @@ 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: init_spectral_chicken(c); + case 0x17: fallthrough; case 0x19: init_amd_zn(c); break; } --=20 2.42.0.rc0.25.ga82fb66fed25