Re: [Qemu-devel] MIPS64 problem with ethernet
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 = 0x8073; unsigned int v2 = v1 + 1; printk(v1 %lx v2 %08x\n, v1, v2); } On the real hw it prints correctly as: v1 8073 v2 80731112 On the emulated 64 bit + 64bit kernel on a 32 bit host it prints as: v1 8073 v2 80731112 This might be due to the ddivu in printk, but it could be elsewhere... Jason.
[Qemu-devel] qemu vl.h hw/esp.c hw/pcnet.c hw/sparc32_dma.c ...
CVSROOT:/cvsroot/qemu Module name:qemu Changes by: Blue Swirl blueswir1 07/05/27 16:36:10 Modified files: . : vl.h hw : esp.c pcnet.c sparc32_dma.c sun4m.c Log message: Use qemu_irqs between dma controllers and esp, lance CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/vl.h?cvsroot=qemur1=1.240r2=1.241 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/esp.c?cvsroot=qemur1=1.21r2=1.22 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/pcnet.c?cvsroot=qemur1=1.12r2=1.13 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sparc32_dma.c?cvsroot=qemur1=1.5r2=1.6 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sun4m.c?cvsroot=qemur1=1.40r2=1.41
[Qemu-devel] qemu vl.h hw/slavio_intctl.c hw/slavio_timer.c ...
CVSROOT:/cvsroot/qemu Module name:qemu Changes by: Blue Swirl blueswir1 07/05/27 16:37:49 Modified files: . : vl.h hw : slavio_intctl.c slavio_timer.c sun4m.c Log message: Use qemu_irq between interrupt controller and timers CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/vl.h?cvsroot=qemur1=1.241r2=1.242 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_intctl.c?cvsroot=qemur1=1.14r2=1.15 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_timer.c?cvsroot=qemur1=1.12r2=1.13 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sun4m.c?cvsroot=qemur1=1.41r2=1.42
[Qemu-devel] qemu vl.h hw/slavio_intctl.c hw/sun4m.c
CVSROOT:/cvsroot/qemu Module name:qemu Changes by: Blue Swirl blueswir1 07/05/27 16:42:29 Modified files: . : vl.h hw : slavio_intctl.c sun4m.c Log message: Use qemu_irqs between CPUs and interrupt controller Fix interrupt priority handling which prevented SMP from working CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/vl.h?cvsroot=qemur1=1.242r2=1.243 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_intctl.c?cvsroot=qemur1=1.15r2=1.16 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sun4m.c?cvsroot=qemur1=1.42r2=1.43
[Qemu-devel] qemu/target-sparc cpu.h op_helper.c
CVSROOT:/cvsroot/qemu Module name:qemu Changes by: Blue Swirl blueswir1 07/05/27 19:36:00 Modified files: target-sparc : cpu.h op_helper.c Log message: Separate fault for code access to unassigned memory CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/target-sparc/cpu.h?cvsroot=qemur1=1.39r2=1.40 http://cvs.savannah.gnu.org/viewcvs/qemu/target-sparc/op_helper.c?cvsroot=qemur1=1.29r2=1.30
[Qemu-devel] qemu sparc-dis.c linux-user/main.c target-i386/...
CVSROOT:/cvsroot/qemu Module name:qemu Changes by: Blue Swirl blueswir1 07/05/27 19:39:27 Modified files: . : sparc-dis.c linux-user : main.c target-i386: helper.c translate.c target-ppc : translate.c Log message: Spelling fix (Mark Glines) CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/sparc-dis.c?cvsroot=qemur1=1.3r2=1.4 http://cvs.savannah.gnu.org/viewcvs/qemu/linux-user/main.c?cvsroot=qemur1=1.112r2=1.113 http://cvs.savannah.gnu.org/viewcvs/qemu/target-i386/helper.c?cvsroot=qemur1=1.81r2=1.82 http://cvs.savannah.gnu.org/viewcvs/qemu/target-i386/translate.c?cvsroot=qemur1=1.63r2=1.64 http://cvs.savannah.gnu.org/viewcvs/qemu/target-ppc/translate.c?cvsroot=qemur1=1.58r2=1.59
[Qemu-devel] qemu qemu-doc.texi hw/integratorcp.c hw/mips_r4...
CVSROOT:/cvsroot/qemu Module name:qemu Changes by: Blue Swirl blueswir1 07/05/27 19:41:18 Modified files: . : qemu-doc.texi hw : integratorcp.c mips_r4k.c pc.c pci.c ppc_prep.c sun4m.c Log message: New option -net nic,model=? (Mark Glines) Network documentation update (Mark Glines) CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/qemu-doc.texi?cvsroot=qemur1=1.144r2=1.145 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/integratorcp.c?cvsroot=qemur1=1.16r2=1.17 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/mips_r4k.c?cvsroot=qemur1=1.43r2=1.44 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/pc.c?cvsroot=qemur1=1.78r2=1.79 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/pci.c?cvsroot=qemur1=1.38r2=1.39 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/ppc_prep.c?cvsroot=qemur1=1.38r2=1.39 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sun4m.c?cvsroot=qemur1=1.44r2=1.45
[Qemu-devel] qemu/hw slavio_intctl.c
CVSROOT:/cvsroot/qemu Module name:qemu Changes by: Blue Swirl blueswir1 07/05/27 19:42:35 Modified files: hw : slavio_intctl.c Log message: Interrupt debugging DPRINTFs CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/hw/slavio_intctl.c?cvsroot=qemur1=1.16r2=1.17
Re: [Qemu-devel] MIPS64 problem with ethernet
On Sun, May 27, 2007 at 06:30:52AM -0500, Jason Wessel wrote: 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 = 0x8073; unsigned int v2 = v1 + 1; printk(v1 %lx v2 %08x\n, v1, v2); } On the real hw it prints correctly as: v1 8073 v2 80731112 On the emulated 64 bit + 64bit kernel on a 32 bit host it prints as: v1 8073 v2 80731112 This might be due to the ddivu in printk, but it could be elsewhere... The problem is actually not specific to 32-bit hosts. It is a bug in the lwu instruction, which should not sign extend the loaded byte. Please find below a patch to fix that. Index: target-mips/op_mem.c === RCS file: /sources/qemu/qemu/target-mips/op_mem.c,v retrieving revision 1.10 diff -u -d -p -r1.10 op_mem.c --- target-mips/op_mem.c20 May 2007 01:36:28 - 1.10 +++ target-mips/op_mem.c27 May 2007 22:59:13 - @@ -63,7 +63,7 @@ void glue(op_lw, MEMSUFFIX) (void) void glue(op_lwu, MEMSUFFIX) (void) { -T0 = glue(ldl, MEMSUFFIX)(T0); +T0 = (uint32_t) glue(ldl, MEMSUFFIX)(T0); RETURN(); } -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [EMAIL PROTECTED] | [EMAIL PROTECTED] `-people.debian.org/~aurel32 | www.aurel32.net
[Qemu-devel] qemu/target-m68k translate.c
CVSROOT:/sources/qemu Module name:qemu Changes by: Paul Brook pbrook 07/05/28 01:46:43 Modified files: target-m68k: translate.c Log message: Add diagnostic for bad opcode masks. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/target-m68k/translate.c?cvsroot=qemur1=1.10r2=1.11
[Qemu-devel] qemu/target-m68k op.c translate.c
CVSROOT:/sources/qemu Module name:qemu Changes by: Paul Brook pbrook 07/05/28 02:20:34 Modified files: target-m68k: op.c translate.c Log message: Implement ColdFire ff1. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/target-m68k/op.c?cvsroot=qemur1=1.6r2=1.7 http://cvs.savannah.gnu.org/viewcvs/qemu/target-m68k/translate.c?cvsroot=qemur1=1.11r2=1.12
[Qemu-devel] qemu vl.c
CVSROOT:/sources/qemu Module name:qemu Changes by: Paul Brook pbrook 07/05/28 02:29:59 Modified files: . : vl.c Log message: Fix tap device counting. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/vl.c?cvsroot=qemur1=1.302r2=1.303