From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DvZLu-0003lr-P3 for qemu-devel@nongnu.org; Thu, 21 Jul 2005 07:36:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DvZLr-0003kq-Ra for qemu-devel@nongnu.org; Thu, 21 Jul 2005 07:36:33 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DvZLq-0003g0-52 for qemu-devel@nongnu.org; Thu, 21 Jul 2005 07:36:30 -0400 Received: from [217.147.80.44] (helo=cel.leo) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DvZRj-0001ro-5W for qemu-devel@nongnu.org; Thu, 21 Jul 2005 07:42:35 -0400 Received: from nim.leo (nim.leo [192.168.42.3]) by cel.leo (Postfix) with ESMTP id CFB1023202 for ; Thu, 21 Jul 2005 12:32:36 +0100 (BST) Date: Thu, 21 Jul 2005 12:32:32 +0100 From: Paul LeoNerd Evans Message-ID: <20050721123232.7bf2456c@nim.leo> Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Signature_Thu__21_Jul_2005_12_32_32_+0100_sCsM7.XUEBt064Yd; protocol="application/pgp-signature"; micalg=pgp-sha1 Subject: [Qemu-devel] Network code on AMD64 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --Signature_Thu__21_Jul_2005_12_32_32_+0100_sCsM7.XUEBt064Yd Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Apologies if this issue has already been solved, by the way; I've only just joined the mailing list... I've been running 0.7.0 on an AMD64, and noticed that DHCP doesn't work. I further observe that a build of the same source, running the same image, works fine on an i386. Being familiar with fixing small code bugs on AMD64, I had a good look through the code for any 64bit issues that might arise (usually assumptions that "long" is 32 bits wide)... I found two places where this happens, and fixed them; see patch below... I find now, that DHCP works with this code. But there's a problem. Currently my only test image is a Windows 98SE install - not best known for being able to properly debug - I shall have to test with a decent Knoppix or something like that... But I find that if I start up IE, it attempts a connection to its default homepage, then Qemu itself segfaults. Normally I'd fire up gdb at this stage and have a good look around, but I gather from documentation that the internals of qemu are far from standard, and I might be somewhat out of my depth here. I thought I'd report here anyway; maybe someone with more development experience could pick it up, or at least, give me some suggestions of tests to run. I'm quite familiar with C in general, and Linux coding, but I've never done anything like the dynamic translation stuff that qemu is doing here... Also, I shall try to come up with a minimal test case using a Linux image; maybe if I provide an image that reliably boots and segfaults qemu..? diff -urN qemu-0.7.0-orig/slirp/bootp.h qemu-0.7.0/slirp/bootp.h --- qemu-0.7.0-orig/slirp/bootp.h 2005-04-27 21:52:05.000000000 +0100 +++ qemu-0.7.0/slirp/bootp.h 2005-07-20 20:33:45.413577774 +0100 @@ -97,9 +97,9 @@ uint8_t bp_htype; uint8_t bp_hlen; uint8_t bp_hops; - unsigned long bp_xid; - unsigned short bp_secs; - unsigned short unused; + uint32_t bp_xid; + uint16_t bp_secs; + uint16_t unused; struct in_addr bp_ciaddr; struct in_addr bp_yiaddr; struct in_addr bp_siaddr; diff -urN qemu-0.7.0-orig/slirp/ip.h qemu-0.7.0/slirp/ip.h --- qemu-0.7.0-orig/slirp/ip.h 2005-04-27 21:52:05.000000000 +0100 +++ qemu-0.7.0/slirp/ip.h 2005-07-20 20:33:45.413577774 +0100 @@ -209,7 +209,7 @@ * Overlay for ip header used by other protocols (tcp, udp). */ struct ipovly { - caddr32_t ih_next, ih_prev; /* for protocol sequence q's */ + uint32_t ih_next, ih_prev; /* for protocol sequence q's */ u_int8_t ih_x1; /* (unused) */ u_int8_t ih_pr; /* protocol */ int16_t ih_len; /* protocol length */ -- Paul "LeoNerd" Evans leonerd@leonerd.org.uk ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/ --Signature_Thu__21_Jul_2005_12_32_32_+0100_sCsM7.XUEBt064Yd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFC34fUvcPg11V/1hgRArDbAJ9KqfgKpd58Ep7k1EiTCEhfuf2pCACgh2Qr KWU+G/r7k2Y+pkLhWq8Vj3k= =Ax6R -----END PGP SIGNATURE----- --Signature_Thu__21_Jul_2005_12_32_32_+0100_sCsM7.XUEBt064Yd--