Print this page
9723 provide support for VMM's GDT handling
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>

@@ -902,13 +902,15 @@
 }
 
 #ifdef _KMDB
 /* ARGSUSED */
 static int
-crregs_dcmd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
+sysregs_dcmd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
 {
         ulong_t cr0, cr2, cr3, cr4;
+        desctbr_t gdtr;
+
         static const mdb_bitmask_t cr0_flag_bits[] = {
                 { "PE",         CR0_PE,         CR0_PE },
                 { "MP",         CR0_MP,         CR0_MP },
                 { "EM",         CR0_EM,         CR0_EM },
                 { "TS",         CR0_TS,         CR0_TS },

@@ -951,10 +953,13 @@
 
         cr0 = kmdb_unix_getcr0();
         cr2 = kmdb_unix_getcr2();
         cr3 = kmdb_unix_getcr3();
         cr4 = kmdb_unix_getcr4();
+
+        kmdb_unix_getgdtr(&gdtr);
+
         mdb_printf("%%cr0 = 0x%lx <%b>\n", cr0, cr0, cr0_flag_bits);
         mdb_printf("%%cr2 = 0x%lx <%a>\n", cr2, cr2);
 
         if ((cr4 & CR4_PCIDE)) {
                 mdb_printf("%%cr3 = 0x%lx <pfn:0x%lx pcid:%lu>\n", cr3,

@@ -964,10 +969,13 @@
                     cr3 >> MMU_PAGESHIFT, cr3, cr3_flag_bits);
         }
 
         mdb_printf("%%cr4 = 0x%lx <%b>\n", cr4, cr4, cr4_flag_bits);
 
+        mdb_printf("%%gdtr.base = 0x%lx, %%gdtr.limit = 0x%hx\n",
+            gdtr.dtr_base, gdtr.dtr_limit);
+
         return (DCMD_OK);
 }
 #endif
 
 static const mdb_dcmd_t dcmds[] = {

@@ -995,11 +1003,11 @@
         { "scalehrtime", ":",
             "scale an unscaled high-res time", scalehrtime_cmd },
         { "x86_featureset", NULL, "dump the x86_featureset vector",
                 x86_featureset_cmd },
 #ifdef _KMDB
-        { "crregs", NULL, "dump control registers", crregs_dcmd },
+        { "sysregs", NULL, "dump system registers", sysregs_dcmd },
 #endif
         { NULL }
 };
 
 static const mdb_walker_t walkers[] = {