ChanServ changed the topic of #armlinux to: ARM kernel talk [Upstream kernel, find your vendor forums for questions about their kernels] | https://libera.irclog.whitequark.org/armlinux
<apritzel> SikkiLadho: if you use TF-A, only the primary CPU should enter your HV, so your MPIDR gate should not be necessary
<apritzel> and your kernel would probably do smc calls to bring up secondaries (what we patch into the DT in TF-A)
torez has quit [Quit: torez]
<apritzel> which means they will start in EL2(!), but at kernel provided code
<apritzel> I think the kernel will be irritated, and puts them away
<apritzel> to solve this, you would need to trap smc in your HV, and do the right thing (TM)
djrscally has quit [Ping timeout: 250 seconds]
<apritzel> (what that is depends on what you want to achieve with your HV)
<sikkiladho> for now, I just want to print Hello World to UART with the hypervisor and run the standard kernel soon after.
<apritzel> then it shouldn't matter, for now, and maxcpus=1 should tell the kernel to ignore secondaries
<sikkiladho> so 1) I should remove the MPIDR gate because with TF-A secondary processors won't enter the code.
<sikkiladho> It has been days, I just want to see the standard kernel after hello world for now. :)
<sikkiladho> XD
<sikkiladho> I will work on other hypervisor functionalities later but it won't happen when it is just stuck at hello world.
<apritzel> well, a hypervisor is not exactly the easiest way to beginning with bare metal / kernel programming ;-)
<sikkiladho> It's morning here, I will sleep now and see later, what to do with this. Thank you for patiently helping me apritzel.
<apritzel> SikkiLadho: yw, have a good rest!
sikkiladho has quit [Quit: Connection closed]
rbutler1728 has quit [Read error: Connection reset by peer]
Nact has joined #armlinux
Turingtoast has quit [Ping timeout: 256 seconds]
Turingtoast has joined #armlinux
apritzel has quit [Ping timeout: 264 seconds]
luispm has quit [Ping timeout: 246 seconds]
luispm has joined #armlinux
<amstan> sigh, https://www.youtube.com/watch?v=WtJ9T_IJOPE made me very sad
ravan_ has joined #armlinux
ravan has quit [Ping timeout: 246 seconds]
ravan_ is now known as ravan
ravan has quit [Remote host closed the connection]
apritzel has joined #armlinux
iivanov has joined #armlinux
guillaume_g has joined #armlinux
iivanov has quit [Quit: Leaving...]
iivanov has joined #armlinux
dliviu has quit [Ping timeout: 260 seconds]
dliviu has joined #armlinux
apritzel has quit [Ping timeout: 256 seconds]
sszy has joined #armlinux
matthias_bgg has joined #armlinux
Amit_T has joined #armlinux
sudeepholla has quit [Ping timeout: 240 seconds]
sudeepholla has joined #armlinux
djrscally has joined #armlinux
Pali has joined #armlinux
tre has joined #armlinux
Pali has quit [Ping timeout: 268 seconds]
System_Error has joined #armlinux
jbru1 is now known as jbru
tudorel has joined #armlinux
apritzel has joined #armlinux
nsaenz has joined #armlinux
Nact has quit [Read error: Connection reset by peer]
macromorgan has quit [Read error: Connection reset by peer]
tudorel has quit [Quit: tudorel]
Amit_T has quit [Remote host closed the connection]
kristo has quit [Remote host closed the connection]
josem has joined #armlinux
josem has left #armlinux [#armlinux]
<mwalle_> https://pastebin.com/raw/PVEk1hDb << with the latest next i get this kernel oops on reboot, actually i just noticed its already present in v5.15
<mwalle_> i don't even know how mutex_unlock() can end up in queued_spin_lock_slowpath() but I doubt that one is broken. so its likely something wrong with spi or fsl_dspi
<ukleinek> mwalle_: calling remove from shutdown (as done in dspi_shutdown()) calls for trouble
<ukleinek> it's at least racy, consider you shut down while the device is about to be removed and in the middle of running through dspi_remove()
<ukleinek> (not entirely sure this is prevented by the driver core)
<ukleinek> See also 0650bf52b31f for a similar issue description
nsaenz has quit [Read error: Connection reset by peer]
nsaenz_ has joined #armlinux
apritzel has quit [Remote host closed the connection]
apritzel_ has joined #armlinux
Turingtoast has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jlinton has quit [Quit: Client closed]
bps has quit [Ping timeout: 240 seconds]
apritzel has joined #armlinux
<mwalle_> ukleinek: ok, but then I should see that dspi_remove is called twice, no?
<ukleinek> mwalle_: might be
<ukleinek> mwalle_: maybe it's also a generic problem that also happens when you unbind the device via sysfs?!
torez has joined #armlinux
<ukleinek> mwalle_: this is arm64 without CONFIG_DEBUG_LOCK_ALLOC?
<mwalle_> ukleinek: ahh, indeed, echo 2120000.spi > /sys/bus/platform/drivers/fsl-dspi/unbind triggers the same
prabhakarlad has quit [Quit: Client closed]
<mwalle_> ukleinek: correct
<ukleinek> broonie: ^
prabhakarlad has joined #armlinux
<ukleinek> curl -s https://pastebin.com/raw/PVEk1hDb | CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 scripts/decodecode
<ukleinek> but this is strange, as 0x504322202c293830 + 0x504322202c293830 = 0x5042a2203dc65260, so the upper nibble doesn't seem to be used?!
<ukleinek> something to do with pointer auth?
<mwalle_> FWIW, this is my config http://sprunge.us/7DlpFI
<mwalle_> ukleinek: can't follow you, that pointer seems like some garbage, no?
<ukleinek> mwalle_: that, too, yes
<ukleinek> mwalle_: can you check which of the various mutex_lock in spi_unregister_controller() this is?
<mwalle_> ukleinek: btw, this should be the pointer with the garbage: https://elixir.bootlin.com/linux/v5.15.1/source/kernel/locking/qspinlock.c#L471 but as i said, i don't think that is the culprit here
<mwalle_> ukleinek: oh its the last one, mom
<ukleinek> spi_unregister_controller+0xf0/0x170 doesn't look like the last?!
Amit_T has joined #armlinux
sikkiladho has joined #armlinux
<ukleinek> mwalle_: can you try reverting 16a8e2fbb2d49111004efc1c7342e083eafabeb0 and 6098475d4cb48d821bdf453c61118c56e26294f0
<ukleinek> mwalle_: if this fixes the problem I don't understand why, but these recent commits touch that area.
<mwalle_> ukleinek: both at once, or one after another?
sikkiladho has quit [Client Quit]
<ukleinek> mwalle_: up to you
apritzel has quit [Ping timeout: 240 seconds]
sikkiladho has joined #armlinux
<ukleinek> mwalle_: if one of these is the culprit, please report by mail. If not I have no better idea than to bisect.
<ukleinek> mwalle_: ah, before bisecting, comment out the line "put_device(&ctlr->dev);"
<ukleinek> mwalle_: at least the spi-fsl-dspi driver doesn't use devm (so the put_device is executed) and this is a possible location that destroys the lock.
<ukleinek> mwalle_: also consider enabling CONFIG_LOCKDEP
<ukleinek> and CONFIG_DEBUG_OBJECTS_FREE
<mwalle_> ukleinek: btw i've tried to use the devm_ version (and removed the spi_unregister_ctlr()) but the oops persits
* ukleinek assumes mwalle_ is clever enough to not just add // to the line with put_device
<mwalle_> ukleinek: i don't think bisect is necessary
cmarinas_ has joined #armlinux
cmarinas_ has quit [Client Quit]
cmarinas_ has joined #armlinux
cmarinas has quit [Ping timeout: 268 seconds]
<mwalle_> ukleinek: could you have a quick look at http://sprunge.us/MZFTJk ? the revert didn't apply cleanly, so thats what I've come up with. Then I'd raise that on the ML
<mwalle_> ukleinek: if it's not clear, after that, the oops is gone
cmarinas_ has quit [Client Quit]
<mwalle_> ukleinek: so yes, it seems ctrl->add_lock is either corrupted or gone in my case
cmarinas has joined #armlinux
<javierm>
cmarinas has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
cmarinas has joined #armlinux
bps has joined #armlinux
bps has joined #armlinux
bps has quit [Changing host]
sikkiladho has quit [Ping timeout: 240 seconds]
<ukleinek> javierm: speechless?
<ukleinek> mwalle_: data point: On an i.MX25 running 5.15 echo 43fa4000.spi > /sys/bus/platform/drivers/spi_imx/unbind doesn't trigger that problem
<ukleinek> mwalle_: can you add at the start of spi_unregister_controller: get_device(&ctlr->dev);
<ukleinek> mwalle_: maybe even twice to be sure
tre has quit [Remote host closed the connection]
<javierm> ukleinek: hehe. sorry, I pressed it by mistake
<ukleinek> mwalle_: I'm afk for a while now, but look forward to your findings.
macromorgan has joined #armlinux
<mwalle_> ukleinek: well yeah, that get_device() will make the error go away. the "if (devm_allocated) put_device()" will eventually call spi_controller_release(), which then frees the controller and the mutex at the end of the spi_unregister_contoller() is used after its already freed
<mwalle_> I must have been mistaken, converting it to devm_ will also make the problem go away
<mwalle_> but then I'll read something like 8d559a64f0 which converts devm_ to the non-devm_ version. uhh..
matthias_bgg has quit [Quit: Leaving]
sikkiladho has joined #armlinux
sszy has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<ukleinek> mwalle_: the actual driver looks harmless on first sight, maybe the (conditional) put_device is just wrong?
<mwalle_> ukleinek: you mean in spi_unregister_controller() ? I'm calling it a day now, but I've sent an RFC
krzk has quit [Remote host closed the connection]
<ukleinek> mwalle_: I'm sure your patch is wrong
<mwalle_> ukleinek: thus RFC ;)
bps has quit [Ping timeout: 240 seconds]
<ukleinek> drivers/spi/spi-fsl-dspi.c is the driver that looks harmless
jlinton has joined #armlinux
torez has quit [Ping timeout: 245 seconds]
torez has joined #armlinux
sikkiladho has quit [Ping timeout: 240 seconds]
sikkiladho has joined #armlinux
guillaume_g has quit [Quit: Konversation terminated!]
<sikkiladho> Hi. I'm trying to create a chain between bare metal binaries on raspberry pi 4 to learn about the bare metal world. I have two binaries.
<sikkiladho> el2-kernel.img - it prints Hello to UART.
<sikkiladho> el1-kernel.img - it prints World to UART.
<sikkiladho> kernel=el2-kernel.img
<sikkiladho> initramfs el1-kernel.img 0x400000 I use these configs to load both binaries at different addresses.
<sikkiladho> then in el2-kernel.img, I simpy jump to 0x400000 (using eret and relevant values in spsr_el2 and elr_el2(the address)
<sikkiladho> I have been succesfull in doing so
<sikkiladho> Now I want to jump from el2-kernel to the standard linux kernel. I have been tried to do it for a few weeks but the standard kernel won't run.
alexels has joined #armlinux
Pali has joined #armlinux
Amit_T has quit [Quit: Leaving]
alexels has quit [Quit: WeeChat 3.3]
bps has joined #armlinux
bps has joined #armlinux
bps has quit [Changing host]
<rperier> arnd: o/ , https://paste.debian.net/1219008/ <--- did you notice this with gcc 11 for armhf ?
<rperier> with the torvalds's tree or 5.15 with gcc 11, with gcc 10 everything works like a charm
<rperier> arnd: well, apparently you already gave a feedback on a ticket about this in debian, my bad ;)
sikkiladho has quit [Quit: Connection closed]
apritzel_ has quit [Ping timeout: 256 seconds]
sikkiladho has joined #armlinux
sikkiladho has quit [Quit: Connection closed]
sikkiladho has joined #armlinux
sikkiladho has quit [Client Quit]
<arnd> rperier: the patch is in rmk's patch tracker: https://www.armlinux.org.uk/developer/patches/viewpatch.php?id=9156/1
torez has quit [Ping timeout: 264 seconds]
torez has joined #armlinux
sikkiladho has joined #armlinux
diederik has joined #armlinux
torez has quit [Ping timeout: 240 seconds]
<rperier> arnd: yeah I have applied this one locally, it solves the issue
<rperier> thanks
torez has joined #armlinux
sikkiladho has left #armlinux [#armlinux]
bps has quit [Ping timeout: 256 seconds]
apritzel has joined #armlinux
torez has quit [Quit: torez]
prabhakarlad has quit [Quit: Client closed]
jlinton has quit [Quit: Client closed]
System_Error has quit [Remote host closed the connection]
System_Error has joined #armlinux
bps has joined #armlinux
bps has joined #armlinux
bps has quit [Changing host]
nsaenz_ has quit [Remote host closed the connection]
System_Error has quit [Ping timeout: 276 seconds]
System_Error has joined #armlinux
bps has quit [Ping timeout: 240 seconds]
linusw_ has joined #armlinux
prabhakarlad has joined #armlinux
iivanov has quit [Remote host closed the connection]
djrscally has quit [Quit: Konversation terminated!]
iivanov has joined #armlinux
iivanov has quit [Ping timeout: 240 seconds]