• Stars
    star
    239
  • Rank 168,763 (Top 4 %)
  • Language
    C
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kernel extension that enables TSO for Apple silicon processes

TSOEnabler

A kernel extension that enables total store ordering on Apple silicon, with semantics similar to x86_64's memory model. This is normally done by the kernel through modifications to a special register upon exit from the kernel for programs running under Rosetta 2; however, it is possible to enable this for arbitrary processes (on a per-thread basis, technically) as well by modifying the flag for this feature and letting the kernel enable it for us on. This extension is designed to work on the M1 (t8101) kernel, where it attempts to automatically detect certain offsets from the kernel image. If you are looking for the old code for the A12Z (t8020) kernel, it's available on the t8020 branch.

Installation

Supposedly, you should be able to use this if you build and sign the kernel extension (disabling SIP if you aren't using a KEXT signing certificate) and drag it into /Library/Extensions. A dialog should come up to prompt you to enable the extension in the Security & Privacy preferences pane, you allow it from there and restart, and it will be installed. (If you're not seeing it, the permissions on the extension might be wrong: try a chown -R root:wheel.) In practice this can go wrong in many ways, and I have had luck by "resetting everything" and trying to install after doing the following:

  1. Reboot into recovery.
  2. Open the Startup Disk application. Your boot security should already be lowered to allow KEXTs from untrusted developers, toggle the checkbox anyways.
  3. Quit Startup Disk and open Terminal.
  4. Remove the kernel extension from the Data volume (likely /Volumes/Data/Library/Extensions/TSOEnabler.kext).
  5. Run kmutil trigger-panic-medic --volume-root /Volumes/<YourVolumeName> (again, likely /Volumes/Data).

(The last two steps work around bugs in macOS Big Sur beta).

After that try installing the kernel extension again.

Usage

Load the kernel extension with sudo kextload /Library/Extensions/TSOEnabler.kext. After that, the kern.tso_enable sysctl will be made available to you to read or write. For the reasons described above, you must enable this for all threads of your application if you would like it to work; doing so will also pin these to the high-performance cores of your processor. A shared library that interposes pthreads to automatically enable TSO is also provided for convenience.

More Repositories

1

Ensemble

Cast Mac windows to visionOS
Swift
832
star
2

unxip

A fast Xcode unarchiver
Swift
820
star
3

VirtualApple

Work with macOS VMs using Virtualization
Swift
257
star
4

EffectivePower

Apple PLSQL viewer
Swift
156
star
5

AppleConnect

Peer-to-peer bidirectional connection based on Network.framework
Swift
105
star
6

Chronicle

High-performance Swift logging for the rest of us
Swift
100
star
7

OpenAdBlock

The free, open-source Content Blocker for 32- and 64-bit iOS devices
Swift
82
star
8

dummy_thicc

0xcafebabe
C
68
star
9

macOSSandboxInitializationBypass

App sandbox escapes for macOS
Objective-C
29
star
10

dotfiles

Configuration and stuff. Messy.
Shell
26
star
11

DetailsViewer

A macOS Mail plugin to show extra details
Swift
21
star
12

Jumpcut

Personal patches to change the UI a bit
Objective-C
19
star
13

DarkNight

Sherlocked macOS launch agent for synchronizing Night Shift and the macOS system appearance
Swift
16
star
14

tinycc

Fork of the Tiny C Compiler patched to compile code on iOS
C
16
star
15

CrankPlayer

A crank-based video player for the Panic Playdate
C
16
star
16

expresscall

Proof-of-concept LLVM fork to speculatively inline objc_msgSend
C++
15
star
17

Presentations

Slides and resources for talks I've given
14
star
18

vers

Prints version information for easy pasting into Bug Reporter
Swift
14
star
19

Cod

A binary Swift Coder implementation
Swift
11
star
20

break

App for School Loop
Swift
11
star
21

GenerateAppIcons

A command line tool to generate app icons
Swift
9
star
22

binja-swift-demangler

Binary Ninja plugin to demangle Swift function names
Python
9
star
23

DerivedDataDeleter

Source Editor Extension to delete Xcode's DerivedData folder
Swift
7
star
24

elevate

The concise C++ STL extension
C++
5
star
25

ions

List of ions for 68k TI calculators
C
5
star
26

homebrew-tap

Homebrew tap for personal projects
Ruby
4
star
27

Complicated

My personal watchOS widgets
Swift
3
star
28

ictf-carprey

CarPrey jeopardy challenge and writeup from iCTF 2019
Python
3
star
29

advent-of-code

Advent of Code
Python
3
star
30

ports

Portfiles for personal MacPorts ports
3
star
31

SFSEE

swift-format Source Editor Extension
Swift
3
star
32

saagarjha.github.io

SCSS
3
star
33

MailHeaderLock

OS X Mail plugin to lock headers
Swift
2
star
34

MARS

Fork of the MARS MIPS simulator, modified to behave better on macOS
Java
2
star
35

WWDC18-Scholarship-Submission

Submission for the WWDC18 Scholarships application
Swift
1
star
36

El-Capitan-Theme

OS X Yosemite inspired theme for Sublime Text 3
1
star
37

hdshell

CLI wrapper for HDFS
Swift
1
star
38

CCode

C compiler for non-jailbroken iOS devices using TinyCC
1
star
39

TIGCC-macOS

TIGCC compiled for macOS
C
1
star
40

bntv450-images

Boot, recovery, and patched (rooted) images for Barnes and Noble Nook Tablet 7"
1
star