Skip to content

Commit e952f31

Browse files
author
Linus Torvalds
committed
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6: [IA64-SGI] SN2-XP reduce kmalloc wrapper inlining [IA64] MCA: remove obsolete ifdef [IA64] MCA: update MCA comm field for user space tasks [IA64] MCA: print messages in MCA handler [IA64-SGI] - Eliminate SN pio_phys_xxx macros. Move to assembly [IA64] use icc defined constant [IA64] add __builtin_trap definition for icc build [IA64] clean up asm/intel_intrin.h [IA64] map ia64_hint definition to intel compiler intrinsic [IA64] hooks to wait for mmio writes to drain when migrating processes [IA64-SGI] driver bugfixes and hardware workarounds for CE1.0 asic [IA64-SGI] Handle SC env. powerdown events [IA64] Delete MCA/INIT sigdelayed code [IA64-SGI] sem2mutex ioc4.c [IA64] implement ia64 specific mutex primitives [IA64] Fix UP build with BSP removal support. [IA64] support for cpu0 removal
2 parents e0f4ab8 + 133a58c commit e952f31

38 files changed

Lines changed: 952 additions & 478 deletions

‎arch/ia64/Kconfig‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,25 @@ config SCHED_SMT
271271
Intel IA64 chips with MultiThreading at a cost of slightly increased
272272
overhead in some places. If unsure say N here.
273273

274+
config PERMIT_BSP_REMOVE
275+
bool "Support removal of Bootstrap Processor"
276+
depends on HOTPLUG_CPU
277+
default n
278+
---help---
279+
Say Y here if your platform SAL will support removal of BSP with HOTPLUG_CPU
280+
support.
281+
282+
config FORCE_CPEI_RETARGET
283+
bool "Force assumption that CPEI can be re-targetted"
284+
depends on PERMIT_BSP_REMOVE
285+
default n
286+
---help---
287+
Say Y if you need to force the assumption that CPEI can be re-targetted to
288+
any cpu in the system. This hint is available via ACPI 3.0 specifications.
289+
Tiger4 systems are capable of re-directing CPEI to any CPU other than BSP.
290+
This option it useful to enable this feature on older BIOS's as well.
291+
You can also enable this by using boot command line option force_cpei=1.
292+
274293
config PREEMPT
275294
bool "Preemptible Kernel"
276295
help

‎arch/ia64/configs/tiger_defconfig‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ CONFIG_FORCE_MAX_ZONEORDER=17
116116
CONFIG_SMP=y
117117
CONFIG_NR_CPUS=4
118118
CONFIG_HOTPLUG_CPU=y
119+
CONFIG_PERMIT_BSP_REMOVE=y
120+
CONFIG_FORCE_CPEI_RETARGET=y
119121
# CONFIG_SCHED_SMT is not set
120122
# CONFIG_PREEMPT is not set
121123
CONFIG_SELECT_MEMORY_MODEL=y

‎arch/ia64/kernel/acpi.c‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,19 +284,24 @@ acpi_parse_plat_int_src(acpi_table_entry_header * header,
284284
return 0;
285285
}
286286

287+
#ifdef CONFIG_HOTPLUG_CPU
287288
unsigned int can_cpei_retarget(void)
288289
{
289290
extern int cpe_vector;
291+
extern unsigned int force_cpei_retarget;
290292

291293
/*
292294
* Only if CPEI is supported and the override flag
293295
* is present, otherwise return that its re-targettable
294296
* if we are in polling mode.
295297
*/
296-
if (cpe_vector > 0 && !acpi_cpei_override)
297-
return 0;
298-
else
299-
return 1;
298+
if (cpe_vector > 0) {
299+
if (acpi_cpei_override || force_cpei_retarget)
300+
return 1;
301+
else
302+
return 0;
303+
}
304+
return 1;
300305
}
301306

