[Qemu-discuss] Booting a standalone with qemu-microblaze

2014-12-17 Thread Kevin Grandemange
I am trying to boot my own "kernel" with qemu-microblaze but I can't get it
running.
I tried the following cmdline:

qemu-system-microblaze img.elf
qemu-system-microblaze -M petalogix-s3adsp1800 -kernel img.elf  -net none
-s -S

img.elf: ELF 32-bit MSB executable, version 1 (SYSV), statically linked,
not stripped
Base adress is  0x0.


I get the following error:

IN: PC=0
rmsr=0 resr=0 rear=0 debug=0 imm=0 iflags=0 fsr=0
btaken=0 btarget=0 mode=kernel(saved=kernel) eip=0 ie=0
r00= r01= r02= r03=
r04= r05= r06= r07=
r08= r09= r10= r11=
r12= r13= r14= r15=
r16= r17= r18= r19=
r20= r21= r22= r23=
r24= r25= r26= r27=
r28= r29= r30= r31=
qemu: fatal: fetching nop sequence

IN: PC=0
rmsr=0 resr=0 rear=0 debug=0 imm=0 iflags=0 fsr=0
btaken=0 btarget=0 mode=kernel(saved=kernel) eip=0 ie=0
r00= r01= r02= r03=
r04= r05= r06= r07=
r08= r09= r10= r11=
r12= r13= r14= r15=
r16= r17= r18= r19=
r20= r21= r22= r23=
r24= r25= r26= r27=
r28= r29= r30= r31=


Aborted

How can I get the code of my elf to be emulated ?


Re: [Qemu-discuss] Booting a standalone with qemu-microblaze

2014-12-17 Thread Jakob Bohm

On 17/12/2014 14:36, Kevin Grandemange wrote:
I am trying to boot my own "kernel" with qemu-microblaze but I can't 
get it running.

I tried the following cmdline:

qemu-system-microblaze img.elf
qemu-system-microblaze -M petalogix-s3adsp1800 -kernel img.elf  -net 
none -s -S


img.elf: ELF 32-bit MSB executable, version 1 (SYSV), statically 
linked, not stripped

Base adress is  0x0.


I get the following error:

IN: PC=0
rmsr=0 resr=0 rear=0 debug=0 imm=0 iflags=0 fsr=0
btaken=0 btarget=0 mode=kernel(saved=kernel) eip=0 ie=0
r00= r01= r02= r03=
r04= r05= r06= r07=
r08= r09= r10= r11=
r12= r13= r14= r15=
r16= r17= r18= r19=
r20= r21= r22= r23=
r24= r25= r26= r27=
r28= r29= r30= r31=
qemu: fatal: fetching nop sequence

IN: PC=0
rmsr=0 resr=0 rear=0 debug=0 imm=0 iflags=0 fsr=0
btaken=0 btarget=0 mode=kernel(saved=kernel) eip=0 ie=0
r00= r01= r02= r03=
r04= r05= r06= r07=
r08= r09= r10= r11=
r12= r13= r14= r15=
r16= r17= r18= r19=
r20= r21= r22= r23=
r24= r25= r26= r27=
r28= r29= r30= r31=


Aborted

How can I get the code of my elf to be emulated ?




I believe the "-kernel" option expects the file to be invoked
according to the conventions for invoking a Linux kernel.  I
don't know what those conventions are for a microblaze, but
on most architectures, it involves something beyond a simple
ELF file.

As an alternative, you may want to look at options for loading
your kernel as a "ROM" firmware image, which would involve a
different set of conventions.


Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S.  http://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded




[Qemu-discuss] cannot boot PPC E500 vmlinux in Qemu 2.1.2

2014-12-17 Thread Markus Stockhausen
Hello,

I try to run a PPC VM inside qemu 2.1.2 with CPU type E500. Therfore I 
downloaded a kernel and initrd from the ubuntu provided netinst packages.

http://ports.ubuntu.com/ubuntu-ports/dists/trusty-updates/main/installer-powerpc/current/images/e500/netboot/

