Hi, Jason Thank you very much for the answer. Maybe the error is caused by some version that not support the intel CPU yet. After checking out the latest version of GEM5 and re-compile, the X86KvmCPU can run in SE mode now. Thank you.
Best Regards Boya ------------------------------ Message: 5 Date: Tue, 28 Jan 2020 08:37:28 -0800 From: Jason Lowe-Power <[email protected]> To: gem5 users mailing list <[email protected]> Subject: Re: [gem5-users] set special registers error when running Kvm mode Message-ID: <cafehpuc9wwucxf+ygk6gwqj3fyapnhccogxgeww_ffvzgvd...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Hello, While I haven't seen that particular error before, currently KVM only works on AMD platforms and it doesn't work on Intel platforms. There are a couple of patches on our code review site to fix this ( https://gem5-review.googlesource.com/ <https://gem5-review.googlesource.com/dashboard/self>). However, they are untested in SE mode. Cheers, Jason On Tue, Jan 28, 2020 at 2:39 AM chenboya <[email protected]> wrote: > Hi, community: > > I'm trying to run the KVM CPU. The command is: > build/X86/gem5.debug configs/example/se_kvm.py -c > ./tests/test-progs/hello/bin/x86/linux/hello --cpu-type=X86KvmCPU > But the simulation will fail with this message: "panic: KVM: Failed to set > guest special registers" > > The se_kvm.py is just the se.py with the code of 'brandPred' removed, > because X86KvmCPU doesn't have it. > > Using gdb to debug, the error is caused by the ioctl() function, which is > from the system lib. > And this function returns error. > I tried same command in another computer, and it can work, seems that > there are some system related issue. > > Does anyone have ideas about why this function can not return right value? > Any system permission needed? > > This is the failed function: > > BaseKvmCPU::setSpecialRegisters(const struct kvm_sregs ®s) > { > if (ioctl(KVM_SET_SREGS, (void *)®s) == -1) > panic("KVM: Failed to set guest special registers\n"); > } > > Using gdb, the parameter value for ioctl() is: > > (gdb) p KVM_SET_SREGS > $1 = 1094233732 > (gdb) p ®s > $2 = (const kvm_sregs *) 0x7fffffffcac0 > > The function is in this file and has no code source. > ioctl () at ../sysdeps/unix/syscall-template.S:84 > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://m5sim.org/cgi-bin/mailman/private/gem5-users/attachments/20200128/9a0c7965/attachment-0001.html> ------------------------------ Subject: Digest Footer _______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users ------------------------------ End of gem5-users Digest, Vol 162, Issue 24 ******************************************* _______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
