Re: Linux fails on startup looking for SMC

2025-06-22 Thread Adam Lackorzynski
Hi Moshe,

good the first thing works now.

Tough to say why zynqmp_pm_clock_getstate would be stuck, it looks
really read-only. Which clock_id is it checking at this point?
It could also be that Linux is switching off some clock because it is
not using it. Please also put "clk_ignore_unused" on the Linux kernel
command line.

I would not imagine that an interrupt is involved here, those smc calls
are also synchronous. Also there is no mention of irq or interrupt in
drivers/firmware/xilinx/.



Adam

On Mon Jun 16, 2025 at 06:17:52 +, Moshe Kravchik wrote:
> Hi,
> 
> So I replaced the way SMC is done in smc_user.cpp to the one you proposed and 
> it seems to work now. At least I see the SMC calls that failed earlier 
> succeed now.
> 
> Now I'm stuck at some clock initialization issue, there is an SMC call in 
> zynqmp_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 
> Sent: Monday, June 9, 2025 11:12 PM
> To: Moshe Kravchik ; [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("==\n");
> 
> {
>   register unsigned long r0 asm("r0") = 0x8400;
>   register unsigned long r1 asm("r1") = 0;
>   register unsigned long r2 asm("r2") = 0;
> 
>   asm volatile ("smc #0"
> : "=r"(r0), "=r" (r1), "=r"(r2)
> : "r"(r0), "r" (r1), "r"(r2)
> : "memory", "x8", "x9", "x10", "x11", "x12", "x13", 
> "x14", "x15", "x16", "x17");
> 
>   printf("r0=%lx r1=%lx r2=%lx\n", r0, r1, r2);
> 
>   r0 = 0x1;
>   r1 = 0x8002;
>   r2 = 0x4;
> 
>   asm volatile ("smc #0"
> : "=r"(r0), "=r" (r1), "=r"(r2)
> : "r"(r0), "r" (r1), "r"(r2)
> : "memory", "x8", "x9", "x10", "x11", "x12", "x13", 
> "x14", "x15", "x16", "x17");
> 
>   printf("r0=%lx r1=%lx r2=%lx\n", r0, r1, r2);
>     }
> 
>   while (1);
> 
> The first smc call shall print the PSCI version of the firmware, prints
> r0=10001 r1=0 r2=0
> 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 +, Moshe Kravchik wrote:
> > Hi Adam,
> > Did you have any thoughts?
> >
> > Get Outlook for Android<https://aka.ms/AAb9ysg>
> > 
> > From: Adam Lackorzynski 
> > Sent: Saturday, May 31, 2025 6:37:43 PM
> > To: Moshe Kravchik ; [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 +, Moshe Kravchik wrote:
> > > Sorry for a long delay.
> > > 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 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 kernel 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 
> > > after 0 usecs
> > > vm-

Re: Linux fails on startup looking for SMC

2025-06-15 Thread Moshe Kravchik
Hi,

So I replaced the way SMC is done in smc_user.cpp to the one you proposed and 
it seems to work now. At least I see the SMC calls that failed earlier succeed 
now.

Now I'm stuck at some clock initialization issue, there is an SMC call in 
zynqmp_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 
Sent: Monday, June 9, 2025 11:12 PM
To: Moshe Kravchik ; [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("==\n");

{
  register unsigned long r0 asm("r0") = 0x8400;
  register unsigned long r1 asm("r1") = 0;
  register unsigned long r2 asm("r2") = 0;

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

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

  r0 = 0x1;
  r1 = 0x8002;
  r2 = 0x4;

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

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

  while (1);

The first smc call shall print the PSCI version of the firmware, prints
r0=10001 r1=0 r2=0
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 +, Moshe Kravchik wrote:
> Hi Adam,
> Did you have any thoughts?
>
> Get Outlook for Android<https://aka.ms/AAb9ysg>
> 
> From: Adam Lackorzynski 
> Sent: Saturday, May 31, 2025 6:37:43 PM
> To: Moshe Kravchik ; [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 +, Moshe Kravchik wrote:
> > Sorry for a long delay.
> > 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 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 
> > kernel 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 
> > 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) 0x8001
> > SMC_USER: kinvoke (5)
> > 7SMC_USER: kinvoke (6) r0 0x1 r1 0x8002 r2 0x4 r3 0x152b198
> > mSMC_USER: kinvoke (7) r0 0x r1 0x4040 r2 
> > 0x r3 0x1
> > vm-1| vm_call 0x8001
> > vm-1| [   17.340449] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, 
> > skipping 
> > 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 
> > returned 0 after 7382 usecs
> >
> > And later:
> > vm-1| [   19.699352] calling  deferred_probe_initcall+0x0/0xc0 @ 1

Re: Linux fails on startup looking for SMC

2025-06-11 Thread Moshe Kravchik
Hi,

I added the calls and get:
  Starting kernel fiasco at 1198
==
r0=10001 r1=0 r2=0
r0= r1=8002 r2=4

Moshe

From: Adam Lackorzynski 
Sent: Monday, June 9, 2025 11:12 PM
To: Moshe Kravchik ; [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("==\n");

{
  register unsigned long r0 asm("r0") = 0x8400;
  register unsigned long r1 asm("r1") = 0;
  register unsigned long r2 asm("r2") = 0;

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

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

  r0 = 0x1;
  r1 = 0x8002;
  r2 = 0x4;

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

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

  while (1);

The first smc call shall print the PSCI version of the firmware, prints
r0=10001 r1=0 r2=0
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 +, Moshe Kravchik wrote:
> Hi Adam,
> Did you have any thoughts?
>
> Get Outlook for Android<https://aka.ms/AAb9ysg>
> 
> From: Adam Lackorzynski 
> Sent: Saturday, May 31, 2025 6:37:43 PM
> To: Moshe Kravchik ; [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 +, Moshe Kravchik wrote:
> > Sorry for a long delay.
> > 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 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 
> > kernel 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 
> > 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) 0x8001
> > SMC_USER: kinvoke (5)
> > 7SMC_USER: kinvoke (6) r0 0x1 r1 0x8002 r2 0x4 r3 0x152b198
> > mSMC_USER: kinvoke (7) r0 0x r1 0x4040 r2 
> > 0x r3 0x1
> > vm-1| vm_call 0x8001
> > vm-1| [   17.340449] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, 
> > skipping 
> > 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 
> > returned 0 after 7382 usecs
> >
> > And later:
> > vm-1| [   19.699352] calling  deferred_probe_initcall+0x0/0xc0 @ 1
> > vm-1| [   19.708582] probe of ff0a.gpio returned 517 after 55 usecs
> > vm-1| [   19.716071] probe of ff0c.ethernet returned -517 after 15 
> > usecs
> > vm-1| [   19.723148] zynq-gpio ff0a.gpio: deferred probe timeout, 
> > ignoring dependency
> > vm-1| [   19.731093] zynq-gpi

Re: Linux fails on startup looking for SMC

2025-06-09 Thread Adam Lackorzynski
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("==\n");

{
  register unsigned long r0 asm("r0") = 0x8400;
  register unsigned long r1 asm("r1") = 0;
  register unsigned long r2 asm("r2") = 0;

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

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

  r0 = 0x1;
  r1 = 0x8002;
  r2 = 0x4;

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

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

  while (1);

The first smc call shall print the PSCI version of the firmware, prints
r0=10001 r1=0 r2=0
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 +, Moshe Kravchik wrote:
> Hi Adam,
> Did you have any thoughts?
> 
> Get Outlook for Android<https://aka.ms/AAb9ysg>
> 
> From: Adam Lackorzynski 
> Sent: Saturday, May 31, 2025 6:37:43 PM
> To: Moshe Kravchik ; [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 +, Moshe Kravchik wrote:
> > Sorry for a long delay.
> > 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 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 
> > kernel 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 
> > 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) 0x8001
> > SMC_USER: kinvoke (5)
> > 7SMC_USER: kinvoke (6) r0 0x1 r1 0x8002 r2 0x4 r3 0x152b198
> > mSMC_USER: kinvoke (7) r0 0x r1 0x4040 r2 
> > 0x r3 0x1
> > vm-1| vm_call 0x8001
> > vm-1| [   17.340449] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, 
> > skipping 
> > 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 
> > returned 0 after 7382 usecs
> >
> > And later:
> > vm-1| [   19.699352] calling  deferred_probe_initcall+0x0/0xc0 @ 1
> > vm-1| [   19.708582] probe of ff0a.gpio returned 517 after 55 usecs
> > vm-1| [   19.716071] probe of ff0c.ethernet returned -517 after 15 
> > usecs
> > vm-1| [   19.723148] zynq-gpio ff0a.gpio: deferred probe timeout, 
> > ignoring dependency
> > vm-1| [   19.731093] zynq-gpio: probe of ff0a.gpio failed with 
> > error -110
> > vm-1| [   19.740075] probe of ff0a.gpio returned 110 after 16951 
> > usecs
> > vm-1| [   19.748483] macb ff0c.ethernet: deferred probe timeout, 
> > ignoring dependency
> > vm-1| [   19.756015] probe of ff0c.ethernet returned -517 after 
&

Re: Linux fails on startup looking for SMC

2025-06-05 Thread Moshe Kravchik
Hi Adam,
Did you have any thoughts?

Get Outlook for Android<https://aka.ms/AAb9ysg>

From: Adam Lackorzynski 
Sent: Saturday, May 31, 2025 6:37:43 PM
To: Moshe Kravchik ; [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 +, Moshe Kravchik wrote:
> Sorry for a long delay.
> 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 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 kernel 
> 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 
> 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) 0x8001
> SMC_USER: kinvoke (5)
> 7SMC_USER: kinvoke (6) r0 0x1 r1 0x8002 r2 0x4 r3 0x152b198
> mSMC_USER: kinvoke (7) r0 0x r1 0x4040 r2 
> 0x r3 0x1
> vm-1| vm_call 0x8001
> vm-1| [   17.340449] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping 
> 
> 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 
> returned 0 after 7382 usecs
>
> And later:
> vm-1| [   19.699352] calling  deferred_probe_initcall+0x0/0xc0 @ 1
> vm-1| [   19.708582] probe of ff0a.gpio returned 517 after 55 usecs
> vm-1| [   19.716071] probe of ff0c.ethernet returned -517 after 15 
> usecs
> vm-1| [   19.723148] zynq-gpio ff0a.gpio: deferred probe timeout, 
> ignoring dependency
> vm-1| [   19.731093] zynq-gpio: probe of ff0a.gpio failed with error 
> -110
> vm-1| [   19.740075] probe of ff0a.gpio returned 110 after 16951 usecs
> vm-1| [   19.748483] macb ff0c.ethernet: deferred probe timeout, 
> ignoring dependency
> vm-1| [   19.756015] probe of ff0c.ethernet returned -517 after 7540 
> usecs
> vm-1| [   19.764931] initcall deferred_probe_initcall+0x0/0xc0 returned 0 
> after 55255 usecs
>
> Any ideas appreciated,
> Moshe
> ________________
> From: Adam Lackorzynski 
> Sent: Tuesday, April 29, 2025 10:57 AM
> To: Moshe Kravchik ; [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 +, 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 
> > Sent: Tuesday, April 29, 2025 12:04 AM
> > To: Moshe Kravchik ; [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
> > 0xcfff or so.
> >
> >
> > Adam
> >
> > On Mon Apr 28, 2025 at 15:00:04 +, 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 
> > &g

Re: Linux fails on startup looking for SMC

2025-05-31 Thread Adam Lackorzynski
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 +, Moshe Kravchik wrote:
> Sorry for a long delay.
> 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 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 kernel 
> 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 
> 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) 0x8001
> SMC_USER: kinvoke (5)
> 7SMC_USER: kinvoke (6) r0 0x1 r1 0x8002 r2 0x4 r3 0x152b198
> mSMC_USER: kinvoke (7) r0 0x r1 0x4040 r2 
> 0x r3 0x1
> vm-1| vm_call 0x8001
> vm-1| [   17.340449] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping 
> 
> 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 
> returned 0 after 7382 usecs
> 
> And later:
> vm-1| [   19.699352] calling  deferred_probe_initcall+0x0/0xc0 @ 1
> vm-1| [   19.708582] probe of ff0a.gpio returned 517 after 55 usecs
> vm-1| [   19.716071] probe of ff0c.ethernet returned -517 after 15 
> usecs
> vm-1| [   19.723148] zynq-gpio ff0a.gpio: deferred probe timeout, 
> ignoring dependency
> vm-1| [   19.731093] zynq-gpio: probe of ff0a.gpio failed with error 
> -110
> vm-1| [   19.740075] probe of ff0a.gpio returned 110 after 16951 usecs
> vm-1| [   19.748483] macb ff0c.ethernet: deferred probe timeout, 
> ignoring dependency
> vm-1| [   19.756015] probe of ff0c.ethernet returned -517 after 7540 
> usecs
> vm-1| [   19.764931] initcall deferred_probe_initcall+0x0/0xc0 returned 0 
> after 55255 usecs
> 
> Any ideas appreciated,
> Moshe
> ________________________
> From: Adam Lackorzynski 
> Sent: Tuesday, April 29, 2025 10:57 AM
> To: Moshe Kravchik ; [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 +, 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 
> > Sent: Tuesday, April 29, 2025 12:04 AM
> > To: Moshe Kravchik ; [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
> > 0xcfff or so.
> >
> >
> > Adam
> >
> > On Mon Apr 28, 2025 at 15:00:04 +, 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
> > > 
> >

Re: Linux fails on startup looking for SMC

2025-05-26 Thread Moshe Kravchik
Sorry for a long delay.
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 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 kernel 
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 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) 0x8001
SMC_USER: kinvoke (5)
7SMC_USER: kinvoke (6) r0 0x1 r1 0x8002 r2 0x4 r3 0x152b198
mSMC_USER: kinvoke (7) r0 0x r1 0x4040 r2 
0x r3 0x1
vm-1| vm_call 0x8001
vm-1| [   17.340449] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping 

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 returned 
0 after 7382 usecs

And later:
vm-1| [   19.699352] calling  deferred_probe_initcall+0x0/0xc0 @ 1
vm-1| [   19.708582] probe of ff0a.gpio returned 517 after 55 usecs
vm-1| [   19.716071] probe of ff0c.ethernet returned -517 after 15 usecs
vm-1| [   19.723148] zynq-gpio ff0a.gpio: deferred probe timeout, 
ignoring dependency
vm-1| [   19.731093] zynq-gpio: probe of ff0a.gpio failed with error 
-110
vm-1| [   19.740075] probe of ff0a.gpio returned 110 after 16951 usecs
vm-1| [   19.748483] macb ff0c.ethernet: deferred probe timeout, 
ignoring dependency
vm-1| [   19.756015] probe of ff0c.ethernet returned -517 after 7540 
usecs
vm-1| [   19.764931] initcall deferred_probe_initcall+0x0/0xc0 returned 0 
after 55255 usecs

Any ideas appreciated,
Moshe

From: Adam Lackorzynski 
Sent: Tuesday, April 29, 2025 10:57 AM
To: Moshe Kravchik ; [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 +, 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 
> Sent: Tuesday, April 29, 2025 12:04 AM
> To: Moshe Kravchik ; [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
> 0xcfff or so.
>
>
> Adam
>
> On Mon Apr 28, 2025 at 15:00:04 +, 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 
> > Sent: Monday, April 28, 2025 2:53 PM
> > To: Moshe Kravchik ; [email protected] 
> > 
> > Subject: Re: Linux fails on startup looking for SMC
> >
> >
> > On Mon Apr 28, 2025 at 05:25:34 +, 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' ca

Re: Linux fails on startup looking for SMC

2025-04-29 Thread Adam Lackorzynski
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 +, 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 
> Sent: Tuesday, April 29, 2025 12:04 AM
> To: Moshe Kravchik ; [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
> 0xcfff or so.
> 
> 
> Adam
> 
> On Mon Apr 28, 2025 at 15:00:04 +, 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 
> > Sent: Monday, April 28, 2025 2:53 PM
> > To: Moshe Kravchik ; [email protected] 
> > 
> > Subject: Re: Linux fails on startup looking for SMC
> >
> >
> > On Mon Apr 28, 2025 at 05:25:34 +, 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 
> > > Sent: Monday, April 28, 2025 12:07 AM
> > > To: Moshe Kravchik ; 
> > > [email protected] 
> > > Subject: Re: Linux fails on startup looking for SMC
> > >
> > > Hi Moshe,
> > >
> > > On Sun Apr 27, 2025 at 15:32:53 +, 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=c23f a1=3f 
> > > > ip=800080026884 lr=800080dcdb04
> > > > vm-1 | VMM[guest]: No handler for SMC call: imm=0 a0=c201 a1=0 
> > > > ip=800080026884 lr=800080dcdb04
> > > > 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 [email protected]
>   Lackorzynski http://os.inf.tu-dresden.de/~adam/

Adam
-- 
Adam [email protected]
  Lackorzynski http://os.inf.tu-dresden.de/~adam/
___
l4-hackers mailing list -- [email protected]
To unsubscribe send an email to [email protected]


Re: Linux fails on startup looking for SMC

2025-04-28 Thread Moshe Kravchik
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 
Sent: Tuesday, April 29, 2025 12:04 AM
To: Moshe Kravchik ; [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
0xcfff or so.


Adam

On Mon Apr 28, 2025 at 15:00:04 +, 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 
> Sent: Monday, April 28, 2025 2:53 PM
> To: Moshe Kravchik ; [email protected] 
> 
> Subject: Re: Linux fails on startup looking for SMC
>
>
> On Mon Apr 28, 2025 at 05:25:34 +, 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 
> > Sent: Monday, April 28, 2025 12:07 AM
> > To: Moshe Kravchik ; [email protected] 
> > 
> > Subject: Re: Linux fails on startup looking for SMC
> >
> > Hi Moshe,
> >
> > On Sun Apr 27, 2025 at 15:32:53 +, 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=c23f a1=3f 
> > > ip=800080026884 lr=800080dcdb04
> > > vm-1 | VMM[guest]: No handler for SMC call: imm=0 a0=c201 a1=0 
> > > ip=800080026884 lr=800080dcdb04
> > > 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 [email protected]
  Lackorzynski http://os.inf.tu-dresden.de/~adam/
___
l4-hackers mailing list -- [email protected]
To unsubscribe send an email to [email protected]


Re: Linux fails on startup looking for SMC

2025-04-28 Thread Adam Lackorzynski
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
0xcfff or so.


Adam

On Mon Apr 28, 2025 at 15:00:04 +, 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 
> Sent: Monday, April 28, 2025 2:53 PM
> To: Moshe Kravchik ; [email protected] 
> 
> Subject: Re: Linux fails on startup looking for SMC
> 
> 
> On Mon Apr 28, 2025 at 05:25:34 +, 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 
> > Sent: Monday, April 28, 2025 12:07 AM
> > To: Moshe Kravchik ; [email protected] 
> > 
> > Subject: Re: Linux fails on startup looking for SMC
> >
> > Hi Moshe,
> >
> > On Sun Apr 27, 2025 at 15:32:53 +, 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=c23f a1=3f 
> > > ip=800080026884 lr=800080dcdb04
> > > vm-1 | VMM[guest]: No handler for SMC call: imm=0 a0=c201 a1=0 
> > > ip=800080026884 lr=800080dcdb04
> > > 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 [email protected]
  Lackorzynski http://os.inf.tu-dresden.de/~adam/
___
l4-hackers mailing list -- [email protected]
To unsubscribe send an email to [email protected]


Re: Linux fails on startup looking for SMC

2025-04-28 Thread Moshe Kravchik
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 
Sent: Monday, April 28, 2025 2:53 PM
To: Moshe Kravchik ; [email protected] 

Subject: Re: Linux fails on startup looking for SMC


On Mon Apr 28, 2025 at 05:25:34 +, 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 
> Sent: Monday, April 28, 2025 12:07 AM
> To: Moshe Kravchik ; [email protected] 
> 
> Subject: Re: Linux fails on startup looking for SMC
>
> Hi Moshe,
>
> On Sun Apr 27, 2025 at 15:32:53 +, 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=c23f a1=3f 
> > ip=800080026884 lr=800080dcdb04
> > vm-1 | VMM[guest]: No handler for SMC call: imm=0 a0=c201 a1=0 
> > ip=800080026884 lr=800080dcdb04
> > 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
___
l4-hackers mailing list -- [email protected]
To unsubscribe send an email to [email protected]


Re: Linux fails on startup looking for SMC

2025-04-28 Thread Adam Lackorzynski


On Mon Apr 28, 2025 at 05:25:34 +, 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 
> Sent: Monday, April 28, 2025 12:07 AM
> To: Moshe Kravchik ; [email protected] 
> 
> Subject: Re: Linux fails on startup looking for SMC
> 
> Hi Moshe,
> 
> On Sun Apr 27, 2025 at 15:32:53 +, 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=c23f a1=3f 
> > ip=800080026884 lr=800080dcdb04
> > vm-1 | VMM[guest]: No handler for SMC call: imm=0 a0=c201 a1=0 
> > ip=800080026884 lr=800080dcdb04
> > 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
___
l4-hackers mailing list -- [email protected]
To unsubscribe send an email to [email protected]


Re: Linux fails on startup looking for SMC

2025-04-27 Thread Moshe Kravchik
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.
```
Moshe

From: Adam Lackorzynski 
Sent: Monday, April 28, 2025 12:07 AM
To: Moshe Kravchik ; [email protected] 

Subject: Re: Linux fails on startup looking for SMC

Hi Moshe,

On Sun Apr 27, 2025 at 15:32:53 +, 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=c23f a1=3f 
> ip=800080026884 lr=800080dcdb04
> vm-1 | VMM[guest]: No handler for SMC call: imm=0 a0=c201 a1=0 
> ip=800080026884 lr=800080dcdb04
> 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
___
l4-hackers mailing list -- [email protected]
To unsubscribe send an email to [email protected]


Re: Linux fails on startup looking for SMC

2025-04-27 Thread Adam Lackorzynski
Hi Moshe,

On Sun Apr 27, 2025 at 15:32:53 +, 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=c23f a1=3f 
> ip=800080026884 lr=800080dcdb04
> vm-1 | VMM[guest]: No handler for SMC call: imm=0 a0=c201 a1=0 
> ip=800080026884 lr=800080dcdb04
> 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
___
l4-hackers mailing list -- [email protected]
To unsubscribe send an email to [email protected]