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

Function data_abort

freebsd/arm64/arm64/trap.c:232–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static void
233data_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 |

Callers

nothing calls this directly

Calls 11

clrexFunction · 0.85
kdb_reenterFunction · 0.85
print_registersFunction · 0.85
vm_fault_trapFunction · 0.85
kdb_trapFunction · 0.85
userretFunction · 0.85
pmap_faultFunction · 0.70
call_trapsignalFunction · 0.70
intr_enableFunction · 0.50
printfFunction · 0.50
panicFunction · 0.50

Tested by

no test coverage detected