{"id":114,"date":"2021-01-08T00:00:24","date_gmt":"2021-01-07T23:00:24","guid":{"rendered":"https:\/\/threedots.ovh\/blog\/?p=114"},"modified":"2021-01-08T00:09:33","modified_gmt":"2021-01-07T23:09:33","slug":"building-arm-64-bit-xnu-darwin-20","status":"publish","type":"post","link":"https:\/\/threedots.ovh\/blog\/2021\/01\/building-arm-64-bit-xnu-darwin-20\/","title":{"rendered":"Building Arm 64-bit XNU (Darwin 20)"},"content":{"rendered":"\n<p>Assuming that instructions from <a href=\"https:\/\/kernelshaman.blogspot.com\/2021\/01\/building-xnu-for-macos-big-sur-1101.html\">https:\/\/kernelshaman.blogspot.com\/2021\/01\/building-xnu-for-macos-big-sur-1101.html<\/a> were already followed including for the iPhoneOS target&#8230;<\/p>\n\n\n\n<p>The patch:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>diff --git a\/config\/Private.exports b\/config\/Private.exports\nindex 28b023dd..ebaba915 100644\n--- a\/config\/Private.exports\n+++ b\/config\/Private.exports\n@@ -589,15 +589,6 @@ _current_persona_get\n _persona_put\n _pffinddomain:_pffinddomain_old\n _pffindproto:_pffindproto_old\n-_pmap_claim_reserved_ppl_page\n-_pmap_free_reserved_ppl_page\n-_pmap_in_ppl\n-_pmap_is_trust_cache_loaded\n-_pmap_load_legacy_trust_cache\n-_pmap_load_image4_trust_cache\n-_pmap_lockdown_image4_slab\n-_pmap_lookup_in_static_trust_cache\n-_pmap_lookup_in_loaded_trust_caches\n _port_name_to_task\n _port_name_to_thread\n _post_sys_powersource\ndiff --git a\/makedefs\/MakeInc.def b\/makedefs\/MakeInc.def\nindex d53f3e1a..6e646215 100644\n--- a\/makedefs\/MakeInc.def\n+++ b\/makedefs\/MakeInc.def\n@@ -65,8 +65,8 @@ MACHINE_FLAGS_ARM64_S8000 = -DARM64_BOARD_CONFIG_S8000\n MACHINE_FLAGS_ARM64_S8001 = -DARM64_BOARD_CONFIG_S8001\n MACHINE_FLAGS_ARM_T8002 = -DARM_BOARD_CONFIG_T8002\n MACHINE_FLAGS_ARM_T8004 = -DARM_BOARD_CONFIG_T8004\n-MACHINE_FLAGS_ARM64_T8010 = -DARM64_BOARD_CONFIG_T8010 -mcpu=hurricane\n-MACHINE_FLAGS_ARM64_T8011 = -DARM64_BOARD_CONFIG_T8011 -mcpu=hurricane\n+MACHINE_FLAGS_ARM64_T8010 = -DARM64_BOARD_CONFIG_T8010 -mcpu=apple-a10\n+MACHINE_FLAGS_ARM64_T8011 = -DARM64_BOARD_CONFIG_T8011 -mcpu=apple-a10\n MACHINE_FLAGS_ARM64_BCM2837 = -DARM64_BOARD_CONFIG_BCM2837\n \n \ndiff --git a\/osfmk\/arm64\/amcc_rorgn.c b\/osfmk\/arm64\/amcc_rorgn.c\nindex 35128d53..fe0c6f80 100644\n--- a\/osfmk\/arm64\/amcc_rorgn.c\n+++ b\/osfmk\/arm64\/amcc_rorgn.c\n@@ -42,7 +42,6 @@\n #include &lt;arm\/pmap.h&gt;\n #include &lt;arm64\/tlb.h&gt;\n #include &lt;arm64\/amcc_rorgn.h&gt;\n-#include &lt;memmap_types.h&gt;\n \n #if HIBERNATION\n #include &lt;arm64\/pal_hibernate.h&gt;\ndiff --git a\/osfmk\/arm64\/locore.s b\/osfmk\/arm64\/locore.s\nindex b18a335e..1996e094 100644\n--- a\/osfmk\/arm64\/locore.s\n+++ b\/osfmk\/arm64\/locore.s\n@@ -27,7 +27,6 @@\n  *\/\n \n #include &lt;machine\/asm.h&gt;\n-#include &lt;arm64\/hv\/hv_regs.h&gt;\n #include &lt;arm64\/machine_routines_asm.h&gt;\n #include &lt;arm64\/proc_reg.h&gt;\n #include &lt;pexpert\/arm64\/board_config.h&gt;\ndiff --git a\/pexpert\/pexpert\/arm64\/board_config.h b\/pexpert\/pexpert\/arm64\/board_config.h\nindex 01265fdf..7adb0f23 100644\n--- a\/pexpert\/pexpert\/arm64\/board_config.h\n+++ b\/pexpert\/pexpert\/arm64\/board_config.h\n@@ -81,7 +81,7 @@\n #define MAX_L2_CLINE                   7\n \n #if DEVELOPMENT || DEBUG\n-#define PMAP_CS                        1\n+\/\/#define PMAP_CS                        1\n #define PMAP_CS_ENABLE                 0\n #endif\n #endif  \/* ARM64_BOARD_CONFIG_T8010 *\/\n@@ -94,7 +94,7 @@\n #define MAX_CPU_CLUSTERS               1\n \n #if DEVELOPMENT || DEBUG\n-#define PMAP_CS                        1\n+\/\/#define PMAP_CS                        1\n #define PMAP_CS_ENABLE                 0\n #endif\n #endif  \/* ARM64_BOARD_CONFIG_T8011 *\/\n@@ -109,7 +109,7 @@\n #define BROKEN_FRIGGING_SLEEP          1 \/* Spurious wake: See rdar:\/\/problem\/29762505 *\/\n \n #if DEVELOPMENT || DEBUG\n-#define PMAP_CS                        1\n+\/\/#define PMAP_CS                        1\n #define PMAP_CS_ENABLE                 0\n #endif\n #endif  \/* ARM64_BOARD_CONFIG_T8015 *\/\n@@ -126,8 +126,8 @@\n #define T8020_DART_ALLOW_BYPASS        (1 &lt;&lt; 1) \/* DART allows translation bypass in certain cases *\/\n #define XNU_MONITOR_NVME_PPL           1 \/* NVMe PPL plugin for secure pmap runtime *\/\n #define XNU_MONITOR_ANS2_SART          1 \/* ANS2 SART plugin for secure pmap runtime *\/\n-#define PMAP_CS                        1\n-#define PMAP_CS_ENABLE                 1\n+\/\/#define PMAP_CS                        1\n+\/\/#define PMAP_CS_ENABLE                 1\n #endif  \/* ARM64_BOARD_CONFIG_T8020 *\/\n \n #ifdef ARM64_BOARD_CONFIG_T8006\n@@ -151,8 +151,8 @@\n #define T8020_DART_ALLOW_BYPASS        (1 &lt;&lt; 1) \/* DART allows translation bypass in certain cases *\/\n #define XNU_MONITOR_NVME_PPL           1 \/* NVMe PPL plugin for secure pmap runtime *\/\n #define XNU_MONITOR_ANS2_SART          1 \/* ANS2 SART plugin for secure pmap runtime *\/\n-#define PMAP_CS                        1\n-#define PMAP_CS_ENABLE                 1\n+\/\/#define PMAP_CS                        1\n+\/\/#define PMAP_CS_ENABLE                 1\n #define PREFER_ARM64_32_BINARIES\n #define PEXPERT_NO_3X_IMAGES           1\n #endif \/* ARM64_BOARD_CONFIG_T8006 *\/\n@@ -169,8 +169,8 @@\n #define T8020_DART_ALLOW_BYPASS        (1 &lt;&lt; 1) \/* DART allows translation bypass in certain cases *\/\n #define XNU_MONITOR_NVME_PPL           1 \/* NVMe PPL plugin for secure pmap runtime *\/\n #define XNU_MONITOR_ANS2_SART          1 \/* ANS2 SART plugin for secure pmap runtime *\/\n-#define PMAP_CS                        1\n-#define PMAP_CS_ENABLE                 1\n+\/\/#define PMAP_CS                        1\n+\/\/#define PMAP_CS_ENABLE                 1\n #endif  \/* ARM64_BOARD_CONFIG_T8027 *\/\n \n #ifdef ARM64_BOARD_CONFIG_T8028\n@@ -185,8 +185,8 @@\n #define T8020_DART_ALLOW_BYPASS        (1 &lt;&lt; 1) \/* DART allows translation bypass in certain cases *\/\n #define XNU_MONITOR_NVME_PPL           1 \/* NVMe PPL plugin for secure pmap runtime *\/\n #define XNU_MONITOR_ANS2_SART          1 \/* ANS2 SART plugin for secure pmap runtime *\/\n-#define PMAP_CS                        1\n-#define PMAP_CS_ENABLE                 1\n+\/\/#define PMAP_CS                        1\n+\/\/#define PMAP_CS_ENABLE                 1\n #endif  \/* ARM64_BOARD_CONFIG_T8028 *\/\n \n #ifdef ARM64_BOARD_CONFIG_T8030\n@@ -202,8 +202,8 @@\n #define XNU_MONITOR_NVME_PPL           1 \/* NVMe PPL plugin for secure pmap runtime *\/\n #define XNU_MONITOR_ANS2_SART          1 \/* ANS2 SART plugin for secure pmap runtime *\/\n #define XNU_MONITOR_UAT_PPL            1 \/* UAT PPL plugin for secure pmap runtime *\/\n-#define PMAP_CS                        1\n-#define PMAP_CS_ENABLE                 1\n+\/\/#define PMAP_CS                        1\n+\/\/#define PMAP_CS_ENABLE                 1\n #endif  \/* ARM64_BOARD_CONFIG_T8030 *\/\n<\/code><\/pre>\n\n\n\n<p>The build command line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>make SDKROOT=iphoneos  ARCH_CONFIGS=ARM64 KERNEL_CONFIGS=DEBUG MACHINE_CONFIGS=T8010 ARCH_STRING_FOR_CURRENT_MACHINE_CONFIG=arm64 USE_WERROR=0<\/code><\/pre>\n\n\n\n<p>Of course, without kexts that&#8217;s not very useful for now&#8230; and most macOS arm64 stuff isn&#8217;t included yet.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Assuming that instructions from https:\/\/kernelshaman.blogspot.com\/2021\/01\/building-xnu-for-macos-big-sur-1101.html were already followed including for the iPhoneOS target&#8230; The patch: The build command line: Of course, without kexts that&#8217;s not very useful for now&#8230; and most macOS arm64 stuff isn&#8217;t included yet.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":2,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":116,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts\/114\/revisions\/116"}],"wp:attachment":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}