qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Network code on AMD64


From: Paul LeoNerd Evans
Subject: [Qemu-devel] Network code on AMD64
Date: Thu, 21 Jul 2005 12:32:32 +0100

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

address@hidden
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Attachment: pgp0sLNIDdr6z.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]