Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272057
b: refs/heads/master
c: 1943f53
h: refs/heads/master
i:
  272055: 7e8cd32
v: v3
  • Loading branch information
Michael Holzheu authored and Martin Schwidefsky committed Oct 30, 2011
1 parent 7e9aa38 commit fd1b90d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3bf37955d46718ee1a7f1fc69f953d2328ba7c2
refs/heads/master: 1943f53c9ca182fa233e5a17e89ef8e421d7819e
5 changes: 5 additions & 0 deletions trunk/arch/s390/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1];
extern void smp_switch_to_ipl_cpu(void (*func)(void *), void *);
extern void smp_switch_to_cpu(void (*)(void *), void *, unsigned long sp,
int from, int to);
extern void smp_restart_with_online_cpu(void);
extern void smp_restart_cpu(void);

/*
Expand Down Expand Up @@ -64,6 +65,10 @@ static inline void smp_switch_to_ipl_cpu(void (*func)(void *), void *data)
func(data);
}

static inline void smp_restart_with_online_cpu(void)
{
}

#define smp_vcpu_scheduled (1)

#endif /* CONFIG_SMP */
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/s390/kernel/ipl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,7 @@ static struct kobj_attribute on_restart_attr =

void do_restart(void)
{
smp_restart_with_online_cpu();
smp_send_stop();
on_restart_trigger.action->fn(&on_restart_trigger);
stop_run(&on_restart_trigger);
Expand Down
23 changes: 23 additions & 0 deletions trunk/arch/s390/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,29 @@ static inline int cpu_stopped(int cpu)
return raw_cpu_stopped(cpu_logical_map(cpu));
}

/*
* Ensure that PSW restart is done on an online CPU
*/
void smp_restart_with_online_cpu(void)
{
int cpu;

for_each_online_cpu(cpu) {
if (stap() == __cpu_logical_map[cpu]) {
/* We are online: Enable DAT again and return */
__load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK);
return;
}
}
/* We are not online: Do PSW restart on an online CPU */
while (sigp(cpu, sigp_restart) == sigp_busy)
cpu_relax();
/* And stop ourself */
while (raw_sigp(stap(), sigp_stop) == sigp_busy)
cpu_relax();
for (;;);
}

void smp_switch_to_ipl_cpu(void (*func)(void *), void *data)
{
struct _lowcore *lc, *current_lc;
Expand Down

0 comments on commit fd1b90d

Please sign in to comment.