Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4502040rdh; Wed, 29 Nov 2023 03:23:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHE9iqxZ/6r7ktzDiNNE1WPn5BCa5ERM2mH1h2P+InMmE2YU2vCtbczcaqLQlsc+AHAfJrF X-Received: by 2002:a05:6a00:3016:b0:6cd:dc2e:a444 with SMTP id ay22-20020a056a00301600b006cddc2ea444mr416104pfb.27.1701256991553; Wed, 29 Nov 2023 03:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701256991; cv=none; d=google.com; s=arc-20160816; b=sDWdQuOBP/afPYYteJrpS/x8S7MtI0ZF0j3AHY9Zup7BqVQ6EA0iuLDzeONwoJ3Ikq 3MKDgQUJg2A/9AVsHHVSxf/QRMVPyCofN5EMGsnwAhmnTaCtjt7fN1G4sKf2fuove+Am tvqhD7jdn26M8MzoGtQ8QpL2MSiT4gq8R1itTGk/TZJ6xzkmqnce6HoEluUL2l3geNX7 /PY7Irp+Pmi1fx4PrsfvW8JhIhOYqVujzbyZIhOn0wGLa92S6/Sa2IizJbNr1mvWT5xn nw+UTmokBFhysx6O3bHodYuFogSHIb9UDpYS+Q61rv7j6iil58wQ5yIZNM78xfcTLZgU VJkQ== 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 header.s=2020e header.b=KtYI+ssI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o3-20020a635d43000000b005c5e22334d9si4084786pgm.267.2023.11.29.03.23.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 03:23:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; 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 header.s=2020e header.b=KtYI+ssI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 39C6E80C65D6; Wed, 29 Nov 2023 03:23:10 -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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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:10 -0800 (PST) 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; }