qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] MIPS64 problem with ethernet


From: Jason Wessel
Subject: Re: [Qemu-devel] MIPS64 problem with ethernet
Date: Sun, 27 May 2007 06:30:52 -0500
User-agent: Thunderbird 1.5.0.10 (X11/20070302)

Aurelien Jarno wrote:
As discussed on IRC, the problem is only present on 32-bit hosts. It is
due to the do_ddivu which is falsely implemented using lldiv and then by
casting the result. The patch below uses / and % as on the 64-bit host
code. It is maybe slower than lldiv, but at least it gives the correct
result. This probably involves some libgcc code, so it is better to keep
it in op_helper.c for 32-bit hosts.


With your change the ethernet does come up but it seems there is a further problem, perhaps with ddivu. My host is a 32bit host, and this does seem to work on a 64bit host or the real hardware. Doing something like an ls /proc does not work in the emulated target. The reason is that the compatibility syscalls are 32bit and there is some sign extension problem somewhere.

I put the following code in kernel/main/init.c as an illustration of the problem.
   {
       unsigned long v1 = 0xffffffff80731111;
       unsigned int v2 = v1 + 1;
       printk("v1 %lx v2 %08x\n", v1, v2);
   }

On the real hw it prints correctly as:
v1 ffffffff80731111 v2 80731112

On the emulated 64 bit + 64bit kernel on a 32 bit host it prints as:
v1 ffffffff80731111 v2 ffffffff80731112

This might be due to the ddivu in printk, but it could be elsewhere...

Jason.






reply via email to

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