x86: Show epte value when printing the kpte.
authorRonald G. Minnich <rminnich@gmail.com>
Fri, 12 Jun 2015 21:35:10 +0000 (14:35 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 18 Jun 2015 20:10:47 +0000 (16:10 -0400)
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Git-fu'd-by: brho

kern/arch/x86/cpuinfo.c

index 5e330be..93efe02 100644 (file)
@@ -177,9 +177,9 @@ void show_mapping(pgdir_t pgdir, uintptr_t start, size_t size)
        page_t *page;
        uintptr_t i;
 
-       printk("   %sVirtual    %sPhysical  Ps Dr Ac CD WT U W P\n", BIT_SPACING,
-              BIT_SPACING);
-       printk("--------------------------------------------%s\n", BIT_DASHES);
+       printk("   %sVirtual    %sPhysical  Ps Dr Ac CD WT U W P EPTE\n",
+              BIT_SPACING, BIT_SPACING);
+       printk("-------------------------------------------------%s\n", BIT_DASHES);
        for(i = 0; i < size; i += PGSIZE, start += PGSIZE) {
                pte = pgdir_walk(pgdir, (void*)start, 0);
                printk("%p  ", start);
@@ -193,7 +193,7 @@ void show_mapping(pgdir_t pgdir, uintptr_t start, size_t size)
                         * UVPT mapping requires the U to see interior pages (but have W
                         * off). */
                        perm = get_va_perms(pgdir, (void*)start);
-                       printk("%p  %1d  %1d  %1d  %1d  %1d  %1d %1d %1d\n",
+                       printk("%p  %1d  %1d  %1d  %1d  %1d  %1d %1d %1d 0x%llx\n",
                               pte_get_paddr(pte),
                               pte_is_jumbo(pte),
                               pte_is_dirty(pte),
@@ -202,7 +202,8 @@ void show_mapping(pgdir_t pgdir, uintptr_t start, size_t size)
                               (pte_print(pte) & PTE_PWT) / PTE_PWT,
                               (perm & PTE_U) / PTE_U,
                               (perm & PTE_W) / PTE_W,
-                              pte_is_present(pte));
+                              pte_is_present(pte),
+                              *(unsigned long*)kpte_to_epte(pte));
                } else {
                        printk("%p\n", 0);
                }