Toggle IBT off during amd64 hibernate before dropping to real mode.
authordv <dv@openbsd.org>
Mon, 24 Apr 2023 09:04:03 +0000 (09:04 +0000)
committerdv <dv@openbsd.org>
Mon, 24 Apr 2023 09:04:03 +0000 (09:04 +0000)
commitd7fb83ec8e606829eabfddeca63857805f59d4fc
tree7d516a7fb575f55620e7054f860fb4969d4376a3
parent34280c3558f99c088e86e83972cef8ff0ab7e570
Toggle IBT off during amd64 hibernate before dropping to real mode.

Hibernate on IBT-capable MP systems broke when trying to quiesce
cpus. Instead of finding the locations of endbr64 in the asm indirect
jumps in acpi_wakecode.S, simply disable CR4.CET beforehand and
re-enable on resume.

This will also disable shadowstack, but there are no plans to use it.

"this approach is fine" deraadt@
sys/arch/amd64/amd64/acpi_machdep.c
sys/arch/amd64/amd64/cpu.c
sys/arch/amd64/amd64/hibernate_machdep.c