Close a race when making the CPU idle under pHyp. If an interrupt occurs
between the beginning of the idle function and actually going idle, the CPU could go to sleep with pending work. MFC after: 1 month
This commit is contained in:
parent
95f9709424
commit
e21d69e9a7
@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/bus.h>
|
||||
#include <sys/pcpu.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/sched.h>
|
||||
#include <sys/smp.h>
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
@ -492,7 +493,18 @@ chrp_reset(platform_t platform)
|
||||
static void
|
||||
phyp_cpu_idle(sbintime_t sbt)
|
||||
{
|
||||
phyp_hcall(H_CEDE);
|
||||
register_t msr;
|
||||
|
||||
msr = mfmsr();
|
||||
|
||||
mtmsr(msr & ~PSL_EE);
|
||||
if (sched_runnable()) {
|
||||
mtmsr(msr);
|
||||
return;
|
||||
}
|
||||
|
||||
phyp_hcall(H_CEDE); /* Re-enables interrupts internally */
|
||||
mtmsr(msr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user