Re: Execute "SMC" instruction in Guest OS

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

 



Hi Chenxu,

On 2021-09-25 07:45, Chenxu Wang wrote:
Hi all,

I want the Guest OS to use the Arm-TF service in Host OS (It is the
same as using Trusted Application in OP-TEE). So I should provide some
parameters and call SMC instruction.

It is unlikely to work out of the box. For a start, the guest is a
different entity altogether, and it is unlikely that ATF can directly
deal with a request coming from the guest, specially if you are passing
any sort of memory reference.

But it returns an "Undefined Instruction" in my Linux v4.9.51.
I find that KVM calls a " kvm_inject_undefined(vcpu);" when handling
the SMC instruction.

You should really get rid of this kernel and move to something more
recent. This UNDEF injection is a bug which has been fixed in more
recent versions of the kernel (by returning -1 instead).

So, if I want the Guest OS to use the "Arm-TF service" or "TA", should
I simply change the kvm_inject_undefined() as "SMC #0", and carefully
handle the input parameters? What else should I do?

You should probably consider relaying the SMC to userspace, and then get
the VMM to do the talking with with the platform TEE driver.

        M.
--
Who you jivin' with that Cosmik Debris?
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux