linux/arch/sparc64/kernel
David S. Miller b830ab665a [SPARC64]: Fix bugs in SUN4V cpu mondo dispatch.
There were several bugs in the SUN4V cpu mondo dispatch code.

In fact, if we ever got a EWOULDBLOCK or other error from
the hypervisor call, we'd potentially send a cpu mondo multiple
times to the same cpu and even worse we could loop until the
timeout resending the same mondo over and over to such cpus.

So let's bulletproof this thing as follows:

1) Implement cpu_mondo_send() and cpu_state() hypervisor calls
   in arch/sparc64/kernel/entry.S, add prototypes to asm/hypervisor.h

2) Don't build and update the cpulist using inline functions, this
   was causing the cpu mask to not get updated in the caller.

3) Disable interrupts during the entire mondo send, otherwise our
   cpu list and/or mondo block could get overwritten if we take
   an interrupt and do a cpu mondo send on the current cpu.

4) Check for all possible error return types from the cpu_mondo_send()
   hypervisor call.  In particular:

   HV_EOK) Our work is done, all cpus have received the mondo.
   HV_CPUERROR) One or more of the cpus in the cpu list we passed
                to the hypervisor are in error state.  Use cpu_state()
                calls over the entries in the cpu list to see which
		ones.  Record them in "error_mask" and report this
		after we are done sending the mondo to cpus which are
		not in error state.
   HV_EWOULDBLOCK) We need to keep trying.

   Any other error we consider fatal, we report the event and exit
   immediately.

5) We only timeout if forward progress is not made.  Forward progress
   is defined as having at least one cpu get the mondo successfully
   in a given cpu_mondo_send() call.  Otherwise we bump a counter
   and delay a little.  If the counter hits a limit, we signal an
   error and report the event.

