gem5-users@gem5.org

The gem5 Users mailing list

View all threads

About kvm-x86 in SE mode

C
ChenShixuan
Fri, Jan 12, 2024 2:46 AM

Hi all,

I am a beginner to use the Gem5. I am using kvm to run "x86-hello64-static" and switch to timing cpu in SE  simulation but it seems to be not working. And I am getting an error that I dont understand.

Here are the errors that I am getting:

src/sim/simulate.cc:199: info: Entering event queue @ 0.  Starting simulation...
src/arch/x86/kvm/x86_cpu.cc:542: warn: tr: S flag is set
src/cpu/kvm/base.cc:866: panic: KVM: Failed to set guest special registers
Memory Usage: 8527892 KBytes

I am certain that my computer supports and has KVM virtualization enabled. And my computer's architecture is also X86.

I cloned the latest version of gem5. And the python script I used is:

cache_hierarchy = NoCache()
memory = SingleChannelDDR3_1600()
processor = SimpleProcessor(
    cpu_type=CPUTypes.KVM,
    isa=ISA.X86,
    num_cores=1,
)
motherboard = SimpleBoard(
    clk_freq="3GHz",
    processor=processor,
    memory=memory,
    cache_hierarchy=cache_hierarchy,
)
binary = obtain_resource("x86-hello64-static")

motherboard.set_se_binary_workload(binary)
simulator = Simulator(board=motherboard)
simulator.run()
print(
    "Exiting @ tick {} because {}.".format(
        simulator.get_current_tick(), simulator.get_last_exit_event_cause()
    )
)










At the same time, I run the sample script “x86-ubuntu-run-with-kvm.py”  will get stuck in this:

in gem5/:
src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0xc0010015) unsupported by gem5. Skipping.
src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0x4b564d05) unsupported by gem5. Skipping.
20062000000000: board.pc.com_1.device: attach terminal 0



in gem5/util/term:
./m5term  3456
==== m5 terminal: Terminal 0 ====

And this simulation never run it again.

Thank you very much if you could help me answer my questions!

Best,
Chen SX

Hi all, I am a beginner to use the Gem5. I am using kvm to run "x86-hello64-static" and switch to timing cpu in SE  simulation but it seems to be not working. And I am getting an error that I dont understand. Here are the errors that I am getting: ~~~ src/sim/simulate.cc:199: info: Entering event queue @ 0.  Starting simulation... src/arch/x86/kvm/x86_cpu.cc:542: warn: tr: S flag is set src/cpu/kvm/base.cc:866: panic: KVM: Failed to set guest special registers Memory Usage: 8527892 KBytes ~~~ I am certain that my computer supports and has KVM virtualization enabled. And my computer's architecture is also X86. I cloned the latest version of gem5. And the python script I used is: ~~~ cache_hierarchy = NoCache() memory = SingleChannelDDR3_1600() processor = SimpleProcessor(     cpu_type=CPUTypes.KVM,     isa=ISA.X86,     num_cores=1, ) motherboard = SimpleBoard(     clk_freq="3GHz",     processor=processor,     memory=memory,     cache_hierarchy=cache_hierarchy, ) binary = obtain_resource("x86-hello64-static") motherboard.set_se_binary_workload(binary) simulator = Simulator(board=motherboard) simulator.run() print(     "Exiting @ tick {} because {}.".format(         simulator.get_current_tick(), simulator.get_last_exit_event_cause()     ) ) ~~~ At the same time, I run the sample script “x86-ubuntu-run-with-kvm.py”  will get stuck in this: ~~~ in gem5/: src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0xc0010015) unsupported by gem5. Skipping. src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0x4b564d05) unsupported by gem5. Skipping. 20062000000000: board.pc.com_1.device: attach terminal 0 in gem5/util/term: ./m5term  3456 ==== m5 terminal: Terminal 0 ==== ~~~ And this simulation never run it again. Thank you very much if you could help me answer my questions! Best, Chen SX
M
muke101
Fri, Jan 12, 2024 3:22 AM

Might not be it but are you part of the KVM user group? Does it work if you run gem5 under sudo?

Sent from Proton Mail mobile

-------- Original Message --------
On 12 Jan 2024, 02:46, ChenShixuan via gem5-users wrote:

Hi all,

I am a beginner to use the Gem5. I am using kvm to run "x86-hello64-static" and switch to timing cpu in SE simulation but it seems to be not working. And I am getting an error that I dont understand.

Here are the errors that I am getting:

~~~
src/sim/simulate.cc:199: info: Entering event queue @ 0. Starting simulation...
src/arch/x86/kvm/x86_cpu.cc:542: warn: tr: S flag is set
src/cpu/kvm/base.cc:866: panic: KVM: Failed to set guest special registers
Memory Usage: 8527892 KBytes
~~~

I am certain that my computer supports and has KVM virtualization enabled. And my computer's architecture is also X86.

I cloned the latest version of gem5. And the python script I used is:

