Index: trunk/include/VBox/vmm/dbgf.h
===================================================================
--- trunk/include/VBox/vmm/dbgf.h	(revision 54106)
+++ trunk/include/VBox/vmm/dbgf.h	(revision 54218)
@@ -1551,4 +1551,6 @@
     /** Thread info. */
     DBGFOSINTERFACE_THREAD,
+    /** Kernel message log - DBGFOSIDMESG. */
+    DBGFOSINTERFACE_DMESG,
     /** The end of the valid entries. */
     DBGFOSINTERFACE_END,
@@ -1658,4 +1660,7 @@
      * This is called after pfnProbe.
      *
+     * The returned interface must be valid until pfnDestruct is called.  Two calls
+     * to this method with the same @a enmIf value must return the same pointer.
+     *
      * @returns Pointer to the interface if available, NULL if not available.
      * @param   pUVM    The user mode VM handle.
@@ -1676,4 +1681,47 @@
 #define DBGFOSREG_MAGIC     0x19830808
 
+
+/**
+ * Interface for querying kernel log messages (DBGFOSINTERFACE_DMESG).
+ */
+typedef struct DBGFOSIDMESG
+{
+    /** Trailing magic (DBGFOSIDMESG_MAGIC). */
+    uint32_t    u32Magic;
+
+    /**
+     * Query the kernel log.
+     *
+     * @returns VBox status code.
+     * @retval  VERR_NOT_FOUND if the messages could not be located.
+     * @retval  VERR_INVALID_STATE if the messages was found to have unknown/invalid
+     *          format.
+     * @retval  VERR_BUFFER_OVERFLOW if the buffer isn't large enough, pcbActual
+     *          will be set to the required buffer size.  The buffer, however, will
+     *          be filled with as much data as it can hold (properly zero terminated
+     *          of course).
+     *
+     * @param   pThis       Pointer to the interface structure.
+     * @param   pUVM        The user mode VM handle.
+     * @param   fFlags      Flags reserved for future use, MBZ.
+     * @param   cMessages   The number of messages to retrieve, counting from the
+     *                      end of the log (i.e. like tail), use UINT32_MAX for all.
+     * @param   pszBuf      The output buffer.
+     * @param   cbBuf       The buffer size.
+     * @param   pcbActual   Where to store the number of bytes actually returned,
+     *                      including zero terminator.  On VERR_BUFFER_OVERFLOW this
+     *                      holds the necessary buffer size.  Optional.
+     */
+    DECLCALLBACKMEMBER(int, pfnQueryKernelLog)(struct DBGFOSIDMESG *pThis, PUVM pUVM, uint32_t fFlags, uint32_t cMessages,
+                                               char *pszBuf, size_t cbBuf, size_t *pcbActual);
+    /** Trailing magic (DBGFOSIDMESG_MAGIC). */
+    uint32_t    u32EndMagic;
+} DBGFOSIDMESG;
+/** Pointer to the interface for query kernel log messages (DBGFOSINTERFACE_DMESG). */
+typedef DBGFOSIDMESG *PDBGFOSIDMESG;
+/** Magic value for DBGFOSIDMESG::32Magic and DBGFOSIDMESG::u32EndMagic. (Kenazburo Oe) */
+#define DBGFOSIDMESG_MAGIC UINT32_C(0x19350131)
+
+
 VMMR3DECL(int)      DBGFR3OSRegister(PUVM pUVM, PCDBGFOSREG pReg);
 VMMR3DECL(int)      DBGFR3OSDeregister(PUVM pUVM, PCDBGFOSREG pReg);
Index: trunk/include/VBox/vmm/uvm.h
===================================================================
--- trunk/include/VBox/vmm/uvm.h	(revision 54106)
+++ trunk/include/VBox/vmm/uvm.h	(revision 54218)
@@ -143,5 +143,5 @@
         struct DBGFUSERPERVM    s;
 #endif
-        uint8_t                 padding[256];
+        uint8_t                 padding[384];
     } dbgf;
 
@@ -167,4 +167,12 @@
                          RT_VALID_ALIGNED_PTR(a_pUVM, PAGE_SIZE) ? (a_pUVM)->u32Magic : 0), \
                         (a_rc))
+/** @def UVM_ASSERT_VALID_EXT_RETURN
+ * Asserts a user mode VM handle is valid for external access.
+ */
+#define UVM_ASSERT_VALID_EXT_RETURN_VOID(a_pUVM) \
+        AssertMsgReturnVoid(    RT_VALID_ALIGNED_PTR(a_pUVM, PAGE_SIZE) \
+                            &&  (a_pUVM)->u32Magic == UVM_MAGIC, \
+                            ("a_pUVM=%p u32Magic=%#x\n", (a_pUVM), \
+                             RT_VALID_ALIGNED_PTR(a_pUVM, PAGE_SIZE) ? (a_pUVM)->u32Magic : 0))
 
 #endif
