logo       

Re: [PATCH 0/8] KVM updates for 2.6.20-rc2: msg#00252

emulators.kvm.devel

Subject: Re: [PATCH 0/8] KVM updates for 2.6.20-rc2


btw., we've got a problem with KVM in -rt:

BUG: scheduling while atomic: qemu/0x00000001/11445, CPU#0
[<c0104fce>] dump_trace+0x63/0x1e8
[<c010516c>] show_trace_log_lvl+0x19/0x2e
[<c0105541>] show_trace+0x12/0x14
[<c0105557>] dump_stack+0x14/0x16
[<c0322662>] __schedule+0xae/0xd9f
[<c0323597>] schedule+0xec/0x10f
[<c0324017>] rt_spin_lock_slowlock+0xd2/0x15b
[<c03244a6>] rt_spin_lock+0x1e/0x20
[<c0169d94>] kunmap_high+0x11/0x99
[<c0121139>] kunmap+0x40/0x42
[<c0121171>] kunmap_virt+0x36/0x38
[<f8f017b7>] emulator_read_std+0x92/0xaf [kvm]
[<f8f05292>] x86_emulate_memop+0xc6/0x295c [kvm]
[<f8f018c3>] emulate_instruction+0xef/0x202 [kvm]
[<f8e0f2a7>] handle_exception+0x107/0x1c8 [kvm_intel]
[<f8e0ef0c>] kvm_vmx_return+0x145/0x18d [kvm_intel]
[<f8f0253c>] kvm_dev_ioctl+0x253/0xd76 [kvm]
[<c01874f1>] do_ioctl+0x21/0x66
[<c018778b>] vfs_ioctl+0x255/0x268
[<c01877e6>] sys_ioctl+0x48/0x62
[<c0103f8d>] syscall_call+0x7/0xb
[<4a4538b2>] 0x4a4538b2

NOTE: this is not a worry for upstream kernel, it is caused by
PREEMPT_RT scheduling in previously atomic APIs like kunmap(). But KVM
used to work pretty nicely in -rt and this problem got introduced fairly
recently, related to some big-page changes IIRC.

Any suggestions of how to best fix this in -rt? Basically, it would be
nice to decouple KVM from get_cpu/preempt_disable type of interfaces as
much as possible, to make it fully preemptible. Below are my current
fixups for KVM, but the problem above looks harder to fix.

Ingo

---
drivers/kvm/vmx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux/drivers/kvm/vmx.c
===================================================================
--- linux.orig/drivers/kvm/vmx.c
+++ linux/drivers/kvm/vmx.c
@@ -117,7 +117,7 @@ static void vmcs_clear(struct vmcs *vmcs
static void __vcpu_clear(void *arg)
{
struct kvm_vcpu *vcpu = arg;
- int cpu = smp_processor_id();
+ int cpu = raw_smp_processor_id();

if (vcpu->cpu == cpu)
vmcs_clear(vcpu->vmcs);
@@ -576,7 +576,7 @@ static struct vmcs *alloc_vmcs_cpu(int c

static struct vmcs *alloc_vmcs(void)
{
- return alloc_vmcs_cpu(smp_processor_id());
+ return alloc_vmcs_cpu(raw_smp_processor_id());
}

static void free_vmcs(struct vmcs *vmcs)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise