All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: David Brown <dmlb2000-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: out of memory page request
Date: Mon, 08 Oct 2007 10:03:09 +0200	[thread overview]
Message-ID: <4709E43D.40003@qumranet.com> (raw)
In-Reply-To: <9c21eeae0710071037o452bea4bm706e044526ed7ab7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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

David Brown wrote:
>> Can you run 'gdb /path/to/kvm.ko' and post the output of 'disassemble
>> ioapic_mmio_write' please?
>>
>>     
>
> Sorry for not getting back sooner.
>
> (gdb) disassemble ioapic_mmio_write
> Dump of assembler code for function ioapic_mmio_write:
>   

The attached patch should fix, though there's probably another problem 
lurking in there.

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


[-- Attachment #2: ioapic-indirect-write-fix.patch --]
[-- Type: text/x-patch, Size: 1092 bytes --]

commit f1b8c28f1886c9375361d7f2ebca1f742ea6bc5f
Author: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Date:   Mon Oct 8 10:01:45 2007 +0200

    KVM: Check I/O APIC indirect index before writing
    
    Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

diff --git a/drivers/kvm/ioapic.c b/drivers/kvm/ioapic.c
index 9eb5058..c7992e6 100644
--- a/drivers/kvm/ioapic.c
+++ b/drivers/kvm/ioapic.c
@@ -96,7 +96,7 @@ static void ioapic_service(struct kvm_ioapic *ioapic, unsigned int idx)
 
 static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
 {
-	int index;
+	unsigned index;
 
 	switch (ioapic->ioregsel) {
 	case IOAPIC_REG_VERSION:
@@ -114,7 +114,8 @@ static void ioapic_write_indirect(struct kvm_ioapic *ioapic, u32 val)
 		index = (ioapic->ioregsel - 0x10) >> 1;
 
 		ioapic_debug("change redir index %x val %x", index, val);
-		ASSERT(irq < IOAPIC_NUM_PINS);
+		if (index >= IOAPIC_NUM_PINS)
+			return;
 		if (ioapic->ioregsel & 1) {
 			ioapic->redirtbl[index].bits &= 0xffffffff;
 			ioapic->redirtbl[index].bits |= (u64) val << 32;

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

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

  parent reply	other threads:[~2007-10-08  8:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-04  4:43 out of memory page request David Brown
     [not found] ` <9c21eeae0710032143j3ed5f43dgc3858a8fde6806d1-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-10-05 13:14   ` Avi Kivity
     [not found]     ` <470638A5.3020609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-07 17:37       ` David Brown
     [not found]         ` <9c21eeae0710071037o452bea4bm706e044526ed7ab7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-10-08  8:03           ` Avi Kivity [this message]
     [not found]             ` <4709E43D.40003-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-08 23:53               ` Dong, Eddie
     [not found]                 ` <10EA09EFD8728347A513008B6B0DA77A014E8B00-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-09  9:41                   ` Avi Kivity
2007-10-10  3:19               ` David Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4709E43D.40003@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=dmlb2000-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.