Skip to content

Commit 4497b0a

Browse files
committed
Try mwait
1 parent b3a2740 commit 4497b0a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

kernel/time/hrtimer.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,6 +2019,22 @@ void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, clockid_t clock_id,
20192019
}
20202020
EXPORT_SYMBOL_GPL(hrtimer_init_sleeper);
20212021

2022+
// __inline void deep_halt(void)
2023+
// {
2024+
// asm volatile(
2025+
// "movq $0xffffff8000000000, %%rax\n" // listen linear_mapping
2026+
// "movq $0x0, %%rcx\n"
2027+
// "movq $0x0, %%rdx\n"
2028+
// "monitor\n"
2029+
// "movq $0x10, %%rax\n" // C2 state
2030+
// "movq $1, %%rcx\n" // wake on interrupt
2031+
// "mwait\n"
2032+
// :
2033+
// :
2034+
// : "rax", "rcx", "rdx", "memory"
2035+
// );
2036+
// }
2037+
20222038
ktime_t hlt_sleep(ktime_t sleep_req)
20232039
{
20242040
ktime_t start_time = ktime_get(), remaining_time = 233;

0 commit comments

Comments
 (0)