shithub: riscv

Download patch

ref: f5e45a02d4e1621a9720b3abcadd6b12e7fb4be0
parent: 32b5b2f42db04ed84197392cebf2930b2208ae20
author: cinap_lenrek <[email protected]>
date: Tue Nov 4 00:52:42 EST 2014

pc: enable page size extension early in apbootstrap

vmware in efi mode brings application processors up
with CR4 = 0 (pse disabled) which makes us page fault
when accessing the ap's pdb which might be in a 4MB
mapping when the boot processor used pse to setup
page tables.

so we unconditionally enable pse in apbootstrap
(and disable pae in case of surprises).

--- a/sys/src/9/pc/apbootstrap.s
+++ b/sys/src/9/pc/apbootstrap.s
@@ -73,6 +73,11 @@
 	MOVL	DX, (PDO(0))(CX)
 	MOVL	CX, CR3				/* load and flush the mmu */
 
+	MOVL	CR4, AX
+	ANDL	$~0x00000020, AX		/* ~PAE */
+	ORL	$0x00000010, AX			/* PSE */
+	MOVL	AX, CR4
+
 	MOVL	CR0, DX
 	ORL	$0x80010000, DX			/* PG|WP */
 	ANDL	$~0x6000000A, DX		/* ~(CD|NW|TS|MP) */