~~~
cache_hierarchy = NoCache()
memory = SingleChannelDDR3_1600()
processor = SimpleProcessor(
cpu_type=CPUTypes.KVM,
isa=ISA.X86,
num_cores=1,
)
motherboard = SimpleBoard(
clk_freq="3GHz",
processor=processor,
memory=memory,
cache_hierarchy=cache_hierarchy,
)
binary = obtain_resource("x86-hello64-static")
motherboard.set_se_binary_workload(binary)
simulator = Simulator(board=motherboard)
simulator.run()
print(
"Exiting @ tick {} because {}.".format(
simulator.get_current_tick(), simulator.get_last_exit_event_cause()
)
)
~~~

At the same time, I run the sample script “x86-ubuntu-run-with-kvm.py” will get stuck in this:

~~~
in gem5/:
src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0xc0010015) unsupported by gem5. Skipping.
src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0x4b564d05) unsupported by gem5. Skipping.
20062000000000: board.pc.com_1.device: attach terminal 0

in gem5/util/term:
./m5term 3456
==== m5 terminal: Terminal 0 ====
~~~

And this simulation never run it again.

Thank you very much if you could help me answer my questions!

Best,
Chen SX

Might not be it but are you part of the KVM user group? Does it work if you run gem5 under sudo? Sent from Proton Mail mobile -------- Original Message -------- On 12 Jan 2024, 02:46, ChenShixuan via gem5-users wrote: > Hi all, > > I am a beginner to use the Gem5. I am using kvm to run "x86-hello64-static" and switch to timing cpu in SE simulation but it seems to be not working. And I am getting an error that I dont understand. > > Here are the errors that I am getting: > > ~~~ > src/sim/simulate.cc:199: info: Entering event queue @ 0. Starting simulation... > src/arch/x86/kvm/x86_cpu.cc:542: warn: tr: S flag is set > src/cpu/kvm/base.cc:866: panic: KVM: Failed to set guest special registers > Memory Usage: 8527892 KBytes > ~~~ > > I am certain that my computer supports and has KVM virtualization enabled. And my computer's architecture is also X86. > > I cloned the latest version of gem5. And the python script I used is: > > ~~~ > cache_hierarchy = NoCache() > memory = SingleChannelDDR3_1600() > processor = SimpleProcessor( > cpu_type=CPUTypes.KVM, > isa=ISA.X86, > num_cores=1, > ) > motherboard = SimpleBoard( > clk_freq="3GHz", > processor=processor, > memory=memory, > cache_hierarchy=cache_hierarchy, > ) > binary = obtain_resource("x86-hello64-static") > motherboard.set_se_binary_workload(binary) > simulator = Simulator(board=motherboard) > simulator.run() > print( > "Exiting @ tick {} because {}.".format( > simulator.get_current_tick(), simulator.get_last_exit_event_cause() > ) > ) > ~~~ > > At the same time, I run the sample script “x86-ubuntu-run-with-kvm.py” will get stuck in this: > > ~~~ > in gem5/: > src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0xc0010015) unsupported by gem5. Skipping. > src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0x4b564d05) unsupported by gem5. Skipping. > 20062000000000: board.pc.com_1.device: attach terminal 0 > > in gem5/util/term: > ./m5term 3456 > ==== m5 terminal: Terminal 0 ==== > ~~~ > > And this simulation never run it again. > > Thank you very much if you could help me answer my questions! > > Best, > Chen SX
8
869066469@qq.com
Fri, Jan 12, 2024 3:35 AM

Hi muke101,

I followed the tutorial of Gem5 (using kvm) to add my user to the kvm and libvirt groups. And I have been running gem5 under root user all along.

Thank you for your reply!

Hi muke101, I followed the tutorial of Gem5 (using kvm) to add my user to the kvm and libvirt groups. And I have been running gem5 under root user all along. Thank you for your reply!
C
ChenShixuan
Fri, Jan 12, 2024 3:43 AM

Hi muke101,

I followed the tutorial of Gem5 (using kvm) to add my user to the kvm and libvirt groups. And I have been running gem5 under root user all along.

Thank you for your reply!

-------- Original Message --------
发件人:                                                                                                                        "muke101"                                                                                    <muke101@protonmail.com>;
发送时间: 2024年1月12日(星期五) 中午11:22
收件人: "gem5-users"<gem5-users@gem5.org>;
抄送: "jlowepower"<jlowepower@ucdavis.edu>;"nsakib6"<nsakib6@nmsu.edu>;"太阳王"<869066469@qq.com>;
主题: Re: [gem5-users] About kvm-x86 in SE mode

Might not be it but are you part of the KVM user group? Does it work if you run gem5 under sudo?

Sent from Proton Mail mobile

-------- Original Message --------
On 12 Jan 2024, 02:46, ChenShixuan via gem5-users < gem5-users@gem5.org> wrote:
Hi all,

I am a beginner to use the Gem5. I am using kvm to run "x86-hello64-static" and switch to timing cpu in SE  simulation but it seems to be not working. And I am getting an error that I dont understand.

Here are the errors that I am getting:

