Index: kernel/arch/amd64/src/mm/page.c
===================================================================
--- kernel/arch/amd64/src/mm/page.c	(revision 7e752b2a0d66c871748e5fa9e8bbe3a27c70a202)
+++ kernel/arch/amd64/src/mm/page.c	(revision 9d4e1704695fcf4bdd0d097a2dc12155e07a840f)
@@ -46,28 +46,32 @@
 #include <panic.h>
 #include <align.h>
+#include <macros.h>
 
 void page_arch_init(void)
 {
-	if (config.cpu_active == 1) {
-		uintptr_t cur;
-		unsigned int identity_flags =
-		    PAGE_CACHEABLE | PAGE_EXEC | PAGE_GLOBAL | PAGE_WRITE;
+	if (config.cpu_active > 1) {
+		write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
+		return;
+	}
+
+	uintptr_t cur;
+	unsigned int identity_flags =
+	    PAGE_CACHEABLE | PAGE_EXEC | PAGE_GLOBAL | PAGE_WRITE;
 		
-		page_mapping_operations = &pt_mapping_operations;
+	page_mapping_operations = &pt_mapping_operations;
 		
-		page_table_lock(AS_KERNEL, true);
+	page_table_lock(AS_KERNEL, true);
 		
-		/*
-		 * PA2KA(identity) mapping for all frames.
-		 */
-		for (cur = 0; cur < last_frame; cur += FRAME_SIZE)
-			page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, identity_flags);
+	/*
+	 * PA2KA(identity) mapping for all frames.
+	 */
+	for (cur = 0; cur < min(config.identity_size, last_frame);
+	    cur += FRAME_SIZE)
+		page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, identity_flags);
 		
-		page_table_unlock(AS_KERNEL, true);
+	page_table_unlock(AS_KERNEL, true);
 		
-		exc_register(14, "page_fault", true, (iroutine_t) page_fault);
-		write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
-	} else
-		write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
+	exc_register(14, "page_fault", true, (iroutine_t) page_fault);
+	write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
 }
 
