Commit 25892521 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Zeng Heng
Browse files

x86: Move gds_ucode_mitigated() declaration to header

mainline inclusion
from mainline-v6.5-rc6
commit eb3515dc
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7XLNT
CVE: CVE-2022-40982

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eb3515dc99c7c85f4170b50838136b2a193f8012



---------------------------

The declaration got placed in the .c file of the caller, but that
causes a warning for the definition:

arch/x86/kernel/cpu/bugs.c:682:6: error: no previous prototype for 'gds_ucode_mitigated' [-Werror=missing-prototypes]

Move it to a header where both sides can observe it instead.

Fixes: 81ac7e5d ("KVM: Add GDS_NO support to KVM")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Tested-by: default avatarDaniel Sneddon <daniel.sneddon@linux.intel.com>
Cc: stable@kernel.org
Link: https://lore.kernel.org/all/20230809130530.1913368-2-arnd%40kernel.org


Signed-off-by: default avatarZeng Heng <zengheng4@huawei.com>
parent a7051ecd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -893,4 +893,6 @@ bool arch_is_platform_page(u64 paddr);
#define arch_is_platform_page arch_is_platform_page
#endif

extern bool gds_ucode_mitigated(void);

#endif /* _ASM_X86_PROCESSOR_H */
+0 −2
Original line number Diff line number Diff line
@@ -314,8 +314,6 @@ EXPORT_SYMBOL_GPL(supported_xcr0);

static struct kmem_cache *x86_emulator_cache;

extern bool gds_ucode_mitigated(void);

/*
 * When called, it means the previous get/set msr reached an invalid msr.
 * Return true if we want to ignore/silent this failed msr access.