Skip to content

Commit c5f12fd

Browse files
committed
Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 apic updates from Thomas Gleixner: - Cleanup the apic IPI implementation by removing duplicated code and consolidating the functions into the APIC core. - Implement a safe variant of the IPI broadcast mode. Contrary to earlier attempts this uses the core tracking of which CPUs have been brought online at least once so that a broadcast does not end up in some dead end in BIOS/SMM code when the CPU is still waiting for init. Once all CPUs have been brought up once, IPI broadcasting is enabled. Before that regular one by one IPIs are issued. - Drop the paravirt CR8 related functions as they have no user anymore - Initialize the APIC TPR to block interrupt 16-31 as they are reserved for CPU exceptions and should never be raised by any well behaving device. - Emit a warning when vector space exhaustion breaks the admin set affinity of an interrupt. - Make sure to use the NMI fallback when shutdown via reboot vector IPI fails. The original code had conditions which prevent the code path to be reached. - Annotate various APIC config variables as RO after init. [ The ipi broadcase change came in earlier through the cpu hotplug branch, but I left the explanation in the commit message since it was shared between the two different branches - Linus ] * 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (28 commits) x86/apic/vector: Warn when vector space exhaustion breaks affinity x86/apic: Annotate global config variables as "read-only after init" x86/apic/x2apic: Implement IPI shorthands support x86/apic/flat64: Remove the IPI shorthand decision logic x86/apic: Share common IPI helpers x86/apic: Remove the shorthand decision logic x86/smp: Enhance native_send_call_func_ipi() x86/smp: Move smp_function_call implementations into IPI code x86/apic: Provide and use helper for send_IPI_allbutself() x86/apic: Add static key to Control IPI shorthands x86/apic: Move no_ipi_broadcast() out of 32bit x86/apic: Add NMI_VECTOR wait to IPI shorthand x86/apic: Remove dest argument from __default_send_IPI_shortcut() x86/hotplug: Silence APIC and NMI when CPU is dead x86/cpu: Move arch_smt_update() to a neutral place x86/apic/uv: Make x2apic_extra_bits static x86/apic: Consolidate the apic local headers x86/apic: Move apic_flat_64 header into apic directory x86/apic: Move ipi header into apic directory x86/apic: Cleanup the include maze ...
2 parents a572ba6 + 743dac4 commit c5f12fd

34 files changed

+432
-572
lines changed

arch/x86/include/asm/apic.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ extern int lapic_get_maxlvt(void);
136136
extern void clear_local_APIC(void);
137137
extern void disconnect_bsp_APIC(int virt_wire_setup);
138138
extern void disable_local_APIC(void);
139+
extern void apic_soft_disable(void);
139140
extern void lapic_shutdown(void);
140141
extern void sync_Arb_IDs(void);
141142
extern void init_bsp_APIC(void);
@@ -176,6 +177,8 @@ extern void lapic_online(void);
176177
extern void lapic_offline(void);
177178
extern bool apic_needs_pit(void);
178179

180+
extern void apic_send_IPI_allbutself(unsigned int vector);
181+
179182
#else /* !CONFIG_X86_LOCAL_APIC */
180183
static inline void lapic_shutdown(void) { }
181184
#define local_apic_timer_c2_ok 1
@@ -465,12 +468,6 @@ static inline unsigned default_get_apic_id(unsigned long x)
465468
#define TRAMPOLINE_PHYS_LOW 0x467
466469
#define TRAMPOLINE_PHYS_HIGH 0x469
467470

468-
#ifdef CONFIG_X86_64
469-
extern void apic_send_IPI_self(int vector);
470-
471-
DECLARE_PER_CPU(int, x2apic_extra_bits);
472-
#endif
473-
474471
extern void generic_bigsmp_probe(void);
475472

476473
#ifdef CONFIG_X86_LOCAL_APIC
@@ -506,8 +503,10 @@ extern int default_check_phys_apicid_present(int phys_apicid);
506503

