qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Failed to execute "SMC" call on Guest OS.


From: Peter Maydell
Subject: Re: Failed to execute "SMC" call on Guest OS.
Date: Thu, 23 Sep 2021 10:15:12 +0100

On Thu, 23 Sept 2021 at 08:38, Chenxu Wang <irakatz51@gmail.com> wrote:
>
> Hi all,
>
> In the Host OS, I make a smc call and get the correct return.
> Also, the Host OS enables KVM support. (specifically, it supports VHE, so 
> Host is running on EL2)
>
> Then I run a qemu-system-aarch64 to run a guest OS, with KVM support. Here I 
> use a QEMU v2.9. I pre-load a helloworld module in the ramdisk.img, in the 
> module it contains a SMC call.
>
> My booting instructions are listed below.
>
> ./qemu-system-aarch64 -nographic -kernel Image -initrd ramdisk.img -m 512 
> -machine virt,accel=kvm -cpu host -append "console=ttyAMA0 init=/liunxrc 
> root=/dev/ram0 rw rootfstype=ext4"
>
> Then I execute the module, it says
>
> insmod[1086]: undefined instruction: pc=ffff0000008b5060
> Code: 95e2c44a 580002e0 95e2c448 18000360 (d4000003)

This happens because your guest is making an SMC call, which
it should not be doing. Inside the VM, your guest is running
on the "virt" board. The DTB tells the guest that it should
use the HVC call to make PSCI calls. There is nothing that tells
the guest that SMC will do anything sensible.

I don't know what your guest code expects the SMC to do, but
QEMU and KVM are unlikely to be able to provide it. (The behaviour
of KVM has changed in this area for different host kernel versions:
older kernels made the SMC UNDEF; newer ones make it set X0 to -1
and advance the PC past the SMC. TCG QEMU currently still UNDEFs.)

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]