Also, smp_call_function_mask() error handling reports the number
of cpus incorrectly.

Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20 01:14:09 -08:00
..
asm-offsets.c kbuild: frv,m32r,sparc64 introduce fake asm-offsets.h file 2005-09-09 22:47:53 +02:00
auxio.c [SPARC64]: Get rid of fast IRQ feature. 2005-06-27 17:04:45 -07:00
binfmt_aout32.c [SPARC64]: Fix binfmt_aout32.c build. 2006-03-20 01:14:02 -08:00
binfmt_elf32.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
central.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
chmc.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cpu.c [SPARC64]: kernel/cpu.c needs asm/spitfire.h 2006-03-20 01:12:05 -08:00
devices.c [SPARC64]: Decode virtual-devices interrupts correctly. 2006-03-20 01:13:05 -08:00
dtlb_miss.S [SPARC64]: More TLB/TSB handling fixes. 2006-03-20 01:13:34 -08:00
dtlb_prot.S [SPARC64]: Fix boot failures on SunBlade-150 2005-10-12 12:22:46 -07:00
ebus.c [PATCH] PCI: pci_find_device remove (sparc64/kernel/ebus.c) 2006-01-09 12:13:15 -08:00
entry.S [SPARC64]: Fix bugs in SUN4V cpu mondo dispatch. 2006-03-20 01:14:09 -08:00
etrap.S [SPARC64]: Fix tl1 trap state capture/dump on SUN4V. 2006-03-20 01:13:12 -08:00
head.S [SPARC64]: Put syscall tables after trap table. 2006-03-20 01:13:59 -08:00
idprom.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
init_task.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
iommu_common.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
iommu_common.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
irq.c [SPARC64]: Fix uniprocessor IRQ targetting on SUN4V. 2006-03-20 01:13:24 -08:00
isa.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
itlb_miss.S [SPARC64]: More TLB/TSB handling fixes. 2006-03-20 01:13:34 -08:00
kprobes.c [PATCH] kprobes: fix race in recovery of reentrant probe 2006-01-11 18:42:12 -08:00
ktlb.S [SPARC64]: Fix indexing into kpte_linear_bitmap. 2006-03-20 01:14:07 -08:00
Makefile [SPARC64]: More SUN4V PCI controller work. 2006-03-20 01:12:11 -08:00
module.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pci_common.c [SPARC64]: Fix PCI IRQ probing regression. 2006-03-20 01:13:23 -08:00
pci_impl.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pci_iommu.c [SPARC64]: First cut at SUN4V PCI IOMMU handling. 2006-03-20 01:12:15 -08:00
pci_psycho.c [SPARC64]: Consolidate common PCI IOMMU init code. 2005-10-13 21:10:08 -07:00
pci_sabre.c [SPARC64]: Consolidate common PCI IOMMU init code. 2005-10-13 21:10:08 -07:00
pci_schizo.c [SPARC64]: Consolidate common PCI IOMMU init code. 2005-10-13 21:10:08 -07:00
pci_sun4v_asm.S [SPARC64]: Remove PGLIST_NENTS PCI IOMMU mapping limitation on SUN4V. 2006-03-20 01:13:41 -08:00
pci_sun4v.c [SPARC64]: Handle zero-length map requests in pci_sun4v.c 2006-03-20 01:13:45 -08:00
pci_sun4v.h [SPARC64]: Remove PGLIST_NENTS PCI IOMMU mapping limitation on SUN4V. 2006-03-20 01:13:41 -08:00
pci.c [SPARC64]: Beginnings of SUN4V PCI controller support. 2006-03-20 01:12:10 -08:00
power.c [SPARC64]: Add needed pm_power_off symbol. 2006-01-09 14:12:50 -08:00
process.c [SPARC64]: Use sun4v_cpu_idle() in cpu_idle() on SUN4V. 2006-03-20 01:13:54 -08:00
ptrace.c [SPARC64]: Don't do anything in flush_ptrace_access() on SUN4V. 2006-03-20 01:13:33 -08:00
rtrap.S [SPARC64]: Drop %gl to 0 before re-enabling PSTATE_IE in rtrap 2006-03-20 01:13:57 -08:00
sbus.c [PATCH] unpaged: fix sound Bad page states 2005-11-22 09:13:43 -08:00
semaphore.c [SPARC64]: Avoid membar instructions in delay slots. 2005-06-27 15:42:04 -07:00
setup.c [SPARC64]: Init boot cpu's trap_block[] before paging_init() 2006-03-20 01:13:30 -08:00
signal32.c [SPARC]: Add support for *at(), ppoll, and pselect syscalls. 2006-01-19 02:42:49 -08:00
signal.c [SPARC]: Add support for *at(), ppoll, and pselect syscalls. 2006-01-19 02:42:49 -08:00
smp.c [SPARC64]: Fix bugs in SUN4V cpu mondo dispatch. 2006-03-20 01:14:09 -08:00
sparc64_ksyms.c [SPARC64]: Niagara optimized XOR functions for RAID. 2006-03-20 01:14:03 -08:00
starfire.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sun4v_ivec.S [SPARC64]: Use TRAP_LOAD_IRQ_WORK() in sun4v device mondo handler. 2006-03-20 01:12:49 -08:00
sun4v_tlb_miss.S [SPARC64]: Fix unaligned access winfxup handling on SUN4V. 2006-03-20 01:13:39 -08:00
sunos_ioctl32.c [SPARC]: Kill remaining kbio.h references. 2005-11-07 14:12:21 -08:00
sys32.S [SPARC64]: Mark __ex_table section correctly. 2006-03-04 23:23:56 -08:00
sys_sparc32.c [SPARC]: sys_newfstatat --> sys_fstatat64 2006-02-12 23:30:11 -08:00
sys_sparc.c [PATCH] Avoiding mmap fragmentation 2005-06-21 18:46:16 -07:00
sys_sunos32.c [PATCH] capable/capability.h (arch/) 2006-01-11 18:42:14 -08:00
systbls.S [SPARC]: sys_newfstatat --> sys_fstatat64 2006-02-12 23:30:11 -08:00
time.c [SPARC64]: Define ARCH_HAS_READ_CURRENT_TIMER. 2006-03-20 01:13:29 -08:00
trampoline.S [SPARC64]: Get SUN4V SMP working. 2006-03-20 01:13:22 -08:00
traps.c [SPARC64]: Bulletproof hypervisor TLB flushing. 2006-03-20 01:14:05 -08:00
tsb.S [SPARC64]: More TLB/TSB handling fixes. 2006-03-20 01:13:34 -08:00
ttable.S [SPARC64]: Put SUN4V ITSB miss into correct trap table entry. 2006-03-20 01:13:27 -08:00
una_asm.S [SPARC64]: Mark __ex_table section correctly. 2006-03-04 23:23:56 -08:00
unaligned.c [SPARC64]: SUN4V memory exception trap handlers. 2006-03-20 01:12:07 -08:00
us2e_cpufreq.c [SPARC64]: Detect sun4v early in boot process. 2006-03-20 01:12:03 -08:00
us3_cpufreq.c [SPARC64]: Detect sun4v early in boot process. 2006-03-20 01:12:03 -08:00
vmlinux.lds.S [SPARC64]: Rename gl_{1,2}insn_patch --> sun4v_{1,2}insn_patch 2006-03-20 01:11:53 -08:00
winfixup.S [SPARC64]: Fix unaligned access winfxup handling on SUN4V. 2006-03-20 01:13:39 -08:00