507504
#ifdef CONFIG_SMP
508505
bool apic_id_is_primary_thread(unsigned int id);
506+
void apic_smt_update(void);
509507
#else
510508
static inline bool apic_id_is_primary_thread(unsigned int id) { return false; }
509+
static inline void apic_smt_update(void) { }
511510
#endif
512511

513512
extern void irq_enter(void);

arch/x86/include/asm/apic_flat_64.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

arch/x86/include/asm/bugs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ int ppro_with_ram_bug(void);
1818
static inline int ppro_with_ram_bug(void) { return 0; }
1919
#endif
2020

21+
extern void cpu_bugs_smt_update(void);
22+
2123
#endif /* _ASM_X86_BUGS_H */

arch/x86/include/asm/ipi.h

Lines changed: 0 additions & 109 deletions
This file was deleted.

arch/x86/include/asm/paravirt.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,6 @@ static inline void __write_cr4(unsigned long x)
139139
PVOP_VCALL1(cpu.write_cr4, x);
140140
}
141141

142-
#ifdef CONFIG_X86_64
143-
static inline unsigned long read_cr8(void)
144-
{
145-
return PVOP_CALL0(unsigned long, cpu.read_cr8);
146-
}
147-
148-
static inline void write_cr8(unsigned long x)
149-
{
150-
PVOP_VCALL1(cpu.write_cr8, x);
151-
}
152-
#endif
153-
154142
static inline void arch_safe_halt(void)
155143
{
156144
PVOP_VCALL0(irq.safe_halt);

arch/x86/include/asm/paravirt_types.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@ struct pv_cpu_ops {
119119

120120
void (*write_cr4)(unsigned long);
121121

122-
#ifdef CONFIG_X86_64
123-
unsigned long (*read_cr8)(void);
124-
void (*write_cr8)(unsigned long);
125-
#endif
126-
127122
/* Segment descriptor handling */
128123
void (*load_tr_desc)(void);
129124
void (*load_gdt)(const struct desc_ptr *);

arch/x86/include/asm/smp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ void play_dead_common(void);
143143
void wbinvd_on_cpu(int cpu);
144144
int wbinvd_on_all_cpus(void);
145145

146+
void native_smp_send_reschedule(int cpu);
146147
void native_send_call_func_ipi(const struct cpumask *mask);
147148
void native_send_call_func_single_ipi(int cpu);
148149
void x86_idle_thread_init(unsigned int cpu, struct task_struct *idle);

arch/x86/include/asm/special_insns.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,6 @@ static inline unsigned long native_read_cr4(void)
7373

7474
void native_write_cr4(unsigned long val);
7575

76-
#ifdef CONFIG_X86_64
77-
static inline unsigned long native_read_cr8(void)
78-
{
79-
unsigned long cr8;
80-
asm volatile("movq %%cr8,%0" : "=r" (cr8));
81-
return cr8;
82-
}
83-
84-
static inline void native_write_cr8(unsigned long val)
85-
{
86-
asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
87-
}
88-
#endif
89-
9076
#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
9177
static inline u32 rdpkru(void)
9278
{
@@ -200,16 +186,6 @@ static inline void wbinvd(void)
200186

201187
#ifdef CONFIG_X86_64
202188

203-
static inline unsigned long read_cr8(void)
204-
{
205-
return native_read_cr8();
206-
}
207-
208-
static inline void write_cr8(unsigned long x)
209-
{
210-
native_write_cr8(x);
211-
}
212-
213189
static inline void load_gs_index(unsigned selector)
214190
{
215191
native_load_gs_index(selector);

arch/x86/include/asm/suspend_64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct saved_context {
3434
*/
3535
unsigned long kernelmode_gs_base, usermode_gs_base, fs_base;
3636

37-
unsigned long cr0, cr2, cr3, cr4, cr8;
37+
unsigned long cr0, cr2, cr3, cr4;
3838
u64 misc_enable;
3939
bool misc_enable_saved;
4040
struct saved_msrs saved_msrs;

0 commit comments

Comments
 (0)