Thanks Ciro, My guess it is the –smt parameter and X86 don’t work well together for some reason, I made an attempt using a Hello world and once I removed the –smt parameter it worked.
Any taugths anybody ? From: gem5-users [mailto:gem5-users-boun...@gem5.org] On Behalf Of Ciro Santilli Sent: Wednesday, April 4, 2018 2:39 PM To: gem5 users mailing list <gem5-users@gem5.org> Subject: Re: [gem5-users] [EXT] Re: New image of Ubuntu 17.x with custom kernel (append build string -gem5) - kernel Panic Hi Vitorio, I don't know exactly what is the problem, but I can provide a setup that just works which might help you to diff it out: https://github.com/cirosantilli/linux-kernel-module-cheat/tree/e38a1dea9223bf4658384cbd93aaaae748d728de#gem5-getting-started (replace arm with x86_64) My commands use X86/gem.out, but I've have just hacked up the scripts locally to use X86_MOESI_AMD_Base like you and it this just worked: ./run -g -m 4G -- --mem-type=DDR4_2400_16x4 --mem-ranks=4 --caches --l2cache --smt Previously I had some similar failures on x86 (not sure exactly the same), and they went away when I did the following: - get latest gem5 master, that test repo is at 68af229 via a submodule: https://github.com/cirosantilli/linux-kernel-module-cheat/tree/e38a1dea9223bf4658384cbd93aaaae748d728de/gem5 - use this kernel config: https://github.com/cirosantilli/linux-kernel-module-cheat/blob/e38a1dea9223bf4658384cbd93aaaae748d728de/kernel_config_x86_64-gem5 so maybe this is what you are missing. This is the patch I referred to: @@ -27,7 +27,7 @@ disks_dir="${system_dir}/disks" mkdir -p "$binaries_dir" "$disks_dir" cd "${top}/gem5" if [ "$arch" = x86_64 ]; then - scons -j "$j" --ignore-style build/X86/gem5.opt + scons -j "$j" --ignore-style build/X86_MOESI_AMD_Base/gem5.opt f="${disks_dir}/linux-bigswap2.img" dd if=/dev/zero of="$f" bs=1024 count=65536 mkswap "$f" --- a/run +++ b/run @@ -134,7 +134,7 @@ if "$gem5"; then gem5_common="\ M5_PATH='${gem5_build_dir}/system' \ ${debug_vm} \ -'${gem5_src_dir}/build/${gem5_arch}/gem5.opt' \ +'${gem5_src_dir}/build/X86_MOESI_AMD_Base/gem5.opt' \ --debug-file=trace.txt \ ${gem5opts} \ -d '${m5out_dir}' \ On Wed, Apr 4, 2018 at 9:30 PM, Vitorio Cargnini (lcargnini) <lcargn...@micron.com<mailto:lcargn...@micron.com>> wrote: Ok, Thanks Ciro, I'll look into that, besides that I built a Gentoo image, and currently, I'm facing another roadblock, for some reason booting the images, on x86 at least I didn’t attempt it on ARM yet, it is next on the agenda, once It achieves the following point: [ 0.913616] ata1.01: configured for UDMA/33 [ 0.913702] scsi 0:0:0:0: Direct-Access ATA M5 IDE Disk n/a PQ: 0 ANSI: 5 [ 0.914223] sd 0:0:0:0: [sda] 131072000 512-byte logical blocks: (67.1 GB/62.5 GiB) [ 0.914269] sd 0:0:0:0: [sda] Write Protect is off [ 0.914302] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 0.914771] sd 0:0:0:0: Attached scsi generic sg0 type 0 [ 0.914862] sda: sda1 [ 0.915256] sd 0:0:0:0: [sda] Attached SCSI disk [ 0.917970] scsi 0:0:1:0: Direct-Access ATA M5 IDE Disk n/a PQ: 0 ANSI: 5 [ 0.918339] sd 0:0:1:0: [sdb] 1048320 512-byte logical blocks: (537 MB/512 MiB) [ 0.918384] sd 0:0:1:0: [sdb] Write Protect is off [ 0.918417] sd 0:0:1:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 0.918883] sd 0:0:1:0: Attached scsi generic sg1 type 0 [ 0.919251] sd 0:0:1:0: [sdb] Attached SCSI disk It breaks, I got the following error on gem5 console [1226:lcargnini@rndarch11/home/user/gem5]> ./build/X86_MOESI_AMD_Base/gem5.opt configs/user/fs.py --caches --l2cache --smt --disk-image=`pwd`/disks/user-gentoo-gem5.img --kernel=`pwd`/binaries/vmlinuX-4.9.76-gentoo-r1-user-gem5 --mem-type=DDR4_2400_16x4 --mem-size=4GB --mem-ranks=4 gem5 Simulator System. http://gem5.org gem5 is copyrighted software; use the --copyright option for details. gem5 compiled Mar 26 2018 18:01:36 gem5 started Apr 4 2018 13:26:40 gem5 executing on rndarch11, pid 26274 command line: ./build/X86_MOESI_AMD_Base/gem5.opt configs/user/fs.py --caches --l2cache --smt --disk-image=/home/user/gem5/disks/user-gentoo-gem5.img --kernel=/home/user/gem5/binaries/vmlinuX-4.9.76-gentoo-r1-user-gem5 --mem-type=DDR4_2400_16x4 --mem-size=4GB --mem-ranks=4 warn: Physical memory size specified is 4GB which is greater than 3GB. Twice the number of memory controllers would be created. Global frequency set at 1000000000000 ticks per second warn: DRAM device capacity (65536 Mbytes) does not match the address range assigned (4096 Mbytes) warn: DRAM device capacity (65536 Mbytes) does not match the address range assigned (1024 Mbytes) info: kernel located at: /home/user/gem5/binaries/vmlinuX-4.9.76-gentoo-r1-user-gem5 Listening for com_1 connection on port 3456 0: rtc: Real-time clock set to Sun Jan 1 00:00:00 2012 0: system.remote_gdb: listening for remote gdb on port 7000 warn: Reading current count from inactive timer. **** REAL SIMULATION **** info: Entering event queue @ 0. Starting simulation... warn: x86 cpuid family 0x0000: unimplemented function 6 warn: x86 cpuid family 0x0000: unimplemented function 6 warn: x86 cpuid family 0x0000: unimplemented function 6 warn: instruction 'fninit' unimplemented warn: Don't know what interrupt to clear for console. 32407855000: system.pc.com_1.device: attach terminal 0 warn: x86 cpuid family 0x0000: unimplemented function 6 warn: x86 cpuid family 0x0000: unimplemented function 6 warn: x86 cpuid family 0x0000: unimplemented function 6 warn: Write to unknown i8042 (keyboard controller) command port. hack: Assuming logical destinations are 1 << id. warn: Tried to clear PCI interrupt 14 panic: Resetting mouse wrap mode unimplemented. Memory Usage: 4866916 KBytes Program aborted at tick 1491323047000 --- BEGIN LIBC BACKTRACE --- ./build/X86_MOESI_AMD_Base/gem5.opt(_Z15print_backtracev+0x19)[0xe4e5d9] ./build/X86_MOESI_AMD_Base/gem5.opt(_Z12abortHandleri+0x7f)[0xe5791f] /lib64/libpthread.so.0[0x342ae0f790] /lib64/libc.so.6(gsignal+0x35)[0x342a632625] /lib64/libc.so.6(abort+0x175)[0x342a633e05] ./build/X86_MOESI_AMD_Base/gem5.opt[0xbf719c] ./build/X86_MOESI_AMD_Base/gem5.opt[0x1787da4] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN6X86ISA5I80425writeEP6Packet+0x34b)[0x178829b] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN7PioPort10recvAtomicEP6Packet+0x3d)[0x17a54cd] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN15NoncoherentXBar10recvAtomicEP6Packets+0x1e3)[0xe0abc3] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN6Bridge15BridgeSlavePort10recvAtomicEP6Packet+0x2a)[0xdde97a] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN12CoherentXBar10recvAtomicEP6Packets+0x5d8)[0xde5738] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN5Cache10recvAtomicEP6Packet+0x51f)[0x17dc63f] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN12CoherentXBar10recvAtomicEP6Packets+0x5d8)[0xde5738] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN5Cache10recvAtomicEP6Packet+0x51f)[0x17dc63f] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN15AtomicSimpleCPU8writeMemEPhjm5FlagsImEPm+0x443)[0x1791e33] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN17SimpleExecContext8writeMemEPhjm5FlagsImEPm+0x21)[0x17a09c1] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZNK10X86ISAInst2St7executeEP11ExecContextPN5Trace10InstRecordE+0x165)[0x170e1f5] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN15AtomicSimpleCPU4tickEv+0x247)[0x1792547] ./build/X86_MOESI_AMD_Base/gem5.opt(_ZN10EventQueue10serviceOneEv+0x62)[0xe55042] ./build/X86_MOESI_AMD_Base/gem5.opt(_Z9doSimLoopP10EventQueue+0x1a0)[0xe5e090] ./build/X86_MOESI_AMD_Base/gem5.opt(_Z8simulatem+0x349)[0xe5dcd9] ./build/X86_MOESI_AMD_Base/gem5.opt[0xce4df8] ./build/X86_MOESI_AMD_Base/gem5.opt[0xcb38a7] ../../common/software/el6/python-2.7.13/lib/libpython2.7.so<http://libpython2.7.so>.1.0(PyEval_EvalFrameEx+0x8dd8)[0x7f4f631d5008] ../../common/software/el6/python-2.7.13/lib/libpython2.7.so<http://libpython2.7.so>.1.0(PyEval_EvalCodeEx+0x830)[0x7f4f631d5ea0] ../../common/software/el6/python-2.7.13/lib/libpython2.7.so<http://libpython2.7.so>.1.0(PyEval_EvalFrameEx+0x5aba)[0x7f4f631d1cea] ../../common/software/el6/python-2.7.13/lib/libpython2.7.so<http://libpython2.7.so>.1.0(PyEval_EvalCodeEx+0x830)[0x7f4f631d5ea0] ../../common/software/el6/python-2.7.13/lib/libpython2.7.so<http://libpython2.7.so>.1.0(PyEval_EvalFrameEx+0x5aba)[0x7f4f631d1cea] ../../common/software/el6/python-2.7.13/lib/libpython2.7.so<http://libpython2.7.so>.1.0(PyEval_EvalCodeEx+0x830)[0x7f4f631d5ea0] ../../common/software/el6/python-2.7.13/lib/libpython2.7.so<http://libpython2.7.so>.1.0(PyEval_EvalFrameEx+0x5aba)[0x7f4f631d1cea] ../../common/software/el6/python-2.7.13/lib/libpython2.7.so<http://libpython2.7.so>.1.0(PyEval_EvalCodeEx+0x830)[0x7f4f631d5ea0] --- END LIBC BACKTRACE --- Aborted Any clue why this is happening? Regards, Vitorio. -----Original Message----- From: gem5-users [mailto:gem5-users-boun...@gem5.org<mailto:gem5-users-boun...@gem5.org>] On Behalf Of Ciro Santilli Sent: Tuesday, March 27, 2018 4:28 PM To: gem5 users mailing list <gem5-users@gem5.org<mailto:gem5-users@gem5.org>> Subject: [EXT] Re: [gem5-users] New image of Ubuntu 17.x with custom kernel (append build string -gem5) - kernel Panic If the init process is exits or is killed, the kernel panics, and shows the message: Kernel panic - not syncing: Attempted to kill init! exitcode you can it out with a minimal init that just prints hello world and exits, e.g. along: https://unix.stackexchange.com/questions/122717/custom-linux-distro-that-runs-just-one-program-nothing-else/238579#238579 In order to not panic, you need to either: - do an infinite loop (which is what respawn on inittab does) - poweroff - m5 exit On Tue, Mar 27, 2018 at 9:21 PM, Vitorio Cargnini (lcargnini) <lcargn...@micron.com<mailto:lcargn...@micron.com>> wrote: > Hello, > > > I buit an image of the latest uBuntu 17.10 and added the m5 binary into it. > Created a custom kernel (pretty much the same config just compiled and > appended my additional string name). > > > Started the gem5 Full-System using the configs/example/fs.py. Using the > supplied gentoo image all worked well, so I created a new image based on > ubuntu. First time Kernel Panic due to root=/dev/hda1, I fix this with the > --comand-line="... root=/dev/sda1", so far so good, until I reach the > following point: > > > [ 0.568623] Freeing unused kernel memory: 2008K > [ 0.602852] Freeing unused kernel memory: 2036K > [ 0.659931] x86/mm: Checked W+X mappings: passed, no W+X pages found. > [ 0.659942] x86/mm: Checking user space page tables > [ 0.716001] x86/mm: Checked W+X mappings: passed, no W+X pages found. > [ 0.759422] systemd[1]: System time before build time, advancing clock. > [ 0.770195] systemd[1]: segfault at 7f93ff3e6079 ip 00007f93f8004c60 sp > 00007ffd34ec4760 error 4 in libkmod.so.2.3.2[7f93f7ffe000+16000] > [ 0.771176] Kernel panic - not syncing: Attempted to kill init! > exitcode=0x0000000b > [ 0.771176] > [ 0.771194] CPU: 0 PID: 1 Comm: systemd Not tainted 4.16.0-rc7-gem5 #1 > [ 0.771207] Hardware name: , BIOS 06/08/2008 > [ 0.771216] Call Trace: > [ 0.771226] dump_stack+0x63/0x8b > [ 0.771238] panic+0xe4/0x244 > [ 0.771251] do_exit+0xaec/0xaf0 > [ 0.771264] do_group_exit+0x43/0xb0 > [ 0.771275] get_signal+0x27f/0x5c0 > [ 0.771289] do_signal+0x37/0x730 > [ 0.771301] ? __bad_area_nosemaphore+0xd7/0x1b0 > [ 0.771314] ? printk+0x52/0x6e > [ 0.771325] ? print_vma_addr+0x87/0x110 > [ 0.771339] exit_to_usermode_loop+0x8a/0xd0 > [ 0.771352] prepare_exit_to_usermode+0x77/0x80 > [ 0.771365] ? page_fault+0x2f/0x50 > [ 0.771376] retint_user+0x8/0x8 > [ 0.771385] RIP: 0033:0x7f93f8004c60 > [ 0.771394] RSP: 002b:00007ffd34ec4760 EFLAGS: 0000022c > [ 0.771406] RAX: 0000000005642079 RBX: 00007f93ff3e6079 RCX: > 0000000000000029 > [ 0.771420] RDX: 000000000000007a RSI: 0000000065642079 RDI: > 000055bb21df7700 > [ 0.771434] RBP: 000055bb21def8c0 R08: 00007f93f800f07e R09: > 0000000000000038 > [ 0.771447] R10: 00007f93f800f07e R11: 000055bb21def8e4 R12: > 000055bb21df7700 > [ 0.771461] R13: 000055bb200ae480 R14: 000055bb21def400 R15: > 0000000000000000 > [ 0.771478] Kernel Offset: disabled > [ 0.771488] ---[ end Kernel panic - not syncing: Attempted to kill init! > exitcode=0x0000000b > [ 0.771488] > > > > Does anybody ahve any idea why this kernel panic, it seems due to systemd?, > has to do with me install gem5-guest-tools ?? > > > Best Regards, > > Luis Vitorio. > _______________________________________________ > gem5-users mailing list > gem5-users@gem5.org<mailto:gem5-users@gem5.org> > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users _______________________________________________ gem5-users mailing list gem5-users@gem5.org<mailto:gem5-users@gem5.org> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users _______________________________________________ gem5-users mailing list gem5-users@gem5.org<mailto:gem5-users@gem5.org> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________ gem5-users mailing list gem5-users@gem5.org http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users