Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/pmap.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 1,689 Lines • ▼ Show 20 Lines | if (CPU_REV(PCPU_GET(midr)) < 3) { | ||||
| *errata_count = 1; | *errata_count = 1; | ||||
| return (true); | return (true); | ||||
| } | } | ||||
| } | } | ||||
| return (false); | return (false); | ||||
| } | } | ||||
| static void | static bool | ||||
| pmap_dbm_enable(const struct cpu_feat *feat __unused, | pmap_dbm_enable(const struct cpu_feat *feat __unused, | ||||
| cpu_feat_errata errata_status, u_int *errata_list __unused, | cpu_feat_errata errata_status, u_int *errata_list __unused, | ||||
| u_int errata_count) | u_int errata_count) | ||||
| { | { | ||||
| uint64_t tcr; | uint64_t tcr; | ||||
| /* Skip if there is an erratum affecting DBM */ | /* Skip if there is an erratum affecting DBM */ | ||||
| if (errata_status != ERRATA_NONE) | if (errata_status != ERRATA_NONE) | ||||
| return; | return (false); | ||||
| tcr = READ_SPECIALREG(tcr_el1) | TCR_HD; | tcr = READ_SPECIALREG(tcr_el1) | TCR_HD; | ||||
| WRITE_SPECIALREG(tcr_el1, tcr); | WRITE_SPECIALREG(tcr_el1, tcr); | ||||
| isb(); | isb(); | ||||
| /* Flush the local TLB for the TCR_HD flag change */ | /* Flush the local TLB for the TCR_HD flag change */ | ||||
| dsb(nshst); | dsb(nshst); | ||||
| __asm __volatile("tlbi vmalle1"); | __asm __volatile("tlbi vmalle1"); | ||||
| dsb(nsh); | dsb(nsh); | ||||
| isb(); | isb(); | ||||
| return (true); | |||||
| } | } | ||||
| CPU_FEAT(feat_hafdbs, | CPU_FEAT(feat_hafdbs, "Hardware management of the Access flag and dirty state", | ||||
| pmap_dbm_check, pmap_dbm_has_errata, pmap_dbm_enable, | pmap_dbm_check, pmap_dbm_has_errata, pmap_dbm_enable, | ||||
| CPU_FEAT_AFTER_DEV | CPU_FEAT_PER_CPU); | CPU_FEAT_AFTER_DEV | CPU_FEAT_PER_CPU); | ||||
| /* | /* | ||||
| * Initialize the pmap module. | * Initialize the pmap module. | ||||
| * | * | ||||
| * Called by vm_mem_init(), to initialize any structures that the pmap | * Called by vm_mem_init(), to initialize any structures that the pmap | ||||
| * system needs to map virtual memory. | * system needs to map virtual memory. | ||||
| ▲ Show 20 Lines • Show All 8,394 Lines • Show Last 20 Lines | |||||