:: commit 928f18905ccb477bf09b2ccca4b993c9972d07e3

Mintsuki <mintsuki@protonmail.com> — 2026-02-20 20:45

parents: 9fed600b1b

protos/limine: Implement x86-64 Keep IOMMU feature

diff --git a/bootstrap b/bootstrap
index 9fd1cbe9..3b380481 100755
--- a/bootstrap
+++ b/bootstrap
@@ -85,7 +85,7 @@ if ! test -f version; then
     clone_repo_commit \
         https://codeberg.org/Limine/limine-protocol.git \
         limine-protocol \
-        c76af54a01663d89a74c35b725f79d8af77eb811
+        aa0fe82730f9a6ea09794503cdf6361be15d66a6
 
     clone_repo_commit \
         https://codeberg.org/PicoEFI/PicoEFI.git \
diff --git a/common/protos/limine.c b/common/protos/limine.c
index 421c9c23..8d38a7af 100644
--- a/common/protos/limine.c
+++ b/common/protos/limine.c
@@ -904,6 +904,24 @@ FEAT_START
     entrypoint_request->response = reported_addr(entrypoint_response);
 FEAT_END
 
+    // x86-64 Keep IOMMU feature
+#if defined (__x86_64__) || defined (__i386__)
+    bool keep_iommu = false;
+FEAT_START
+    struct limine_x86_64_keep_iommu_request *keep_iommu_request =
+        get_request(LIMINE_X86_64_KEEP_IOMMU_REQUEST_ID);
+    if (keep_iommu_request == NULL) {
+        break;
+    }
+
+    struct limine_x86_64_keep_iommu_response *keep_iommu_response =
+        ext_mem_alloc(sizeof(struct limine_x86_64_keep_iommu_response));
+
+    keep_iommu_request->response = reported_addr(keep_iommu_response);
+    keep_iommu = true;
+FEAT_END
+#endif
+
     // Bootloader info feature
 FEAT_START
     struct limine_bootloader_info_request *bootloader_info_request = get_request(LIMINE_BOOTLOADER_INFO_REQUEST_ID);
@@ -1666,7 +1684,9 @@ FEAT_END
     rm_int(0x15, &r, &r);
 #endif
 
-    iommu_disable_all();
+    if (!keep_iommu) {
+        iommu_disable_all();
+    }
 
     pic_mask_all();
     io_apic_mask_all(base_revision >= 5);
tab: 248 wrap: offon