| 230 | } |
| 231 | |
| 232 | static void |
| 233 | data_abort(struct thread *td, struct trapframe *frame, uint64_t esr, |
| 234 | uint64_t far, int lower) |
| 235 | { |
| 236 | struct vm_map *map; |
| 237 | struct proc *p; |
| 238 | struct pcb *pcb; |
| 239 | vm_prot_t ftype; |
| 240 | int error, sig, ucode; |
| 241 | #ifdef KDB |
| 242 | bool handled; |
| 243 | #endif |
| 244 | |
| 245 | /* |
| 246 | * According to the ARMv8-A rev. A.g, B2.10.5 "Load-Exclusive |
| 247 | * and Store-Exclusive instruction usage restrictions", state |
| 248 | * of the exclusive monitors after data abort exception is unknown. |
| 249 | */ |
| 250 | clrex(); |
| 251 | |
| 252 | #ifdef KDB |
| 253 | if (kdb_active) { |
| 254 | kdb_reenter(); |
| 255 | return; |
| 256 | } |
| 257 | #endif |
| 258 | |
| 259 | pcb = td->td_pcb; |
| 260 | p = td->td_proc; |
| 261 | if (lower) |
| 262 | map = &p->p_vmspace->vm_map; |
| 263 | else { |
| 264 | intr_enable(); |
| 265 | |
| 266 | /* The top bit tells us which range to use */ |
| 267 | if (far >= VM_MAXUSER_ADDRESS) { |
| 268 | map = kernel_map; |
| 269 | } else { |
| 270 | map = &p->p_vmspace->vm_map; |
| 271 | if (map == NULL) |
| 272 | map = kernel_map; |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | /* |
| 277 | * Try to handle translation, access flag, and permission faults. |
| 278 | * Translation faults may occur as a result of the required |
| 279 | * break-before-make sequence used when promoting or demoting |
| 280 | * superpages. Such faults must not occur while holding the pmap lock, |
| 281 | * or pmap_fault() will recurse on that lock. |
| 282 | */ |
| 283 | if ((lower || map == kernel_map || pcb->pcb_onfault != 0) && |
| 284 | pmap_fault(map->pmap, esr, far) == KERN_SUCCESS) |
| 285 | return; |
| 286 | |
| 287 | KASSERT(td->td_md.md_spinlock_count == 0, |
| 288 | ("data abort with spinlock held")); |
| 289 | if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK | |
nothing calls this directly
no test coverage detected