Re: Linux fails on startup looking for SMC

Moshe Kravchik <[email protected]> Mon, 16 Jun 2025 06:17:52 +0000
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <DB7PR08MB32920449FBD3E3E4EF86B988A570A@DB7PR08MB3292.eurprd08.prod.outlook.com>
--===============2548389331884827932==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DB7PR08MB32920449FBD3E3E4EF86B988A570ADB7PR08MB3292eurp_"

--_000_DB7PR08MB32920449FBD3E3E4EF86B988A570ADB7PR08MB3292eurp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,

So I replaced the way SMC is done in smc_user.cpp to the one you proposed a=
nd it seems to work now. At least I see the SMC calls that failed earlier s=
ucceed now.

Now I'm stuck at some clock initialization issue, there is an SMC call in z=
ynqmp_pm_clock_getstate in the kernel which never returns.
I see that in a bare-metal setup there are some dealyes in that area of the=
 kernel code execution.
Can it be related to some special IRQ I need to map into the VM?
How can I troubleshoot this?
Moshe
________________________________
From: Adam Lackorzynski <[email protected]>
Sent: Monday, June 9, 2025 11:12 PM
To: Moshe Kravchik <[email protected]>; [email protected]=
 <[email protected]>
Subject: Re: Linux fails on startup looking for SMC

Hi Moshe,

