Skip to content

Commit adf6de0

Browse files
davem330gregkh
authored andcommitted
sparc64: Make sure %pil interrupts are enabled during hypervisor yield.
[ Upstream commit cb3042d ] 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 <fabbione@fabbione.net> Reported-by: Jan Engelhardt <jengelh@inai.de> Tested-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4c0d2e8 commit adf6de0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎arch/sparc/kernel/process_64.c‎

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

64+
local_irq_enable();
65+
6366
/* The sun4v sleeping code requires that we have PSTATE.IE cleared over
6467
* the cpu sleep hypervisor call.
6568
*/
@@ -81,7 +84,6 @@ void arch_cpu_idle(void)
8184
: "=&r" (pstate)
8285
: "i" (PSTATE_IE));
8386
}
84-
local_irq_enable();
8587
}
8688

8789
#ifdef CONFIG_HOTPLUG_CPU

0 commit comments

Comments
 (0)