Page MenuHomeFreeBSD

Add an instruction barrier to pmap_activate()
ClosedPublic

Authored by alc on Jul 10 2019, 3:15 PM.
Tags
None
Referenced Files
F114388923: D20904.id59603.diff
Sat, Apr 12, 12:58 AM
Unknown Object (File)
Fri, Apr 4, 7:21 PM
Unknown Object (File)
Sun, Mar 30, 1:29 PM
Unknown Object (File)
Wed, Mar 26, 1:19 AM
Unknown Object (File)
Wed, Mar 26, 12:29 AM
Unknown Object (File)
Tue, Mar 25, 9:00 PM
Unknown Object (File)
Sat, Mar 15, 12:50 PM
Unknown Object (File)
Mar 11 2025, 11:37 PM

Details

Summary

According to Section D5.10.3 "Maintenance requirements on changing System register values" of the architecture manual, an isb instruction should be executed after updating ttbr0_el1 and before invalidating the TLB.

Test Plan

After adding the isb instruction into pmap_activate(), I can replace the pmap_invalidate_page() in pmap_enter_quick_locked() with a dsb ishst instruction and not suffer from spurious bus errors.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

efi_arch_enter() and _leave() have the isb following the TLB invalidation.

Perhaps we should add a cpufunc.h intrinsic for these two instructions?

This revision is now accepted and ready to land.Jul 10 2019, 3:20 PM

Add the isb instruction to efi_arch_enter() and efi_arch_leave().

This revision now requires review to proceed.Jul 10 2019, 3:43 PM
This revision is now accepted and ready to land.Jul 10 2019, 3:46 PM

efi_arch_enter() and _leave() have the isb following the TLB invalidation.

I believe that the isb instruction must be executed before and after TLB invalidation.

Perhaps we should add a cpufunc.h intrinsic for these two instructions?

Probably.