If there is a return that's good as there is someone responding. Are you currently running without ATF? Do you just run L4Re instead of Linux or is there some bigger difference?
Adam
On Tue Apr 29, 2025 at 05:50:37 +0000, Moshe Kravchik wrote:
OK, that's great, I just commented out the range check in `fiasco/src/kern/arm/smc_user.cpp`, but even though I see the calls get through, they still return -1. Should I load ATF or some other code first so that someone will respond to these SMC calls? ________________________________ From: Adam Lackorzynski adam@l4re.org Sent: Tuesday, April 29, 2025 12:04 AM To: Moshe Kravchik mkravchik@hotmail.com; l4-hackers@os.inf.tu-dresden.de l4-hackers@os.inf.tu-dresden.de Subject: Re: Linux fails on startup looking for SMC
Hi,
Could you tune ARM_SMC_USER_MIN/ARM_SMC_USER_MAX in the kernel? Seems the SMC functions asked are 0x8200ff03U and 0xC2000xxx and that's not covered by the default range, so increasing ARM_SMC_USER_MAX to 0xcfffffff or so.
Adam
On Mon Apr 28, 2025 at 15:00:04 +0000, Moshe Kravchik wrote:
Thank you! This configuration indeed resulted in the capability present. However, I still get the error: `zynqmp_firmware firmware:zynqmp-firmware: probe with driver zynqmp_firmware failed with error -22` and when I add prints I see that the SMC calls in the Linux kernel return -1. Anything else I need to add to the device tree to initialize it or something? When I boot into Ubuntu without L4 it works. Moshe ________________________________ From: Adam Lackorzynski adam@l4re.org Sent: Monday, April 28, 2025 2:53 PM To: Moshe Kravchik mkravchik@hotmail.com; l4-hackers@os.inf.tu-dresden.de l4-hackers@os.inf.tu-dresden.de Subject: Re: Linux fails on startup looking for SMC
On Mon Apr 28, 2025 at 05:25:34 +0000, Moshe Kravchik wrote:
Thanks a lot, Adam! I added both and rebuilt the device tree, but now I'm getting:
vm-1 | VMM[smccc_proxy]: smccc_proxy vm-1 | VMM: smccc_proxy.l4vmm,smccc_cap: capability smc is invalid. vm-1 | VMM[vm]: Device creation for virtual device smccc_proxy failed. Disabling device.This tells that the 'smc' cap is not there in uvmm. Is it there in the 'caps' table with which uvmm is started? There, where "ram = ..." is as well: caps = { ram = ...., smc = L4.Env.arm_smc, }, .... Additionally, in the microkernel, the CONFIG_ARM_SMC_USER option must also be enabled.
Adam
Moshe ________________________________ From: Adam Lackorzynski adam@l4re.org Sent: Monday, April 28, 2025 12:07 AM To: Moshe Kravchik mkravchik@hotmail.com; l4-hackers@os.inf.tu-dresden.de l4-hackers@os.inf.tu-dresden.de Subject: Re: Linux fails on startup looking for SMC
Hi Moshe,
On Sun Apr 27, 2025 at 15:32:53 +0000, Moshe Kravchik wrote:
Hi, I'm trying to set up a Linux running on uvmm with a HW passthrough. I added `zynqmp_firmware` to my DTS (it was required for the device I'm trying to pass). However, Linux fails to add the device and I see: vm-1 | [ 1.772078] ledtrig-cpu: registered to indicate activity on CPUs vm-1 | VMM[guest]: No handler for SMC call: imm=0 a0=c200003f a1=3f ip=ffff800080026884 lr=ffff800080dcdb04 vm-1 | VMM[guest]: No handler for SMC call: imm=0 a0=c2000001 a1=0 ip=ffff800080026884 lr=ffff800080dcdb04 vm-1 | [ 1.805957] zynqmp_firmware firmware:zynqmp-firmware: probe with driver zynqmp_firmware failed with error -22
From the traces I added, the failure is in `zynqmp_pm_get_api_version`.
How do I add SMC handling?
You give uvmm in the Ned script: smc = L4.Env.arm_smc
And put this into you device tree: smccc_proxy { compatible = "l4vmm,smccc_proxy"; l4vmm,smccc_cap = "smc"; method = "smc"; };
Note that L4.Env.arm_smc gives access to the real interface with all the power that is behind it (the kernel only filters its range). So in a longer run it might be necessary to have proxy for this interface, or emulate the SMCs, or modify Linux to not use it, whatever fits best.
Adam
Adam
Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/
Adam