diff --git a/Docs/Configuration.md5 b/Docs/Configuration.md5 index 798f2c0d..2d2ed8f8 100644 --- a/Docs/Configuration.md5 +++ b/Docs/Configuration.md5 @@ -1 +1 @@ -d0ca24f6995d72c340b8ee894ddf5882 +4e5a5fbb0a57ee29804ed531403c8eb6 diff --git a/Docs/Configuration.pdf b/Docs/Configuration.pdf index 5a7ad685..5a053f68 100644 Binary files a/Docs/Configuration.pdf and b/Docs/Configuration.pdf differ diff --git a/Docs/Configuration.tex b/Docs/Configuration.tex index a8517215..5c679736 100755 --- a/Docs/Configuration.tex +++ b/Docs/Configuration.tex @@ -2776,7 +2776,7 @@ blocking. One way to workaround the problem is to increase the timeout to an extremely high value, which at the cost of slow boot times (extra minutes) will ensure that all the blocks are trimmed. Setting this option to a high value, - such as \texttt{4294967295} (a.k.a. \texttt{-1}) ensures that all blocks are trimmed. + such as \texttt{4294967295} ensures that all blocks are trimmed. Alternatively, use over-provisioning, if supported, or create a dedicated unmapped partition where the reserve blocks can be found by the controller. Conversely, the trim operation can be mostly disabled by @@ -2784,10 +2784,13 @@ blocking. \href{https://interface31.ru/tech_it/2015/04/mozhno-li-effektivno-ispolzovat-ssd-bez-podderzhki-trim.html}{article} for details. - On macOS 12.0 and above, it is no longer possible to specify trim timeout. + \emph{Note}: The failsafe value \texttt{-1} indicates that this patch will not be applied, + such that \texttt{apfs.kext} will remain untouched. + + \emph{Note 2}: On macOS 12.0 and above, it is no longer possible to specify trim timeout. However, it can be disabled by setting \texttt{0}. - \emph{Note}: Trim operations are \emph{only} affected at booting phase when the startup volume is mounted. + \emph{Note 3}: Trim operations are \emph{only} affected at booting phase when the startup volume is mounted. Either specifying timeout, or completely disabling trim with \texttt{0}, will not affect normal macOS running. \item diff --git a/Docs/Differences/Differences.pdf b/Docs/Differences/Differences.pdf index 54b6478f..73b79ce9 100644 Binary files a/Docs/Differences/Differences.pdf and b/Docs/Differences/Differences.pdf differ diff --git a/Docs/Differences/Differences.tex b/Docs/Differences/Differences.tex index 83516228..d3744b5e 100644 --- a/Docs/Differences/Differences.tex +++ b/Docs/Differences/Differences.tex @@ -1,7 +1,7 @@ \documentclass[]{article} %DIF LATEXDIFF DIFFERENCE FILE %DIF DEL PreviousConfiguration.tex Thu Mar 10 21:36:27 2022 -%DIF ADD ../Configuration.tex Mon Apr 4 13:04:33 2022 +%DIF ADD ../Configuration.tex Mon Apr 4 20:16:05 2022 \usepackage{lmodern} \usepackage{amssymb,amsmath} @@ -2843,7 +2843,7 @@ blocking. One way to workaround the problem is to increase the timeout to an extremely high value, which at the cost of slow boot times (extra minutes) will ensure that all the blocks are trimmed. \DIFdelbegin \DIFdel{Set }\DIFdelend \DIFaddbegin \DIFadd{Setting }\DIFaddend this option to a high value, - such as \texttt{4294967295} \DIFdelbegin \DIFdel{, to ensure }\DIFdelend \DIFaddbegin \DIFadd{(a.k.a. }\texttt{\DIFadd{-1}}\DIFadd{) ensures }\DIFaddend that all blocks are trimmed. + such as \texttt{4294967295} \DIFdelbegin \DIFdel{, to ensure }\DIFdelend \DIFaddbegin \DIFadd{ensures }\DIFaddend that all blocks are trimmed. Alternatively, use over-provisioning, if supported, or create a dedicated unmapped partition where the reserve blocks can be found by the controller. Conversely, the trim operation can be \DIFaddbegin \DIFadd{mostly }\DIFaddend disabled by @@ -2852,10 +2852,14 @@ blocking. \href{https://interface31.ru/tech_it/2015/04/mozhno-li-effektivno-ispolzovat-ssd-bez-podderzhki-trim.html}{article} for details. - On macOS \DIFdelbegin \DIFdel{12+}\DIFdelend \DIFaddbegin \DIFadd{12.0 and above}\DIFaddend , it is no longer possible to \DIFdelbegin \DIFdel{set trim timeoutfor APFS filesystems}\DIFdelend \DIFaddbegin \DIFadd{specify trim timeout}\DIFaddend . + \DIFdelbegin \DIFdel{On macOS 12+}\DIFdelend \DIFaddbegin \emph{\DIFadd{Note}}\DIFadd{: The failsafe value }\texttt{\DIFadd{-1}} \DIFadd{indicates that this patch will not be applied, + such that }\texttt{\DIFadd{apfs.kext}} \DIFadd{will remain untouched. +} + + \emph{\DIFadd{Note 2}}\DIFadd{: On macOS 12.0 and above}\DIFaddend , it is no longer possible to \DIFdelbegin \DIFdel{set trim timeoutfor APFS filesystems}\DIFdelend \DIFaddbegin \DIFadd{specify trim timeout}\DIFaddend . However, \DIFdelbegin \DIFdel{trim }\DIFdelend \DIFaddbegin \DIFadd{it }\DIFaddend can be disabled \DIFdelbegin \DIFdel{when the timeout value is set to }\DIFdelend \DIFaddbegin \DIFadd{by setting }\DIFaddend \texttt{0}. - \DIFaddbegin \emph{\DIFadd{Note}}\DIFadd{: Trim operations are }\emph{\DIFadd{only}} \DIFadd{affected at booting phase when the startup volume is mounted. + \DIFaddbegin \emph{\DIFadd{Note 3}}\DIFadd{: Trim operations are }\emph{\DIFadd{only}} \DIFadd{affected at booting phase when the startup volume is mounted. Either specifying timeout, or completely disabling trim with }\texttt{\DIFadd{0}}\DIFadd{, will not affect normal macOS running. } diff --git a/Docs/Errata/Errata.pdf b/Docs/Errata/Errata.pdf index 3ce89099..b4143266 100644 Binary files a/Docs/Errata/Errata.pdf and b/Docs/Errata/Errata.pdf differ diff --git a/Library/OcAppleKernelLib/CommonPatches.c b/Library/OcAppleKernelLib/CommonPatches.c index 66f0ab8c..9bc082e2 100644 --- a/Library/OcAppleKernelLib/CommonPatches.c +++ b/Library/OcAppleKernelLib/CommonPatches.c @@ -2136,8 +2136,6 @@ PatchSetApfsTrimTimeout ( return Status; } - // - // FIXME: This is wrong! At least from 11.6.1, mApfsTimeoutPatch cannot be applied anymore. // // It is only possible to specify trim timeout value from 10.14 to 11.x. // Starting at 12.0 this is no longer possible. @@ -2153,7 +2151,7 @@ PatchSetApfsTrimTimeout ( return Status; } - DEBUG ((DEBUG_INFO, "OCAK: Skipping SetApfsTrimTimeout on macOS 12.0+, set 0 to disable trim instead\n")); + DEBUG ((DEBUG_INFO, "OCAK: Skipping SetApfsTrimTimeout on macOS 12.0+\n")); return EFI_SUCCESS; } diff --git a/Library/OcMainLib/OpenCoreKernelPatch.c b/Library/OcMainLib/OpenCoreKernelPatch.c index 55c7fb7c..5c23c63e 100644 --- a/Library/OcMainLib/OpenCoreKernelPatch.c +++ b/Library/OcMainLib/OpenCoreKernelPatch.c @@ -282,6 +282,9 @@ OcKernelApplyPatches ( } } + // + // Ignore timeout -1. + // if (Config->Kernel.Quirks.SetApfsTrimTimeout >= 0) { PatchSetApfsTimeout ((UINT32) Config->Kernel.Quirks.SetApfsTrimTimeout); OcKernelApplyQuirk (KernelQuirkSetApfsTrimTimeout, CacheType, DarwinVersion, Context, NULL);