diff --git a/payloads/Config/config.plist b/payloads/Config/config.plist
index 84249a3df..7614e71f8 100644
--- a/payloads/Config/config.plist
+++ b/payloads/Config/config.plist
@@ -1221,6 +1221,24 @@
PlistPath
Contents/Info.plist
+
+ Arch
+ x86_64
+ BundlePath
+ NoAVXFSCompressionTypeZlib.kext
+ Comment
+ Work-around 12.4+ Zlib kernel panic
+ Enabled
+
+ ExecutablePath
+ Contents/MacOS/NoAVXFSCompressionTypeZlib
+ MaxKernel
+
+ MinKernel
+ 21.5.0
+ PlistPath
+ Contents/Info.plist
+
Block
diff --git a/payloads/Kexts/Misc/NoAVXFSCompressionTypeZlib-v12.3.1.zip b/payloads/Kexts/Misc/NoAVXFSCompressionTypeZlib-v12.3.1.zip
new file mode 100644
index 000000000..b665eb2cd
Binary files /dev/null and b/payloads/Kexts/Misc/NoAVXFSCompressionTypeZlib-v12.3.1.zip differ
diff --git a/resources/build.py b/resources/build.py
index df8dd3780..d63bc2da8 100644
--- a/resources/build.py
+++ b/resources/build.py
@@ -237,6 +237,15 @@ class BuildOpenCore:
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 1 of 2 - Patch read_erandom (inlined in _early_random)")["MaxKernel"] = ""
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 2 of 2 - Patch register_and_init_prng")["MaxKernel"] = ""
+ # In macOS 12.4 and 12.5 Beta 1, Apple added AVX1.0 usage in AppleFSCompressionTypeZlib
+ # Pre-Sandy Bridge CPUs don't support AVX1.0, thus we'll downgrade the kext to 12.3.1's
+ # Currently a (hopefully) temporary workaround for the issue, proper fix needs to be investigated
+ # Ref: https://forums.macrumors.com/threads/macos-12-monterey-on-unsupported-macs-thread.2299557/post-31120235
+
+ # To verify the non-AVX kext is used, check IOService for 'com_apple_AppleFSCompression_NoAVXCompressionTypeZlib'
+ if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge.value:
+ self.enable_kext("NoAVXFSCompressionTypeZlib.kext", self.constants.apfs_zlib_version, self.constants.apfs_zlib_path)
+
if not self.constants.custom_model and (self.constants.allow_oc_everywhere is True or self.model in model_array.MacPro):
# Use Innie's same logic:
# https://github.com/cdf/Innie/blob/v1.3.0/Innie/Innie.cpp#L90-L97
diff --git a/resources/constants.py b/resources/constants.py
index c1e71c114..62a02a8a1 100644
--- a/resources/constants.py
+++ b/resources/constants.py
@@ -57,6 +57,7 @@ class Constants:
self.apple_trackpad = "1.0.1" # AppleUSBTrackpad
self.apple_isight_version = "1.0.0" # AppleiSight
self.apple_raid_version = "1.0.0" # AppleRAIDCard
+ self.apfs_zlib_version = "12.3.1" # NoAVXFSCompressionTypeZlib
## Apple - Dortania Modified
self.bcm570_version = "1.0.2" # CatalinaBCM5701Ethernet
@@ -304,6 +305,10 @@ class Constants:
@property
def bigsursdxc_path(self):
return self.payload_kexts_path / Path(f"Misc/BigSurSDXC-v{self.bigsursdxc_version}.zip")
+
+ @property
+ def apfs_zlib_path(self):
+ return self.payload_kexts_path / Path(f"Misc/NoAVXFSCompressionTypeZlib-v{self.apfs_zlib_version}.zip")
@property
def mousse_path(self):