302307
unsigned int is_cpu_cpei_target(unsigned int cpu)
@@ -315,6 +320,7 @@ void set_cpei_target_cpu(unsigned int cpu)
315320
{
316321
acpi_cpei_phys_cpuid = cpu_physical_id(cpu);
317322
}
323+
#endif
318324

319325
unsigned int get_cpei_target_cpu(void)
320326
{

‎arch/ia64/kernel/entry.S‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,9 +1102,6 @@ skip_rbs_switch:
11021102
st8 [r2]=r8
11031103
st8 [r3]=r10
11041104
.work_pending:
1105-
tbit.nz p6,p0=r31,TIF_SIGDELAYED // signal delayed from MCA/INIT/NMI/PMI context?
1106-
(p6) br.cond.sptk.few .sigdelayed
1107-
;;
11081105
tbit.z p6,p0=r31,TIF_NEED_RESCHED // current_thread_info()->need_resched==0?
11091106
(p6) br.cond.sptk.few .notify
11101107
#ifdef CONFIG_PREEMPT
@@ -1131,17 +1128,6 @@ skip_rbs_switch:
11311128
(pLvSys)br.cond.sptk.few .work_pending_syscall_end
11321129
br.cond.sptk.many .work_processed_kernel // don't re-check
11331130

1134-
// There is a delayed signal that was detected in MCA/INIT/NMI/PMI context where
1135-
// it could not be delivered. Deliver it now. The signal might be for us and
1136-
// may set TIF_SIGPENDING, so redrive ia64_leave_* after processing the delayed
1137-
// signal.
1138-
1139-
.sigdelayed:
1140-
br.call.sptk.many rp=do_sigdelayed
1141-
cmp.eq p6,p0=r0,r0 // p6 <- 1, always re-check
1142-
(pLvSys)br.cond.sptk.few .work_pending_syscall_end
1143-
br.cond.sptk.many .work_processed_kernel // re-check
1144-
11451131
.work_pending_syscall_end:
11461132
adds r2=PT(R8)+16,r12
11471133
adds r3=PT(R10)+16,r12

‎arch/ia64/kernel/iosapic.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ get_target_cpu (unsigned int gsi, int vector)
631631
{
632632
#ifdef CONFIG_SMP
633633
static int cpu = -1;
634+
extern int cpe_vector;
634635

635636
/*
636637
* In case of vector shared by multiple RTEs, all RTEs that
@@ -653,6 +654,11 @@ get_target_cpu (unsigned int gsi, int vector)
653654
if (!cpu_online(smp_processor_id()))
654655
return cpu_physical_id(smp_processor_id());
655656

657+
#ifdef CONFIG_ACPI
658+
if (cpe_vector > 0 && vector == IA64_CPEP_VECTOR)
659+
return get_cpei_target_cpu();
660+
#endif
661+
656662
#ifdef CONFIG_NUMA
657663
{
658664
int num_cpus, cpu_index, iosapic_index, numa_cpu, i = 0;

‎arch/ia64/kernel/irq.c‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,19 @@ void fixup_irqs(void)
163163
{
164164
unsigned int irq;
165165
extern void ia64_process_pending_intr(void);
166+
extern void ia64_disable_timer(void);
167+
extern volatile int time_keeper_id;
168+
169+
ia64_disable_timer();
170+
171+
/*
172+
* Find a new timesync master
173+
*/
174+
if (smp_processor_id() == time_keeper_id) {
175+
time_keeper_id = first_cpu(cpu_online_map);
176+
printk ("CPU %d is now promoted to time-keeper master\n", time_keeper_id);
177+
}
166178

167-
ia64_set_itv(1<<16);
168179
/*
169180
* Phase 1: Locate irq's bound to this cpu and
170181
* relocate them for cpu removal.

‎arch/ia64/kernel/mca.c‎

Lines changed: 60 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,10 @@ ia64_mca_log_sal_error_record(int sal_info_type)
281281
ia64_sal_clear_state_info(sal_info_type);
282282
}
283283

284-
/*
285-
* platform dependent error handling
286-
*/
287-
#ifndef PLATFORM_MCA_HANDLERS
288-
289284
#ifdef CONFIG_ACPI
290285

291286
int cpe_vector = -1;
287+
int ia64_cpe_irq = -1;
292288

293289
static irqreturn_t
294290
ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs)
@@ -377,8 +373,6 @@ ia64_mca_register_cpev (int cpev)
377373
}
378374
#endif /* CONFIG_ACPI */
379375

