Otherwise we can fail to handle translation faults on curthread, leading
to a panic.
I don't really like this solution, but without it I readily get random
panics under QEMU.
Differential D23895
Ensure that arm64 thread structures are allocated from the direct map. markj on Feb 29 2020, 5:49 PM. Authored by Tags None Referenced Files
Subscribers
Details Otherwise we can fail to handle translation faults on curthread, leading I don't really like this solution, but without it I readily get random
Diff Detail
Event TimelineComment Actions The _NOFREE reminds me that we still need a way to segregate _NOFREE allocations in physical memory. Such segregation would most likely provide contiguity inherently. Comment Actions The freepool approach requires some work in order to segregate KVA allocations, I believe, but I think that should be straightforward. I would like to but probably won't in the near future - I found this bug while investigating another bug which is blocking a project I'm working on. I will try to return to this later. Comment Actions Consider this alternative. We create a second backend to kmem allocations that doesn't do normal reservation-based allocations but preemptively allocates the whole 2MB of physical memory and maps it as such before handing out any KVAs from the region. A vmem arena, submap, etc. could then be used to dole out the unused addresses within the region. As a backstop, if we can't allocate a contiguous 2MB of physical memory, we fall back to smaller allocations. Comment Actions I wrote a patch which implements this using a per-domain vmem arena. At the moment it falls back to the regular allocation path if we fail to import 2MB of physical memory: vmem import functions are currently required to return exactly the amount requested. I guess we could work around this with a function to manually add smaller chunks of contiguous memory to the arena when an allocation fails, instead of using the import mechanism. |