Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c	(revision 60681)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c	(revision 60682)
@@ -1392,4 +1392,5 @@
     uint8_t             bFiller;
     int                 off;
+    int                 off2;
     unsigned            cb;
     uint8_t BS3_FAR    *pbTest;
@@ -1881,8 +1882,66 @@
      * Check non-canonical 64-bit space.
      */
-    if (BS3_MODE_IS_64BIT_CODE(bTestMode))
-    {
-
-    }
+    if (   BS3_MODE_IS_64BIT_CODE(bTestMode)
+        && (pbTest = (uint8_t BS3_FAR *)Bs3PagingSetupCanonicalTraps()) != NULL)
+    {
+        /* Make our references relative to the gap. */
+        pbTest += g_cbBs3PagingOneCanonicalTrap;
+
+        /* Hit it from below. */
+        for (off = -cbIdtr - 8; off < cbIdtr + 8; off++)
+        {
+            Ctx.rbx.u = CtxUdExpected.rbx.u = UINT64_C(0x0000800000000000) + off;
+            Bs3MemSet(&pbTest[-64], bFiller, 64*2);
+            Bs3TrapSetJmpAndRestore(&Ctx, &TrapCtx);
+            if (off + cbIdtr <= 0)
+            {
+                bs3CpuBasic2_CompareUdCtx(&TrapCtx, &CtxUdExpected);
+                if (Bs3MemCmp(&pbTest[off], pabExpected, cbIdtr) != 0)
+                    Bs3TestFailedF("Mismatch (#21): expected %.*Rhxs, got %.*Rhxs\n", cbIdtr, pabExpected, cbIdtr, &pbTest[off]);
+            }
+            else
+            {
+                bs3CpuBasic2_CompareGpCtx(&TrapCtx, &Ctx, 0);
+                if (off <= -2 && Bs3MemCmp(&pbTest[off], pabExpected, 2) != 0)
+                    Bs3TestFailedF("Mismatch (#21): expected limit %.2Rhxs, got %.2Rhxs\n", pabExpected, &pbTest[off]);
+                off2 = off <= -2 ? 2 : 0;
+                cb   = cbIdtr - off2;
+                if (!ASMMemIsAllU8(&pbTest[off + off2], cb, bFiller))
+                    Bs3TestFailedF("Mismatch (#21): touched base %.*Rhxs, got %.*Rhxs\n",
+                                   cb, &pabExpected[off], cb, &pbTest[off + off2]);
+            }
+            if (!ASMMemIsAllU8(&pbTest[off - 16], 16, bFiller))
+                Bs3TestFailedF("Leading bytes touched (#21): bFiller=%#x, got %.16Rhxs\n", bFiller, &pbTest[off]);
+            if (!ASMMemIsAllU8(&pbTest[off + cbIdtr], 16, bFiller))
+                Bs3TestFailedF("Trailing bytes touched (#21): bFiller=%#x, got %.16Rhxs\n", bFiller, &pbTest[off + cbIdtr]);
+        }
+
+        /* Hit it from above. */
+        for (off = -cbIdtr - 8; off < cbIdtr + 8; off++)
+        {
+            Ctx.rbx.u = CtxUdExpected.rbx.u = UINT64_C(0xffff800000000000) + off;
+            Bs3MemSet(&pbTest[-64], bFiller, 64*2);
+            Bs3TrapSetJmpAndRestore(&Ctx, &TrapCtx);
+            if (off >= 0)
+            {
+                bs3CpuBasic2_CompareUdCtx(&TrapCtx, &CtxUdExpected);
+                if (Bs3MemCmp(&pbTest[off], pabExpected, cbIdtr) != 0)
+                    Bs3TestFailedF("Mismatch (#22): expected %.*Rhxs, got %.*Rhxs\n", cbIdtr, pabExpected, cbIdtr, &pbTest[off]);
+            }
+            else
+            {
+                bs3CpuBasic2_CompareGpCtx(&TrapCtx, &Ctx, 0);
+                if (!ASMMemIsAllU8(&pbTest[off], cbIdtr, bFiller))
+                    Bs3TestFailedF("Mismatch (#22): touched base %.*Rhxs, got %.*Rhxs\n",
+                                   cbIdtr, &pabExpected[off], cbIdtr, &pbTest[off]);
+            }
+            if (!ASMMemIsAllU8(&pbTest[off - 16], 16, bFiller))
+                Bs3TestFailedF("Leading bytes touched (#22): bFiller=%#x, got %.16Rhxs\n", bFiller, &pbTest[off]);
+            if (!ASMMemIsAllU8(&pbTest[off + cbIdtr], 16, bFiller))
+                Bs3TestFailedF("Trailing bytes touched (#22): bFiller=%#x, got %.16Rhxs\n", bFiller, &pbTest[off + cbIdtr]);
+        }
+
+    }
+
 }
 
@@ -2161,5 +2220,5 @@
 BS3_DECL_FAR(uint8_t) TMPL_NM(bs3CpuBasic2_sidt)(uint8_t bMode)
 {
-if (bMode == BS3_MODE_LM64)
+//if (bMode == BS3_MODE_LM64)
 {
     union
@@ -2194,5 +2253,5 @@
 BS3_DECL_FAR(uint8_t) TMPL_NM(bs3CpuBasic2_sgdt)(uint8_t bMode)
 {
-if (bMode == BS3_MODE_LM64)
+//if (bMode == BS3_MODE_LM64)
 {
     union
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk	(revision 60681)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk	(revision 60682)
@@ -87,4 +87,5 @@
        bs3-cmn-PagingInitRootForLM.c \
        bs3-cmn-PagingProtect.c \
+       bs3-cmn-PagingSetupCanonicalTraps.c \
        bs3-cmn-PicMaskAll.c \
        bs3-cmn-RegCtxRestore.asm \
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingData.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingData.c	(revision 60681)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingData.c	(revision 60682)
@@ -42,4 +42,8 @@
 uint32_t g_PhysPagingRootLM  = UINT32_MAX;
 
+uint32_t g_uBs3PagingCanonicalTrapsAddr = UINT32_MAX;
+uint16_t g_cbBs3PagingCanonicalTraps    = 0;
+uint16_t g_cbBs3PagingOneCanonicalTrap  = 0;
+
 #endif
 
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingProtect.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingProtect.c	(revision 60681)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingProtect.c	(revision 60682)
@@ -93,8 +93,5 @@
                 {
                     if (pPD->a[iPde].u <= uMaxAddr)
-                    {
                         pPTE = &((X86PT BS3_FAR *)Bs3XptrFlatToCurrent(pPD->a[iPde].u & ~(uint32_t)PAGE_OFFSET_MASK))->a[iPte];
-                        *prc = VINF_SUCCESS;
-                    }
                     else
                         BS3PAGING_DPRINTF1(("bs3PagingGetLegacyPte: out of range! iPde=%#x: %#x\n", iPde, pPD->a[iPde].u));
@@ -122,5 +119,4 @@
                             ASMInvalidatePage(uFlat);
                         pPTE = &pPT->a[iPte];
-                        *prc = VINF_SUCCESS;
                     }
                 }
@@ -134,6 +130,17 @@
 
 
+/**
+ * Get the PTE for an address, given a PAE or long mode CR3.
+ *
+ * @returns Pointer to the PTE on success, NULL on failure.
+ * @param   cr3                 The CR3.
+ * @param   bMode               Indicates whether it's PAE or long mode.
+ * @param   uFlat               The address for which we want the PTE.
+ * @param   fUseInvlPg          Whether we can use invalidate page when
+ *                              replacing large pages.
+ * @param   prc                 Updated only on failure.
+ */
 #undef bs3PagingGetPte
-BS3_CMN_DEF(X86PTEPAE BS3_FAR *, bs3PagingGetPte,(RTCCUINTXREG cr3, uint64_t uFlat, bool fUseInvlPg, int *prc))
+BS3_CMN_DEF(X86PTEPAE BS3_FAR *, bs3PagingGetPte,(RTCCUINTXREG cr3, uint8_t bMode, uint64_t uFlat, bool fUseInvlPg, int *prc))
 {
     X86PTEPAE BS3_FAR  *pPTE = NULL;
@@ -148,5 +155,5 @@
     {
         X86PDPAE BS3_FAR *pPD;
-        if (BS3_MODE_IS_64BIT_SYS(g_bBs3CurrentMode))
+        if (BS3_MODE_IS_64BIT_SYS(bMode))
         {
             unsigned const   iPml4e = (uFlat >> X86_PML4_SHIFT) & X86_PML4_MASK;
@@ -206,8 +213,5 @@
             {
                 if ((pPD->a[iPde].u & X86_PDE_PAE_PG_MASK) <= uMaxAddr)
-                {
                     pPTE = &((X86PTPAE BS3_FAR *)Bs3XptrFlatToCurrent(pPD->a[iPde].u & ~(uint64_t)PAGE_OFFSET_MASK))->a[iPte];
-                    *prc = VINF_SUCCESS;
-                }
                 else
                     BS3PAGING_DPRINTF1(("bs3PagingGetPte: out of range! iPde=%#x: %RX64 max=%RX32\n",
@@ -233,5 +237,4 @@
                         ASMInvalidatePage(uFlat);
                     pPTE = &pPT->a[iPte];
-                    *prc = VINF_SUCCESS;
                 }
             }
@@ -304,5 +307,5 @@
             while (cb > 0)
             {
-                PX86PTEPAE pPte = BS3_CMN_FAR_NM(bs3PagingGetPte)(cr3, uFlat, fUseInvlPg, &rc);
+                PX86PTEPAE pPte = BS3_CMN_FAR_NM(bs3PagingGetPte)(cr3, g_bBs3CurrentMode, uFlat, fUseInvlPg, &rc);
                 if (!pPte)
                     return rc;
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingSetupCanonicalTraps.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingSetupCanonicalTraps.c	(revision 60682)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-PagingSetupCanonicalTraps.c	(revision 60682)
@@ -0,0 +1,112 @@
+/* $Id$ */
+/** @file
+ * BS3Kit - Bs3PagingSetupCanonicalTraps
+ */
+
+/*
+ * Copyright (C) 2007-2016 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#include "bs3kit-template-header.h"
+#include "bs3-cmn-paging.h"
+#include "iprt/asm-amd64-x86.h"
+
+
+#undef Bs3PagingSetupCanonicalTraps
+BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3PagingSetupCanonicalTraps,(void))
+{
+    if (g_uBs3CpuDetected & BS3CPU_F_LONG_MODE)
+    {
+#if ARCH_BITS == 16
+        if (!BS3_MODE_IS_RM_OR_V86(g_bBs3CurrentMode))
+#endif
+        {
+            uint8_t BS3_FAR   *pb;
+            X86PTEPAE BS3_FAR *paLoPtes;
+            X86PTEPAE BS3_FAR *paHiPtes;
+            int                rc;
+
+            /* Already initialized? Likely. */
+            if (g_cbBs3PagingCanonicalTraps != 0)
+                return Bs3XptrFlatToCurrent(g_uBs3PagingCanonicalTrapsAddr);
+
+            /* Initialize AMD64 page tables if necessary (unlikely). */
+            if (g_PhysPagingRootLM == UINT32_MAX)
+            {
+                rc = Bs3PagingInitRootForLM();
+                if (RT_FAILURE(rc))
+                    return NULL;
+            }
+
+            /*
+             * Get the page table entries first to avoid having to unmap things.
+             */
+            paLoPtes = bs3PagingGetPte(g_PhysPagingRootLM, BS3_MODE_LM64, UINT64_C(0x00007fffffffe000), false, &rc);
+            paHiPtes = bs3PagingGetPte(g_PhysPagingRootLM, BS3_MODE_LM64, UINT64_C(0xffff800000000000), false, &rc);
+            if (!paHiPtes || !paLoPtes)
+            {
+                Bs3TestPrintf("warning: Bs3PagingSetupCanonicalTraps - failed to get PTEs!\n");
+                return NULL;
+            }
+
+            /*
+             * Allocate the buffer. Currently using 8KB on each side.
+             */
+            pb = (uint8_t BS3_FAR *)Bs3MemAlloc(BS3MEMKIND_TILED, X86_PAGE_SIZE * 4);
+            if (pb)
+            {
+                RTCCUINTXREG uFlat = Bs3SelPtrToFlat(pb);
+
+                /*
+                 * Inject it into the page tables.
+                 */
+                paLoPtes[0].u &= ~X86_PTE_PAE_PG_MASK;
+                paLoPtes[0].u |= uFlat + X86_PAGE_SIZE * 0;
+                paLoPtes[1].u &= ~X86_PTE_PAE_PG_MASK;
+                paLoPtes[1].u |= uFlat + X86_PAGE_SIZE * 1;
+
+                paHiPtes[0].u &= ~X86_PTE_PAE_PG_MASK;
+                paHiPtes[0].u |= uFlat + X86_PAGE_SIZE * 2;
+                paHiPtes[1].u &= ~X86_PTE_PAE_PG_MASK;
+                paHiPtes[1].u |= uFlat + X86_PAGE_SIZE * 3;
+                ASMReloadCR3();
+
+                /*
+                 * Update globals and return successfully.
+                 */
+                g_uBs3PagingCanonicalTrapsAddr = uFlat;
+                g_cbBs3PagingCanonicalTraps    = X86_PAGE_SIZE * 4;
+                g_cbBs3PagingOneCanonicalTrap  = X86_PAGE_SIZE * 2;
+                return pb;
+            }
+
+            Bs3TestPrintf("warning: Bs3PagingSetupCanonicalTraps - out of memory (mode %#x)\n", g_bBs3CurrentMode);
+        }
+#if ARCH_BITS == 16
+        else
+            Bs3TestPrintf("warning: Bs3PagingSetupCanonicalTraps was called in RM or V86 mode (%#x)!\n", g_bBs3CurrentMode);
+#endif
+    }
+    return NULL;
+}
+
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSub.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSub.c	(revision 60681)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSub.c	(revision 60682)
@@ -53,4 +53,5 @@
     g_cusBs3SubTestAtErrors = g_cusBs3TestErrors;
     BS3_ASSERT(!g_fbBs3SubTestSkipped);
+    g_cusBs3SubTests++;
 
     /*
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-paging.h
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-paging.h	(revision 60681)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-paging.h	(revision 60682)
@@ -31,34 +31,25 @@
 #include <iprt/asm.h>
 
-RT_C_DECLS_BEGIN;
+RT_C_DECLS_BEGIN
 
 /** Root directory for page protected mode.
  * UINT32_MAX if not initialized. */
-#ifndef DOXYGEN_RUNNING
-# define g_PhysPagingRootPP BS3_DATA_NM(g_PhysPagingRootPP)
-#endif
 extern uint32_t g_PhysPagingRootPP;
 /** Root directory pointer table for PAE mode.
  * UINT32_MAX if not initialized. */
-#ifndef DOXYGEN_RUNNING
-# define g_PhysPagingRootPAE BS3_DATA_NM(g_PhysPagingRootPAE)
-#endif
 extern uint32_t g_PhysPagingRootPAE;
 /** Root table (level 4) for long mode.
  * UINT32_MAX if not initialized. */
-#ifndef DOXYGEN_RUNNING
-# define g_PhysPagingRootLM BS3_DATA_NM(g_PhysPagingRootLM)
-#endif
 extern uint32_t g_PhysPagingRootLM;
 
-RT_C_DECLS_END;
+#undef bs3PagingGetLegacyPte
+BS3_CMN_PROTO_STUB(X86PTE BS3_FAR *, bs3PagingGetLegacyPte,(RTCCUINTXREG cr3, uint32_t uFlat, bool fUseInvlPg, int *prc));
+#undef bs3PagingGetPte
+BS3_CMN_PROTO_STUB(X86PTEPAE BS3_FAR *, bs3PagingGetPte,(RTCCUINTXREG cr3, uint8_t bMode, uint64_t uFlat,
+                                                         bool fUseInvlPg, int *prc));
 
+RT_C_DECLS_END
 
-#define bs3PagingGetLegacyPte BS3_CMN_NM(bs3PagingGetLegacyPte)
-BS3_DECL(X86PTE BS3_FAR *) bs3PagingGetLegacyPte(RTCCUINTXREG cr3, uint32_t uFlat, bool fUseInvlPg, int *prc);
-
-#define bs3PagingGetPte BS3_CMN_NM(bs3PagingGetPte)
-BS3_DECL(X86PTEPAE BS3_FAR *) bs3PagingGetPte(RTCCUINTXREG cr3, uint64_t uFlat, bool fUseInvlPg, int *prc);
-
+#include "bs3kit-mangling-code.h"
 
 #endif
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk	(revision 60681)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-autostubs.kmk	(revision 60682)
@@ -61,4 +61,5 @@
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemMove)
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3MemPCpy)
+$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3PagingSetupCanonicalTraps)
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAlloc)
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3SlabAllocEx)
@@ -109,3 +110,5 @@
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3UInt32Div)
 $(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,Bs3UInt64Div)
+$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,bs3PagingGetLegacyPte)
+$(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,bs3PagingGetPte)
 $(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,Bs3TrapInit)
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h	(revision 60681)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h	(revision 60682)
@@ -47,4 +47,6 @@
 #define Bs3MemSet BS3_CMN_MANGLER(Bs3MemSet)
 #define Bs3MemZero BS3_CMN_MANGLER(Bs3MemZero)
+#define bs3PagingGetLegacyPte BS3_CMN_MANGLER(bs3PagingGetLegacyPte)
+#define bs3PagingGetPte BS3_CMN_MANGLER(bs3PagingGetPte)
 #define Bs3PagingInitRootForLM BS3_CMN_MANGLER(Bs3PagingInitRootForLM)
 #define Bs3PagingInitRootForPAE BS3_CMN_MANGLER(Bs3PagingInitRootForPAE)
@@ -52,4 +54,5 @@
 #define Bs3PagingProtect BS3_CMN_MANGLER(Bs3PagingProtect)
 #define Bs3PagingProtectPtr BS3_CMN_MANGLER(Bs3PagingProtectPtr)
+#define Bs3PagingSetupCanonicalTraps BS3_CMN_MANGLER(Bs3PagingSetupCanonicalTraps)
 #define Bs3Panic BS3_CMN_MANGLER(Bs3Panic)
 #define Bs3PicMaskAll BS3_CMN_MANGLER(Bs3PicMaskAll)
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h	(revision 60681)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h	(revision 60682)
@@ -47,4 +47,6 @@
 #undef Bs3MemSet
 #undef Bs3MemZero
+#undef bs3PagingGetLegacyPte
+#undef bs3PagingGetPte
 #undef Bs3PagingInitRootForLM
 #undef Bs3PagingInitRootForPAE
@@ -52,4 +54,5 @@
 #undef Bs3PagingProtect
 #undef Bs3PagingProtectPtr
+#undef Bs3PagingSetupCanonicalTraps
 #undef Bs3Panic
 #undef Bs3PicMaskAll
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h	(revision 60681)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h	(revision 60682)
@@ -2137,4 +2137,23 @@
 BS3_CMN_PROTO_STUB(int, Bs3PagingProtectPtr,(void BS3_FAR *pv, size_t cb, uint64_t fSet, uint64_t fClear));
 
+/** The physical / flat address of the buffer backing the canonical traps.
+ * This buffer is spread equally on each side of the 64-bit non-canonical
+ * address divide.  Non-64-bit code can use this to setup trick shots and
+ * inspect their results. */
+extern uint32_t g_uBs3PagingCanonicalTrapsAddr;
+/** The size of the buffer at g_uPagingCanonicalTraps (both sides). */
+extern uint16_t g_cbBs3PagingCanonicalTraps;
+/** The size of one trap buffer (low or high).
+ * This is g_cbBs3PagingCanonicalTraps divided by two. */
+extern uint16_t g_cbBs3PagingOneCanonicalTrap;
+
+/**
+ * Sets up the 64-bit canonical address space trap buffers, if neceessary.
+ *
+ * @returns Pointer to the buffers (i.e. the first page of the low one) on
+ *          success.  NULL on failure.
+ */
+BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3PagingSetupCanonicalTraps,(void));
+
 /**
  * Waits for the keyboard controller to become ready.
