Re: [Qemu-devel] I got a kernel booted under qemu-system-ppc !

2007-10-20 Thread Rob Landley
On Friday 19 October 2007 3:33:52 pm Aurelien Jarno wrote:
 Aurelien Jarno a écrit :
  - The target CPU never gets into idle loop, so the host CPU is always
used at 100%

 This is actually not a problem. The default CPU (604) does not support
 DOZE or NAP. Switching to a 603 CPU, the target CPU correctly goes
 into idle loop.

This would be adding -cpu 603 to the command line?

Is there a web page listing all the powerpc processors somewhere?  I'm still 
at the everything is 7xx except for 4xx and 8xx stage...

I found this:
http://www.power.org/resources/devcorner/roadmap

But it groups by manufacturer rather than capabilities or software 
compatability...

Rob
-- 
One of my most productive days was throwing away 1000 lines of code.
  - Ken Thompson.




Re: [Qemu-devel] qemu-i386 does not start on x86_64 or i686

2007-10-20 Thread Rob Landley
On Thursday 18 October 2007 4:46:50 pm Ronan Keryell wrote:
 Anybody kind enough to have a look at :
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=446868

 I've asked some other people and they hit the same issue.
 It's not clear to me where the bug is since it happens very early in the
 starting process...

 Thank you,

There have been several earlier threads on this.  Here's one I started back in 
June: http://lists.gnu.org/archive/html/qemu-devel/2007-06/msg00303.html

It was still broken, last I checked.  I'd try to do a git bisect, but 0.9.0 
was still broken and if you go back too far it can't find gcc-3.4 and barfs 
because the gcc everything else in the world builds with is 4.x.  (What broke 
it was moving the system to glibc 2.5, I.E. upgrading Ubuntu to 7.04.  Old 
versions of qemu don't run against that either.)

It only affects user mode, not system mode, and only the i386 target, so I 
just delete that executable after the install so nothing tries to use it.

Rob
-- 
One of my most productive days was throwing away 1000 lines of code.
  - Ken Thompson.




Re: [Qemu-devel] Questions on hidden functions in QEMU source code

2007-10-20 Thread Rob Landley
On Tuesday 16 October 2007 9:19:36 am Johannes Schindelin wrote:
 If you wonder why it is included four times, this might help:

 http://libvncserver.sourceforge.net/qemu/qemu-templates-ala-Fabrice.txt

Is that linked from qemu.org/user-doc.html somewhere?

Rob
-- 
One of my most productive days was throwing away 1000 lines of code.
  - Ken Thompson.




[Qemu-devel] qemu/target-sparc op.c op_helper.c

2007-10-20 Thread Blue Swirl
CVSROOT:/cvsroot/qemu
Module name:qemu
Changes by: Blue Swirl blueswir1  07/10/20 07:07:47

Modified files:
target-sparc   : op.c op_helper.c 

Log message:
 Fix compiling Sparc64 on PPC host

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/target-sparc/op.c?cvsroot=qemur1=1.43r2=1.44
http://cvs.savannah.gnu.org/viewcvs/qemu/target-sparc/op_helper.c?cvsroot=qemur1=1.46r2=1.47




[Qemu-devel] qemu/target-sparc op_helper.c

2007-10-20 Thread Blue Swirl
CVSROOT:/cvsroot/qemu
Module name:qemu
Changes by: Blue Swirl blueswir1  07/10/20 07:09:08

Modified files:
target-sparc   : op_helper.c 

Log message:
 Avoid gcc warnings

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/target-sparc/op_helper.c?cvsroot=qemur1=1.47r2=1.48




Re: [Qemu-devel] I got a kernel booted under qemu-system-ppc !

2007-10-20 Thread Rob Landley
On Friday 19 October 2007 10:19:16 am Aurelien Jarno wrote:
 The small patch below fixes the IDE problem, but not the NE2000 ISA one.
 Please apply.

 Index: hw/i8259.c
 ===
 RCS file: /sources/qemu/qemu/hw/i8259.c,v
 retrieving revision 1.25
 diff -u -d -p -r1.25 i8259.c
 --- hw/i8259.c17 Sep 2007 08:09:46 -  1.25
 +++ hw/i8259.c19 Oct 2007 15:17:22 -
 @@ -164,7 +164,7 @@ void pic_update_irq(PicState2 *s)
  }

  /* all targets should do this rather than acking the IRQ in the cpu */
 -#if defined(TARGET_MIPS)
 +#if defined(TARGET_MIPS) || defined(TARGET_PPC)
  else {
  qemu_irq_lower(s-parent_irq);
  }

