From patchwork Fri Oct 28 14:26:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 12346 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp864201wru; Fri, 28 Oct 2022 07:30:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4NE69k4GQqSVvQI24mHFsGlnnptntuhyxmRugPEvqRQXHRVTV6WprGwphcDljd1flpYY3t X-Received: by 2002:a17:903:183:b0:184:5b9a:24e7 with SMTP id z3-20020a170903018300b001845b9a24e7mr55986899plg.79.1666967437372; Fri, 28 Oct 2022 07:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666967437; cv=none; d=google.com; s=arc-20160816; b=RCejkqMyesJjod1ScMMEqs2sExsrfFCWhyInDhdwgoHb0xV/nfgExmfifdg7Frlaes 381+LnCWX1PqGIDHe3fyEMGwaJJJxqTJ4RF2IXqSYbnuMgzKJT0jX1PVSzO/TSqHgQQ5 a3mx843zG73pgqxp6Lj6fMAxAC+7zrfmUBg2T34FHPYBXpUxo5OhsUph0nguv3um1UT6 EGjAWJvjersqklEXOUlZOpIWgwePCpezg6pxkDKnxm9zQ1mly2zNxnHyCovYgRFikPiB 1A2a9G3/0iaJj7u86YbQokHEUd5H0lY4kCxyBNCgGZCetOhPqRNcMW1RoRv+80DhMQvf 44dQ== 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=EUzepTEbA+PjW41liMbq12+QwoMLZTumivAWH3EYXPA=; b=n2ZQnS90sWw5SZzSMt8aokobQmWwJ40B3S0QOf+NVHb/yreud+UigHCx/K1Cyfo2G+ Mt+kqutgVYgKi3kwmQLrYKog9XLFg4CO3xhM84x4U6k7JGpL0bo7s5W0fjPp9F2IAvXR fpII0NbvwGvh7fNZ1f9NjBeN8J+pvGluGRwXZMi5hQNggyFQiQKOUNhQFt7M7xA91cgb SlAtFyHfxxzCXu8NafGkbDsX3L7T85gtBMN6hjtmtGLrkCLXUzObD0uWpdDdm/AWL74H vSSyD8SlnM459PV5jrvNA0FK7Y+xfCv7OmXwlPIOWCYj8NMaOOF91HHRiu6XROcObQYS A8zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=OTIjjUkT; 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=NONE dis=NONE) header.from=alien8.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 127-20020a630285000000b0046f5ffc935asi4622006pgc.413.2022.10.28.07.30.22; Fri, 28 Oct 2022 07:30:37 -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=@alien8.de header.s=dkim header.b=OTIjjUkT; 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=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231196AbiJ1O2M (ORCPT + 99 others); Fri, 28 Oct 2022 10:28:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbiJ1O1X (ORCPT ); Fri, 28 Oct 2022 10:27:23 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD2508286B for ; Fri, 28 Oct 2022 07:26:50 -0700 (PDT) Received: from zn.tnic (p200300ea9733e7ce329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7ce:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 423DE1EC0779; Fri, 28 Oct 2022 16:26:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1666967208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EUzepTEbA+PjW41liMbq12+QwoMLZTumivAWH3EYXPA=; b=OTIjjUkTU+7DslvPHPJVlMGazN5sWoqfKdrHoNrgcBCLSxHeModOVgvfhpbAubQ+CLoG0x uTUQxU6GhEj0viKoKlZU9bejAcl4Ss3sYOZt6hRBtN4+IPqPuT4od0ut+lhapaIFDPsWhF civAaisHtMdTJS0rT+9WKGxvd7WTduc= From: Borislav Petkov To: Ashok Raj Cc: X86 ML , LKML Subject: [PATCH 5/5] x86/microcode: Drop struct ucode_cpu_info.valid Date: Fri, 28 Oct 2022 16:26:38 +0200 Message-Id: <20221028142638.28498-6-bp@alien8.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221028142638.28498-1-bp@alien8.de> References: <20221028142638.28498-1-bp@alien8.de> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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?1747942047994013025?= X-GMAIL-MSGID: =?utf-8?q?1747942047994013025?= From: Borislav Petkov It is not needed anymore. Signed-off-by: Borislav Petkov Reviewed-by: Ashok Raj --- arch/x86/include/asm/microcode.h | 1 - arch/x86/kernel/cpu/intel.c | 1 - arch/x86/kernel/cpu/microcode/core.c | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h index d4c36fbd1d39..d5a58bde091c 100644 --- a/arch/x86/include/asm/microcode.h +++ b/arch/x86/include/asm/microcode.h @@ -49,7 +49,6 @@ struct microcode_ops { struct ucode_cpu_info { struct cpu_signature cpu_sig; - int valid; void *mc; }; extern struct ucode_cpu_info ucode_cpu_info[]; diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 2d7ea5480ec3..beb8ca596784 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -210,7 +210,6 @@ int intel_cpu_collect_info(struct ucode_cpu_info *uci) csig.rev = intel_get_microcode_revision(); uci->cpu_sig = csig; - uci->valid = 1; return 0; } diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index ffb249c29f30..712aafff96e0 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -554,9 +554,9 @@ void microcode_bsp_resume(void) int cpu = smp_processor_id(); struct ucode_cpu_info *uci = ucode_cpu_info + cpu; - if (uci->valid && uci->mc) + if (uci->mc) microcode_ops->apply_microcode(cpu); - else if (!uci->mc) + else reload_early_microcode(); }