Skip to contentSkip to conversation

trivial Makefile patch + problem report

PATCH Applied Roland Dreier 3 participants 11 messages Nov 28, 2006 – Nov 30, 2006 6 messages not in the archive KVM

lore
Share & tools
lore
#0 lore raw

Hi, I've just installed kvm release 5 on systems with Intel Xeon 5160 processors, running up-to-date git kernels (2.6.19-rc6).

First, since I built my kernel with a separate object directory ("O=xxx"), I needed the patch below to the kernel module Kbuild file to get things to work (otherwise the build wouldn't find <linux/kvm.h>). As Documentation/kbuild/makefiles.txt says:

    $(src)
	$(src) is a relative path which points to the directory
	where the Makefile is located. Always use $(src) when
	referring to files located in the src tree.

Second, some of the time when starting a guest, I see a flood of messages like

rtc: lost some interrupts at 1024Hz.

flooding my kernel log, and almost always when that happens the system becomes unresponsive (although occasionally I'm able to kill the qemu process and restore the system).

Is there any debugging information or other way I can help fix this issue?

Thanks,
Roland

kernel/Kbuild +1 -1
@@ -1,4 +1,4 @@
-EXTRA_CFLAGS := -I$(PWD)/include
+EXTRA_CFLAGS := -I$(src)/include
 obj-m := kvm.o kvm-intel.o kvm-amd.o
 kvm-objs := kvm_main.o mmu.o x86_emulate.o debug.o
 kvm-intel-objs := vmx.o

-------------------------------------------------------------------------
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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 2 lines

Second, some of the time when starting a guest, I see a flood of messages like

By the way, just to be clear, the rest of the time everything works fine. Although after booting the Fedora Core 6 x86_64 installer, I did see the following kernel messages:

kvm: unhandled rdmsr: 417
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000400
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000401
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000402
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000403
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000404
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000405
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000406
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000407
inject_general_protection: rip 0xffffffff80270426

I assume these are benign.

- R.

-------------------------------------------------------------------------
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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 17 lines · Roland Dreier
Quoted 2 lines

Second, some of the time when starting a guest, I see a flood of messages like

By the way, just to be clear, the rest of the time everything works fine. Although after booting the Fedora Core 6 x86_64 installer, I did see the following kernel messages:

kvm: unhandled rdmsr: 417
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000400
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000401
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000402
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000403
inject_general_protection: rip 0xffffffff80270426

Quoted 10 lines

kvm: unhandled rdmsr: c0000404
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000405
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000406
inject_general_protection: rip 0xffffffff80270426
kvm: unhandled rdmsr: c0000407
inject_general_protection: rip 0xffffffff80270426

The guest is using rdmsr_safe() so it handles the exceptions fine. I'll add handling for these msrs, if it's possible to emulate them, so the messages don't appear.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
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
Applied
#5 lore raw
In reply to a message not in the archive
Quoted 8 lines · Roland Dreier

Hi, I've just installed kvm release 5 on systems with Intel Xeon 5160 processors, running up-to-date git kernels (2.6.19-rc6).

First, since I built my kernel with a separate object directory ("O=xxx"), I needed the patch below to the kernel module Kbuild file to get things to work (otherwise the build wouldn't find <linux/kvm.h>). As Documentation/kbuild/makefiles.txt says:

Quoted 6 lines
    $(src)
	$(src) is a relative path which points to the directory
	where the Makefile is located. Always use $(src) when
	referring to files located in the src tree.

Applied, thanks.

Quoted 13 lines

Second, some of the time when starting a guest, I see a flood of messages like

rtc: lost some interrupts at 1024Hz.

flooding my kernel log, and almost always when that happens the system becomes unresponsive (although occasionally I'm able to kill the qemu process and restore the system).

Is there any debugging information or other way I can help fix this issue?

You're using a Core (not 2) processor on a laptop, right?

There are two other reports about lost interrupts. One of them (hi Christian) is a total lockup, the other is lost rtc interrupts like yours.

Does your machine like Xen?

I'll try to cook up an experimental patch to modify interrupt handling to be more like Xen's.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
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

A message that is not in the archive (sent off-list or not yet received): 456D76B2.3040001-atKUWr5tajBWk0Htik3J/[email protected]

#7 lore raw
Quoted 4 lines · Avi Kivity

I'll try to cook up an experimental patch to modify interrupt handling to be more like Xen's.

Patch attached. It's for the external module, not -mm.

Signature · 1 line
error compiling committee.c: too many arguments to function
vmx.c +18 -0
Index: vmx.c
===================================================================
@@ -1163,6 +1163,7 @@
 	vmcs_writel(VM_EXIT_MSR_LOAD_ADDR,
 		    virt_to_phys(vcpu->host_msrs + NR_BAD_MSRS));
 	vmcs_write32_fixedbits(MSR_IA32_VMX_EXIT_CTLS_MSR, VM_EXIT_CONTROLS,
+			       VM_EXIT_ACK_INTR_ON_EXIT |
 		     	       (HOST_IS_64 << 9));  /* 22.2,1, 20.7.1 */
 	vmcs_write32(VM_EXIT_MSR_STORE_COUNT, nr_good_msrs); /* 22.2.2 */
 	vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, nr_good_msrs);  /* 22.2.2 */
@@ -1380,7 +1381,24 @@
 static int handle_external_interrupt(struct kvm_vcpu *vcpu,
 				     struct kvm_run *kvm_run)
 {
+	unsigned long irq;
+
 	++kvm_stat.irq_exits;
+	irq = vmcs_read32(VM_EXIT_INTR_INFO) & 0xff;
+	asm volatile (
+		"lea irq_dispatch(%0,%0,2), %0 \n\t"
+		"call *%0 \n\t"
+		"jmp out \n\t"
+		"irq_dispatch: \n\t"
+		"irq = 0 \n\t"
+		".rept 256 \n\t"
+		"  .byte 0xcd, irq \n\t" /* avoid int $3 -- one byte opcode */
+		"  ret \n\t"
+		"  irq = irq + 1 \n\t"
+		".endr \n\t"
+		"out:"
+		: "+r"(irq) );
+
 	return 1;
 }
 

-------------------------------------------------------------------------
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

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

A message that is not in the archive (sent off-list or not yet received): 456D7F4B.1000307-atKUWr5tajBWk0Htik3J/[email protected]

#10 lore raw
In reply to a message not in the archive

I still see the

rtc: lost some interrupts at 1024Hz.

message with your patch applied.

One thing I noticed is that my serial console seems to be related to the messages. I just booted my machine with the serial console printing kernel messages, and I saw the lost interrupt messages when starting a guest twice in a row. Then I did

echo 0 0 > /proc/sys/kernel/printk

and started a guest with no lost interrupt messages. And then I did

echo 8 8 > /proc/sys/kernel/printk

and the messages started spewing out and my machine was hosed to the point where I couldn't kill the guest again.

The only message that actually printed on the serial console before the machine got stuck spewing rtc messages was

device tap0 entered promiscuous mode

(I'm using tun and bridging for my qemu networking)

-------------------------------------------------------------------------
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

#11 lore raw
In reply to a message not in the archive

Actually ... this does not seem to be a kvm issue at all!

I just rebooted my system to try again, and I started a qemu guest and got the spew of rtc lost interrupt messages. But I also noticed:

Could not initialize KVM, will disable KVM support

and in fact I had forgotten to load the kvm module!

So somehow qemu's tap networking is causing a problem it seems...

-------------------------------------------------------------------------
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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw
Quoted 4 lines

Subject: Re: [kvm-devel] trivial Makefile patch + problem report

Actually ... this does not seem to be a kvm issue at all!

Quoted 8 lines

I just rebooted my system to try again, and I started a qemu guest and got the spew of rtc lost interrupt messages. But I also noticed:

Could not initialize KVM, will disable KVM support

and in fact I had forgotten to load the kvm module!

So somehow qemu's tap networking is causing a problem it seems...

I find it hard to believe, can you test qemu with user mode networking and see what happens?

Quoted 2 lines

------------------------------------------------------------------------
-

Quoted 2 lines

Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to

share

Quoted 3 lines

your
opinions on IT & business topics through brief surveys - and earn cash

http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V

Quoted 4 lines

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
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

A message that is not in the archive (sent off-list or not yet received): 64F9B87B6B770947A9F8391472E03216094CB09E-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/[email protected]

#15 lore raw
Quoted 2 lines

I find it hard to believe, can you test qemu with user mode networking and see what happens?

If I remove "-net tap" from my qemu command line I don't get any of the rtc messages.

- R.

-------------------------------------------------------------------------
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

#16 lore raw
In reply to a message not in the archive
Quoted 1 line

You're using a Core (not 2) processor on a laptop, right?

No, a Xeon 5160 (Core 2 basically I believe). And I'm running a 64-bit kernel.

Quoted 1 line

Does your machine like Xen?

I've not tried to be honest...

-------------------------------------------------------------------------
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