Ack.  This fixed it for me.

Off to try the network one...

Rob
-- 
One of my most productive days was throwing away 1000 lines of code.
  - Ken Thompson.




[Qemu-devel] qemu qemu-doc.texi qemu-tech.texi

2007-10-20 Thread Blue Swirl
CVSROOT:/cvsroot/qemu
Module name:qemu
Changes by: Blue Swirl blueswir1  07/10/20 08:09:05

Modified files:
.  : qemu-doc.texi qemu-tech.texi 

Log message:
 Update Sparc parts in documentation

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/qemu-doc.texi?cvsroot=qemur1=1.161r2=1.162
http://cvs.savannah.gnu.org/viewcvs/qemu/qemu-tech.texi?cvsroot=qemur1=1.14r2=1.15




Re: [Qemu-devel] I got a kernel booted under qemu-system-ppc !

2007-10-20 Thread J. Mayer

On Sat, 2007-10-20 at 01:08 -0500, Rob Landley wrote:
 On Friday 19 October 2007 3:33:52 pm Aurelien Jarno wrote:
  Aurelien Jarno a écrit :
   - The target CPU never gets into idle loop, so the host CPU is always
 used at 100%
 
  This is actually not a problem. The default CPU (604) does not support
  DOZE or NAP. Switching to a 603 CPU, the target CPU correctly goes
  into idle loop.

Sleep mode is currently implemented only for a few CPUs. I should add
all the currently emulated cores. For this, I would have to emulate the
HID registers, in most case, which is still not done.

 This would be adding -cpu 603 to the command line?

Yes

 
 Is there a web page listing all the powerpc processors somewhere?  I'm still 
 at the everything is 7xx except for 4xx and 8xx stage...
 
 I found this:
 http://www.power.org/resources/devcorner/roadmap
 
 But it groups by manufacturer rather than capabilities or software 
 compatability...

I could do this, as Qemu has definitions for most PowerPC cores (even if
most are still not available).
For now, you can take a look in target-ppc/translate_init.c. Most
PowerPC are referenced here:
- there's a big table with all the PVR I know (but there's still a lot
missing)
- the ppc_defs table contains most PowerPC definitions, with their
features defined.
I will think of doing a reference table on my web pages, to have a more
readable PowerPC reference document. Of course, any information about
missing PVRs or PowerPC implementation in welcome !

You can also take a look at the file target-ppc/STATUS file to figure
out all cores emulation working in Qemu.
And you can get the list of all CPUs emulated by Qemu with the '-cpu ?'
switch.

-- 
J. Mayer [EMAIL PROTECTED]
Never organized





Re: [Qemu-devel] qemu alpha?

2007-10-20 Thread J. Mayer

On Fri, 2007-10-19 at 19:49 -0500, Rob Landley wrote:
 On Sunday 14 October 2007 5:14:27 am J. Mayer wrote:
  On Sun, 2007-10-14 at 11:19 +0200, Oliver Falk wrote:
   Hi list!
 
  Hi you !
 
   Just wanted to know how far the progress on alpha target is? I would be
   happy if I have some 'virtual alpha' to test new isos.
  
   If I can help some way (I have a few alphas around). Let me know.
 
  I'm happy to see someone interresting in improving Alpha support, which
  is  very alpha for now !
 
 I'm interested in testing Alpha too, but I haven't seem a qemu-system-alpha 
 show up yet.  Alas, I have no hardware or specific expertise in this 
 platform, I'm just trying to build and boot Linux kernels (and corresponding 
 root filesystems) on as many emulated target platforms as I can.

