public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Greg Kurtzer <gmkurtzer@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: e1000 and PXE issues
Date: Sat, 26 Jul 2008 11:12:31 +0300	[thread overview]
Message-ID: <488ADC6F.2090907@qumranet.com> (raw)
In-Reply-To: <571f1a060807212145o24153cc4s1686d713f2ae41e8@mail.gmail.com>

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

Greg Kurtzer wrote:
> Hello,
>
> I noticed some problems with the e1000 implementation in kvm >= 70. At
> first glance it seemed liked a PXE problem as it would not acknowledge
> the DHCP offer from the server. I tried several different Etherboot
> ROM images and version 5.2.6 seemed to work. That version isn't PXE
> compliant so I built an ELF image to boot, and it downloaded it very,
> very, very, very slowly (as in about 10 minutes) but it did end up
> working.
>
> This all worked perfectly with version 69 and previous.
>   

There are two patches to e1000 in kvm-70; can you try backing them out 
(patch -Rp1 < test.patch) to see which one is guilty?

Candidates attached.


-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


[-- Attachment #2: test1.patch --]
[-- Type: text/x-patch, Size: 1291 bytes --]

commit 2ec717a98c8b8e0c8f1ddc562115ca81d2dc024e
Author: Laurent Vivier <Laurent.Vivier@bull.net>
Date:   Fri May 30 16:07:31 2008 +0200

    kvm: qemu: coalesced MMIO support (e1000)
    
    This patch defines coalesced MMIO zones for e1000 ethernet card.
    
    Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
    Signed-off-by: Avi Kivity <avi@qumranet.com>

diff --git a/qemu/hw/e1000.c b/qemu/hw/e1000.c
index 01f8983..5b3a365 100644
--- a/qemu/hw/e1000.c
+++ b/qemu/hw/e1000.c
@@ -26,6 +26,7 @@
 #include "hw.h"
 #include "pci.h"
 #include "net.h"
+#include "qemu-kvm.h"
 
 #include "e1000_hw.h"
 
@@ -938,6 +939,18 @@ e1000_mmio_map(PCIDevice *pci_dev, int region_num,
 
     d->mmio_base = addr;
     cpu_register_physical_memory(addr, PNPMMIO_SIZE, d->mmio_index);
+
+    if (kvm_enabled()) {
+	int i;
+        uint32_t excluded_regs[] = {
+            E1000_MDIC, E1000_ICR, E1000_ICS, E1000_IMS,
+            E1000_IMC, E1000_TCTL, E1000_TDT, PNPMMIO_SIZE
+        };
+        qemu_kvm_register_coalesced_mmio(addr, excluded_regs[0]);
+        for (i = 0; excluded_regs[i] != PNPMMIO_SIZE; i++)
+            qemu_kvm_register_coalesced_mmio(addr + excluded_regs[i] + 4,
+                             excluded_regs[i + 1] - excluded_regs[i] - 4);
+    }
 }
 
 static int

[-- Attachment #3: test2.patch --]
[-- Type: text/x-patch, Size: 1018 bytes --]

commit 404ce95cb202ca6015beb26e9b870f91c0309ee0
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Wed May 7 16:40:58 2008 -0500

    kvm: qemu: fix e1000 can_receive handler
    
    The current logic of the can_receive handler is to allow packets whenever the
    receiver is disabled or when there are descriptors available in the ring.
    
    I think the logic ought to be to allow packets whenever the receiver is enabled
    and there are descriptors available in the ring.
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
    Signed-off-by: Avi Kivity <avi@qumranet.com>

diff --git a/qemu/hw/e1000.c b/qemu/hw/e1000.c
index 0728539..01f8983 100644
--- a/qemu/hw/e1000.c
+++ b/qemu/hw/e1000.c
@@ -520,8 +520,8 @@ e1000_can_receive(void *opaque)
 {
     E1000State *s = opaque;
 
-    return (!(s->mac_reg[RCTL] & E1000_RCTL_EN) ||
-            s->mac_reg[RDH] != s->mac_reg[RDT]);
+    return ((s->mac_reg[RCTL] & E1000_RCTL_EN) &&
+	    s->mac_reg[RDH] != s->mac_reg[RDT]);
 }
 
 static void

  parent reply	other threads:[~2008-07-26  8:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-22  4:45 e1000 and PXE issues Greg Kurtzer
2008-07-24 18:28 ` H. Peter Anvin
2008-07-26  8:12 ` Avi Kivity [this message]
2008-07-26 14:24   ` Greg Kurtzer
2008-07-27 17:32     ` Farkas Levente
2008-07-28  2:29       ` Greg Kurtzer
2008-07-28  8:16       ` Amit Shah
2008-07-28 13:12         ` Greg Kurtzer
2008-07-28 18:21 ` Charles Duffy

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=488ADC6F.2090907@qumranet.com \
    --to=avi@qumranet.com \
    --cc=gmkurtzer@gmail.com \
    --cc=kvm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox