x86: Maps in the full LAPIC and IOAPIC size (XCC)
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 6 Mar 2014 06:34:39 +0000 (22:34 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 6 Mar 2014 06:38:41 +0000 (22:38 -0800)
MP spec says they are 1MB in size, not one page.  This changes a kernel
header, though not part userspace cares about.

kern/arch/x86/pmap32.c
kern/arch/x86/pmap64.c
kern/arch/x86/ros/mmu32.h
kern/arch/x86/ros/mmu64.h

index 1fc9068..526202b 100644 (file)
@@ -211,10 +211,10 @@ vm_init(void)
 
        // APIC mapping: using PAT (but not *the* PAT flag) to make these type UC
        // IOAPIC
-       boot_map_segment(pgdir, IOAPIC_BASE, PGSIZE, IOAPIC_PBASE, 
+       boot_map_segment(pgdir, IOAPIC_BASE, APIC_SIZE, IOAPIC_PBASE,
                         PTE_PCD | PTE_PWT | PTE_W | PTE_G);
        // Local APIC
-       boot_map_segment(pgdir, LAPIC_BASE, PGSIZE, LAPIC_PBASE,
+       boot_map_segment(pgdir, LAPIC_BASE, APIC_SIZE, LAPIC_PBASE,
                         PTE_PCD | PTE_PWT | PTE_W | PTE_G);
 
        // Check that the initial page directory has been set up correctly.
index c8ada42..009c1d1 100644 (file)
@@ -397,8 +397,8 @@ static void check_syms_va(void)
 {
        /* Make sure our symbols are up to date (see arch/ros/mmu64.h) */
        check_sym_va(KERN_LOAD_ADDR, 0xffffffffc0000000);
-       check_sym_va(LAPIC_BASE,     0xffffffffbffff000);
-       check_sym_va(IOAPIC_BASE,    0xffffffffbfffe000);
+       check_sym_va(LAPIC_BASE,     0xffffffffbff00000);
+       check_sym_va(IOAPIC_BASE,    0xffffffffbfe00000);
        check_sym_va(VPT_TOP,        0xffffff0000000000);
        check_sym_va(VPT,            0xfffffe8000000000);
        check_sym_va(KERN_VMAP_TOP,  0xfffffe8000000000);
@@ -436,9 +436,9 @@ void vm_init(void)
        }
        /* For the LAPIC and IOAPIC, we use PAT (but not *the* PAT flag) to make
         * these type UC */
-       map_segment(boot_pgdir, LAPIC_BASE, PGSIZE, LAPIC_PBASE,
+       map_segment(boot_pgdir, LAPIC_BASE, APIC_SIZE, LAPIC_PBASE,
                    PTE_PCD | PTE_PWT | PTE_W | PTE_G, max_jumbo_shift);
-       map_segment(boot_pgdir, IOAPIC_BASE, PGSIZE, IOAPIC_PBASE,
+       map_segment(boot_pgdir, IOAPIC_BASE, APIC_SIZE, IOAPIC_PBASE,
                    PTE_PCD | PTE_PWT | PTE_W | PTE_G, max_jumbo_shift);
        /* VPT mapping: recursive PTE inserted at the VPT spot */
        boot_pgdir[PDX(VPT)] = PADDR(boot_pgdir) | PTE_W | PTE_P;
index b7d455b..22f6bf1 100644 (file)
@@ -31,10 +31,10 @@ typedef unsigned long pde_t;
  *    KERNBASE ----->  +------------------------------+ 0xc0000000
  *                     |  Cur. Page Table (Kern. RW)  | RW/--  PTSIZE
  *    VPT          --> +------------------------------+ 0xbfc00000
- *                     |          Local APIC          | RW/--  PGSIZE
- *    LAPIC        --> +------------------------------+ 0xbfbff000
- *                     |            IOAPIC            | RW/--  PGSIZE
- *    IOAPIC,      --> +------------------------------+ 0xbfbfe000
+ *                     |          Local APIC          | RW/--  APIC_SIZE
+ *    LAPIC        --> +------------------------------+ 0xbfb00000
+ *                     |            IOAPIC            | RW/--  APIC_SIZE
+ *    IOAPIC,      --> +------------------------------+ 0xbfa00000
  *  KERN_DYN_TOP       |   Kernel Dynamic Mappings    |
  *                     |              .               |
  *                     :              .               :
@@ -112,8 +112,9 @@ typedef unsigned long pde_t;
 #define VPT                            (KERNBASE - PTSIZE)
 #define VPD (VPT + (VPT >> 10))
 #define vpd VPD
-#define LAPIC_BASE             (VPT - PGSIZE)
-#define IOAPIC_BASE            (LAPIC_BASE - PGSIZE)
+#define APIC_SIZE              0x100000
+#define LAPIC_BASE             (VPT - APIC_SIZE)
+#define IOAPIC_BASE            (LAPIC_BASE - APIC_SIZE)
 
 /* All arches must define this, which is the lower limit of their static
  * mappings, and where the dynamic mappings will start. */
index a7b8979..d89804b 100644 (file)
@@ -25,13 +25,13 @@ typedef unsigned long pde_t;
  *                     |                              |                     |
  * KERN_LOAD_ADDR -->  +------------------------------+ 0xffffffffc0000000 -+
  *                     |                              |
- *                     |          Local APIC          | RW/--  PGSIZE
+ *                     |          Local APIC          | RW/--  APIC_SIZE (1MB)
  *                     |                              |
- *    LAPIC_BASE  -->  +------------------------------+ 0xffffffffbffff000
+ *    LAPIC_BASE  -->  +------------------------------+ 0xffffffffbff00000
  *                     |                              |
- *                     |            IOAPIC            | RW/--  PGSIZE
+ *                     |            IOAPIC            | RW/--  APIC_SIZE (1MB)
  *                     |                              |
- *  IOAPIC_BASE,  -->  +------------------------------+ 0xffffffffbfffe000
+ *  IOAPIC_BASE,  -->  +------------------------------+ 0xffffffffbfe00000
  *  KERN_DYN_TOP       |   Kernel Dynamic Mappings    |
  *                     |              .               |
  *                     :              .               :
@@ -134,8 +134,9 @@ typedef unsigned long pde_t;
  * the top 1 GB. */
 #define KERN_LOAD_ADDR  0xffffffffc0000000
 /* Static kernel mappings */
-#define LAPIC_BASE             (KERN_LOAD_ADDR - PGSIZE)
-#define IOAPIC_BASE            (LAPIC_BASE - PGSIZE)
+#define APIC_SIZE              0x100000
+#define LAPIC_BASE             (KERN_LOAD_ADDR - APIC_SIZE)
+#define IOAPIC_BASE            (LAPIC_BASE - APIC_SIZE)
 /* All arches must define this, which is the lower limit of their static
  * mappings, and where the dynamic mappings will start. */
 #define KERN_DYN_TOP   IOAPIC_BASE