Skip to content

Commit

Permalink
x86/boot: Don't overwrite cr4 when enabling PAE
Browse files Browse the repository at this point in the history
Some EFI firmware makes use of the FPU during boottime services and
clearing X86_CR4_OSFXSR by overwriting %cr4 causes the firmware to
crash.

Add the PAE bit explicitly instead of trashing the existing contents,
leaving the rest of the bits as the firmware set them.

Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
  • Loading branch information
Matt Fleming committed Mar 4, 2014
1 parent 7d453ee commit 108d3f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/boot/compressed/head_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ ENTRY(startup_32)
lgdt gdt(%ebp)

/* Enable PAE mode */
movl $(X86_CR4_PAE), %eax
movl %cr4, %eax
orl $X86_CR4_PAE, %eax
movl %eax, %cr4

/*
Expand Down

0 comments on commit 108d3f4

Please sign in to comment.