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,914 **** } #ifdef _KMDB /* ARGSUSED */ static int ! crregs_dcmd(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) { ulong_t cr0, cr2, cr3, cr4; 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 }, --- 902,916 ---- } #ifdef _KMDB /* ARGSUSED */ static int ! 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,960 **** --- 953,965 ---- 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,973 **** --- 969,981 ---- 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,1005 **** { "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 }, #endif { NULL } }; static const mdb_walker_t walkers[] = { --- 1003,1013 ---- { "scalehrtime", ":", "scale an unscaled high-res time", scalehrtime_cmd }, { "x86_featureset", NULL, "dump the x86_featureset vector", x86_featureset_cmd }, #ifdef _KMDB ! { "sysregs", NULL, "dump system registers", sysregs_dcmd }, #endif { NULL } }; static const mdb_walker_t walkers[] = {