mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
Clear exclusive monitors when handling data aborts, the monitors are
in unknown state per spec. Reviewed by: andrew (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3668
This commit is contained in:
parent
cf8b6f76a2
commit
6ced378970
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=287960
@ -155,6 +155,13 @@ data_abort(struct trapframe *frame, uint64_t esr, int lower)
|
||||
uint64_t far;
|
||||
int error, sig, ucode;
|
||||
|
||||
/*
|
||||
* According to the ARMv8-A rev. A.g, B2.10.5 "Load-Exclusive
|
||||
* and Store-Exclusive instruction usage restrictions", state
|
||||
* of the exclusive monitors after data abort exception is unknown.
|
||||
*/
|
||||
clrex();
|
||||
|
||||
#ifdef KDB
|
||||
if (kdb_active) {
|
||||
kdb_reenter();
|
||||
|
@ -108,6 +108,17 @@ get_mpidr(void)
|
||||
return (mpidr);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
clrex(void)
|
||||
{
|
||||
|
||||
/*
|
||||
* Ensure compiler barrier, otherwise the monitor clear might
|
||||
* occur too late for us ?
|
||||
*/
|
||||
__asm __volatile("clrex" : : : "memory");
|
||||
}
|
||||
|
||||
#define cpu_nullop() arm64_nullop()
|
||||
#define cpufunc_nullop() arm64_nullop()
|
||||
#define cpu_setttb(a) arm64_setttb(a)
|
||||
|
Loading…
Reference in New Issue
Block a user