[DragonFlyBSD - Submit #3263] (Resolved) [PATCH] Add memory barriers on some ASM functions

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Wed Jan 27 17:22:21 PST 2021


Issue #3263 has been updated by dillon.

Status changed from New to Resolved
Assignee set to dillon

Committed.  Totally reasonable to give these __asm functions memory barriers (prevents the compiler from reordering instructions around the functions).

-Matt

----------------------------------------
Submit #3263: [PATCH] Add memory barriers on some ASM functions
http://bugs.dragonflybsd.org/issues/3263#change-13956

* Author: chicken
* Status: Resolved
* Priority: Normal
* Assignee: dillon
* Category: Kernel
* Target version: master
----------------------------------------
Certain instructions have memory side effects and having the compiler reorder
them is generally not a good thing. Eg modifying CR4_SMAP changes the way memory
fetches are done afterwards. Same with WRMSR on certain MSRs such as PAT, etc.

In practice I don't think there are conditions where they make a difference, but
for correctness, add memory barriers.

---Files--------------------------------
1-add-memory-barriers.diff (3.01 KB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account


More information about the Submit mailing list