| 279 | } |
| 280 | |
| 281 | static void |
| 282 | alloc_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 | |
| 304 | void |
no test coverage detected