MCPcopy Create free account
hub / github.com/F-Stack/f-stack / alloc_sv_fxrng_generation

Function alloc_sv_fxrng_generation

freebsd/kern/kern_sharedpage.c:281–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279}
280
281static void
282alloc_sv_fxrng_generation(void)
283{
284 int base;
285
286 /*
287 * Allocate a full cache line for the fxrng root generation (64-bit
288 * counter, or truncated 32-bit counter on ILP32 userspace). It is
289 * important that the line is not shared with frequently dirtied data,
290 * and the shared page allocator lacks a __read_mostly mechanism.
291 * However, PAGE_SIZE is typically large relative to the amount of
292 * stuff we've got in it so far, so maybe the possible waste isn't an
293 * issue.
294 */
295 base = shared_page_alloc(CACHE_LINE_SIZE, CACHE_LINE_SIZE);
296 KASSERT(base != -1, ("%s: base allocation failed", __func__));
297 fxrng_shpage_mapping = (void *)(shared_page_mapping + base);
298 *fxrng_shpage_mapping = (struct vdso_fxrng_generation) {
299 .fx_vdso_version = VDSO_FXRNG_VER_CURR,
300 };
301}
302#endif /* RANDOM_FENESTRASX */
303
304void

Callers 1

exec_sysvec_initFunction · 0.85

Calls 1

shared_page_allocFunction · 0.85

Tested by

no test coverage detected