Could you place the following code block in
l4/pkg/bootstrap/server/src/startup.cc just after the printfs printing
"Starting kernel":

  printf("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D\n");

    {
      register unsigned long r0 asm("r0") =3D 0x84000000;
      register unsigned long r1 asm("r1") =3D 0;
      register unsigned long r2 asm("r2") =3D 0;

      asm volatile ("smc #0"
                    : "=3Dr"(r0), "=3Dr" (r1), "=3Dr"(r2)
                    : "r"(r0), "r" (r1), "r"(r2)
                    : "memory", "x8", "x9", "x10", "x11", "x12", "x13", "x1=
4", "x15", "x16", "x17");

      printf("r0=3D%lx r1=3D%lx r2=3D%lx\n", r0, r1, r2);

      r0 =3D 0x1;
      r1 =3D 0x80000002;
      r2 =3D 0x4;

      asm volatile ("smc #0"
                    : "=3Dr"(r0), "=3Dr" (r1), "=3Dr"(r2)
                    : "r"(r0), "r" (r1), "r"(r2)
                    : "memory", "x8", "x9", "x10", "x11", "x12", "x13", "x1=
4", "x15", "x16", "x17");

      printf("r0=3D%lx r1=3D%lx r2=3D%lx\n", r0, r1, r2);
    }

  while (1);

The first smc call shall print the PSCI version of the firmware, prints
r0=3D10001 r1=3D0 r2=3D0
for me (QEMU).
The second part are the values from your debugging, do they print the
same?


Adam



On Thu Jun 05, 2025 at 08:47:44 +0000, Moshe Kravchik wrote:
> Hi Adam,
> Did you have any thoughts?
>
> Get Outlook for Android<https://aka.ms/AAb9ysg>
> ________________________________
> From: Adam Lackorzynski <[email protected]>
> Sent: Saturday, May 31, 2025 6:37:43 PM
> To: Moshe Kravchik <[email protected]>; [email protected].=
de <[email protected]>
> Subject: Re: Linux fails on startup looking for SMC
>
> Hi Moshe,
>
> I was thinking a bit about this and cannot think of a reason. I'd now
> try to issue those calls in bootstrap, just to check whether they work
> from a "bare-metal" environment. And then work from there.
>
>
> Adam
>
> On Mon May 26, 2025 at 08:49:01 +0000, Moshe Kravchik wrote:
> > Sorry for a long delay.
> > On this board, there is a Uboot which can load and run Ubuntu. I replac=
ed Ubuntu 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 lo=
aded before Uboot and therefore before L4 is loaded. I switched to using a =
kernel from the working Ubuntu image, but SMC calls still return -1 and I c=
an'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 after 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 0xfff=
fffffffffffff r3 0x1
> > vm-1    | vm_call 0x80000001
> > vm-1    | [   17.340449] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, sk=
ipping ....
> > vm-1    | [   17.344029] initcall smccc_soc_init+0x0/0x2ac returned 0 a=
fter 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 a=
fter 160 usecs
> > vm-1    | [   17.368210] initcall zynqmp_firmware_driver_init+0x0/0x34 =
returned 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 u=
secs
> > vm-1    | [   19.716071] probe of ff0c0000.ethernet returned -517 after=
 15 usecs
> > vm-1    | [   19.723148] zynq-gpio ff0a0000.gpio: deferred probe timeou=
t, ignoring dependency
> > vm-1    | [   19.731093] zynq-gpio: probe of ff0a0000.gpio failed with =
error -110
> > vm-1    | [   19.740075] probe of ff0a0000.gpio returned 110 after 1695=
1 usecs
> > vm-1    | [   19.748483] macb ff0c0000.ethernet: deferred probe timeout=
, ignoring dependency
> > vm-1    | [   19.756015] probe of ff0c0000.ethernet returned -517 after=
 7540 usecs
> > vm-1    | [   19.764931] initcall deferred_probe_initcall+0x0/0xc0 retu=
rned 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]=
n.de <[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 yo=
u
> > 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 respo=
nd to these SMC calls?
> > > ________________________________
> > > From: Adam Lackorzynski <[email protected]>
> > > Sent: Tuesday, April 29, 2025 12:04 AM
> > > To: Moshe Kravchik <[email protected]>; [email protected]=
den.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=
_firmware failed with error -22` and when I add prints I see that the SMC c=
alls 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 <[email protected]>
> > > > Sent: Monday, April 28, 2025 2:53 PM
> > > > To: Moshe Kravchik <[email protected]>; [email protected]=
esden.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 inv=
alid.
> > > > > 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 =3D ..."=
 is
> > > > as well: caps =3D { ram =3D ...., smc =3D L4.Env.arm_smc, }, ....
> > > > Additionally, in the microkernel, the CONFIG_ARM_SMC_USER option mu=
st
> > > > 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]=
dresden.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 passthro=
ugh.
> > > > > > I added `zynqmp_firmware` to my DTS (it was required for the de=
vice 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=3Dc20000=
3f a1=3D3f ip=3Dffff800080026884 lr=3Dffff800080dcdb04
> > > > > > vm-1 | VMM[guest]: No handler for SMC call: imm=3D0 a0=3Dc20000=
01 a1=3D0 ip=3Dffff800080026884 lr=3Dffff800080dcdb04
> > > > > > vm-1 | [ 1.805957] zynqmp_firmware firmware:zynqmp-firmware: pr=
obe 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 =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 i=
n 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 be=
st.
> > > > >

--_000_DB7PR08MB32920449FBD3E3E4EF86B988A570ADB7PR08MB3292eurp_
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);">
Hi,</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
So I replaced the way SMC is done in smc_user.cpp to the one you proposed a=
nd it seems to work now. At least I see the SMC calls that failed earlier s=
ucceed now.</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Now I'm stuck at some clock initialization issue, there is an SMC call in z=
ynqmp_pm_clock_getstate in the kernel which never returns.</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I see that in a bare-metal setup there are some dealyes in that area of the=
 kernel code execution.</div>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Can it be related to some special IRQ I need to map into the VM?&nbsp;</div=
>
<div class=3D"elementToProof" style=3D"font-family: Calibri, Helvetica, san=
s-serif; font-size: 12pt; color: rgb(0, 0, 0);">
How can I troubleshoot this?</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 &lt=
;[email protected]&gt;<br>
<b>Sent:</b> Monday, June 9, 2025 11:12 PM<br>
<b>To:</b> Moshe Kravchik &lt;[email protected]&gt;; [email protected].=
tu-dresden.de &lt;[email protected]&gt;<br>
<b>Subject:</b> Re: Linux fails on startup looking for SMC</font>
<div>&nbsp;</div>
</div>
<div class=3D"BodyFragment"><font size=3D"2"><span style=3D"font-size:11pt;=
">
<div class=3D"PlainText">Hi Moshe,<br>
<br>
Could you place the following code block in<br>
l4/pkg/bootstrap/server/src/startup.cc just after the printfs printing<br>
&quot;Starting kernel&quot;:<br>
<br>
&nbsp; printf(&quot;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D\n&quot;);<br>
<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; register unsigned long r0 asm(&quot;r0&quot;=
) =3D 0x84000000;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; register unsigned long r1 asm(&quot;r1&quot;=
) =3D 0;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; register unsigned long r2 asm(&quot;r2&quot;=
) =3D 0;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; asm volatile (&quot;smc #0&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : &quot;=3Dr&quot;(r0), &quot;=3Dr&=
quot; (r1), &quot;=3Dr&quot;(r2)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : &quot;r&quot;(r0), &quot;r&quot; =
(r1), &quot;r&quot;(r2)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : &quot;memory&quot;, &quot;x8&quot=
;, &quot;x9&quot;, &quot;x10&quot;, &quot;x11&quot;, &quot;x12&quot;, &quot=
;x13&quot;, &quot;x14&quot;, &quot;x15&quot;, &quot;x16&quot;, &quot;x17&qu=
ot;);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;r0=3D%lx r1=3D%lx r2=3D%lx\n&qu=
ot;, r0, r1, r2);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r0 =3D 0x1;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r1 =3D 0x80000002;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r2 =3D 0x4;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; asm volatile (&quot;smc #0&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : &quot;=3Dr&quot;(r0), &quot;=3Dr&=
quot; (r1), &quot;=3Dr&quot;(r2)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : &quot;r&quot;(r0), &quot;r&quot; =
(r1), &quot;r&quot;(r2)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : &quot;memory&quot;, &quot;x8&quot=
;, &quot;x9&quot;, &quot;x10&quot;, &quot;x11&quot;, &quot;x12&quot;, &quot=
;x13&quot;, &quot;x14&quot;, &quot;x15&quot;, &quot;x16&quot;, &quot;x17&qu=
ot;);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;r0=3D%lx r1=3D%lx r2=3D%lx\n&qu=
ot;, r0, r1, r2);<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp; while (1);<br>
<br>
The first smc call shall print the PSCI version of the firmware, prints<br>
r0=3D10001 r1=3D0 r2=3D0<br>
for me (QEMU).<br>
The second part are the values from your debugging, do they print the<br>
same?<br>
<br>
<br>
Adam<br>
<br>
<br>
<br>
On Thu Jun 05, 2025 at 08:47:44 +0000, Moshe Kravchik wrote:<br>
&gt; Hi Adam,<br>
&gt; Did you have any thoughts?<br>
&gt; <br>
&gt; Get Outlook for Android&lt;<a href=3D"https://aka.ms/AAb9ysg">https://=
aka.ms/AAb9ysg</a>&gt;<br>
&gt; ________________________________<br>
&gt; From: Adam Lackorzynski &lt;[email protected]&gt;<br>
&gt; Sent: Saturday, May 31, 2025 6:37:43 PM<br>
&gt; To: Moshe Kravchik &lt;[email protected]&gt;; [email protected]=
-dresden.de &lt;[email protected]&gt;<br>
&gt; Subject: Re: Linux fails on startup looking for SMC<br>
&gt; <br>
&gt; Hi Moshe,<br>
&gt; <br>
&gt; I was thinking a bit about this and cannot think of a reason. I'd now<=
br>
&gt; try to issue those calls in bootstrap, just to check whether they work=
<br>
&gt; from a &quot;bare-metal&quot; environment. And then work from there.<b=
r>
&gt; <br>
&gt; <br>
&gt; Adam<br>
&gt; <br>
&gt; On Mon May 26, 2025 at 08:49:01 +0000, Moshe Kravchik wrote:<br>
&gt; &gt; Sorry for a long delay.<br>
&gt; &gt; On this board, there is a Uboot which can load and run Ubuntu. I =
replaced Ubuntu with L4, which starts a Linux VM that I want to pass the Et=
hernet to as a passthrough device.<br>
&gt; &gt;<br>
&gt; &gt; 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 us=
ing a kernel from the working Ubuntu image, but SMC calls still return -1 a=
nd I can't init the ethernet driver inside
 the VM.<br>
&gt; &gt; I added prints into the fiasco part and see:<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 17.285888] calling&nbsp; s=
mccc_devices_init+0x0/0xa4 @ 1<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 17.294574] initcall smccc_=
devices_init+0x0/0xa4 returned 0 after 0 usecs<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 17.301414] calling&nbsp; s=
mccc_soc_init+0x0/0x2ac @ 1<br>
&gt; &gt; SMC_USER: kinvoke (1)<br>
&gt; &gt; MC_USER: kinvoke (2)<br>
&gt; &gt; [SMC_USER: kinvoke (3)<br>
&gt; &gt; 3SMC_USER: kinvoke (4) 0x80000001<br>
&gt; &gt; SMC_USER: kinvoke (5)<br>
&gt; &gt; 7SMC_USER: kinvoke (6) r0 0x1 r1 0x80000002 r2 0x4 r3 0x152b198<b=
r>
&gt; &gt; mSMC_USER: kinvoke (7) r0 0xffffffffffffffff r1 0xffff40400000 r2=
 0xffffffffffffffff r3 0x1<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | vm_call 0x80000001<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 17.340449] SMCCC: SOC_ID: =
ARCH_SOC_ID not implemented, skipping ....<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 17.344029] initcall smccc_=
soc_init+0x0/0x2ac returned 0 after 33538 usecs<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 17.352198] calling&nbsp; z=
ynqmp_firmware_driver_init+0x0/0x34 @ 1<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 17.360828] probe of firmwa=
re:zynqmp-firmware returned 0 after 160 usecs<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 17.368210] initcall zynqmp=
_firmware_driver_init+0x0/0x34 returned 0 after 7382 usecs<br>
&gt; &gt;<br>
&gt; &gt; And later:<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 19.699352] calling&nbsp; d=
eferred_probe_initcall+0x0/0xc0 @ 1<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 19.708582] probe of ff0a00=
00.gpio returned 517 after 55 usecs<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 19.716071] probe of ff0c00=
00.ethernet returned -517 after 15 usecs<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 19.723148] zynq-gpio ff0a0=
000.gpio: deferred probe timeout, ignoring dependency<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 19.731093] zynq-gpio: prob=
e of ff0a0000.gpio failed with error -110<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 19.740075] probe of ff0a00=
00.gpio returned 110 after 16951 usecs<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 19.748483] macb ff0c0000.e=
thernet: deferred probe timeout, ignoring dependency<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 19.756015] probe of ff0c00=
00.ethernet returned -517 after 7540 usecs<br>
&gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | [&nbsp;&nbsp; 19.764931] initcall deferr=
ed_probe_initcall+0x0/0xc0 returned 0 after 55255 usecs<br>
&gt; &gt;<br>
&gt; &gt; Any ideas appreciated,<br>
&gt; &gt; Moshe<br>
&gt; &gt; ________________________________<br>
&gt; &gt; From: Adam Lackorzynski &lt;[email protected]&gt;<br>
&gt; &gt; Sent: Tuesday, April 29, 2025 10:57 AM<br>
&gt; &gt; To: Moshe Kravchik &lt;[email protected]&gt;; [email protected]=
nf.tu-dresden.de &lt;[email protected]&gt;<br>
&gt; &gt; Subject: Re: Linux fails on startup looking for SMC<br>
&gt; &gt;<br>
&gt; &gt; If there is a return that's good as there is someone responding. =
Are you<br>
&gt; &gt; currently running without ATF? Do you just run L4Re instead of Li=
nux or<br>
&gt; &gt; is there some bigger difference?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Adam<br>
&gt; &gt;<br>
&gt; &gt; On Tue Apr 29, 2025 at 05:50:37 +0000, Moshe Kravchik wrote:<br>
&gt; &gt; &gt; OK, that's great, I just commented out the range check in `f=
iasco/src/kern/arm/smc_user.cpp`, but even though I see the calls get throu=
gh, they still return -1.<br>
&gt; &gt; &gt; Should I load ATF or some other code first so that someone w=
ill respond to these SMC calls?<br>
&gt; &gt; &gt; ________________________________<br>
&gt; &gt; &gt; From: Adam Lackorzynski &lt;[email protected]&gt;<br>
&gt; &gt; &gt; Sent: Tuesday, April 29, 2025 12:04 AM<br>
&gt; &gt; &gt; To: Moshe Kravchik &lt;[email protected]&gt;; l4-hackers=
@os.inf.tu-dresden.de &lt;[email protected]&gt;<br>
&gt; &gt; &gt; Subject: Re: Linux fails on startup looking for SMC<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Hi,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Could you tune ARM_SMC_USER_MIN/ARM_SMC_USER_MAX in the kern=
el? Seems<br>
&gt; &gt; &gt; the SMC functions asked are 0x8200ff03U and 0xC2000xxx and t=
hat's not<br>
&gt; &gt; &gt; covered by the default range, so increasing ARM_SMC_USER_MAX=
 to<br>
&gt; &gt; &gt; 0xcfffffff or so.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Adam<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Mon Apr 28, 2025 at 15:00:04 +0000, Moshe Kravchik wrote:=
<br>
&gt; &gt; &gt; &gt; Thank you!<br>
&gt; &gt; &gt; &gt; This configuration indeed resulted in the capability pr=
esent.<br>
&gt; &gt; &gt; &gt; However, I still get the error:<br>
&gt; &gt; &gt; &gt; `zynqmp_firmware firmware:zynqmp-firmware: probe with d=
river zynqmp_firmware failed with error -22` and when I add prints I see th=
at the SMC calls in the Linux kernel return -1.<br>
&gt; &gt; &gt; &gt; Anything else I need to add to the device tree to initi=
alize it or something?<br>
&gt; &gt; &gt; &gt; When I boot into Ubuntu without L4 it works.<br>
&gt; &gt; &gt; &gt; Moshe<br>
&gt; &gt; &gt; &gt; ________________________________<br>
&gt; &gt; &gt; &gt; From: Adam Lackorzynski &lt;[email protected]&gt;<br>
&gt; &gt; &gt; &gt; Sent: Monday, April 28, 2025 2:53 PM<br>
&gt; &gt; &gt; &gt; To: Moshe Kravchik &lt;[email protected]&gt;; l4-ha=
[email protected] &lt;[email protected]&gt;<br>
&gt; &gt; &gt; &gt; Subject: Re: Linux fails on startup looking for SMC<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On Mon Apr 28, 2025 at 05:25:34 +0000, Moshe Kravchik w=
rote:<br>
&gt; &gt; &gt; &gt; &gt; Thanks a lot, Adam!<br>
&gt; &gt; &gt; &gt; &gt; I added both and rebuilt the device tree, but now =
I'm getting:<br>
&gt; &gt; &gt; &gt; &gt; ```<br>
&gt; &gt; &gt; &gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | VMM[smccc_proxy]: smccc_p=
roxy<br>
&gt; &gt; &gt; &gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | VMM: smccc_proxy.l4vmm,sm=
ccc_cap: capability smc is invalid.<br>
&gt; &gt; &gt; &gt; &gt; vm-1&nbsp;&nbsp;&nbsp; | VMM[vm]: Device creation =
for virtual device smccc_proxy failed. Disabling device.<br>
&gt; &gt; &gt; &gt; &gt; ```<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; This tells that the 'smc' cap is not there in uvmm. Is =
it there in the<br>
&gt; &gt; &gt; &gt; 'caps' table with which uvmm is started? There, where &=
quot;ram =3D ...&quot; is<br>
&gt; &gt; &gt; &gt; as well: caps =3D { ram =3D ...., smc =3D L4.Env.arm_sm=
c, }, ....<br>
&gt; &gt; &gt; &gt; Additionally, in the microkernel, the CONFIG_ARM_SMC_US=
ER option must<br>
&gt; &gt; &gt; &gt; also be enabled.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Adam<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Moshe<br>
&gt; &gt; &gt; &gt; &gt; ________________________________<br>
&gt; &gt; &gt; &gt; &gt; From: Adam Lackorzynski &lt;[email protected]&gt;<br>
&gt; &gt; &gt; &gt; &gt; Sent: Monday, April 28, 2025 12:07 AM<br>
&gt; &gt; &gt; &gt; &gt; To: Moshe Kravchik &lt;[email protected]&gt;; =
[email protected] &lt;[email protected]&gt;<br>
&gt; &gt; &gt; &gt; &gt; Subject: Re: Linux fails on startup looking for SM=
C<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Hi Moshe,<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; On Sun Apr 27, 2025 at 15:32:53 +0000, Moshe Kravc=
hik wrote:<br>
&gt; &gt; &gt; &gt; &gt; &gt; Hi,<br>
&gt; &gt; &gt; &gt; &gt; &gt; I'm trying to set up a Linux running on uvmm =
with a HW passthrough.<br>
&gt; &gt; &gt; &gt; &gt; &gt; I added `zynqmp_firmware` to my DTS (it was r=
equired for the device I'm trying to pass).<br>
&gt; &gt; &gt; &gt; &gt; &gt; However, Linux fails to add the device and I =
see:<br>
&gt; &gt; &gt; &gt; &gt; &gt; vm-1 | [ 1.772078] ledtrig-cpu: registered to=
 indicate activity on CPUs<br>
&gt; &gt; &gt; &gt; &gt; &gt; vm-1 | VMM[guest]: No handler for SMC call: i=
mm=3D0 a0=3Dc200003f a1=3D3f ip=3Dffff800080026884 lr=3Dffff800080dcdb04<br=
>
&gt; &gt; &gt; &gt; &gt; &gt; vm-1 | VMM[guest]: No handler for SMC call: i=
mm=3D0 a0=3Dc2000001 a1=3D0 ip=3Dffff800080026884 lr=3Dffff800080dcdb04<br>
&gt; &gt; &gt; &gt; &gt; &gt; vm-1 | [ 1.805957] zynqmp_firmware firmware:z=
ynqmp-firmware: probe with driver zynqmp_firmware failed with error -22<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;From the traces I added, the failure is i=
n `zynqmp_pm_get_api_version`.<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; How do I add SMC handling?<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; You give uvmm in the Ned script: smc =3D L4.Env.ar=
m_smc<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; And put this into you device tree:<br>
&gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp; smccc_proxy {<br>
&gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; compatib=
le =3D &quot;l4vmm,smccc_proxy&quot;;<br>
&gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l4vmm,sm=
ccc_cap =3D &quot;smc&quot;;<br>
&gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; method =
=3D &quot;smc&quot;;<br>
&gt; &gt; &gt; &gt; &gt;&nbsp;&nbsp;&nbsp; };<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Note that L4.Env.arm_smc gives access to the real =
interface with all the<br>
&gt; &gt; &gt; &gt; &gt; power that is behind it (the kernel only filters i=
ts range). So in a<br>
&gt; &gt; &gt; &gt; &gt; longer run it might be necessary to have proxy for=
 this interface, or<br>
&gt; &gt; &gt; &gt; &gt; emulate the SMCs, or modify Linux to not use it, w=
hatever fits best.<br>
&gt; &gt; &gt; &gt; &gt;<br>
</div>
</span></font></div>
</body>
</html>

--_000_DB7PR08MB32920449FBD3E3E4EF86B988A570ADB7PR08MB3292eurp_--

--===============2548389331884827932==
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]

--===============2548389331884827932==--