|
|
@@ -18,6 +18,7 @@
|
|
|
.equ AP_INFO_STACK, AP_INFO + 4
|
|
|
.equ AP_INFO_ENTRY, AP_INFO + 8
|
|
|
.equ AP_INFO_CPU, AP_INFO + 12
|
|
|
+.equ AP_INFO_CR0, AP_INFO + 16 /* written back: CR0 as the AP woke up */
|
|
|
|
|
|
.globl ap_tramp_start
|
|
|
ap_tramp_start:
|
|
|
@@ -81,7 +82,15 @@ ap_pm32:
|
|
|
andl $~0x100, %eax
|
|
|
wrmsr
|
|
|
3:
|
|
|
+ /* INIT leaves an AP with CR0 = 0x60000010: CD and NW set, so its
|
|
|
+ * caches are off until the OS clears them. Nothing did, and every
|
|
|
+ * ring-3 process the scheduler put on an AP (the browser, its TLS
|
|
|
+ * helpers) ran from uncached memory, about 100x slower; QEMU does
|
|
|
+ * not model caches, so only real hardware showed it. The original
|
|
|
+ * value goes back to the BSP for the boot log. */
|
|
|
movl %cr0, %eax
|
|
|
+ movl %eax, AP_INFO_CR0
|
|
|
+ andl $~0x60000000, %eax /* clear CR0.CD | CR0.NW */
|
|
|
orl $0x80010000, %eax /* CR0.PG | CR0.WP */
|
|
|
movl %eax, %cr0
|
|
|
jmp 1f
|