Search
Monday, 6th of April 2020, 22:03:30 UTC
22:09:20
stassats
i don't quite understand how the alloc tramp argument/result is passed
22:09:33
stassats
and why is ca0-offset saved on the lisp stack?
22:17:20
stassats
specifically, not getting why is (nbytes-start (- number-framesize n-word-bytes)) and not +, and then there's some alignment as well
22:20:55
stassats
(storew size nsp-tn -1) isn't that going beyond the NSP?
22:23:17
stassats
why does it allocate space for lip-tn, but not for size?
22:26:55
karlosz
stassats: yeah, none of the list allocation stuff should be messing with this
22:27:08
karlosz
the size argument is saved on the stack in the stub
22:27:15
karlosz
and the tramp makes space for it
22:27:21
stassats
ok, in the end i see only one problem, size is not protected by nsp
22:27:54
stassats
any interrupt will trash it
22:28:14
stassats
it might be not, but it will be in the future
22:28:29
karlosz
i was worried about it but convinced myself it was fine because of PA but that only protects our own stack from our own handlers
22:28:32
stassats
it's a bit strange since there's already (inst subi nsp-tn nsp-tn n-word-bytes)
22:28:48
karlosz
yeah this was when i didn't have alloc tramp stub
22:28:55
karlosz
and i was worried about inline code space
22:29:05
stassats
so (* n-word-bytes 2) wouldn't be any different
22:29:09
stassats
(i assume that's encodable)
22:29:28
karlosz
there should be no downsides to moving it at the place of using it
22:29:52
karlosz
right, that messy setup was when i hadn't made stubs that were selected on the register. i'll fix that
22:30:01
karlosz
and i hope thats the problem
22:31:01
stassats
can you save lip-tn in alloc-tn?
22:35:17
stassats
but i doubt there are any interrupts going on here to trigger this problem, but it would be as deterministic
22:35:36
stassats
riscv also may have some red zones
22:36:08
stassats
search engine says "there is no red zone on RISC-V"
22:37:22
stassats
protection can invoke signals, but then, why would it here?
22:45:00
stassats
and don't forget about ca0 on the control stack
22:47:55
karlosz
stassats: ca0 is a descriptor reg
22:48:31
karlosz
granted, non obvious from the code
22:48:36
karlosz
i wonder how to make it clearer
22:49:02
karlosz
Krystof decided it would be a good idea to alternate descriptors and non descriptors in the C arg area
22:49:13
karlosz
for the purposes of the C extension
22:49:21
karlosz
C as in compressed instruction
22:56:04
karlosz
yeah lip-tn is an any-reg so i can stash that in alloc-tn
23:00:06
karlosz
also i just realized im not aligning the stack
23:04:19
stassats
ok, i was going from (:temp ca0 unsigned-reg ca0-offset)
23:06:58
karlosz
yeah i should change that....
23:15:00
karlosz
this whole alloc tramp thing turned into a mess
23:15:14
karlosz
maybe the problem will get fixed when i clean this up (wishful thinking)
5:18:14
White_Flame
another silly micro-optimization question, but is there a way to test if some value is of a specific structure type, without including descendant types?
6:07:51
karlosz
there is in sbcl, but its internals only
6:08:38
karlosz
you can test the layout directly
6:59:31
White_Flame
yeah, that's why I asked here, instead of in #lisp ;)
Tuesday, 7th of April 2020, 10:03:30 UTC