public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* trivial Makefile patch + problem report
@ 2006-11-28 23:23 Roland Dreier
       [not found] ` <aday7pvrw97.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Roland Dreier @ 2006-11-28 23:23 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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


--- kvm-5/kernel/Kbuild	2006-11-27 05:56:08.000000000 -0800
+++ kvm-5.new/kernel/Kbuild	2006-11-28 13:13:21.000000000 -0800
@@ -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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trivial Makefile patch + problem report
       [not found] ` <aday7pvrw97.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
@ 2006-11-28 23:28   ` Roland Dreier
       [not found]     ` <adau00jrw0g.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  2006-11-29 12:01   ` Avi Kivity
  1 sibling, 1 reply; 11+ messages in thread
From: Roland Dreier @ 2006-11-28 23:28 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

 > 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trivial Makefile patch + problem report
       [not found] ` <aday7pvrw97.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  2006-11-28 23:28   ` Roland Dreier
@ 2006-11-29 12:01   ` Avi Kivity
       [not found]     ` <456D76B2.3040001-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  1 sibling, 1 reply; 11+ messages in thread
From: Avi Kivity @ 2006-11-29 12:01 UTC (permalink / raw)
  To: Roland Dreier; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Roland Dreier wrote:
> 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.
>
>   

Applied, thanks.

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


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trivial Makefile patch + problem report
       [not found]     ` <adau00jrw0g.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
@ 2006-11-29 12:03       ` Avi Kivity
  0 siblings, 0 replies; 11+ messages in thread
From: Avi Kivity @ 2006-11-29 12:03 UTC (permalink / raw)
  To: Roland Dreier; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Roland Dreier wrote:
>  > 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
>
>   

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.



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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trivial Makefile patch + problem report
       [not found]     ` <456D76B2.3040001-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2006-11-29 12:38       ` Avi Kivity
       [not found]         ` <456D7F4B.1000307-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  2006-11-29 15:30       ` Roland Dreier
  1 sibling, 1 reply; 11+ messages in thread
From: Avi Kivity @ 2006-11-29 12:38 UTC (permalink / raw)
  To: Roland Dreier; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

Avi Kivity wrote:
>
> 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.

-- 
error compiling committee.c: too many arguments to function


[-- Attachment #2: kvm-handle-external-interrupts-explicitly.patch --]
[-- Type: text/x-patch, Size: 1090 bytes --]

Index: vmx.c
===================================================================
--- vmx.c	(revision 3989)
+++ vmx.c	(working copy)
@@ -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;
 }
 

[-- Attachment #3: Type: text/plain, Size: 347 bytes --]

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

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trivial Makefile patch + problem report
       [not found]     ` <456D76B2.3040001-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  2006-11-29 12:38       ` Avi Kivity
@ 2006-11-29 15:30       ` Roland Dreier
  1 sibling, 0 replies; 11+ messages in thread
From: Roland Dreier @ 2006-11-29 15:30 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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

 > 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trivial Makefile patch + problem report
       [not found]         ` <456D7F4B.1000307-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2006-11-29 16:06           ` Roland Dreier
  2006-11-29 22:29           ` Roland Dreier
  2006-11-29 22:38           ` Roland Dreier
  2 siblings, 0 replies; 11+ messages in thread
From: Roland Dreier @ 2006-11-29 16:06 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Thanks, I will give this a try today.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trivial Makefile patch + problem report
       [not found]         ` <456D7F4B.1000307-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  2006-11-29 16:06           ` Roland Dreier
@ 2006-11-29 22:29           ` Roland Dreier
  2006-11-29 22:38           ` Roland Dreier
  2 siblings, 0 replies; 11+ messages in thread
From: Roland Dreier @ 2006-11-29 22:29 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trivial Makefile patch + problem report
       [not found]         ` <456D7F4B.1000307-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  2006-11-29 16:06           ` Roland Dreier
  2006-11-29 22:29           ` Roland Dreier
@ 2006-11-29 22:38           ` Roland Dreier
       [not found]             ` <adavekxq3ou.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  2 siblings, 1 reply; 11+ messages in thread
From: Roland Dreier @ 2006-11-29 22:38 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trivial Makefile patch + problem report
       [not found]             ` <adavekxq3ou.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
@ 2006-11-30  8:29               ` Dor Laor
       [not found]                 ` <64F9B87B6B770947A9F8391472E03216094CB09E-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Dor Laor @ 2006-11-30  8:29 UTC (permalink / raw)
  To: Roland Dreier, Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

> Subject: Re: [kvm-devel] trivial Makefile patch + problem report
> 
> 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...

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

> 
>
------------------------------------------------------------------------
-
> 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=DEVDE
V
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: trivial Makefile patch + problem report
       [not found]                 ` <64F9B87B6B770947A9F8391472E03216094CB09E-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
@ 2006-11-30 14:48                   ` Roland Dreier
  0 siblings, 0 replies; 11+ messages in thread
From: Roland Dreier @ 2006-11-30 14:48 UTC (permalink / raw)
  To: Dor Laor; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Avi Kivity

 > 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-11-30 14:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-28 23:23 trivial Makefile patch + problem report Roland Dreier
     [not found] ` <aday7pvrw97.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2006-11-28 23:28   ` Roland Dreier
     [not found]     ` <adau00jrw0g.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2006-11-29 12:03       ` Avi Kivity
2006-11-29 12:01   ` Avi Kivity
     [not found]     ` <456D76B2.3040001-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-29 12:38       ` Avi Kivity
     [not found]         ` <456D7F4B.1000307-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-29 16:06           ` Roland Dreier
2006-11-29 22:29           ` Roland Dreier
2006-11-29 22:38           ` Roland Dreier
     [not found]             ` <adavekxq3ou.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2006-11-30  8:29               ` Dor Laor
     [not found]                 ` <64F9B87B6B770947A9F8391472E03216094CB09E-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org>
2006-11-30 14:48                   ` Roland Dreier
2006-11-29 15:30       ` Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox