[gem5-users] Re: ARM KVM Switch + Restoration

2023-08-01 Thread AbdelQader AlKilany via gem5-users
Hello Jason,

I have attached the files of the checkpoint/restoring.

Thank you for your help.
Abdal

From: Jason Lowe-Power 
Sent: Tuesday, August 1, 2023 7:35 PM
To: The gem5 Users mailing list 
Cc: AbdelQader AlKilany 
Subject: Re: [gem5-users] ARM KVM Switch + Restoration

This should work... can you provide an example script and specific commands to 
reproduce the error?

Thanks,
Jason

On Tue, Aug 1, 2023 at 11:24 AM AbdelQader AlKilany via gem5-users 
mailto:gem5-users@gem5.org>> wrote:
Hello gem5 users,

I was wondering if it is possible to start a FS ARM simulation using KVM, 
switch to another CPU type such as Atomic, then restore the CPU type(Atomic), 
and maybe even switch again to O3.

I have tried to do this using the standard library but I have encountered some 
errors such as:

build/ALL/sim/serialize.hh:379: fatal: fatal condition !paramInImpl(cp, name, 
param) occurred: Can't unserialize 'board.processor.start.core:_pid'


I am using:
platform VExpress_Gem5_V1 (since it’s the only one I found to work with KVM)
release ArmRelease.for_kvm()

I used this for both the checkpointing and restoring simulations (I found the 
release worked for non KVM CPUs when not restoring).

Thank you for any help!
Abdal
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to 
gem5-users-le...@gem5.org

from gem5.utils.requires import requires
from gem5.components.boards.arm_board import ArmBoard
from gem5.components.memory.single_channel import SingleChannelDDR3_1600
from gem5.components.processors.simple_switchable_processor import (
SimpleSwitchableProcessor,
)
from gem5.components.processors.cpu_types import CPUTypes
from gem5.isas import ISA
from gem5.coherence_protocol import CoherenceProtocol
from gem5.simulate.simulator import Simulator
from gem5.simulate.exit_event import ExitEvent
from gem5.resources.workload import Workload, CustomWorkload
from gem5.resources.resource import AbstractResource

from m5.objects import GenericTimer, SimObject, ArmDefaultRelease, 
VExpress_GEM5_V1, VExpress_GEM5_Foundation

requires(
isa_required=ISA.ARM,
kvm_required=True,
)
from gem5.components.cachehierarchies.classic.no_cache import NoCache



cache_hierarchy = NoCache()

memory = SingleChannelDDR3_1600(size="3GB")


processor = SimpleSwitchableProcessor(
starting_core_type=CPUTypes.KVM,
switch_core_type=CPUTypes.ATOMIC,
isa=ISA.ARM,
num_cores=1,
)


release = ArmDefaultRelease.for_kvm()
platform = VExpress_GEM5_V1()
GenericTimer.generateDeviceTree = SimObject.generateDeviceTree



board = ArmBoard(
clk_freq="3GHz",
processor=processor,
memory=memory,
cache_hierarchy=cache_hierarchy,
release=release,
platform=platform,
)


board.realview.gic.simulate_gic = True


command = ("m5 --addr 0x1001 exit;" 
+ "m5 checkpoint;"
+ "m5 exit;" 
)


workload= CustomWorkload(
function = "set_kernel_disk_workload",
parameters = {
"bootloader" : 
AbstractResource("system/arm/bootloader/arm64/boot_foundation.arm64"),
"kernel" : AbstractResource("CustomResource/arm/arm64-vmlinux-5.4.49"),
"disk_image" : 
AbstractResource("CustomResource/arm/arm64-ubuntu-20220727.img")
}
)
workload.set_parameter("readfile_contents", command)
board.set_workload(workload)