src/sim/simulate.cc:199: info: Entering event queue @ 0.&nbsp; Starting simulation...
src/arch/x86/kvm/x86_cpu.cc:542: warn: tr: S flag is set
src/cpu/kvm/base.cc:866: panic: KVM: Failed to set guest special registers
Memory Usage: 8527892 KBytes

I am certain that my computer supports and has KVM virtualization enabled. And my computer's architecture is also X86.

I cloned the latest version of gem5. And the python script I used is:

cache_hierarchy = NoCache()
memory = SingleChannelDDR3_1600()
processor = SimpleProcessor(
&nbsp; &nbsp; cpu_type=CPUTypes.KVM,
&nbsp; &nbsp; isa=ISA.X86,
&nbsp; &nbsp; num_cores=1,
)
motherboard = SimpleBoard(
&nbsp; &nbsp; clk_freq="3GHz",
&nbsp; &nbsp; processor=processor,
&nbsp; &nbsp; memory=memory,
&nbsp; &nbsp; cache_hierarchy=cache_hierarchy,
)
binary = obtain_resource("x86-hello64-static")

motherboard.set_se_binary_workload(binary)
simulator = Simulator(board=motherboard)
simulator.run()
print(
&nbsp; &nbsp; "Exiting @ tick {} because {}.".format(
&nbsp; &nbsp; &nbsp; &nbsp; simulator.get_current_tick(), simulator.get_last_exit_event_cause()
&nbsp; &nbsp; )
)










At the same time, I run the sample script “x86-ubuntu-run-with-kvm.py”  will get stuck in this:

in gem5/:
src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0xc0010015) unsupported by gem5. Skipping.
src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0x4b564d05) unsupported by gem5. Skipping.
20062000000000: board.pc.com_1.device: attach terminal 0



in gem5/util/term:
./m5term&nbsp; 3456
==== m5 terminal: Terminal 0 ====

And this simulation never run it again.

Thank you very much if you could help me answer my questions!

Best,
Chen SX

Hi muke101, I followed the tutorial of Gem5 (using kvm) to add my user to the kvm&nbsp;and&nbsp;libvirt groups. And I have been running gem5 under root user all along. Thank you for your reply! -------- Original Message -------- 发件人: "muke101" <muke101@protonmail.com&gt;; 发送时间:&nbsp;2024年1月12日(星期五) 中午11:22 收件人:&nbsp;"gem5-users"<gem5-users@gem5.org&gt;; 抄送:&nbsp;"jlowepower"<jlowepower@ucdavis.edu&gt;;"nsakib6"<nsakib6@nmsu.edu&gt;;"太阳王"<869066469@qq.com&gt;; 主题:&nbsp;Re: [gem5-users] About kvm-x86 in SE mode Might not be it but are you part of the KVM user group? Does it work if you run gem5 under sudo? Sent from Proton Mail mobile -------- Original Message -------- On 12 Jan 2024, 02:46, ChenShixuan via gem5-users < gem5-users@gem5.org&gt; wrote: Hi all, I am a beginner to use the Gem5. I am using kvm to run "x86-hello64-static" and switch to timing cpu in SE&nbsp; simulation but it seems to be not working. And I am getting an error that I dont understand. Here are the errors that I am getting: ~~~ src/sim/simulate.cc:199: info: Entering event queue @ 0.&nbsp; Starting simulation... src/arch/x86/kvm/x86_cpu.cc:542: warn: tr: S flag is set src/cpu/kvm/base.cc:866: panic: KVM: Failed to set guest special registers Memory Usage: 8527892 KBytes ~~~ I am certain that my computer supports and has KVM virtualization enabled. And my computer's architecture is also X86. I cloned the latest version of gem5. And the python script I used is: ~~~ cache_hierarchy = NoCache() memory = SingleChannelDDR3_1600() processor = SimpleProcessor( &nbsp; &nbsp; cpu_type=CPUTypes.KVM, &nbsp; &nbsp; isa=ISA.X86, &nbsp; &nbsp; num_cores=1, ) motherboard = SimpleBoard( &nbsp; &nbsp; clk_freq="3GHz", &nbsp; &nbsp; processor=processor, &nbsp; &nbsp; memory=memory, &nbsp; &nbsp; cache_hierarchy=cache_hierarchy, ) binary = obtain_resource("x86-hello64-static") motherboard.set_se_binary_workload(binary) simulator = Simulator(board=motherboard) simulator.run() print( &nbsp; &nbsp; "Exiting @ tick {} because {}.".format( &nbsp; &nbsp; &nbsp; &nbsp; simulator.get_current_tick(), simulator.get_last_exit_event_cause() &nbsp; &nbsp; ) ) ~~~ At the same time, I run the sample script “x86-ubuntu-run-with-kvm.py”&nbsp; will get stuck in this: ~~~ in gem5/: src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0xc0010015) unsupported by gem5. Skipping. src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0x4b564d05) unsupported by gem5. Skipping. 20062000000000: board.pc.com_1.device: attach terminal 0 in gem5/util/term: ./m5term&nbsp; 3456 ==== m5 terminal: Terminal 0 ==== ~~~ And this simulation never run it again. Thank you very much if you could help me answer my questions! Best, Chen SX