Page MenuHomeFreeBSD

Add an instruction barrier to pmap_activate()
ClosedPublic

Authored by alc on Jul 10 2019, 3:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 3:47 AM
Unknown Object (File)
Wed, Sep 24, 10:29 PM
Unknown Object (File)
Fri, Sep 19, 10:51 PM
Unknown Object (File)
Aug 27 2025, 8:44 PM
Unknown Object (File)
Aug 2 2025, 3:13 PM
Unknown Object (File)
Jul 30 2025, 7:16 PM
Unknown Object (File)
Jul 12 2025, 4:06 AM
Unknown Object (File)
Jul 7 2025, 10:40 AM

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.