HI Giacomo, 

I add that line of code you pointed me to to the fs_bigLittle.py, now I can 
boot into the terminal, however, the kernel cannot bring all but one cpu 
online. It’s also a bit strange in the sense that I specify ‘-smp 12’, and 
inside the guest when I check lscpu, it shows total of 13 CPUs and only cpu0 is 
online, cpu1-12 are offline. 

I tried both the stock kernel as well as compiling kernel myself following your 
suggestions from earlier email, both have the same issue. Do you have any 
suggestions on what could be causing the problem?

Best, 
Wenqi

> On Apr 1, 2021, at 03:28, Giacomo Travaglini <giacomo.travagl...@arm.com> 
> wrote:
> 
> Yes, apologies, I forgot to mention that.
> As your host is likely using a GICv3 interrupt controller, you need to 
> entirely emulate the GICv2 and Generic Timer in userspace (gem5).
> 
> This is done via the simulate_gic (as you have already done) and by removing 
> the system register interface info from the DTB node
> 
> Here's an example:
> 
> https://github.com/gem5/gem5/blob/stable/tests/gem5/configs/arm_generic.py#L99
> 
> Let me know if this works
> 
> Kind Regards
> 
> Giacomo
> 
> 
>> -----Original Message-----
>> From: wq...@utexas.edu <wq...@utexas.edu>
>> Sent: 31 March 2021 19:18
>> To: Giacomo Travaglini <giacomo.travagl...@arm.com>; gem5 users mailing
>> list <gem5-users@gem5.org>; wq...@utexas.edu
>> Subject: Re: [gem5-users] Fail to Boot Multicore Arm System with KVM CPU
>> 
>> Hi Giacomo,
>> 
>> Thanks for your reply. I tried the solution you suggested, but seems there
>> are still problems. Just make sure I understood correctly, I specified the
>> 'machine-type' as 'VExpress_GEM5_V1' and in the VExpress_GEM5_V1_Base
>> class's definition (src/dev/arm/RealView.py), when instantiating the gic, I 
>> use:
>> 
>> gic = kvm_gicv2_class(dist_addr=0x2c001000, cpu_addr=0x2c002000,
>>                           it_lines=512, gem5_extensions=True)
>> 
>> The kvm_gicv2_class will be resolved as MuxingKvmGic, which inherent from
>> GicV2 class. To make sure the change applied, I also change the default value
>> of gem5_extensions from False to True in the GicV2 class's definition
>> (src/dev/arm/Gic.py). After rebuild, when starting gem5 there will be a panic
>> says "KVM: failed to create virtual CPU" (from /src/cpu/kvm/vm.cc, when
>> using ioctl to create vcpu)
>> 
>> Another thing I tried is to set the "simulate_gic" of the MuxingKvmGic class
>> from False to True, this seems help me get around the vCPU creation failure,
>> however, at some point it faces an assertion failure of:
>> 
>> gem5.opt: build/ARM/sim/eventq.hh:763: void
>> EventQueue::schedule(Event*, Tick, bool): Assertion `when >= getCurTick()'
>> failed.
>> Program aborted at tick 112565277000
>> 
>> Best,
>> 
>> Wenqi
>> 
>> On 3/31/21 7:57 AM, Giacomo Travaglini wrote:
>>> Hi Wenqi,
>>> 
>>> First of all thanks for the detailed explanation of your problem.
>>> 
>>>> -----Original Message-----
>>>> From: wqyin--- via gem5-users <gem5-users@gem5.org>
>>>> Sent: 30 March 2021 22:47
>>>> To: gem5-users@gem5.org; wq...@utexas.edu
>>>> Cc: wq...@utexas.edu
>>>> Subject: [gem5-users] Fail to Boot Multicore Arm System with KVM CPU
>>>> 
>>>> Hello all,
>>>> 
>>>> I am trying to model a multicore arm64 system with the
>>>> example/arm/fs_bigLittle.py using kvm cpu. However, when I specify "-
>>>> machine-type VExpress_Gem5_V2_XXX", the kernel panic during booting,
>>>> giving an error message of:
>>>> 
>>>> [    0.000000] GICv3: Distributor has Range Selector support [    0.000000]
>>>> GICv3: no VLPI support, direct LPI support [    0.000000] ITS [mem
>>>> 0x2e010000-0x2e02ffff] [    0.000000] ITS@0x000000002e010000: allocated
>>>> 262144 Devices
>>>> @fc600000 (flat, esz 8, psz 64K, shr 1)
>>>> [    0.000000] ITS@0x000000002e010000: allocated 8192 Interrupt
>> Collections
>>>> @fc460000 (flat, esz 8, psz 64K, shr 1) [    0.000000] GIC: using LPI 
>>>> property
>>>> table @0x00000000fc470000 [    0.000000] ITS: Allocated 1792 chunks for
>> LPIs
>>>> [    0.000000] GICv3: CPU0: found redistributor 0 region
>>>> 0:0x000000002c010000
>>>> [    0.000000] CPU0: using LPI pending table @0x00000000fc480000
>> [    0.000000]
>>>> GIC: using cache flushing for LPI property table [    0.000000] GICv3: GIC:
>>>> unable to set SRE (disabled at EL2), panic ahead [    0.000000] 
>>>> ------------
>> [ cut
>>>> here ]------------ [    0.000000] kernel BUG at /work/gem5-
>>>> scripts/submodules/linux/arch/arm64/kernel/entry.S:602!
>>>> [    0.000000] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [    
>>>> 0.000000]
>>>> Modules linked in:
>>>> [    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.18.0+ #1
>>>> [    0.000000] Hardware name: V2P-CA15 (DT) [    0.000000] pstate:
>> 80000085
>>>> (Nzcv daIf -PAN -UAO)
>>> Unfortunately KVM with GICv3 is not currently supported.
>>> 
>>>> I saw this error message regardless of how many vCPU I try to model.
>>>> However, when I switch to machine-type of "VExpress-Gem5", the guest
>>>> can boot, but it only allows up to 8 vCPUs. I suppose this is because
>>>> in this config it doesn't support GICv3.
>>>> 
>>>> For my use case, I do need more than 8 cpus in the modeled system,
>>>> can anyone help me here?
>>> We provide a workaround for that, allowing you to use more than 8 CPUs
>> with GICv2.
>>> That requires you to set the Gicv2.gem5_extensions parameter to True.
>>> A change in the Linux GIC driver is also needed. IIRC the prebuilt binary
>> should already contain that.
>>> If not, you would have to rebuild the kernel yourself from the following
>> Linux fork:
>>> 
>>> https://gem5.googlesource.com/arm/linux/+/refs/heads/gem5/v4.15
>>> 
>>> (Use the gem5_defconfig)
>>> 
>>> Let me know if it works
>>> 
>>>> Here is the environment I used for the experiment:
>>>> 
>>>> Host: aarch64 platform
>>>> 
>>>> Gem5 version: v21.0 both stable and develop branch
>>>> 
>>>> kernel and disk image: both downloaded from gem5 homepage:
>>>> 
>>>> kernel: http://dist.gem5.org/dist/current/arm/aarch-system-
>>>> 201901106.tar.bz2
>>>> 
>>>> disk:
>>>> http://dist.gem5.org/dist/current/arm/disks/ubuntu-18.04-arm64-
>>>> docker.img.bz2
>>>> 
>>>> launch cmd: build/ARM/gem5.opt configs/example/arm/fs_bigLITTLE.py
>>>> --kernel ../gem5_image/binaries/vmlinux.arm64 --machine-type
>>>> VExpress_GEM5_V2 --disk ../gem5_image/ubuntu-18.04-arm64-
>> docker.img
>>>> --cpu-type kvm --big-cpus X
>>>> 
>>>> Best,
>>>> 
>>>> Wenqi
>>>> _______________________________________________
>>>> 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
>>> Kind Regards
>>> 
>>> Giacomo
>>> IMPORTANT NOTICE: The contents of this email and any attachments are
>> confidential and may also be privileged. If you are not the intended 
>> recipient,
>> please notify the sender immediately and do not disclose the contents to any
>> other person, use it for any purpose, or store or copy the information in any
>> medium. Thank you.
> IMPORTANT NOTICE: The contents of this email and any attachments are 
> confidential and may also be privileged. If you are not the intended 
> recipient, please notify the sender immediately and do not disclose the 
> contents to any other person, use it for any purpose, or store or copy the 
> information in any medium. Thank you.
_______________________________________________
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

Reply via email to