* Determine whether the attributes specified by a page table entry match those * being tracked by the current range. This is not quite as simple as a direct * flag comparison since some PAT modes have multiple representations. */
| 11213 | * flag comparison since some PAT modes have multiple representations. |
| 11214 | */ |
| 11215 | static bool |
| 11216 | sysctl_kmaps_match(struct pmap_kernel_map_range *range, pt_entry_t attrs) |
| 11217 | { |
| 11218 | pt_entry_t diff, mask; |
| 11219 | |
| 11220 | mask = X86_PG_G | X86_PG_RW | X86_PG_U | X86_PG_PDE_CACHE | pg_nx; |
| 11221 | diff = (range->attrs ^ attrs) & mask; |
| 11222 | if (diff == 0) |
| 11223 | return (true); |
| 11224 | if ((diff & ~X86_PG_PDE_PAT) == 0 && |
| 11225 | pmap_pat_index(kernel_pmap, range->attrs, true) == |
| 11226 | pmap_pat_index(kernel_pmap, attrs, true)) |
| 11227 | return (true); |
| 11228 | return (false); |
| 11229 | } |
| 11230 | |
| 11231 | static void |
| 11232 | sysctl_kmaps_reinit(struct pmap_kernel_map_range *range, vm_offset_t va, |
no test coverage detected