qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul LeoNerd Evans <leonerd@leonerd.org.uk>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Network code on AMD64
Date: Thu, 21 Jul 2005 12:32:32 +0100	[thread overview]
Message-ID: <20050721123232.7bf2456c@nim.leo> (raw)

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

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/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2005-07-21 11:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-21 11:32 Paul LeoNerd Evans [this message]
2005-07-21 15:25 ` [Qemu-devel] Network code on AMD64 Jim C. Brown
2005-07-21 16:18   ` Julian Seward
2005-07-21 21:55   ` Paul LeoNerd Evans
2005-07-21 22:58     ` Paul LeoNerd Evans

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=20050721123232.7bf2456c@nim.leo \
    --to=leonerd@leonerd.org.uk \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).