Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2470003rwo; Thu, 3 Aug 2023 09:48:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAkNPg0JxpqrpigC7Pev8hYmOW6/vTKGTT6PSnAlC3+enaMTZEZsscBmBeTYu2Gif/pQY1 X-Received: by 2002:a05:6a00:178e:b0:687:82f9:3d8d with SMTP id s14-20020a056a00178e00b0068782f93d8dmr4788489pfg.2.1691081313922; Thu, 03 Aug 2023 09:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691081313; cv=none; d=google.com; s=arc-20160816; b=MkfNJDOnAlrls0NlxiIViK2ZTiGI99eQCod8Nk74AQDdVZTOD1k5Hkpiw+ua1isb2O phTn5HtXBb7/YB6u6PWxhKSFzaG70JXQWFi/kklRRYeoi99qBmtRQh2slcsNpu4TWTXk fJ82bCtxSnXf5NyBTjjEYgE1zPkIDIDY+JGEb2HqP1yNaMfLcqxLGEve05ebfeDZOWHV hwN3p8RSDio/TEj0YYdOq51qEpy/L6BkvB81ucnVQP5Cl/YRmMD7vT6yQ0dLb+DHP4r5 u/qteUUAT0Xgg1vn9suMUqnzvY7o+4aXHtVMjHZigz78s6Mco7pX1XBY+1as7qnLUVvh wnRQ== 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=eTChyiFhvIi4JIl1UodawWAFP422YBkqPUZjcTiWnRQ=; fh=GmswEOGbKr3VXwADkGMdbYvANKaeXXy9MxNXblyNAM0=; b=zgJJhZo3dhdG4X8T+CUZvXq3FvvI9YMI0FCrRjfeA2iKFJ5v6zsiiYXngmC5jtMPV1 7XYU1BovhnhrrbZfvZVg1+UzwID8ybut8/j64n01yXKcH0yuLDqSQpdoHOGylAYVxBQp 4ej6g5fz+jtIXuIxjaGu1g09/+RITGMAp+eiFhHaZXMwRxHwvn3Wg/Ym27X8Dc0McwsE jjd3R93pA9k5IMYlfj0IAGXXR7FIz02Gg3WmLLXCsOa7uWpc9eOuc8ODtaWcb5iwrO/a WfEQTgBMQGmUdqfmiOSwGmPr62b/U8XZzMsfd12tBoaWrzjU08RFiOjv5z4IXVtCZDM9 +q5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="mEtG/rtD"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q8-20020a656848000000b0055adfd71daesi147402pgt.663.2023.08.03.09.48.21; Thu, 03 Aug 2023 09:48:33 -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="mEtG/rtD"; 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 S235549AbjHCP7g (ORCPT + 99 others); Thu, 3 Aug 2023 11:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237276AbjHCP7U (ORCPT ); Thu, 3 Aug 2023 11:59:20 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AAEF211B; Thu, 3 Aug 2023 08:59:18 -0700 (PDT) Date: Thu, 03 Aug 2023 15:59:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691078356; 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=eTChyiFhvIi4JIl1UodawWAFP422YBkqPUZjcTiWnRQ=; b=mEtG/rtDo/OBInzajt2mngeLe+8/pjFaAOxIo5Zp/N+jKIsm9ZauzMw5Sr0dt+K/m6FiiF z53O1KDp2+TttsDv5MjRnhb3vgUUBmuJh43vEjsOYHTThWOg0tdB1j6lvWwWz8PMDEdnwd e0EscLecnlEdK5Pdx3qCSAMCO5v7a7G8zyx9dZlPnld8zFat5GIsz9k/984v6L62lC0Wxc Gn009ZgiQZW409zGkIcZ3kA8nCNA4l3ea2M74mU/ICEzw0y0+xpalv+uIhp7AqTAWk/WMw mI7YaDWzb7HSqE3T9TcmuLhZSuiXVW9tynnRuyn8GYesVQjYnRAnhHf/U7KJpA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691078356; 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=eTChyiFhvIi4JIl1UodawWAFP422YBkqPUZjcTiWnRQ=; b=ggXJJUhgVsZBl73vnO/8+g2PFQ/ftKnxSM6z44MyE+hu1Y7OrtEZwRobHYSj9k2prZ1eoZ kJ2wgTVpiujXujCw== From: "tip-bot2 for Arnd Bergmann" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cleanups] x86/cpu: Fix amd_check_microcode() declaration Cc: Arnd Bergmann , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230725121751.2007665-1-arnd@kernel.org> References: <20230725121751.2007665-1-arnd@kernel.org> MIME-Version: 1.0 Message-ID: <169107835629.28540.8472266349964382413.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 The following commit has been merged into the x86/cleanups branch of tip: Commit-ID: 566ffa3ae9649f7aa1debcf559ee7e26ed4a110f Gitweb: https://git.kernel.org/tip/566ffa3ae9649f7aa1debcf559ee7e26ed4a110f Author: Arnd Bergmann AuthorDate: Tue, 25 Jul 2023 14:17:39 +02:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 31 Jul 2023 11:03:16 +02:00 x86/cpu: Fix amd_check_microcode() declaration The newly added amd_check_microcode() function has two conflicting definitions if CONFIG_CPU_SUP_AMD is enabled and CONFIG_MICROCODE_AMD is disabled. Since the header with the stub definition is not included in cpu/amd.c, this only causes a -Wmissing-prototype warning with W=1: arch/x86/kernel/cpu/amd.c:1289:6: error: no previous prototype for 'amd_check_microcode' [-Werror=missing-prototypes] Adding the missing #include shows the other problem: arch/x86/kernel/cpu/amd.c:1290:6: error: redefinition of 'amd_check_microcode' arch/x86/include/asm/microcode_amd.h:58:20: note: previous definition of 'amd_check_microcode' with type 'void(void)' Move the declaration into a more appropriate header that is already included, with the #ifdef check changed to match the definition's. Fixes: 522b1d69219d8 ("x86/cpu/amd: Add a Zenbleed fix") Signed-off-by: Arnd Bergmann Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230725121751.2007665-1-arnd@kernel.org --- arch/x86/include/asm/microcode_amd.h | 3 +-- arch/x86/include/asm/processor.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/microcode_amd.h b/arch/x86/include/asm/microcode_amd.h index 9675c62..2ed09a1 100644 --- a/arch/x86/include/asm/microcode_amd.h +++ b/arch/x86/include/asm/microcode_amd.h @@ -48,13 +48,12 @@ extern void __init load_ucode_amd_bsp(unsigned int family); extern void load_ucode_amd_ap(unsigned int family); extern int __init save_microcode_in_initrd_amd(unsigned int family); void reload_ucode_amd(unsigned int cpu); -extern void amd_check_microcode(void); #else static inline void __init load_ucode_amd_bsp(unsigned int family) {} static inline void load_ucode_amd_ap(unsigned int family) {} static inline int __init save_microcode_in_initrd_amd(unsigned int family) { return -EINVAL; } static inline void reload_ucode_amd(unsigned int cpu) {} -static inline void amd_check_microcode(void) {} #endif + #endif /* _ASM_X86_MICROCODE_AMD_H */ diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index d46300e..36d5207 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -682,9 +682,11 @@ extern u16 get_llc_id(unsigned int cpu); #ifdef CONFIG_CPU_SUP_AMD extern u32 amd_get_nodes_per_socket(void); extern u32 amd_get_highest_perf(void); +extern void amd_check_microcode(void); #else static inline u32 amd_get_nodes_per_socket(void) { return 0; } static inline u32 amd_get_highest_perf(void) { return 0; } +static inline void amd_check_microcode(void) { } #endif extern unsigned long arch_align_stack(unsigned long sp);