diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 1 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/proc_machdep.c | 5 | ||||
-rw-r--r-- | sys/include/arch/amd64/cpu.h | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 94b2d18..72de150 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -609,6 +609,7 @@ cpu_startup(struct cpu_info *ci) try_mitigate_spectre(); ci->online = 1; + ci->preempt = 1; cpu_get_info(ci); cpu_enable_smep(); diff --git a/sys/arch/amd64/amd64/proc_machdep.c b/sys/arch/amd64/amd64/proc_machdep.c index a1d6563..56348be 100644 --- a/sys/arch/amd64/amd64/proc_machdep.c +++ b/sys/arch/amd64/amd64/proc_machdep.c @@ -273,6 +273,11 @@ md_sched_switch(struct trapframe *tf) struct cpu_info *ci; ci = this_cpu(); + if (!ci->preempt) { + sched_oneshot(false); + return; + } + td = ci->curtd; mi_sched_switch(td); diff --git a/sys/include/arch/amd64/cpu.h b/sys/include/arch/amd64/cpu.h index 6ed675e..cf073fe 100644 --- a/sys/include/arch/amd64/cpu.h +++ b/sys/include/arch/amd64/cpu.h @@ -58,6 +58,7 @@ struct cpu_info { uint32_t apicid; uint32_t feat; uint32_t vendor; /* Vendor (see CPU_VENDOR_*) */ + uint8_t preempt : 1; /* CPU is preemptable */ uint8_t ipi_dispatch : 1; /* 1: IPIs being dispatched */ uint8_t ipi_id; ipi_pend_t ipi_pending[N_IPIVEC]; |