Repository navigation
Commit 3b82a6e
Revert "arm64: uaccess: implement unsafe accessors"
This reverts commit a1f3394.
The unsafe accessors allow the PAN enable/disable calls to be made
once for a group of accesses. Adding these means we can now have
sequences that look like this:
| user_access_begin();
| unsafe_put_user(static-value, x, err);
| unsafe_put_user(helper-that-sleeps(), x, err);
| user_access_end();
Calling schedule() without taking an exception doesn't switch the
PSTATE or TTBRs. We can switch out of a uaccess-enabled region, and
run other code with uaccess enabled for a different thread.
We can also switch from uaccess-disabled code back into this region,
meaning the unsafe_put_user()s will fault.
For software-PAN, threads that do this will get stuck as
handle_mm_fault() will determine the page has already been mapped in,
but we fault again as the page tables aren't loaded.
To solve this we need code in __switch_to() that save/restores the
PAN state.
Acked-by: Julien Thierry <julien.thierry@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>1 parent 742fafa commit 3b82a6e
1 file changed
Lines changed: 15 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
| |||
299 | 301 | | |
300 | 302 | | |
301 | 303 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | 304 | | |
| 305 | + | |
311 | 306 | | |
312 | 307 | | |
313 | | - | |
| 308 | + | |
314 | 309 | | |
315 | 310 | | |
316 | 311 | | |
317 | 312 | | |
318 | 313 | | |
319 | | - | |
| 314 | + | |
320 | 315 | | |
321 | 316 | | |
322 | 317 | | |
323 | 318 | | |
324 | 319 | | |
325 | 320 | | |
326 | 321 | | |
327 | | - | |
| 322 | + | |
328 | 323 | | |
329 | 324 | | |
330 | 325 | | |
331 | 326 | | |
332 | 327 | | |
333 | 328 | | |
334 | | - | |
| 329 | + | |
335 | 330 | | |
336 | 331 | | |
337 | 332 | | |
| |||
351 | 346 | | |
352 | 347 | | |
353 | 348 | | |
354 | | - | |
| 349 | + | |
355 | 350 | | |
356 | 351 | | |
| 352 | + | |
| 353 | + | |
357 | 354 | | |
358 | 355 | | |
359 | 356 | | |
| |||
374 | 371 | | |
375 | 372 | | |
376 | 373 | | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | 374 | | |
386 | 375 | | |
387 | 376 | | |
388 | | - | |
| 377 | + | |
389 | 378 | | |
390 | 379 | | |
391 | 380 | | |
392 | 381 | | |
393 | 382 | | |
394 | | - | |
| 383 | + | |
395 | 384 | | |
396 | 385 | | |
397 | 386 | | |
398 | 387 | | |
399 | 388 | | |
400 | 389 | | |
401 | 390 | | |
402 | | - | |
| 391 | + | |
403 | 392 | | |
404 | 393 | | |
405 | 394 | | |
406 | 395 | | |
407 | 396 | | |
408 | 397 | | |
409 | | - | |
| 398 | + | |
410 | 399 | | |
411 | 400 | | |
412 | 401 | | |
413 | 402 | | |
414 | 403 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | 404 | | |
436 | 405 | | |
437 | 406 | | |
| |||
0 commit comments