From a847e062d68ebf3e508df3c79d6e6824160c5170 Mon Sep 17 00:00:00 2001 From: iwasaki Date: Wed, 22 Aug 2001 15:41:43 +0000 Subject: [PATCH] Move CR4.PGE enabling code after paging is enabled via CR0.PG based on the description (2.5. CONTROL REGISTERS) of Intel developer's manual at: ftp://download.intel.com/design/PentiumII/manuals/24319202.pdf Reviewed by: peter, bde, tlambert2@mindspring.com Pointed-out by: "Shin'ya Kumabuchi" MFC after: 1 week --- sys/amd64/amd64/locore.S | 13 ++++++------- sys/amd64/amd64/locore.s | 13 ++++++------- sys/i386/i386/locore.s | 13 ++++++------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index cdfd7992cc48..9d106a49a834 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -374,6 +374,12 @@ begin: movl IdlePTD,%esi movl %esi,PCB_CR3(%eax) + testl $CPUID_PGE, R(cpu_feature) + jz 1f + movl %cr4, %eax + orl $CR4_PGE, %eax + movl %eax, %cr4 +1: pushl physfree /* value of first for init386(first) */ call init386 /* wire 386 chip for unix operation */ @@ -719,13 +725,6 @@ trycpuid: /* Use the `cpuid' instruction. */ create_pagetables: - testl $CPUID_PGE, R(cpu_feature) - jz 1f - movl %cr4, %eax - orl $CR4_PGE, %eax - movl %eax, %cr4 -1: - /* Find end of kernel image (rounded up to a page boundary). */ movl $R(_end),%esi diff --git a/sys/amd64/amd64/locore.s b/sys/amd64/amd64/locore.s index cdfd7992cc48..9d106a49a834 100644 --- a/sys/amd64/amd64/locore.s +++ b/sys/amd64/amd64/locore.s @@ -374,6 +374,12 @@ begin: movl IdlePTD,%esi movl %esi,PCB_CR3(%eax) + testl $CPUID_PGE, R(cpu_feature) + jz 1f + movl %cr4, %eax + orl $CR4_PGE, %eax + movl %eax, %cr4 +1: pushl physfree /* value of first for init386(first) */ call init386 /* wire 386 chip for unix operation */ @@ -719,13 +725,6 @@ trycpuid: /* Use the `cpuid' instruction. */ create_pagetables: - testl $CPUID_PGE, R(cpu_feature) - jz 1f - movl %cr4, %eax - orl $CR4_PGE, %eax - movl %eax, %cr4 -1: - /* Find end of kernel image (rounded up to a page boundary). */ movl $R(_end),%esi diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s index cdfd7992cc48..9d106a49a834 100644 --- a/sys/i386/i386/locore.s +++ b/sys/i386/i386/locore.s @@ -374,6 +374,12 @@ begin: movl IdlePTD,%esi movl %esi,PCB_CR3(%eax) + testl $CPUID_PGE, R(cpu_feature) + jz 1f + movl %cr4, %eax + orl $CR4_PGE, %eax + movl %eax, %cr4 +1: pushl physfree /* value of first for init386(first) */ call init386 /* wire 386 chip for unix operation */ @@ -719,13 +725,6 @@ trycpuid: /* Use the `cpuid' instruction. */ create_pagetables: - testl $CPUID_PGE, R(cpu_feature) - jz 1f - movl %cr4, %eax - orl $CR4_PGE, %eax - movl %eax, %cr4 -1: - /* Find end of kernel image (rounded up to a page boundary). */ movl $R(_end),%esi