Skip to content

Commit 97efd28

Browse files
committed
Merge tag 'x86-cleanups-2023-08-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull misc x86 cleanups from Ingo Molnar: "The following commit deserves special mention: 22dc02f Revert "sched/fair: Move unused stub functions to header" This is in x86/cleanups, because the revert is a re-application of a number of cleanups that got removed inadvertedly" [ This also effectively undoes the amd_check_microcode() microcode declaration change I had done in my microcode loader merge in commit 42a7f6e ("Merge tag 'x86_microcode_for_v6.6_rc1' [...]"). I picked the declaration change by Arnd from this branch instead, which put it in <asm/processor.h> instead of <asm/microcode.h> like I had done in my merge resolution - Linus ] * tag 'x86-cleanups-2023-08-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/platform/uv: Refactor code using deprecated strncpy() interface to use strscpy() x86/hpet: Refactor code using deprecated strncpy() interface to use strscpy() x86/platform/uv: Refactor code using deprecated strcpy()/strncpy() interfaces to use strscpy() x86/qspinlock-paravirt: Fix missing-prototype warning x86/paravirt: Silence unused native_pv_lock_init() function warning x86/alternative: Add a __alt_reloc_selftest() prototype x86/purgatory: Include header for warn() declaration x86/asm: Avoid unneeded __div64_32 function definition Revert "sched/fair: Move unused stub functions to header" x86/apic: Hide unused safe_smp_processor_id() on 32-bit UP x86/cpu: Fix amd_check_microcode() declaration
2 parents 3ca9a83 + 212f07a commit 97efd28

File tree

18 files changed

+48
-40
lines changed

18 files changed

+48
-40
lines changed

arch/x86/boot/compressed/error.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "misc.h"
88
#include "error.h"
99

10-
void warn(char *m)
10+
void warn(const char *m)
1111
{
1212
error_putstr("\n\n");
1313
error_putstr(m);

arch/x86/boot/compressed/error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <linux/compiler.h>
66

7-
void warn(char *m);
7+
void warn(const char *m);
88
void error(char *m) __noreturn;
99
void panic(const char *fmt, ...) __noreturn __cold;
1010

arch/x86/include/asm/div64.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ static inline u64 mul_u32_u32(u32 a, u32 b)
7171
}
7272
#define mul_u32_u32 mul_u32_u32
7373

74+
/*
75+
* __div64_32() is never called on x86, so prevent the
76+
* generic definition from getting built.
77+
*/
78+
#define __div64_32
79+
7480
#else
7581
# include <asm-generic/div64.h>
7682

arch/x86/include/asm/microcode.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,4 @@ void show_ucode_info_early(void);
7575
static inline void show_ucode_info_early(void) { }
7676
#endif /* !CONFIG_CPU_SUP_INTEL */
7777

78-
#ifdef CONFIG_CPU_SUP_AMD
79-
void amd_check_microcode(void);
80-
#else /* CONFIG_CPU_SUP_AMD */
81-
static inline void amd_check_microcode(void) {}
82-
#endif
83-
8478
#endif /* _ASM_X86_MICROCODE_H */

arch/x86/include/asm/paravirt.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ static __always_inline unsigned long arch_local_irq_save(void)
739739
".popsection")
740740

741741
extern void default_banner(void);
742+
void native_pv_lock_init(void) __init;
742743

743744
#else /* __ASSEMBLY__ */
744745

@@ -778,6 +779,12 @@ extern void default_banner(void);
778779
#endif /* __ASSEMBLY__ */
779780
#else /* CONFIG_PARAVIRT */
780781
# define default_banner x86_init_noop
782+
783+
#ifndef __ASSEMBLY__
784+
static inline void native_pv_lock_init(void)
785+
{
786+
}
787+
#endif
781788
#endif /* !CONFIG_PARAVIRT */
782789

783790
#ifndef __ASSEMBLY__

arch/x86/include/asm/processor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,11 +678,13 @@ extern u32 amd_get_nodes_per_socket(void);
678678
extern u32 amd_get_highest_perf(void);
679679
extern bool cpu_has_ibpb_brtype_microcode(void);
680680
extern void amd_clear_divider(void);
681+
extern void amd_check_microcode(void);
681682
#else
682683
static inline u32 amd_get_nodes_per_socket(void) { return 0; }
683684
static inline u32 amd_get_highest_perf(void) { return 0; }
684685
static inline bool cpu_has_ibpb_brtype_microcode(void) { return false; }
685686
static inline void amd_clear_divider(void) { }
687+
static inline void amd_check_microcode(void) { }
686688
#endif
687689

688690
extern unsigned long arch_align_stack(unsigned long sp);

arch/x86/include/asm/qspinlock.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ static inline bool vcpu_is_preempted(long cpu)
7474
*/
7575
DECLARE_STATIC_KEY_TRUE(virt_spin_lock_key);
7676

77-
void native_pv_lock_init(void) __init;
78-
7977
/*
8078
* Shortcut for the queued_spin_lock_slowpath() function that allows
8179
* virt to hijack it.
@@ -103,10 +101,7 @@ static inline bool virt_spin_lock(struct qspinlock *lock)
103101

104102
return true;
105103
}
106-
#else
107-
static inline void native_pv_lock_init(void)
108-
{
109-
}
104+
110105
#endif /* CONFIG_PARAVIRT */
111106

112107
#include <asm-generic/qspinlock.h>

arch/x86/include/asm/qspinlock_paravirt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include <asm/ibt.h>
66

7+
void __lockfunc __pv_queued_spin_unlock_slowpath(struct qspinlock *lock, u8 locked);
8+
79
/*
810
* For x86-64, PV_CALLEE_SAVE_REGS_THUNK() saves and restores 8 64-bit
911
* registers. For i386, however, only 1 32-bit register needs to be saved

arch/x86/kernel/alternative.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,7 @@ static noinline void __init int3_selftest(void)
15271527

15281528
static __initdata int __alt_reloc_selftest_addr;
15291529

1530+
extern void __init __alt_reloc_selftest(void *arg);
15301531
__visible noinline void __init __alt_reloc_selftest(void *arg)
15311532
{
15321533
WARN_ON(arg != &__alt_reloc_selftest_addr);

arch/x86/kernel/apic/ipi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ void default_send_IPI_mask_logical(const struct cpumask *cpumask, int vector)
301301
local_irq_restore(flags);
302302
}
303303

304+
#ifdef CONFIG_SMP
304305
/* must come after the send_IPI functions above for inlining */
305306
static int convert_apicid_to_cpu(int apic_id)
306307
{
@@ -329,3 +330,4 @@ int safe_smp_processor_id(void)
329330
return cpuid >= 0 ? cpuid : 0;
330331
}
331332
#endif
333+
#endif

0 commit comments

Comments
 (0)