There are a lot of things missing for qemu-system-alpha to be available:
- the PALCode emulation is far from being complete or even usable
- there is no hardware machine emulation for Alpha in Qemu.
As I have no Alpha platform, I don't know much about the hardware to be
emulated.
But the first step about the Alpha target would be to properly debug the
linux-user-mode emulation, that would validate the core CPU INSNS
emulation part.
I guess my Alpha CPU and ABI knowledge is too restricted to find the
problem of most program crashing for now. It seems to me that the Unique
register is not initialized properly, but this is just a guess and I
have no idea of what's going wrong with this register and what should be
its value.

-- 
J. Mayer [EMAIL PROTECTED]
Never organized





Re: [Qemu-devel] qemu alpha?

2007-10-20 Thread Sunil Amitkumar Janki

Rob Landley wrote:
I'm interested in testing Alpha too, but I haven't seem a 
qemu-system-alpha
show up yet.  Alas, I have no hardware or specific expertise in this 
platform, I'm just trying to build and boot Linux kernels (and corresponding 
root filesystems) on as many emulated target platforms as I can.


Rob
  

Hi Rob,

I've been reading Alpha documentation, that I was pointed to
by Wikipedia, over the summer, because I too would like to see
a qemu-system-alpha. The problem is I don't really know how
to develop for QEMU in general and in particular this target.

The QEMU source code looks very complicated and opaque to me,
but that may be because I lack the necessary knowledge and
experience to reach a thorough understanding of it. I would
appreciate it if someone could tell me where and how to start.

Regards,
Sunil






Re: [Qemu-devel] I got a kernel booted under qemu-system-ppc !