380-
#endif /* PLATFORM_MCA_HANDLERS */
381-
382376
/*
383377
* ia64_mca_cmc_vector_setup
384378
*
@@ -630,6 +624,32 @@ copy_reg(const u64 *fr, u64 fnat, u64 *tr, u64 *tnat)
630624
*tnat |= (nat << tslot);
631625
}
632626

627+
/* Change the comm field on the MCA/INT task to include the pid that
628+
* was interrupted, it makes for easier debugging. If that pid was 0
629+
* (swapper or nested MCA/INIT) then use the start of the previous comm
630+
* field suffixed with its cpu.
631+
*/
632+
633+
static void
634+
ia64_mca_modify_comm(const task_t *previous_current)
635+
{
636+
char *p, comm[sizeof(current->comm)];
637+
if (previous_current->pid)
638+
snprintf(comm, sizeof(comm), "%s %d",
639+
current->comm, previous_current->pid);
640+
else {
641+
int l;
642+
if ((p = strchr(previous_current->comm, ' ')))
643+
l = p - previous_current->comm;
644+
else
645+
l = strlen(previous_current->comm);
646+
snprintf(comm, sizeof(comm), "%s %*s %d",
647+
current->comm, l, previous_current->comm,
648+
task_thread_info(previous_current)->cpu);
649+
}
650+
memcpy(current->comm, comm, sizeof(current->comm));
651+
}
652+
633653
/* On entry to this routine, we are running on the per cpu stack, see
634654
* mca_asm.h. The original stack has not been touched by this event. Some of
635655
* the original stack's registers will be in the RBS on this stack. This stack
@@ -648,7 +668,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs,
648668
struct ia64_sal_os_state *sos,
649669
const char *type)
650670
{
651-
char *p, comm[sizeof(current->comm)];
671+
char *p;
652672
ia64_va va;
653673
extern char ia64_leave_kernel[]; /* Need asm address, not function descriptor */
654674
const pal_min_state_area_t *ms = sos->pal_min_state;
@@ -721,6 +741,10 @@ ia64_mca_modify_original_stack(struct pt_regs *regs,
721741
/* Verify the previous stack state before we change it */
722742
if (user_mode(regs)) {
723743
msg = "occurred in user space";
744+
/* previous_current is guaranteed to be valid when the task was
745+
* in user space, so ...
746+
*/
747+
ia64_mca_modify_comm(previous_current);
724748
goto no_mod;
725749
}
726750
if (r13 != sos->prev_IA64_KR_CURRENT) {
@@ -750,25 +774,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs,
750774
goto no_mod;
751775
}
752776

753-
/* Change the comm field on the MCA/INT task to include the pid that
754-
* was interrupted, it makes for easier debugging. If that pid was 0
755-
* (swapper or nested MCA/INIT) then use the start of the previous comm
756-
* field suffixed with its cpu.
757-
*/
758-
if (previous_current->pid)
759-
snprintf(comm, sizeof(comm), "%s %d",
760-
current->comm, previous_current->pid);
761-
else {
762-
int l;
763-
if ((p = strchr(previous_current->comm, ' ')))
764-
l = p - previous_current->comm;
765-
else
766-
l = strlen(previous_current->comm);
767-
snprintf(comm, sizeof(comm), "%s %*s %d",
768-
current->comm, l, previous_current->comm,
769-
task_thread_info(previous_current)->cpu);
770-
}
771-
memcpy(current->comm, comm, sizeof(current->comm));
777+
ia64_mca_modify_comm(previous_current);
772778

773779
/* Make the original task look blocked. First stack a struct pt_regs,
774780
* describing the state at the time of interrupt. mca_asm.S built a
@@ -908,7 +914,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs,
908914
static void
909915
ia64_wait_for_slaves(int monarch)
910916
{
911-
int c, wait = 0;
917+
int c, wait = 0, missing = 0;
912918
for_each_online_cpu(c) {
913919
if (c == monarch)
914920
continue;
@@ -919,15 +925,32 @@ ia64_wait_for_slaves(int monarch)
919925
}
920926
}
921927
if (!wait)
922-
return;
928+
goto all_in;
923929
for_each_online_cpu(c) {
924930
if (c == monarch)
925931
continue;
926932
if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE) {
927933
udelay(5*1000000); /* wait 5 seconds for slaves (arbitrary) */
934+
if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE)
935+
missing = 1;
928936
break;
929937
}
930938
}
939+
if (!missing)
940+
goto all_in;
941+
printk(KERN_INFO "OS MCA slave did not rendezvous on cpu");
942+
for_each_online_cpu(c) {
943+
if (c == monarch)
944+
continue;
945+
if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE)
946+
printk(" %d", c);
947+
}
948+
printk("\n");
949+
return;
950+
951+
all_in:
952+
printk(KERN_INFO "All OS MCA slaves have reached rendezvous\n");
953+
return;
931954
}
932955

