Hi Yifan, First of all, the branch that you referred to is pretty old. I would use gem5-20.1. You can check out the gem5-resources for information on how to get KVM+x86 working with SPEC, Parsec, and other benchmarks.
http://www.gem5.org/documentation/general_docs/gem5_resources/ Switching CPUs *should* work, but it's not tested robustly for x86, so there could be some problems. For #3: when using KVM you must use the MMIO/address version of the m5ops. Since it's *real hardware* that's executing the workload, any illegal instructions (like the fake m5op magic instructions) will cause exceptions. Cheers, Jason On Tue, Oct 6, 2020 at 8:02 PM syf1997--- via gem5-users < gem5-users@gem5.org> wrote: > Hi all, > > I am using kvm to fast forward and make a checkpoint. My gem5 version is > https://github.com/darchr/gem5/tree/jason/kvm-testing-again > and I use configs/myconfigs/runkvm.py to run my simulation in FS mode with > custom disk-image and vmlinux-4.8.19 kernel. Here is my command line: > build/X86/gem5.opt --outdir=output/graph/base/1 > configs/myconfigs/runkvm.py --disk=/home/songyifan/gem5kvm/disk/graph.img. > I have a couple of questions: > 1. The stats of simulation time (both host time and simulated time ) is > different though using the same command line above and configurations. > Sometimes the host time is close to native host machine time (about 26s) > and the gem5 output only contains a few warning like: > warn: ds: S flag not set warn: ds: P flag not set > and m5 terminal showed the booting is normal. On the one hand, sometimes > the host time is long (about 150 min) and the gem5 keeps outputting the > warning. I also checked the m5 terminal which showed: > -bash: cannot set terminal process group (1041): Inappropriate ioctl for > device > -bash: no job control in this shell > Also, both can run my application correctly. > > 2. When I switch my CPU from kvm to O3, I always see the outputs below in > m5 terminal: > > Ubuntu 16.04.6 LTS localhost.localdomain ttyS0 > > localhost login: root (automatic login) > > Got CPU type: M5 Simulator > Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.9.189 x86_64) > > * Documentation: https://help.ubuntu.com > * Management: https://landscape.canonical.com > * Support: https://ubuntu.com/advantage > > The programs included with the Ubuntu system are free software; > the exact distribution terms for each program are described in the > individual files in /usr/share/doc/*/copyright. > > Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by > applicable law. > > -bash: cannot set terminal process group (1041): Inappropriate ioctl for > device > -bash: no job control in this shell > 12 13 > 12 14 > 12 15 > 12 16 > read ending!!! > 41652231 1468365178 > 1 > 0 0.1000000 > 1 1.2112147 > 2 > 1 1.2112147 > BUG: unable to handle kernel paging request at ffffffff81035f80 > IP: [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > PGD 180b067 PUD 180c063 > PMD 10000e1 > Oops: 0010 [#1] SMP > Modules linked in: > CPU: 1 PID: 1118 Comm: gem5init Not tainted 4.9.189 #1 > Hardware name: , BIOS 06/08/2008 > task: ffff8804ed412880 task.stack: ffffc9000117c000 > RIP: 0010:[<ffffffff81035fb8>] [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > RSP: 0000:ffffc9000117ff50 EFLAGS: 0000002e > RAX: 00007f66d448e2c8 RBX: 00007f66d4ea49d8 RCX: 000000000000007f > RDX: 00000000000003f3 RSI: 0000000000000004 RDI: ffffc9000117ff58 > RBP: 0000000000000003 R08: 000000000000ffff R09: 0000000000000007 > R10: 00007f66d4ca1720 R11: 000000000000022a R12: 0000000000000005 > R13: 0000000000000000 R14: 00007f66d4ea4f50 R15: 0000000000000000 > FS: 00007f66d4ea2700(0000) GS:ffff8804ffd00000(0000) > knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: ffffffff81035f80 CR3: 0000000106f5e000 CR4: 0000000000000630 > Stack: > ffffffff81435c08 0000000000000000 00007f66d4ea4f50 0000000000000000 > 0000000000000005 0000000000000003 00007f66d4ea49d8 000000000000022a > 00007f66d4ca1720 0000000000000007 000000000000ffff 00007f66d448e2c8 > Call Trace: > [<ffffffff81435c08>] ? page_fault+0x28/0x30 > Code: 00 48 83 c4 30 5b 5d 41 5c 41 5d 41 5e 41 5f c3 31 d2 48 be ff ff ff > ff ff e8 ff ff 48 bf 00 00 00 00 00 c9 ff ff e9 57 e5 ff ff <55> 48 89 f5 > 53 48 89 fb 0f 20 d0 66 66 66 90 48 89 ee 48 89 df > RIP [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > RSP <ffffc9000117ff50> > CR2: ffffffff81035f80 > ---[ end trace 3f6da64006abaee6 ]--- > /sbin/gem5init: line 43: 1118 Killed chmod 755 > /tmp/script > BUG: unable to handle kernel paging request at ffffffff81035f80 > IP: [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > PGD 180b067 PUD 180c063 > PMD 10000e1 > Oops: 0010 [#2] SMP > Modules linked in: > CPU: 1 PID: 1119 Comm: gem5init Tainted: G D 4.9.189 #1 > Hardware name: , BIOS 06/08/2008 > task: ffff880106f5e8c0 task.stack: ffffc9000117c000 > RIP: 0010:[<ffffffff81035fb8>] [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > RSP: 0000:ffffc9000117ff50 EFLAGS: 0000002e > RAX: 00007f66d4858220 RBX: 00007f66d4ea44f0 RCX: 0000000000000001 > RDX: 000000000000001b RSI: 0000000000000004 RDI: ffffc9000117ff58 > RBP: 0000000000000002 R08: 000000000000ffff R09: 0000000000000007 > R10: 00007f66d4ca1720 R11: 000000000000022a R12: 0000000000000005 > R13: 0000000000000000 R14: 00007f66d4ea4f50 R15: 0000000000000000 > FS: 00007f66d4ea2700(0000) GS:ffff8804ffd00000(0000) > knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: ffffffff81035f80 CR3: 0000000106f38000 CR4: 0000000000000630 > Stack: > ffffffff81435c08 0000000000000000 00007f66d4ea4f50 0000000000000000 > 0000000000000005 0000000000000002 00007f66d4ea44f0 000000000000022a > 00007f66d4ca1720 0000000000000007 000000000000ffff 00007f66d4858220 > Call Trace: > [<ffffffff81435c08>] ? page_fault+0x28/0x30 > Code: 00 48 83 c4 30 5b 5d 41 5c 41 5d 41 5e 41 5f c3 31 d2 48 be ff ff ff > ff ff e8 ff ff 48 bf 00 00 00 00 00 c9 ff ff e9 57 e5 ff ff <55> 48 89 f5 > 53 48 89 fb 0f 20 d0 66 66 66 90 48 89 ee 48 89 df > RIP [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > RSP <ffffc9000117ff50> > CR2: ffffffff81035f80 > ---[ end trace 3f6da64006abaee7 ]--- > /sbin/gem5init: line 51: 1119 Killed su root -c > '/tmp/script' > BUG: unable to handle kernel paging request at ffffffff81035f80 > IP: [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > PGD 180b067 PUD 180c063 > PMD 10000e1 > Oops: 0010 [#3] SMP > Modules linked in: > CPU: 1 PID: 1043 Comm: gem5init Tainted: G D 4.9.189 #1 > Hardware name: , BIOS 06/08/2008 > task: ffff8804eecbc140 task.stack: ffffc90000f50000 > RIP: 0010:[<ffffffff81035fb8>] [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > RSP: 0000:ffffc90000f53f50 EFLAGS: 0000002e > RAX: 0000000000005555 RBX: 0000000000000001 RCX: 0000000000000002 > RDX: 0000000000000010 RSI: 0000000000000007 RDI: ffffc90000f53f58 > RBP: 0000000000000001 R08: 000000000000ffff R09: 0000000000000007 > R10: 00007f66d4518c80 R11: 0000000000000000 R12: 00000000004be09d > R13: 0000000000000187 R14: 0000000000704250 R15: 0000000000000002 > FS: 00007f66d4ea2700(0000) GS:ffff8804ffd00000(0000) > knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: ffffffff81035f80 CR3: 00000004eeb48000 CR4: 0000000000000630 > Stack: > ffffffff81435c08 0000000000000002 0000000000704250 0000000000000187 > 00000000004be09d 0000000000000001 0000000000000001 0000000000000000 > 00007f66d4518c80 0000000000000007 000000000000ffff 0000000000005555 > Call Trace: > [<ffffffff81435c08>] ? page_fault+0x28/0x30 > Code: 00 48 83 c4 30 5b 5d 41 5c 41 5d 41 5e 41 5f c3 31 d2 48 be ff ff ff > ff ff e8 ff ff 48 bf 00 00 00 00 00 c9 ff ff e9 57 e5 ff ff <55> 48 89 f5 > 53 48 89 fb 0f 20 d0 66 66 66 90 48 89 ee 48 89 df > RIP [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > RSP <ffffc90000f53f50> > CR2: ffffffff81035f80 > ---[ end trace 3f6da64006abaee8 ]--- > BUG: unable to handle kernel paging request at ffffffff81035f80 > IP: [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > PGD 180b067 PUD 180c063 > PMD 10000e1 > Oops: 0010 [#4] SMP > Modules linked in: > CPU: 1 PID: 1121 Comm: systemd-cgroups Tainted: G D 4.9.189 #1 > Hardware name: , BIOS 06/08/2008 > task: ffff8804ed412880 task.stack: ffffc90000f50000 > RIP: 0010:[<ffffffff81035fb8>] [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > RSP: 0000:ffffc90000f53f50 EFLAGS: 0000002c > RAX: 00007f5d137b4fc0 RBX: 00007f5d137bae88 RCX: 00007f5d13b5d000 > RDX: 00007f5d13928b15 RSI: 0000000000000007 RDI: ffffc90000f53f58 > RBP: 00007ffd6461d850 R08: 00007f5d137bb680 R09: 00007f5d137bb7b8 > R10: 0000000000000022 R11: 00007f5d143cb000 R12: 00007f5d143cb000 > R13: 00007f5d1379c000 R14: 00007f5d143cb000 R15: 0000000000000006 > FS: 00007f5d143c8840(0000) GS:ffff8804ffd00000(0000) > knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: ffffffff81035f80 CR3: 00000004ed4de000 CR4: 0000000000000630 > Stack: > ffffffff81435c08 0000000000000006 00007f5d143cb000 00007f5d1379c000 > 00007f5d143cb000 00007ffd6461d850 00007f5d137bae88 00007f5d143cb000 > 0000000000000022 00007f5d137bb7b8 00007f5d137bb680 00007f5d137b4fc0 > Call Trace: > [<ffffffff81435c08>] ? page_fault+0x28/0x30 > Code: 00 48 83 c4 30 5b 5d 41 5c 41 5d 41 5e 41 5f c3 31 d2 48 be ff ff ff > ff ff e8 ff ff 48 bf 00 00 00 00 00 c9 ff ff e9 57 e5 ff ff <55> 48 89 f5 > 53 48 89 fb 0f 20 d0 66 66 66 90 48 89 ee 48 89 df > RIP [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > RSP <ffffc90000f53f50> > CR2: ffffffff81035f80 > ---[ end trace 3f6da64006abaee9 ]--- > BUG: unable to handle kernel paging request at ffffffff8102a880 > IP: [<ffffffff8102a883>] smp_apic_timer_interrupt+0x0/0x95 > PGD 180b067 PUD 180c063 > PMD 10000e1 > Oops: 0010 [#5] SMP > Modules linked in: > CPU: 0 PID: 1112 Comm: PR Tainted: G D 4.9.189 #1 > Hardware name: , BIOS 06/08/2008 > task: ffff8804eeaaea80 task.stack: ffffc90001184000 > RIP: 0010:[<ffffffff8102a883>] [<ffffffff8102a883>] > smp_apic_timer_interrupt+0x0/0x95 > RSP: 0000:ffff8804ffc03ff0 EFLAGS: 0000007e > RAX: 0000000000e0a84e RBX: 00007f1076dd2be4 RCX: 000000007c2284f8 > RDX: 000000007c228500 RSI: 0000000000000001 RDI: ffffc90001187f58 > RBP: 00007fff69a1c000 R08: 0000000000000000 R09: 000000000000000c > R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000400f30 > R13: 00007fff69a1c0f0 R14: 0000000000000000 R15: 0000000000000000 > FS: 00007f1086db4740(0000) GS:ffff8804ffc00000(0000) > knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: ffffffff8102a880 CR3: 00000004ed798000 CR4: 0000000000000630 > Stack: > ffffffff81434fce ffffc90001187f58 <EOI> 0000000000000000 0000000000000000 > 00007fff69a1c0f0 0000000000400f30 00007fff69a1c000 00007f1076dd2be4 > 0000000000000246 0000000000000000 000000000000000c 0000000000000000 > Call Trace: > <IRQ> [<ffffffff81434fce>] ? apic_timer_interrupt+0x9e/0xb0 > <EOI> Code: > 00 00 e8 31 d9 40 00 4c 89 f7 57 9d 66 66 90 66 90 5b 41 5e c3 c3 31 d2 31 > f6 48 c7 c7 8c a2 02 81 e9 b4 fc 05 00 e9 33 fa ff ff <55> 53 65 48 8b 2d > 7b 3f fe 7e 65 48 89 3d 73 3f fe 7e e8 14 ac > RIP [<ffffffff8102a883>] smp_apic_timer_interrupt+0x0/0x95 > RSP <ffff8804ffc03ff0> > CR2: ffffffff8102a880 > ---[ end trace 3f6da64006abaeea ]--- > BUG: unable to handle kernel paging request at ffffffff81035f80 > IP: [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > PGD 180b067 PUD 180c063 > PMD 10000e1 > Oops: 0010 [#6] SMP > Modules linked in: > CPU: 0 PID: 1122 Comm: bash Tainted: G D 4.9.189 #1 > Hardware name: , BIOS 06/08/2008 > task: ffff8804ed412880 task.stack: ffffc90000f50000 > RIP: 0010:[<ffffffff81035fb8>] [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > RSP: 0000:ffffc90000f53f50 EFLAGS: 0000002e > RAX: 00007fcce9159220 RBX: 00007fcce97a54f0 RCX: 0000000000000001 > RDX: 000000000000001b RSI: 0000000000000004 RDI: ffffc90000f53f58 > RBP: 0000000000000002 R08: 000000000000ffff R09: 0000000000000007 > R10: 00007fcce95a2720 R11: 000000000000022e R12: 0000000000000005 > R13: 0000000000000000 R14: 00007fcce97a5f50 R15: 0000000000000000 > FS: 00007fcce97a3700(0000) GS:ffff8804ffc00000(0000) > knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: ffffffff81035f80 CR3: 00000003c1c66000 CR4: 0000000000000630 > Stack: > ffffffff81435c08 0000000000000000 00007fcce97a5f50 0000000000000000 > 0000000000000005 0000000000000002 00007fcce97a54f0 000000000000022e > 00007fcce95a2720 0000000000000007 000000000000ffff 00007fcce9159220 > Call Trace: > [<ffffffff81435c08>] ? page_fault+0x28/0x30 > Code: 00 48 83 c4 30 5b 5d 41 5c 41 5d 41 5e 41 5f c3 31 d2 48 be ff ff ff > ff ff e8 ff ff 48 bf 00 00 00 00 00 c9 ff ff e9 57 e5 ff ff <55> 48 89 f5 > 53 48 89 fb 0f 20 d0 66 66 66 90 48 89 ee 48 89 df > RIP [<ffffffff81035fb8>] do_page_fault+0x0/0x1f > RSP <ffffc90000f53f50> > CR2: ffffffff81035f80 > ---[ end trace 3f6da64006abaeeb ]--- > > Is there something wrong after switching cpu? Does the stats (especially > for L3 cache) make sense? Is it because that I use 3 level classic cache? > The reason why I use kvm is to warm up the cache and then do a detailed > research on L3 cache. > > 3. When I am going to make a checkpoint, I can't add m5 pseudo > instructions to my executable file because gem5 killed for illegal > instructions. I aware that the kvmCPU use host machine ISA. But I see > others can do it. I wonder how you guys make it. > > Any suggestion is highly appreciated. Thanks, > > Best regards, > > Yifan Song > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-le...@gem5.org > %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
_______________________________________________ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s