From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: e1000 and PXE issues Date: Sat, 26 Jul 2008 11:12:31 +0300 Message-ID: <488ADC6F.2090907@qumranet.com> References: <571f1a060807212145o24153cc4s1686d713f2ae41e8@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010309060609040707000907" Cc: kvm@vger.kernel.org To: Greg Kurtzer Return-path: Received: from il.qumranet.com ([212.179.150.194]:48744 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751652AbYGZIMe (ORCPT ); Sat, 26 Jul 2008 04:12:34 -0400 In-Reply-To: <571f1a060807212145o24153cc4s1686d713f2ae41e8@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------010309060609040707000907 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. --------------010309060609040707000907 Content-Type: text/x-patch; name="test1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="test1.patch" commit 2ec717a98c8b8e0c8f1ddc562115ca81d2dc024e Author: Laurent Vivier 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 Signed-off-by: Avi Kivity 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 --------------010309060609040707000907 Content-Type: text/x-patch; name="test2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="test2.patch" commit 404ce95cb202ca6015beb26e9b870f91c0309ee0 Author: Anthony Liguori 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 Signed-off-by: Avi Kivity 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 --------------010309060609040707000907--