933956
/*
@@ -953,6 +976,10 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
953976
task_t *previous_current;
954977

955978
oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */
979+
console_loglevel = 15; /* make sure printks make it to console */
980+
printk(KERN_INFO "Entered OS MCA handler. PSP=%lx cpu=%d monarch=%ld\n",
981+
sos->proc_state_param, cpu, sos->monarch);
982+
956983
previous_current = ia64_mca_modify_original_stack(regs, sw, sos, "MCA");
957984
monarch_cpu = cpu;
958985
if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, 0, 0, 0)
@@ -1444,11 +1471,13 @@ void __devinit
14441471
ia64_mca_cpu_init(void *cpu_data)
14451472
{
14461473
void *pal_vaddr;
1474+
static int first_time = 1;
14471475

1448-
if (smp_processor_id() == 0) {
1476+
if (first_time) {
14491477
void *mca_data;
14501478
int cpu;
14511479

1480+
first_time = 0;
14521481
mca_data = alloc_bootmem(sizeof(struct ia64_mca_cpu)
14531482
* NR_CPUS + KERNEL_STACK_SIZE);
14541483
mca_data = (void *)(((unsigned long)mca_data +
@@ -1704,6 +1733,7 @@ ia64_mca_late_init(void)
17041733
desc = irq_descp(irq);
17051734
desc->status |= IRQ_PER_CPU;
17061735
setup_irq(irq, &mca_cpe_irqaction);
1736+
ia64_cpe_irq = irq;
17071737
}
17081738
ia64_mca_register_cpev(cpe_vector);
17091739
IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n", __FUNCTION__);

‎arch/ia64/kernel/perfmon.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6722,6 +6722,7 @@ __initcall(pfm_init);
67226722
void
67236723
pfm_init_percpu (void)
67246724
{
6725+
static int first_time=1;
67256726
/*
67266727
* make sure no measurement is active
67276728
* (may inherit programmed PMCs from EFI).
@@ -6734,8 +6735,10 @@ pfm_init_percpu (void)
67346735
*/
67356736
pfm_unfreeze_pmu();
67366737

6737-
if (smp_processor_id() == 0)
6738+
if (first_time) {
67386739
register_percpu_irq(IA64_PERFMON_VECTOR, &perfmon_irqaction);
6740+
first_time=0;
6741+
}
67396742

67406743
ia64_setreg(_IA64_REG_CR_PMV, IA64_PERFMON_VECTOR);
67416744
ia64_srlz_d();

0 commit comments

Comments
 (0)