Skip to content

Commit cb3042d

Browse files
committed
sparc64: Make sure %pil interrupts are enabled during hypervisor yield.
In arch_cpu_idle() we must enable %pil based interrupts before potentially invoking the hypervisor cpu yield call. As per the Hypervisor API documentation for cpu_yield: Interrupts which are blocked by some mechanism other that pstate.ie (for example %pil) are not guaranteed to cause a return from this service. It seems that only first generation Niagara chips are hit by this bug. My best guess is that later chips implement this in hardware and wake up anyways from %pil events, whereas in first generation chips the yield is implemented completely in hypervisor code and requires %pil to be enabled in order to wake properly from this call. Fixes: 87fa05a ("sparc: Use generic idle loop") Reported-by: Fabio M. Di Nitto <[email protected]> Reported-by: Jan Engelhardt <[email protected]> Tested-by: Jan Engelhardt <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 151b628 commit cb3042d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/sparc/kernel/process_64.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ void arch_cpu_idle(void)
5858
{
5959
if (tlb_type != hypervisor) {
6060
touch_nmi_watchdog();
61+
local_irq_enable();
6162
} else {
6263
unsigned long pstate;
6364

65+
local_irq_enable();
66+
6467
/* The sun4v sleeping code requires that we have PSTATE.IE cleared over
6568
* the cpu sleep hypervisor call.
6669
*/
@@ -82,7 +85,6 @@ void arch_cpu_idle(void)
8285
: "=&r" (pstate)
8386
: "i" (PSTATE_IE));
8487
}
85-
local_irq_enable();
8688
}
8789

8890
#ifdef CONFIG_HOTPLUG_CPU

0 commit comments

Comments
 (0)