2007-10-20 Thread J. Mayer
On Fri, 2007-10-19 at 17:19 +0200, Aurelien Jarno wrote: 
 On Thu, Oct 18, 2007 at 07:12:57PM -0500, Rob Landley wrote:
  The easy way to reproduce this is go to http://landley.net/hg/firmware;, 
  download tip, and ./build.sh powerpc.  When it finishes building 
  everything, cd build and ./run-powerpc.sh.
  
  What I did is build a new ppc_rom.bin (attached, source code is at 
  http://landley.net/hg/firmware/raw-diff/92f89c9c9495/sources/toys/make-ppc_rom.tar.bz2
   ) 
  which was written by Milton Miller.  I use that firmware as the boot rom 
  (point -L at the directory it's in) instead of Open Hackware, which still 
  doesn't work for me.
  
  Then I build a 2.6.23 kernel with this patch: 
  http://landley.net/hg/firmware/raw-diff/fdb6ddd4c3b7/sources/patches/linux-ppcqemu.patch
  which adds a qemu target.
  
  I then boot with the following command line (modulo wordwrap damage):
  
  qemu-system-ppc -M prep -nographic -hda image-powerpc.ext2 -kernel
zImage-powerpc -append 'rw init=/tools/bin/sh panic=1 PATH=/tools/bin
root=/dev/hda console=ttyS0' -L ../sources/toys
  
  And I get a shell prompt inside qemu!  (After almost _two_years_ of trying, 
  I'm kind of happy about this.)
  
  The downside is that the result boots fine under qemu-0.9.0, but is broken 
  with current cvs.  I tracked it down to the specific patch with git 
  bisect, 
  and it's this one:
  
  http://git.kernel.dk/?p=qemu.git;a=commit;h=36f447f730f61ac413c5b1c4a512781f5dea0c94
  
  author  j_mayer j_mayer
  Mon, 9 Apr 2007 22:45:36 + (22:45 +)
  committer  j_mayer j_mayer
  Mon, 9 Apr 2007 22:45:36 + (22:45 +)
  
   Implement embedded IRQ controller for PowerPC 6xx/740  750.
   Fix PowerPC external interrupt input handling and lowering.
   Fix OpenPIC output pins management.
   Fix multiples bugs in OpenPIC IRQ management.
   Fix OpenPIC CPU(s) reset function.
   Fix Mac99 machine to properly route OpenPIC outputs to the PowerPC input 
  pins.
   Fix PREP machine to properly route i8259 output to the PowerPC external
 interrupt pin.
  
  Versions before that patch went in work fine.  Versions since then hang 
  halfway through IDE controller initialization:
  
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with 
  idebus=xx
hda: QEMU HARDDISK, ATA DISK drive
hda: IRQ probe failed (0x0)
hdb: IRQ probe failed (0x0)
hdb: IRQ probe failed (0x0)
hdb: QEMU CD-ROM, ATAPI CD/DVD-ROM drive
hdb: IRQ probe failed (0x0)
-- hangs here with the patch
ide0 at 0x1f0-0x1f7,0x3f6 on irq 13
hda: max request size: 512KiB
hda: 4194304 sectors (2147 MB) w/256KiB Cache, CHS=4161/255/63
hda: set_multmode: status=0x41 { DriveReady Error }
hda: set_multmode: error=0x04 { DriveStatusError }
ide: failed opcode was: 0xef
hda: cache flushes supported
hda: unknown partition table
mice: PS/2 mouse device common for all mice
  
 
 The small patch below fixes the IDE problem, but not the NE2000 ISA one.
 Please apply.

This patch makes the PreP target run for me, using OpenHackWare, and I
got NE2000 working too.
2.4 vanilla kernels runs perfectly, as well as old 2.6 ones. But there
still seems to be problems with recent 2.6 kernels not using the frame
buffer properly: I can see the kernel entering user mode, from the
messages on the serial console, but I got no more messages from here.
But I guess it's booting as I can see the CPU entering sleep mode a few
seconds after reaching this point, the same way it does when I can see
it waiting for the user login.
So I will apply the patch. I also added PCI network devices but still
haven't validated them.

 
 Index: hw/i8259.c
 ===
 RCS file: /sources/qemu/qemu/hw/i8259.c,v
 retrieving revision 1.25
 diff -u -d -p -r1.25 i8259.c
 --- hw/i8259.c17 Sep 2007 08:09:46 -  1.25
 +++ hw/i8259.c19 Oct 2007 15:17:22 -
 @@ -164,7 +164,7 @@ void pic_update_irq(PicState2 *s)
  }
  
  /* all targets should do this rather than acking the IRQ in the cpu */
 -#if defined(TARGET_MIPS)
 +#if defined(TARGET_MIPS) || defined(TARGET_PPC)
  else {
  qemu_irq_lower(s-parent_irq);
  }
 
-- 
J. Mayer [EMAIL PROTECTED]
Never organized





[Qemu-devel] qemu/hw i8259.c

2007-10-20 Thread Jocelyn Mayer
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Jocelyn Mayer j_mayer 07/10/20 09:13:55

Modified files:
hw : i8259.c 

Log message:
Avoid PreP target kernel freeze waiting for IRQs.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/i8259.c?cvsroot=qemur1=1.25r2=1.26




Re: [Qemu-devel] qemu alpha?

2007-10-20 Thread Thiemo Seufer
J. Mayer wrote:
 
 On Fri, 2007-10-19 at 19:49 -0500, Rob Landley wrote:
  On Sunday 14 October 2007 5:14:27 am J. Mayer wrote:
   On Sun, 2007-10-14 at 11:19 +0200, Oliver Falk wrote:
Hi list!
  
   Hi you !
  
Just wanted to know how far the progress on alpha target is? I would be
happy if I have some 'virtual alpha' to test new isos.
   
If I can help some way (I have a few alphas around). Let me know.
  
   I'm happy to see someone interresting in improving Alpha support, which
   is  very alpha for now !
  
  I'm interested in testing Alpha too, but I haven't seem a qemu-system-alpha 
  show up yet.  Alas, I have no hardware or specific expertise in this 
  platform, I'm just trying to build and boot Linux kernels (and 
  corresponding 
  root filesystems) on as many emulated target platforms as I can.
 
 There are a lot of things missing for qemu-system-alpha to be available:
 - the PALCode emulation is far from being complete or even usable
 - there is no hardware machine emulation for Alpha in Qemu.
 As I have no Alpha platform, I don't know much about the hardware to be
 emulated.
 But the first step about the Alpha target would be to properly debug the
 linux-user-mode emulation, that would validate the core CPU INSNS
 emulation part.
 I guess my Alpha CPU and ABI knowledge is too restricted to find the
 problem of most program crashing for now. It seems to me that the Unique
 register is not initialized properly, but this is just a guess and I
 have no idea of what's going wrong with this register and what should be
 its value.

