#
#asahi-dev · 2025-06-01 11:00
svenit's also unrelated to deep wfi messing some state up - i commented out the wfi instruction and that doesn't make any difference either
#asahi-dev · 2025-06-01 10:57
svenadding dc_civac_range there still results in that crash
#asahi-dev · 2025-06-01 10:29
kettenisbad things could happen in smp_call4()
#asahi-dev · 2025-06-01 10:28
kettenisthe spin table is another thing that isn't flushed
#asahi-dev · 2025-06-01 10:16
svenso core #2 entering deep_wfi and then overwriting core #1's stack would explain this but I just don't see any evidence of wrong stack pointers in any core :/
#asahi-dev · 2025-05-31 22:52
sveni think
#asahi-dev · 2025-05-31 22:52
sventhat would also explain where 0x2000000 comes from because that's the original value of SYS_IMP_APL_CYC_OVRD stored on the stack next to the saved LR inside deep_wfi
#asahi-dev · 2025-05-31 22:35
svenhrm, so this abort could happen if any of the other cores is still stuck in smp_secondary_entry and has the same stack. it looks like the SPs are correct on initial smp_secondary_entry though and yet it still crashes
#asahi-dev · 2025-05-31 19:08
svenstill crashes with the same symptoms. probably a good idea to add that additional flush anyway
#asahi-dev · 2025-05-31 19:06
svenlet's see if that changes anything
#asahi-dev · 2025-05-31 19:06
svenhuh, yeah
#asahi-dev · 2025-05-31 17:43
kettenisbut target_cpu is also written and isn't flushed?
#asahi-dev · 2025-05-31 17:25
ketteniscrap, looking at an old tree
#asahi-dev · 2025-05-31 17:23
svendoesn't the dc_civac_range(&_reset_stack, sizeof(void *)); do just that?
#asahi-dev · 2025-05-31 17:20
kettenisa "dmb sy" isn't going to work if we're running with caches enabled and the CPU that's being started starts without the caches enabled
#asahi-dev · 2025-05-31 17:20
kettenisin src/smp.c:smp_start_cpu()
#asahi-dev · 2025-05-31 17:19
kettenis _reset_stack = secondary_stacks[index] + SECONDARY_STACK_SIZE;
#asahi-dev · 2025-05-31 17:19
kettenisI'm fairly certain we need an explicit cache flush after:
#asahi-dev · 2025-05-31 17:14
sveni checked the assembly. it should be a frame pointer there, it just also ends up being corrupted somehow
#asahi-dev · 2025-05-31 17:04
ketteniswhile x29 is typically used as a frame pointer, the compiler is free to use it for other purposes
#asahi-dev · 2025-05-31 15:51
svenyeah, that guess made sense to me. but it reliably points to the instruction after bl deep_wfi inside smp_secondary_entry for me
#asahi-dev · 2025-05-31 15:50
jannauI didn't check where it actually pointed. dummy_stack was just the first suspicion because I expected any stack/frame pointer
#asahi-dev · 2025-05-31 15:30
svenwhich, uh, also doesn't make any sense to me
#asahi-dev · 2025-05-31 15:29
sveni just checked and for me x29 doesn't point to the dummy stack but to the instruction after the branch to deep_wfi
#asahi-dev · 2025-05-31 15:28
ketteniswell there is no cache flush after _reset_stack gets changed
#asahi-dev · 2025-05-31 15:22
nickchanthere's the a7 cache workaround but i really don't think that has any relation to the current issue
#asahi-dev · 2025-05-31 15:19
nickchanit could be some cache or memory ordering issues
#asahi-dev · 2025-05-31 15:16
nickchandummy_stack should never be used in the first place
#asahi-dev · 2025-05-31 15:16
svenit shouldn't even be using dummy_stack at that point
#asahi-dev · 2025-05-31 15:15
kettenisin the m1n1 I looked at, dummy_stack isn't 16-byte aligned
#asahi-dev · 2025-05-31 15:13
kettenishmm, isn't that a stack alignment issue?
#asahi-dev · 2025-05-31 15:11
nickchanwould it be possible that some chicken bits are subtly wrong
#asahi-dev · 2025-05-31 14:55
amarioguyah i see, thanks for the info, probably will implement one of the workarounds then
#asahi-dev · 2025-05-31 14:50
sventhese probably result in something else that isn't as critical being overwritten
#asahi-dev · 2025-05-31 14:49
sventhere are a bunch of workarounds, see https://github.com/AsahiLinux/m1n1/issues/463
#asahi-dev · 2025-05-31 14:49
svenit happens when the other cores are brought up in the guest almost every time
#asahi-dev · 2025-05-31 14:48
sveni suspect that issue has been in m1n1 for a very long time. only some change in the last months made it much more likely
#asahi-dev · 2025-05-31 14:47
amarioguyjust need to know that so i can determine whether i should hold off on fast forwarding my fork to current
#asahi-dev · 2025-05-31 14:47
amarioguyin what scenarios is the HV affected?
#asahi-dev · 2025-05-31 14:46
amarioguythat mmu_setup_secondary issue
#asahi-dev · 2025-05-31 14:04
kettenisyeah, although I'm not aware of that being a problem
#asahi-dev · 2025-05-31 14:00
chadmedwe do need to update the minimal uefi image, its quite old
#asahi-dev · 2025-05-31 13:59
kettenisnow that I've figured out how to build stage1 m1n1 on OpenBSD that becomes easier
#asahi-dev · 2025-05-31 13:58
kettenisperhaps time to proceed with having an OpenBSD option
#asahi-dev · 2025-05-31 13:58
kettenisthe biggest issue will be folks using the UEFI option in the installer
#asahi-dev · 2025-05-31 13:51
svenagreed
#asahi-dev · 2025-05-31 13:50
kettenisthe different compatible signals the different layout
#asahi-dev · 2025-05-31 13:50
kettenisthis is probably best left alone then
#asahi-dev · 2025-05-31 13:48
kettenisyeah
#asahi-dev · 2025-05-31 13:47
svenugh.. that's going to be very annoying

plus ›