Commit 175d5dc
KVM: Avoid re-reading kvm->max_halt_poll_ns during halt-polling
Avoid re-reading kvm->max_halt_poll_ns multiple times during
halt-polling except when it is explicitly useful, e.g. to check if the
max time changed across a halt. kvm->max_halt_poll_ns can be changed at
any time by userspace via KVM_CAP_HALT_POLL.
This bug is unlikely to cause any serious side-effects. In the worst
case one halt polls for shorter or longer than it should, and then is
fixed up on the next halt. Furthmore, this is still possible since
kvm->max_halt_poll_ns are not synchronized with halts.
Fixes: acd0578 ("kvm: add capability for halt polling")
Signed-off-by: David Matlack <dmatlack@google.com>
Message-Id: <20221117001657.1067231-3-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent 97b6847 commit 175d5dc
1 file changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3480 | 3480 | | |
3481 | 3481 | | |
3482 | 3482 | | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
| 3487 | + | |
3483 | 3488 | | |
3484 | 3489 | | |
3485 | 3490 | | |
| |||
3488 | 3493 | | |
3489 | 3494 | | |
3490 | 3495 | | |
| 3496 | + | |
3491 | 3497 | | |
3492 | 3498 | | |
3493 | 3499 | | |
3494 | 3500 | | |
3495 | 3501 | | |
3496 | 3502 | | |
3497 | | - | |
3498 | | - | |
| 3503 | + | |
| 3504 | + | |
3499 | 3505 | | |
3500 | 3506 | | |
3501 | 3507 | | |
| |||
3537 | 3543 | | |
3538 | 3544 | | |
3539 | 3545 | | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
3540 | 3549 | | |
3541 | 3550 | | |
3542 | | - | |
| 3551 | + | |
3543 | 3552 | | |
3544 | 3553 | | |
3545 | 3554 | | |
3546 | 3555 | | |
3547 | | - | |
| 3556 | + | |
3548 | 3557 | | |
3549 | 3558 | | |
3550 | | - | |
3551 | | - | |
| 3559 | + | |
| 3560 | + | |
3552 | 3561 | | |
3553 | 3562 | | |
3554 | 3563 | | |
| |||
0 commit comments