Could you record the limitations you know about in a STATUS file and
commit that to the target-alpha directory?


Thiemo




Re: [Qemu-devel] qemu alpha?

2007-10-20 Thread Daniel Jacobowitz
On Sat, Oct 20, 2007 at 10:56:12AM +0200, J. Mayer wrote:
 I guess my Alpha CPU and ABI knowledge is too restricted to find the
 problem of most program crashing for now. It seems to me that the Unique
 register is not initialized properly, but this is just a guess and I
 have no idea of what's going wrong with this register and what should be
 its value.

Are you running recent Alpha binaries?  I believe the unique register
is used for the thread-local storage base address.

-- 
Daniel Jacobowitz
CodeSourcery




Re: [Qemu-devel] I got a kernel booted under qemu-system-ppc !

2007-10-20 Thread Aurelien Jarno
Aurelien Jarno a écrit :

 I have used QEMU CVS with a Debian Sid image. It basically works, I am
 even able to login via SSH, but I have noticed two problems:
 
 - Some process hang, stay into D state and become unkillable. It seems
   it can happen to all processes, but it is always reproducible with
   uptime or top. I still don't know if it is a problem of the kernel or
   if it comes from the emulation.

This problem arise when using floating point instructions. It can be
easily triggered by running the following testcase:

#include stdio.h

int main()
{
double a = 1.34;
printf(%.2f, a);
return 0;
}

-- 
  .''`.  Aurelien Jarno | GPG: 1024D/F1BCDB73
 : :' :  Debian developer   | Electrical Engineer
 `. `'   [EMAIL PROTECTED] | [EMAIL PROTECTED]
   `-people.debian.org/~aurel32 | www.aurel32.net




[Qemu-devel] qemu/hw gt64xxx.c

2007-10-20 Thread Thiemo Seufer
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Thiemo Seufer ths 07/10/20 19:47:14

Modified files:
hw : gt64xxx.c 

Log message:
Check the Galilleo config register instead of hardcoding the endianness.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/gt64xxx.c?cvsroot=qemur1=1.20r2=1.21




[Qemu-devel] qemu exec-all.h target-mips/cpu.h target-mips/o...

2007-10-20 Thread Thiemo Seufer
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Thiemo Seufer ths 07/10/20 19:45:44

Modified files:
.  : exec-all.h 
target-mips: cpu.h op_helper.c 

Log message:
Handle IBE on MIPS properly.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/exec-all.h?cvsroot=qemur1=1.68r2=1.69
http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/cpu.h?cvsroot=qemur1=1.49r2=1.50
http://cvs.savannah.gnu.org/viewcvs/qemu/target-mips/op_helper.c?cvsroot=qemur1=1.66r2=1.67




[Qemu-devel] qemu/linux-user signal.c syscall.c

2007-10-20 Thread Thiemo Seufer
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Thiemo Seufer ths 07/10/20 20:23:08

Modified files:
linux-user : signal.c syscall.c 

Log message:
Syscall target errno fixes, by Thayne Harbaugh.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/linux-user/signal.c?cvsroot=qemur1=1.46r2=1.47
http://cvs.savannah.gnu.org/viewcvs/qemu/linux-user/syscall.c?cvsroot=qemur1=1.140r2=1.141




