Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4501720rdh; Wed, 29 Nov 2023 03:22:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHE0rWHRCWfDLdV06PnmJIpsx28WjmFF+eVKxQVGdiF6HHPbsl02q7b9D9wU2/z93+2Xxj X-Received: by 2002:a05:6a20:e113:b0:18c:55b4:df2a with SMTP id kr19-20020a056a20e11300b0018c55b4df2amr14904443pzb.2.1701256953477; Wed, 29 Nov 2023 03:22:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701256953; cv=none; d=google.com; s=arc-20160816; b=IDTKtbs+Ac3e7RSaLJKmFdnTWTBaaaKxLapnLYVo1jnIw0JCvX3Z88NZtvxtSXX5l3 OaBS23LDtEwiQbCRHTMl3wVv7wiCuIVsjmFuu1SyOHyMc1oBtKnPLDYcKChJG3NOvLke 5dkdGklR6fk/Q0lk+ZdjDbg28JSdzhbGlIns7KJga9dQvYO6SG/HpmLM8IykVp103ci8 N/iA9bfrWrlFnpK2HyBHdTAfC890Q8lULs+oQ+Vab2ahWMZct0sTErViXYlvW4Zmm3Cc ErPiCAGyGR/g6WIWLjM69joRiYAbmPlDiFi2s+B3eKEMFzOWCQgnOH/8vvPph7HmrrMk zOeg== 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=ycDmQyS/ZUYSu95nNY8Gky809ktQ/s5nNewRtZsfpwk=; fh=UD1ZRCSS/l4PYbuMk1gSsIJwAKOC33PKfkYvw4GUlo4=; b=Yt5bfcSvPxQdxzB6vjE50grTJ7/aO7EATqlljo88BqA4QzsoUxbaMAXo8ffJ6j3ycJ hTQaqgzujoOvUjINIRQgj8sYjJcCgh1D9ZwZC+q3jbcbDv2dGGHiVH/aSbzXdnen4CP2 +K5e0dAbF3Jm1VWq0uye/iZem2o3VlB+7IkUmQGToqFI8b4/xMEhsuJpS08U4UzTeNJK eTnR1+73HlA+INpQJwS+Ln115kfU93Qtl3+n04siFElwJ3asI/QxVZrSweae2G6PaUVs fBswrN5AIk+Iy42BouovvttTn1eyuMS0naHXQFv6NWcZHzO0sK8vzUOyT6Twvnxzc4F6 OKqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bD0lF3r7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=GlpnFQ1Z; 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 o18-20020a056a0015d200b006cb537d7b47si14738860pfu.309.2023.11.29.03.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 03:22:33 -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=bD0lF3r7; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=GlpnFQ1Z; 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 62B6C8040EE9; Wed, 29 Nov 2023 03:22:32 -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 S231797AbjK2LWW (ORCPT + 99 others); Wed, 29 Nov 2023 06:22:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231634AbjK2LWV (ORCPT ); Wed, 29 Nov 2023 06:22:21 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D7BFDA; Wed, 29 Nov 2023 03:22:27 -0800 (PST) Date: Wed, 29 Nov 2023 11:22:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701256945; 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=ycDmQyS/ZUYSu95nNY8Gky809ktQ/s5nNewRtZsfpwk=; b=bD0lF3r7X2mKAaQ9Rr9iJCXTYnUyrCBzNEcTMBtdP5evUpqxyFPrauhKsObWjFXbvwmb3b ePqi2KDu8eSS1cEfus5I8XfFED+4hBLMvzq7szSx9kSM5FAOT78prWFil2vTl9lx2dzVw1 6gv4JDA8xZ9ajIwEnWZXb5yqg6zILKgHiu4BCOJzvfWF+hcUlu0wURg0NBc2Ug90tfolZk Y6ykBLtXzZF0RMeeU30HljfnIFR3SqprUoiAD/7SFHui+/APm+31k9mG2fx5V40vD9eiGb BdV/tlk7aGk8R8v95cGiP9xSQk/U5Akx7RxeJiXc3zKiKZUI0lip2FhfrQ7RuA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701256945; 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=ycDmQyS/ZUYSu95nNY8Gky809ktQ/s5nNewRtZsfpwk=; b=GlpnFQ1ZgwU4Spwf/j6JI+zO56HX+A6nQ40lzTPEkVZPTPLmEAYZIuBPZTdIRV+MTmo0jX XGig4eNdIg1MIpDw== 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: Drop now unused CPU erratum checking function Cc: "Borislav Petkov (AMD)" , Nikolay Borisov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231120104152.13740-14-bp@alien8.de> References: <20231120104152.13740-14-bp@alien8.de> MIME-Version: 1.0 Message-ID: <170125694499.398.14869637705569913920.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=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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:22:32 -0800 (PST) The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 05f5f73936fa4c1bc0a852702edf53789398d278 Gitweb: https://git.kernel.org/tip/05f5f73936fa4c1bc0a852702edf53789398d278 Author: Borislav Petkov (AMD) AuthorDate: Fri, 03 Nov 2023 23:40:48 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 29 Nov 2023 12:13:53 +01:00 x86/CPU/AMD: Drop now unused CPU erratum checking function Bye bye. Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Nikolay Borisov Link: http://lore.kernel.org/r/20231120104152.13740-14-bp@alien8.de --- arch/x86/kernel/cpu/amd.c | 56 +-------------------------------------- 1 file changed, 56 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index f8be7ac..89bbb1a 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -34,62 +34,6 @@ */ static u32 nodes_per_socket = 1; -/* - * AMD errata checking - * - * Errata are defined as arrays of ints using the AMD_LEGACY_ERRATUM() or - * AMD_OSVW_ERRATUM() macros. The latter is intended for newer errata that - * have an OSVW id assigned, which it takes as first argument. Both take a - * variable number of family-specific model-stepping ranges created by - * AMD_MODEL_RANGE(). - * - * Example: - * - * const int amd_erratum_319[] = - * AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0x4, 0x2), - * AMD_MODEL_RANGE(0x10, 0x8, 0x0, 0x8, 0x0), - * AMD_MODEL_RANGE(0x10, 0x9, 0x0, 0x9, 0x0)); - */ - -#define AMD_LEGACY_ERRATUM(...) { -1, __VA_ARGS__, 0 } -#define AMD_OSVW_ERRATUM(osvw_id, ...) { osvw_id, __VA_ARGS__, 0 } -#define AMD_MODEL_RANGE(f, m_start, s_start, m_end, s_end) \ - ((f << 24) | (m_start << 16) | (s_start << 12) | (m_end << 4) | (s_end)) -#define AMD_MODEL_RANGE_FAMILY(range) (((range) >> 24) & 0xff) -#define AMD_MODEL_RANGE_START(range) (((range) >> 12) & 0xfff) -#define AMD_MODEL_RANGE_END(range) ((range) & 0xfff) - -static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum) -{ - int osvw_id = *erratum++; - u32 range; - u32 ms; - - if (osvw_id >= 0 && osvw_id < 65536 && - cpu_has(cpu, X86_FEATURE_OSVW)) { - u64 osvw_len; - - rdmsrl(MSR_AMD64_OSVW_ID_LENGTH, osvw_len); - if (osvw_id < osvw_len) { - u64 osvw_bits; - - rdmsrl(MSR_AMD64_OSVW_STATUS + (osvw_id >> 6), - osvw_bits); - return osvw_bits & (1ULL << (osvw_id & 0x3f)); - } - } - - /* OSVW unavailable or ID unknown, match family-model-stepping range */ - ms = (cpu->x86_model << 4) | cpu->x86_stepping; - while ((range = *erratum++)) - if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) && - (ms >= AMD_MODEL_RANGE_START(range)) && - (ms <= AMD_MODEL_RANGE_END(range))) - return true; - - return false; -} - static inline int rdmsrl_amd_safe(unsigned msr, unsigned long long *p) { u32 gprs[8] = { 0 };