From patchwork Wed Nov 29 11:22:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 171274 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp267798vqn; Wed, 29 Nov 2023 03:23:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrI4X0G1OVLhaIlXAtWyleT/OKiFF+PqvbRXLECcmE5jfJIj9kNsQ0A9JLqD3sFsFwCXt9 X-Received: by 2002:a05:6a00:1acb:b0:6c6:9c3b:f0ed with SMTP id f11-20020a056a001acb00b006c69c3bf0edmr22064218pfv.7.1701256989947; Wed, 29 Nov 2023 03:23:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701256989; cv=none; d=google.com; s=arc-20160816; b=IRnWNLBrUqdleRmPUEO3VbrDSeuuzO78NTDhKgwpKJOPM3V/zBQjyknbSvv/PGciyZ N3wQ2VEqMUiAIl3AvIvfTdFtjY89Uhvj6FREE1znVtlQpMjrtFv5xVsEZ2RhvUv1a7Df KjDb8buup/5EcDP8l6rLBR0JS7aAb2wW5snDLEuPEsK6Bvv9QDfy9ILeiZ4qwDVSPvUY oQtfs2RZQKepPmSzoxk+pnbKSAo6wKMuL7fwbswNiN8bQjq4kCYVw6iBEMfm7rFCQKKY N2Op1I33iimrgsnGuV4TSVCCdrM2C/9Owx6CItDen0DjeR2oYiaNdzwJc8dAGW5DOaDd 7O/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=HP6IetWerb4+s0lyyeErZdEKVor8JXULEZZsowb3yMw=; fh=UD1ZRCSS/l4PYbuMk1gSsIJwAKOC33PKfkYvw4GUlo4=; b=oMv5+Xb68CsmMk+PzaoWutbRPxvs/V5pyE6kDizec+rXhgBoadcA8B/2mM4XfOG852 Yu6e6JjdtPtJtoWcpLe/i+FRJ63YiHD7J2F5JpTCqP7K9pu1SK70VXxCHYwTBphdZvdH UVzdjhTxbZoitfFUtl9OkKilCMwGB/PJZ6P3CtrcsH576hvi2mobitm5hjJqWJkPcgiW QeCLlJt4hJiqqtgTfqQ5u117aPaXXpePChT7pfOeaJX/wV71E5HLWy1kTrjJYUwfxTXc S6cCVFm87pbyMvW9Pe4Y+6AqN+Kp+hZrP5YnnT2mj/V7hNznhGaxLGZX9umgABteWknv NCJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ia72P5Py; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id f21-20020a63dc55000000b005c6184158d7si15126pgj.772.2023.11.29.03.23.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 03:23:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ia72P5Py; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2DD4C8031E36; Wed, 29 Nov 2023 03:23:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233019AbjK2LWv (ORCPT + 99 others); Wed, 29 Nov 2023 06:22:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231797AbjK2LW0 (ORCPT ); Wed, 29 Nov 2023 06:22:26 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAE3810EA; Wed, 29 Nov 2023 03:22:32 -0800 (PST) Date: Wed, 29 Nov 2023 11:22:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701256951; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HP6IetWerb4+s0lyyeErZdEKVor8JXULEZZsowb3yMw=; b=ia72P5Py7AFe2crsrm8OGsAhFhHwuQJ6zy/YYqcqHHTZrnB2Aox5fE2Iq7Zyu9RIpA7F/8 YZKwX2RC1rpa1hr4rScmNo/Qe8VLFrFpMg0MwstL7UMxsE7R5rz7+0NDxRsFqWRyuT7dCT RQnGRlspUbFXrZ1OvQQi0kn6sxz/Kg2t04M65mMMBJgxZuNp96joRPC6rootf1rWf9Ah2b Kl8Re+76cUcVQzHelLk4zBKT9yWSFpCva/8qttRfoBFvKn58NNqoqbgdbW6U366A+npD+L W/o9HzFZc7RgNuGtXuq21HCiOzkHMeT90+pZrjMRYyQ9wi0l2BgEUJfpAVC07w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701256951; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HP6IetWerb4+s0lyyeErZdEKVor8JXULEZZsowb3yMw=; b=KtYI+ssIeavASL4MpznGdGJsPw+d3YP548Rnl9znnXOYWTV/FMOFHwWrx3y/NrYdKxxzMc NxubNC3M/jlNybAw== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/CPU/AMD: Call the spectral chicken in the Zen2 init function Cc: "Borislav Petkov (AMD)" , Nikolay Borisov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231120104152.13740-6-bp@alien8.de> References: <20231120104152.13740-6-bp@alien8.de> MIME-Version: 1.0 Message-ID: <170125695080.398.11018191952633732992.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 29 Nov 2023 03:23:08 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783079387060531166 X-GMAIL-MSGID: 1783897249326335512 The following commit has been merged into the x86/cpu branch of tip: Commit-ID: cfbf4f992bfce1fa9f2f347a79cbbea0368e7971 Gitweb: https://git.kernel.org/tip/cfbf4f992bfce1fa9f2f347a79cbbea0368e7971 Author: Borislav Petkov (AMD) AuthorDate: Wed, 01 Nov 2023 11:20:01 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 29 Nov 2023 12:12:20 +01:00 x86/CPU/AMD: Call the spectral chicken in the Zen2 init function No functional change. Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Nikolay Borisov Link: http://lore.kernel.org/r/20231120104152.13740-6-bp@alien8.de --- 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 ebe6be8..82747b6 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. it * 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_STIBP)) { + if (!cpu_has(c, X86_FEATURE_HYPERVISOR)) { if (!rdmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, &value)) { value |= MSR_ZEN2_SPECTRAL_CHICKEN_BIT; wrmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, value); @@ -1081,6 +1079,7 @@ static void zenbleed_check(struct cpuinfo_x86 *c) static void init_amd_zen2(struct cpuinfo_x86 *c) { + init_spectral_chicken(c); fix_erratum_1386(c); } @@ -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; }