trap 4 seems to be:
#define T_PROTFLT 4 /* protection fault */
it's possible ddb is wrong about the next function because there's
assembly/maybe inlining and it is failing at:
acpi_md_sleep_prepare-> acpi_md_sleep_enter -> acpi_md_sleep_patch
I wouldn't expect ACPI sleep to be reliable, there are several sets of
registers that are not saved & restored. By the way, there are also
several
issues in ddb; as far as I remember, it sometimes miscomputes the symbol
address and gives a wrong function, the disassembler also gets
confused with
opcodes, etc.
In short, very few things work in there.
The last function sounds like it may violate W^X unless it's
careful, but I'm not sure what is going on with ACPI and suspend.
A one-page vm space is created for the ACPI trampoline, and this page is
indeed RWX. But there are good reasons for this, and basically once
awake the
cpu restores the previous space, so this rwx page is gone right away.