Host is a Fedora 21 distro and my start command looks like this. Its
a first iteration I have no HDD configured yet.

qemu-system-ppc -kernel /mnt/vmlinux -M ppce500 -nographic \
  -append "console=ttyS0" -initrd /mnt/initrd.gz -m 256

The machine boots up quite fine until it tries to do modprobing. It looks
like something is running havoc and memory gets exhausted. No matter
how much RAM is configured for the VM.

Console shows:

...
[2.544763] PME2: fsl_pme2_db_init: not on ctrl-plane
[2.545138] Freescale pme2 scan driver
[2.545138] Freescale pme2 scan driver
[2.545689] fsl-pme2-scan: device pme_scan registered
[2.545689] fsl-pme2-scan: device pme_scan registered
[2.549546] TCP: cubic registered
[2.549546] TCP: cubic registered
[2.551821] NET: Registered protocol family 10
[2.551821] NET: Registered protocol family 10
[2.561051] NET: Registered protocol family 17
[2.561051] NET: Registered protocol family 17
[2.561887] Key type dns_resolver registered
[2.561887] Key type dns_resolver registered
[2.564120] bootconsole [udbg0] disabled
[2.564120] bootconsole [udbg0] disabled
[2.564533] Loading compiled-in X.509 certificates
[2.584291] Loaded X.509 cert 'Magrathea: Glacier signing key: 
c98d077ef22b25ae0e0a995ecb2b3daced7366d1'
[2.584879] registered taskstats version 1
[2.627580] modprobe[46]: unhandled signal 11 at 6cab nip b7d2cd90 lr 
b7d2d0c4 code 30001
[2.651179] modprobe[48]: unhandled signal 11 at 000c nip b7dd2ec0 lr 
b7dd30c4 code 30001
[2.651743] swap_free: Bad swap file entry 38c0dcdb
[2.652026] BUG: Bad page map in process modprobe  pte:c0dcdbc0c0dcdbe0 
pmd:cfb2
[2.652336] addr:10004000 vm_flags:0875 anon_vma:  (null) 
mapping:cf9da5b4 index:4
[2.652737] vma->vm_ops->fault: shmem_fault+0x0/0x210
[2.652914] vma->vm_file->f_op->mmap: shmem_mmap+0x0/0x70
[2.653352] CPU: 0 PID: 48 Comm: modprobe Not tainted 3.13.0-40-powerpc-e500 
#69-Ubuntu
[2.653665] Call Trace:
[2.653859] [cfb27bf0] [c00080bc] show_stack+0xfc/0x1c0 (unreliable)
[2.654564] [cfb27c40] [c080b884] dump_stack+0x78/0xa0
[2.654746] [cfb27c50] [c0173c30] print_bad_pte+0x120/0x1f0
[2.654915] [cfb27c80] [c01756c4] unmap_single_vma+0x254/0x620
[2.655086] [cfb27d00] [c0176ea4] unmap_vmas+0x64/0xd0
[2.655245] [cfb27d20] [c017f44c] exit_mmap+0xdc/0x190
[2.655430] [cfb27d90] [c004d7f4] mmput+0x84/0x150
[2.655571] [cfb27da0] [c0052d34] do_exit+0x284/0x980
[2.655716] [cfb27df0] [c00534e4] do_group_exit+0x54/0xc0
[2.655872] [cfb27e10] [c0066160] get_signal_to_deliver+0x170/0x570
[2.656044] [cfb27e70] [c0008c2c] do_signal+0x4c/0x220
[2.656193] [cfb27f30] [c0008f34] do_notify_resume+0x94/0xb0
[2.656360] [cfb27f40] [c00111a8] do_user_signal+0x74/0xc4
[2.656568] --- Exception: 300 at 0xb7dd2ec0
[2.656568] LR = 0xb7dd30c4
[2.656921] Disabling lock debugging due to kernel taint
[2.657121] swap_free: Bad swap file entry 08c0dcdc
[2.657256] BUG: Bad page map in process modprobe  pte:c0dcdc00c0dcdc20 
pmd:cfb2
[2.657489] addr:10005000 vm_flags:0875 anon_vma:  (null) 
mapping:cf9da5b4 index:5
[2.657697] vma->vm_ops->fault: shmem_fault+0x0/0x210
[2.657835] vma->vm_file->f_op->mmap: shmem_mmap+0x0/0x70
[2.658040] CPU: 0 PID: 48 Comm: modprobe Tainted: GB 
3.13.0-40-powerpc-e500 #69-Ubuntu
[2.658490] Call Trace:
...

