From a4838386e6b24fd831847ae7fcdc7ea00e4f8130 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 10 Sep 2024 16:19:16 +0300 Subject: [PATCH] Kernel: Remove unnecessary branch from uncanonicalizing addresses --- kernel/arch/x86_64/PageTable.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/arch/x86_64/PageTable.cpp b/kernel/arch/x86_64/PageTable.cpp index 3fe85a40..f1aa7e7c 100644 --- a/kernel/arch/x86_64/PageTable.cpp +++ b/kernel/arch/x86_64/PageTable.cpp @@ -37,9 +37,7 @@ namespace Kernel static constexpr inline uintptr_t uncanonicalize(uintptr_t addr) { - if (addr & 0x0000800000000000) - return addr & ~0xFFFF000000000000; - return addr; + return addr & 0x0000FFFFFFFFFFFF; } static constexpr inline uintptr_t canonicalize(uintptr_t addr)