From patchwork Sun Mar 12 20:47:36 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: 68578 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp873656wrd; Sun, 12 Mar 2023 14:02:46 -0700 (PDT) X-Google-Smtp-Source: AK7set9w1a2u0gOpUxy1COzFVK3VzqQ+6Tpgzday0fFPypbMEfBl2OcRBnIHEnXFUK+s5SiKpCGp X-Received: by 2002:a62:3042:0:b0:5a8:31a1:2f05 with SMTP id w63-20020a623042000000b005a831a12f05mr27020117pfw.5.1678654965979; Sun, 12 Mar 2023 14:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678654965; cv=none; d=google.com; s=arc-20160816; b=oJ3jClt4y02297ZcYsBJn1OZwbZ/fr95I2kw0Bw5kurT56G8RvIl7dLeukFKCYmIJl svdODmOZKbV8yQKgtnIy04xCdG/T8yZHGxKvVXxNfiXUf3ttPBNYo/lotagvxTX/w6Ev 8NKc6VjMLrte/pkW1llYZkVMVvtHjmeO3YGfWwJ92fenaQtf6uHN47m+6bViMdNBs/It v9EQdExn1KgyQ0Tv3eWkK98MAVnosXf+2kED4LrVMmX8li7l4mPsvondKuEngSFJKnHX AVu1Vbfi9nf4NUH7GM0RyBnYGqmdQ/4Zx4RMq4R2dWT4MuOSiD/Q9UkggS0nlSU9pvTi KyiA== 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=WmDYs33+VDMIv1F2Mo+7be4m4EhaoKcu+WQiAIsIjEQ=; b=jInF22R2n9deMY8rl/7KwBqPV5xRlD8pL+f9hFY89uPwsZkfw/fxYMb+mRoRG7A3Uc 8qT8ZdYWwpnTWC7t/TE9SoRIUVdqWBRilkDTj8Ji4wapICen94dZBWvKMqeqxJaSkxov qp6h/2ox1Kk8mOK5EgSt7rAZZHkuLmbZJmguUlD5sSGwmXqR3uYFvMqJb29l6+9sdsSS 4xDnsPxCa0BrHiyhdTYF4epj2fztIF0sjvOVShnMnL6kBnRGApIC11bLUh2LchnqcHXA U5IHhslF41zLytOUC02BeyfXVAEKDW1sRHs0PnBoYD+p9sepeKHtsJD0wWzyCJqDGIZW LM9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SdCOnOhq; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 202-20020a6301d3000000b00509bd53cd61si2692912pgb.230.2023.03.12.14.02.31; Sun, 12 Mar 2023 14:02:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SdCOnOhq; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230336AbjCLUrm (ORCPT + 99 others); Sun, 12 Mar 2023 16:47:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjCLUrj (ORCPT ); Sun, 12 Mar 2023 16:47:39 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 723C12D4D; Sun, 12 Mar 2023 13:47:38 -0700 (PDT) Date: Sun, 12 Mar 2023 20:47:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1678654056; 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=WmDYs33+VDMIv1F2Mo+7be4m4EhaoKcu+WQiAIsIjEQ=; b=SdCOnOhqbgIqbng3JzNS3oilYUS3u+szQG3od6asYq3RLQGdPIxJqzqDyL1Uz1vuB6GTwN PebQnfLISjOcSUjyZ9sS6biohn2+Sbq/ycWkchwEMU4UPIVGSyoP7W4WZJYm8/NDtwnD1j dDwqgTlEj8Oac+xEgSCSfySXrGRu/X0ndwkX1gDu0c7AuWxm5ohFntt9F5+xiWLxJnHbEs A9ChplF6n9HIoAca+li9WRjBmLsEaCFffyL6yCJd6P4OGQwkE4ElnLOvZeztmJwN/XJr+b vMzdCYUDpxpz89weR5mtrcdJ1Rt+dc1UA+HNA4sraa88HZLGrn9xD0SvKkXFNQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1678654056; 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=WmDYs33+VDMIv1F2Mo+7be4m4EhaoKcu+WQiAIsIjEQ=; b=7NwMpEXknhVoKmKYkmBpgAdbPe36ronJY1PGWneUq9aKO43ZTu/zcMrpEIdlSAbul1h589 7zSxbL2BlA3qmxBg== 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/microcode] x86/microcode: Do not taint when late loading on AMD Cc: "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230303114649.18552-1-bp@alien8.de> References: <20230303114649.18552-1-bp@alien8.de> MIME-Version: 1.0 Message-ID: <167865405614.5837.13144930108431641081.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759348138540759732?= X-GMAIL-MSGID: =?utf-8?q?1760197309642490939?= The following commit has been merged into the x86/microcode branch of tip: Commit-ID: 09b951476df9eadf15f2acba7568fa35e4b2313b Gitweb: https://git.kernel.org/tip/09b951476df9eadf15f2acba7568fa35e4b2313b Author: Borislav Petkov (AMD) AuthorDate: Fri, 03 Mar 2023 12:46:49 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Sun, 12 Mar 2023 21:32:51 +01:00 x86/microcode: Do not taint when late loading on AMD Describe why the concurrency issues which late loading poses are not affecting AMD hardware, after discussing it with hw folks. Thus, do not taint when late loading on it. Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230303114649.18552-1-bp@alien8.de --- Documentation/x86/microcode.rst | 10 ++++++++++ arch/x86/kernel/cpu/microcode/core.c | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Documentation/x86/microcode.rst b/Documentation/x86/microcode.rst index b627c6f..15b52e2 100644 --- a/Documentation/x86/microcode.rst +++ b/Documentation/x86/microcode.rst @@ -208,6 +208,16 @@ Basically there is no way to declare a new microcode update suitable for late-loading. This is another one of the problems that caused late loading to be not enabled by default. +AMD +--- + +Late loading on AMD does not have the concurrency issues described +above: when loading is attempted on T0, the T1 is quiesced and does not +execute instructions. Therefore, even if a higher priority interrupt or +a fault happens, the whole core will see it either before the microcode +patch has been applied or after. In either case, T0 and T1 will have the +same microcode revision and nothing intermediate. + Builtin microcode ================= diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index 7a329e5..779f705 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -498,7 +498,8 @@ put: if (ret == 0) ret = size; - add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK); + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) + add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK); return ret; }