diff options
author | kib <kib@FreeBSD.org> | 2017-05-29 13:17:00 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2017-05-29 13:17:00 +0000 |
commit | 0bf386fbb2559e0d42ec9339380338a3dabd024a (patch) | |
tree | 07721955036c1b97ce614bf659e781cb69411494 /sys/amd64 | |
parent | a8b78f2a29971b6fb72716fc181ec1553fd89fb3 (diff) | |
download | FreeBSD-src-0bf386fbb2559e0d42ec9339380338a3dabd024a.zip FreeBSD-src-0bf386fbb2559e0d42ec9339380338a3dabd024a.tar.gz |
MFC r318318:
Ensure that resume path on amd64 only accesses page tables for normal
operation after processor is configured to allow all required
features.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/acpica/acpi_wakecode.S | 9 | ||||
-rw-r--r-- | sys/amd64/amd64/cpu_switch.S | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/amd64/acpica/acpi_wakecode.S b/sys/amd64/acpica/acpi_wakecode.S index 6b36d55..a63b5b8 100644 --- a/sys/amd64/acpica/acpi_wakecode.S +++ b/sys/amd64/acpica/acpi_wakecode.S @@ -156,11 +156,12 @@ wakeup_32: /* * Enable EFER.LME so that we get long mode when all the prereqs are * in place. In this case, it turns on when CR0_PG is finally enabled. - * Pick up a few other EFER bits that we'll use need we're here. + * Also it picks up a few other EFER bits that we'll use need we're + * here, like SYSCALL and NX enable. */ movl $MSR_EFER, %ecx - rdmsr - orl $EFER_LME | EFER_SCE, %eax + movl wakeup_efer - wakeup_start(%ebx), %eax + movl wakeup_efer + 4 - wakeup_start(%ebx), %edx wrmsr /* @@ -276,6 +277,8 @@ wakeup_pcb: .quad 0 wakeup_ret: .quad 0 +wakeup_efer: + .quad 0 wakeup_gdt: .word 0 .quad 0 diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S index e292797..64a3485 100644 --- a/sys/amd64/amd64/cpu_switch.S +++ b/sys/amd64/amd64/cpu_switch.S @@ -396,7 +396,7 @@ ENTRY(resumectx) movl 4 + PCB_KGSBASE(%rdi),%edx wrmsr - /* Restore EFER. */ + /* Restore EFER one more time. */ movl $MSR_EFER,%ecx movl PCB_EFER(%rdi),%eax wrmsr |