Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1227194
| From | Dominik Dingel <dingel@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] kvm: fix preemption warnings in kvm_vcpu_block |
| Date | 2015-09-17 18:30 +0200 |
| Message-ID | <q9Ken-yZ-25@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Commit f78195129963 ("kvm: add halt_poll_ns module parameter") calls, with
enabled preemption, single_task_running. When CONFIG_DEBUG_PREEMPT is
enabled that will result in a debug_smp_processor_id() call.
Cc: <stable@vger.kernel.org> # 4.2.x
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
---
virt/kvm/kvm_main.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 54534de..ce67dd6 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1971,6 +1971,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
start = cur = ktime_get();
if (vcpu->halt_poll_ns) {
+ bool solo;
ktime_t stop = ktime_add_ns(ktime_get(), vcpu->halt_poll_ns);
do {
@@ -1982,8 +1983,13 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
++vcpu->stat.halt_successful_poll;
goto out;
}
+
+ preempt_disable();
+ solo = single_task_running();
+ preempt_enable();
+
cur = ktime_get();
- } while (single_task_running() && ktime_before(cur, stop));
+ } while (solo && ktime_before(cur, stop));
}
for (;;) {
--
2.3.8
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] kvm: fix preemption warnings in kvm_vcpu_block Dominik Dingel <dingel@linux.vnet.ibm.com> - 2015-09-17 18:30 +0200
single_task_running() vs. preemption warnings (was Re: [PATCH] kvm: fix preemption warnings in kvm_vcpu_block) Paolo Bonzini <pbonzini@redhat.com> - 2015-09-17 18:50 +0200
Re: single_task_running() vs. preemption warnings (was Re: [PATCH] kvm: fix preemption warnings in kvm_vcpu_block) Dominik Dingel <dingel@linux.vnet.ibm.com> - 2015-09-17 19:10 +0200
Re: single_task_running() vs. preemption warnings (was Re: [PATCH] kvm: fix preemption warnings in kvm_vcpu_block) Tim Chen <tim.c.chen@linux.intel.com> - 2015-09-17 22:50 +0200
Re: single_task_running() vs. preemption warnings (was Re: [PATCH] kvm: fix preemption warnings in kvm_vcpu_block) Peter Zijlstra <peterz@infradead.org> - 2015-09-18 10:00 +0200
csiph-web