Re: [Qemu-devel] What happened with NPTL/TLS support?

2007-10-20 Thread Thiemo Seufer
Thayne Harbaugh wrote:
 
 On Fri, 2007-10-12 at 18:12 +0300, Felipe Contreras wrote:
  Hi,
  
  When I try to use codesourcery's toolchain arm-2006q3-27 in my Fedora
  7 box I always have the following issue:
  
  qemu: Unsupported syscall: 983045
 
 Yep, I've seen that before.
 
  I guess it's a problem of NPTL incompatibility. Anyway, the patch that
  Paul Brook sent a while ago solves it [1].
  
  I wonder if it can be integrated or what would be the right way to
  solve this issue. Am I the only one having it?
  
  Best regards.
  
  [1] http://lists.gnu.org/archive/html/qemu-devel/2005-08/msg00128.html
 
 
 I've been using this patch, as well as other NPTL/TLS patches as well as
 some of my own work and have a set of patches for NPTL/TLS that works
 reasonably well for arm and i386.  The patches don't apply cleanly to
 CVS current, but I'm more than happy to rework them so that they will if
 someone is serious about getting NPTL/TLS/futex stuff working for
 linux-user.  I haven't submitted my patches because I kept expecting the
 other patches to be accepted.

Please submit this patch (and resend what you think was missed).


Thiemo




[Qemu-devel] qemu/hw piix_pci.c

2007-10-20 Thread Thiemo Seufer
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Thiemo Seufer ths 07/10/20 20:36:52

Modified files:
hw : piix_pci.c 

Log message:
Enable ACPI interrupts, by Igor Lvovsky.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/piix_pci.c?cvsroot=qemur1=1.11r2=1.12




[Qemu-devel] qemu block-raw.c

2007-10-20 Thread Thiemo Seufer
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Thiemo Seufer ths 07/10/20 20:40:06

Modified files:
.  : block-raw.c 

Log message:
Physical hard disk drive for win32, by Stefan Weil.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/block-raw.c?cvsroot=qemur1=1.24r2=1.25




[Qemu-devel] qemu/hw pckbd.c

2007-10-20 Thread Thiemo Seufer
CVSROOT:/sources/qemu
Module name:qemu
Changes by: Thiemo Seufer ths 07/10/20 20:48:09

Modified files:
hw : pckbd.c 

Log message:
QEMU keyboard issue with Gujin-2.2, by Etienne Lorrain.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/hw/pckbd.c?cvsroot=qemur1=1.23r2=1.24




Re: [Qemu-devel] I got a kernel booted under qemu-system-ppc !

2007-10-20 Thread Aurelien Jarno
Aurelien Jarno a écrit :
 Aurelien Jarno a écrit :
 Aurelien Jarno a écrit :

 I have used QEMU CVS with a Debian Sid image. It basically works, I am
 even able to login via SSH, but I have noticed two problems:

 - Some process hang, stay into D state and become unkillable. It seems
   it can happen to all processes, but it is always reproducible with
   uptime or top. I still don't know if it is a problem of the kernel or
   if it comes from the emulation.
 This problem arise when using floating point instructions. It can be
 easily triggered by running the following testcase:

 #include stdio.h

 int main()
 {
 double a = 1.34;
 printf(%.2f, a);
 return 0;
 }

 
 This is actually not enough to trigger the bug. The testcase works if
 the bug has already been trigger in another process before, for example
 uptime.
 

I finally found a testcase that trigger the bug in any case:

#include stdio.h

int main()
{
printf(%d %f\n, 7, 0.40);
return 0;
}

The bug could also be trigger with sprintf(), so this is not directly
related to I/O. It happens when printing an integer followed by a float,
even when the two are printed in two different calls to printf().

-- 
  .''`.  Aurelien Jarno | GPG: 1024D/F1BCDB73
 : :' :  Debian developer   | Electrical Engineer
 `. `'   [EMAIL PROTECTED] | [EMAIL PROTECTED]
   `-people.debian.org/~aurel32 | www.aurel32.net