simulator = Simulator(
board=board,
on_exit_event={
ExitEvent.EXIT: (func() for func in [processor.switch])
},
)
simulator.run()
from gem5.isas import ISA
from gem5.utils.requires import requires
from gem5.resources.resource import Resource, AbstractResource
from gem5.resources.workload import Workload, CustomWorkload
from gem5.components.memory import SingleChannelDDR3_1600
from gem5.components.processors.cpu_types import CPUTypes
from gem5.components.boards.arm_board import ArmBoard
from gem5.components.cachehierarchies.classic.no_cache import NoCache
from gem5.components.processors.simple_processor import SimpleProcessor
from gem5.components.processors.simple_switchable_processor import 
SimpleSwitchableProcessor
from gem5.simulate.simulator import Simulator
from gem5.simulate.exit_event import ExitEvent
from gem5.coherence_protocol import CoherenceProtocol

from m5.objects import *


requires(
isa_required=ISA.ARM,
)
cache_hierarchy = NoCache()

memory = SingleChannelDDR3_1600(size="3GB")

processor = SimpleSwitchableProcessor(
starting_core_type=CPUTypes.ATOMIC,
switch_core_type=CPUTypes.O3,
isa=ISA.ARM,
num_cores=1,
)



release = ArmDefaultRelease.for_kvm()
platform = VExpress_GEM5_V1()
GenericTimer.generateDeviceTree = SimObject.generateDeviceTree



board = ArmBoard(
clk_freq="3GHz",
processor=processor,
memory=memory,
cache_hierarchy=cache_hierarchy,
release=release,
platform=platform,
)

board.realview.gic.simulate_gic = True

command = "m5 exit ;" \
+ "echo 'This is running on 

[gem5-users] Re: ARM KVM Switch + Restoration

2023-08-01 Thread Jason Lowe-Power via gem5-users
This should work... can you provide an example script and specific commands
to reproduce the error?

Thanks,
Jason

On Tue, Aug 1, 2023 at 11:24 AM AbdelQader AlKilany via gem5-users <
gem5-users@gem5.org> wrote:

> Hello gem5 users,
>
>
>
> I was wondering if it is possible to start a FS ARM simulation using KVM,
> switch to another CPU type such as Atomic, then restore the CPU
> type(Atomic), and maybe even switch again to O3.
>
>
>
> I have tried to do this using the standard library but I have encountered
> some errors such as:
>
>
>
> build/ALL/sim/serialize.hh:379: fatal: fatal condition !paramInImpl(cp,
> name, param) occurred: Can't unserialize 'board.processor.start.core:_pid'
>
>
>
>
>
> I am using:
>
> platform VExpress_Gem5_V1 (since it’s the only one I found to work with
> KVM)
>
> release ArmRelease.for_kvm()
>
>
>
> I used this for both the checkpointing and restoring simulations (I found
> the release worked for non KVM CPUs when not restoring).
>
> Thank you for any help!
>
> Abdal
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
>
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Re: ARM KVM

2021-07-12 Thread Jason Lowe-Power via gem5-users
To use hardware-accelerated virtualization (i.e., KVM) your host and guest
must have the same ISA (and the host must have virtualization extension).

Cheers,
Jason

On Mon, Jul 12, 2021 at 12:17 PM Νικόλαος Ταμπουρατζής via gem5-users <
gem5-users@gem5.org> wrote:

> Dear gem5 community,
>
> I have installed the latest gem5 on an x86 machine. Is it possible to
> run ARM FS with kvm on X86 machine or the host machine must be
> ARM-based?
>
> I try to execute the following configuration (from this thread
> https://www.mail-archive.com/gem5-users@gem5.org/msg19472.html):
>
> $GEM5/build/ARM/gem5.opt $GEM5/configs/example/arm/fs_bigLITTLE.py
> --kernel=vmlinux.arm64 --machine-type VExpress_GEM5 --disk
> ubuntu-18.04-arm64-docker.img --cpu-type kvm --big-cpus 4
>
> and I get the following error (which means that there is not the kvm
> option):
>
> fs_bigLITTLE.py: error: argument --cpu-type: invalid choice: 'kvm'
> (choose from 'atomic', 'timing', 'exynos')
>
> May you help me, please?
>
> Best regards,
> Nikos
>
>
>
> ___
> 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