Re: Linux fails on startup looking for SMC
Moshe Kravchik <[email protected]> Mon, 26 May 2025 08:49:01 +0000
| Newsgroups | gmane.comp.micro-kernel.l4.devel |
|---|---|
| Message-ID | <DB3PR08MB879633C2D0F57A6B14C6FFE7A565A@DB3PR08MB8796.eurprd08.prod.outlook.com> |
--===============6548170143850581111== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_DB3PR08MB879633C2D0F57A6B14C6FFE7A565ADB3PR08MB8796eurp_" --_000_DB3PR08MB879633C2D0F57A6B14C6FFE7A565ADB3PR08MB8796eurp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sorry for a long delay. On this board, there is a Uboot which can load and run Ubuntu. I replaced U= buntu with L4, which starts a Linux VM that I want to pass the Ethernet to = as a passthrough device. I don't explicitly load ATF, if I understand correctly, it should be loaded= before Uboot and therefore before L4 is loaded. I switched to using a kern= el from the working Ubuntu image, but SMC calls still return -1 and I can't= init the ethernet driver inside the VM. I added prints into the fiasco part and see: vm-1 | [ 17.285888] calling smccc_devices_init+0x0/0xa4 @ 1 vm-1 | [ 17.294574] initcall smccc_devices_init+0x0/0xa4 returned 0 af= ter 0 usecs vm-1 | [ 17.301414] calling smccc_soc_init+0x0/0x2ac @ 1 SMC_USER: kinvoke (1) MC_USER: kinvoke (2) [SMC_USER: kinvoke (3) 3SMC_USER: kinvoke (4) 0x80000001 SMC_USER: kinvoke (5) 7SMC_USER: kinvoke (6) r0 0x1 r1 0x80000002 r2 0x4 r3 0x152b198 mSMC_USER: kinvoke (7) r0 0xffffffffffffffff r1 0xffff40400000 r2 0xfffffff= fffffffff r3 0x1 vm-1 | vm_call 0x80000001 vm-1 | [ 17.340449] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skippi= ng .... vm-1 | [ 17.344029] initcall smccc_soc_init+0x0/0x2ac returned 0 after= 33538 usecs vm-1 | [ 17.352198] calling zynqmp_firmware_driver_init+0x0/0x34 @ 1 vm-1 | [ 17.360828] probe of firmware:zynqmp-firmware returned 0 after= 160 usecs vm-1 | [ 17.368210] initcall zynqmp_firmware_driver_init+0x0/0x34 retu= rned 0 after 7382 usecs And later: vm-1 | [ 19.699352] calling deferred_probe_initcall+0x0/0xc0 @ 1 vm-1 | [ 19.708582] probe of ff0a0000.gpio returned 517 after 55 usecs vm-1 | [ 19.716071] probe of ff0c0000.ethernet returned -517 after 15 = usecs vm-1 | [ 19.723148] zynq-gpio ff0a0000.gpio: deferred probe timeout, i= gnoring dependency vm-1 | [ 19.731093] zynq-gpio: probe of ff0a0000.gpio failed with erro= r -110 vm-1 | [ 19.740075] probe of ff0a0000.gpio returned 110 after 16951 us= ecs vm-1 | [ 19.748483] macb ff0c0000.ethernet: deferred probe timeout, ig= noring dependency vm-1 | [ 19.756015] probe of ff0c0000.ethernet returned -517 after 754= 0 usecs vm-1 | [ 19.764931] initcall deferred_probe_initcall+0x0/0xc0 returned= 0 after 55255 usecs Any ideas appreciated, Moshe ________________________________ From: Adam Lackorzynski <[email protected]> Sent: Tuesday, April 29, 2025 10:57 AM To: Moshe Kravchik <[email protected]>; [email protected]= <[email protected]> Subject: Re: Linux fails on startup looking for SMC 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/ker= n/arm/smc_user.cpp`, but even though I see the calls get through, they stil= l return -1. > Should I load ATF or some other code first so that someone will respond t= o these SMC calls? > ________________________________ > From: Adam Lackorzynski <[email protected]> > Sent: Tuesday, April 29, 2025 12:04 AM > To: Moshe Kravchik <[email protected]>; [email protected].= de <[email protected]> > 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_fir= mware 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 some= thing? > > When I boot into Ubuntu without L4 it works. > > Moshe > > ________________________________ > > From: Adam Lackorzynski <[email protected]> > > Sent: Monday, April 28, 2025 2:53 PM > > To: Moshe Kravchik <[email protected]>; [email protected]= n.de <[email protected]> > > 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 fai= led. 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 =3D ..." is > > as well: caps =3D { ram =3D ...., smc =3D L4.Env.arm_smc, }, .... > > Additionally, in the microkernel, the CONFIG_ARM_SMC_USER option must > > also be enabled. > > > > > > Adam > > > > > Moshe > > > ________________________________ > > > From: Adam Lackorzynski <[email protected]> > > > Sent: Monday, April 28, 2025 12:07 AM > > > To: Moshe Kravchik <[email protected]>; [email protected]= den.de <[email protected]> > > > 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=3D0 a0=3Dc200003f a= 1=3D3f ip=3Dffff800080026884 lr=3Dffff800080dcdb04 > > > > vm-1 | VMM[guest]: No handler for SMC call: imm=3D0 a0=3Dc2000001 a= 1=3D0 ip=3Dffff800080026884 lr=3Dffff800080dcdb04 > > > > 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_vers= ion`. > > > > > > > > How do I add SMC handling? > > > > > > You give uvmm in the Ned script: smc =3D L4.Env.arm_smc > > > > > > And put this into you device tree: > > > smccc_proxy { > > > compatible =3D "l4vmm,smccc_proxy"; > > > l4vmm,smccc_cap =3D "smc"; > > > method =3D "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 [email protected] > Lackorzynski http://os.inf.tu-dresden.de/~adam/ Adam -- Adam [email protected] Lackorzynski http://os.inf.tu-dresden.de/~adam/ --_000_DB3PR08MB879633C2D0F57A6B14C6FFE7A565ADB3PR08MB8796eurp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"= > <style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo= ttom:0;} </style> </head> <body dir=3D"ltr"> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> Sorry for a long delay.<br> On this board, there is a Uboot which can load and run Ubuntu. I replaced U= buntu with L4, which starts a Linux VM that I want to pass the Ethernet to = as a passthrough device.<br> <br> I don't explicitly load ATF, if I understand correctly, it should be loaded= before Uboot and therefore before L4 is loaded. I switched to using a kern= el from the working Ubuntu image, but SMC calls still return -1 and I can't= init the ethernet driver inside the VM.<br> I added prints into the fiasco part and see:<br> vm-1 | [ 17.285888] calling smccc_devices_init+0x= 0/0xa4 @ 1</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 17.294574] initcall smccc_devices_init+0x0/0xa= 4 returned 0 after 0 usecs</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 17.301414] calling smccc_soc_init+0x0/0x= 2ac @ 1</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> SMC_USER: kinvoke (1)</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> MC_USER: kinvoke (2)</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> [SMC_USER: kinvoke (3)</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> 3SMC_USER: kinvoke (4) 0x80000001</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> SMC_USER: kinvoke (5)</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> 7SMC_USER: kinvoke (6) r0 0x1 r1 0x80000002 r2 0x4 r3 0x152b198</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> mSMC_USER: kinvoke (7) r0 0xffffffffffffffff r1 0xffff40400000 r2 0xfffffff= fffffffff r3 0x1</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | vm_call 0x80000001</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 17.340449] SMCCC: SOC_ID: ARCH_SOC_ID not impl= emented, skipping ....</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 17.344029] initcall smccc_soc_init+0x0/0x2ac r= eturned 0 after 33538 usecs</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 17.352198] calling zynqmp_firmware_drive= r_init+0x0/0x34 @ 1</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 17.360828] probe of firmware:zynqmp-firmware r= eturned 0 after 160 usecs</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 17.368210] initcall zynqmp_firmware_driver_ini= t+0x0/0x34 returned 0 after 7382 usecs<br> <br> And later:<br> vm-1 | [ 19.699352] calling deferred_probe_initca= ll+0x0/0xc0 @ 1</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 19.708582] probe of ff0a0000.gpio returned 517= after 55 usecs</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 19.716071] probe of ff0c0000.ethernet returned= -517 after 15 usecs</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 19.723148] zynq-gpio ff0a0000.gpio: deferred p= robe timeout, ignoring dependency</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 19.731093] zynq-gpio: probe of ff0a0000.gpio f= ailed with error -110</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 19.740075] probe of ff0a0000.gpio returned 110= after 16951 usecs</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 19.748483] macb ff0c0000.ethernet: deferred pr= obe timeout, ignoring dependency</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 19.756015] probe of ff0c0000.ethernet returned= -517 after 7540 usecs</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> vm-1 | [ 19.764931] initcall deferred_probe_initcall+0x= 0/0xc0 returned 0 after 55255 usecs<br> <br> </div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> Any ideas appreciated,</div> <div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san= s-serif; font-size: 12pt; color: rgb(0, 0, 0);"> Moshe</div> <div id=3D"appendonsend"></div> <hr style=3D"display:inline-block;width:98%" tabindex=3D"-1"> <div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st= yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> Adam Lackorzynski <= ;[email protected]><br> <b>Sent:</b> Tuesday, April 29, 2025 10:57 AM<br> <b>To:</b> Moshe Kravchik <[email protected]>; [email protected].= tu-dresden.de <[email protected]><br> <b>Subject:</b> Re: Linux fails on startup looking for SMC</font> <div> </div> </div> <div class=3D"BodyFragment"><font size=3D"2"><span style=3D"font-size:11pt;= "> <div class=3D"PlainText">If there is a return that's good as there is someo= ne responding. Are you<br> currently running without ATF? Do you just run L4Re instead of Linux or<br> is there some bigger difference?<br> <br> <br> Adam<br> <br> On Tue Apr 29, 2025 at 05:50:37 +0000, Moshe Kravchik wrote:<br> > 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 s= till return -1.<br> > Should I load ATF or some other code first so that someone will respon= d to these SMC calls?<br> > ________________________________<br> > From: Adam Lackorzynski <[email protected]><br> > Sent: Tuesday, April 29, 2025 12:04 AM<br> > To: Moshe Kravchik <[email protected]>; [email protected]= -dresden.de <[email protected]><br> > Subject: Re: Linux fails on startup looking for SMC<br> > <br> > Hi,<br> > <br> > Could you tune ARM_SMC_USER_MIN/ARM_SMC_USER_MAX in the kernel? Seems<= br> > the SMC functions asked are 0x8200ff03U and 0xC2000xxx and that's not<= br> > covered by the default range, so increasing ARM_SMC_USER_MAX to<br> > 0xcfffffff or so.<br> > <br> > <br> > Adam<br> > <br> > On Mon Apr 28, 2025 at 15:00:04 +0000, Moshe Kravchik wrote:<br> > > Thank you!<br> > > This configuration indeed resulted in the capability present.<br> > > However, I still get the error:<br> > > `zynqmp_firmware firmware:zynqmp-firmware: probe with driver zynq= mp_firmware failed with error -22` and when I add prints I see that the SMC= calls in the Linux kernel return -1.<br> > > Anything else I need to add to the device tree to initialize it o= r something?<br> > > When I boot into Ubuntu without L4 it works.<br> > > Moshe<br> > > ________________________________<br> > > From: Adam Lackorzynski <[email protected]><br> > > Sent: Monday, April 28, 2025 2:53 PM<br> > > To: Moshe Kravchik <[email protected]>; [email protected]= nf.tu-dresden.de <[email protected]><br> > > Subject: Re: Linux fails on startup looking for SMC<br> > ><br> > ><br> > > On Mon Apr 28, 2025 at 05:25:34 +0000, Moshe Kravchik wrote:<br> > > > Thanks a lot, Adam!<br> > > > I added both and rebuilt the device tree, but now I'm gettin= g:<br> > > > ```<br> > > > vm-1 | VMM[smccc_proxy]: smccc_proxy<br> > > > vm-1 | VMM: smccc_proxy.l4vmm,smccc_cap: c= apability smc is invalid.<br> > > > vm-1 | VMM[vm]: Device creation for virtua= l device smccc_proxy failed. Disabling device.<br> > > > ```<br> > ><br> > > This tells that the 'smc' cap is not there in uvmm. Is it there i= n the<br> > > 'caps' table with which uvmm is started? There, where "ram = =3D ..." is<br> > > as well: caps =3D { ram =3D ...., smc =3D L4.Env.arm_smc, }, ....= <br> > > Additionally, in the microkernel, the CONFIG_ARM_SMC_USER option = must<br> > > also be enabled.<br> > ><br> > ><br> > > Adam<br> > ><br> > > > Moshe<br> > > > ________________________________<br> > > > From: Adam Lackorzynski <[email protected]><br> > > > Sent: Monday, April 28, 2025 12:07 AM<br> > > > To: Moshe Kravchik <[email protected]>; l4-hackers= @os.inf.tu-dresden.de <[email protected]><br> > > > Subject: Re: Linux fails on startup looking for SMC<br> > > ><br> > > > Hi Moshe,<br> > > ><br> > > > On Sun Apr 27, 2025 at 15:32:53 +0000, Moshe Kravchik wrote:= <br> > > > > Hi,<br> > > > > I'm trying to set up a Linux running on uvmm with a HW = passthrough.<br> > > > > I added `zynqmp_firmware` to my DTS (it was required fo= r the device I'm trying to pass).<br> > > > > However, Linux fails to add the device and I see:<br> > > > > vm-1 | [ 1.772078] ledtrig-cpu: registered to indicate = activity on CPUs<br> > > > > vm-1 | VMM[guest]: No handler for SMC call: imm=3D0 a0= =3Dc200003f a1=3D3f ip=3Dffff800080026884 lr=3Dffff800080dcdb04<br> > > > > vm-1 | VMM[guest]: No handler for SMC call: imm=3D0 a0= =3Dc2000001 a1=3D0 ip=3Dffff800080026884 lr=3Dffff800080dcdb04<br> > > > > vm-1 | [ 1.805957] zynqmp_firmware firmware:zynqmp-firm= ware: probe with driver zynqmp_firmware failed with error -22<br> > > > ><br> > > > > >From the traces I added, the failure is in `zynqmp_= pm_get_api_version`.<br> > > > ><br> > > > > How do I add SMC handling?<br> > > ><br> > > > You give uvmm in the Ned script: smc =3D L4.Env.arm_smc<br> > > ><br> > > > And put this into you device tree:<br> > > > smccc_proxy {<br> > > > compatible =3D &qu= ot;l4vmm,smccc_proxy";<br> > > > l4vmm,smccc_cap = =3D "smc";<br> > > > method =3D "s= mc";<br> > > > };<br> > > ><br> > > > Note that L4.Env.arm_smc gives access to the real interface = with all the<br> > > > power that is behind it (the kernel only filters its range).= So in a<br> > > > longer run it might be necessary to have proxy for this inte= rface, or<br> > > > emulate the SMCs, or modify Linux to not use it, whatever fi= ts best.<br> > > ><br> > > ><br> > > ><br> > > > Adam<br> > <br> > Adam<br> > --<br> > Adam = [email protected]<br> > Lackorzynski &nbs= p; <a href=3D"http://os.inf.tu-dresden.de/~adam/">http://os.inf.tu-dresden.= de/~adam/</a><br> <br> Adam<br> -- <br> Adam  = ; [email protected]<br> Lackorzynski <a href= =3D"http://os.inf.tu-dresden.de/~adam/">http://os.inf.tu-dresden.de/~adam/<= /a><br> </div> </span></font></div> </body> </html> --_000_DB3PR08MB879633C2D0F57A6B14C6FFE7A565ADB3PR08MB8796eurp_-- --===============6548170143850581111== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ l4-hackers mailing list -- [email protected] To unsubscribe send an email to [email protected] --===============6548170143850581111==--