Any ideas?

Best regards.

Markus


Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.

Über das Internet versandte E-Mails können unter fremden Namen erstellt oder
manipuliert werden. Deshalb ist diese als E-Mail verschickte Nachricht keine
rechtsverbindliche Willenserklärung.

Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln

Vorstand:
Kadir Akin
Dr. Michael Höhnerbach

Vorsitzender des Aufsichtsrates:
Hans Kristian Langva

Registergericht: Amtsgericht Köln
Registernummer: HRB 52 497

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

e-mails sent over the internet may have been written under a wrong name or
been manipulated

Re: [Qemu-discuss] Booting a standalone with qemu-microblaze

2014-12-17 Thread Peter Maydell
On 17 December 2014 at 17:23, Jakob Bohm  wrote:
> On 17/12/2014 14:36, Kevin Grandemange wrote:
>>
>> I am trying to boot my own "kernel" with qemu-microblaze but I can't get
>> it running.
>> I tried the following cmdline:
>>
>> qemu-system-microblaze img.elf
>> qemu-system-microblaze -M petalogix-s3adsp1800 -kernel img.elf  -net none
>> -s -S
>>
>> img.elf: ELF 32-bit MSB executable, version 1 (SYSV), statically linked,
>> not stripped
>> Base adress is  0x0.

Are you sure this is the right load address for this hardware?
Looking at the machine model source code the DRAM base address
is 0x9000 (though there is 128K of RAM at 0 I think).

>> I get the following error:
>>
>> IN: PC=0
>> rmsr=0 resr=0 rear=0 debug=0 imm=0 iflags=0 fsr=0
>> btaken=0 btarget=0 mode=kernel(saved=kernel) eip=0 ie=0
>> r00= r01= r02= r03=
>> r04= r05= r06= r07=
>> r08= r09= r10= r11=
>> r12= r13= r14= r15=
>> r16= r17= r18= r19=
>> r20= r21= r22= r23=
>> r24= r25= r26= r27=
>> r28= r29= r30= r31=
>> qemu: fatal: fetching nop sequence
>>
>> IN: PC=0
>> rmsr=0 resr=0 rear=0 debug=0 imm=0 iflags=0 fsr=0
>> btaken=0 btarget=0 mode=kernel(saved=kernel) eip=0 ie=0
>> r00= r01= r02= r03=
>> r04= r05= r06= r07=
>> r08= r09= r10= r11=
>> r12= r13= r14= r15=
>> r16= r17= r18= r19=
>> r20= r21= r22= r23=
>> r24= r25= r26= r27=
>> r28= r29= r30= r31=
>>
>>
>> Aborted
>>
>> How can I get the code of my elf to be emulated ?
>>
>>
>>
> I believe the "-kernel" option expects the file to be invoked
> according to the conventions for invoking a Linux kernel.

Semantics for this option vary by guest architecture. On some
at least, you can use it for "load me this ELF file" as well
as for loading Linux kernels.

In this case it seems to have started execution at address
0, at least. If you use the gdbstub you should be able to
figure out whether it's really loaded the code you expect
at address zero.

My first guess would be that you've made an error in the
linking of your image somehow and you don't really have
code starting at address 0 in it.

QEMU's -d debug logging options are probably helpful for
figuring out what the emulated CPU is actually doing in
this kind of "falls over immediately" situation.

-- PMM