CHANGELOG: document Phase II.X S3 resume trampoline

The S3 state save in `enter_s3()` and the
`s3_resume::s3_trampoline` 64-bit `naked_asm!` block
are now committed and built. Mirrors Linux 7.1
`arch/x86/kernel/acpi/wakeup_64.S` in 64-bit assembly.

Hardware-agnostic: works on any x86_64 system with
standard ACPI S3 support (Dell, HP, Lenovo, LG Gram 14).
The acpid <-> kernel wiring via a new AcpiVerb is the
next step (Phase II.X.W).
This commit is contained in:
2026-07-01 15:58:35 +03:00
parent 5897eefc3a
commit 5725acc7dc
+39
View File
@@ -160,6 +160,45 @@ sync with the newest highlights.
successfully with all Phase J commits. The patch system
works end-to-end.
## 2026-07-01 — Phase II.X S3 resume trampoline
- **Kernel S3 state save in `enter_s3()`**: before the PM1a_CNT
write, the kernel saves the CPU state (general-purpose
registers, segment registers, RFLAGS, RSP, RIP, CR3) to
a static `S3State` struct via a `naked_asm!` block. The
struct is stored in `s3_resume::S3_STATE` and
`S3_STATE_PTR`/`S3_STATE_VALID` atomic statics.
- **Kernel S3 resume trampoline** (`s3_resume::s3_trampoline`):
a 64-bit `naked_asm!` block that runs when the platform
firmware jumps to FACS.waking_vector on S3 wake. Mirrors
Linux 7.1 `arch/x86/kernel/acpi/wakeup_64.S`:
- Checks the magic value (0x123456789abcdef0) in
S3_STATE.saved_magic. If zero (cold boot), halts.
- Restores segment registers to __KERNEL_DS.
- Restores CR3 (page table base).
- Restores RSP, RFLAGS, 13 general-purpose registers.
- Sets the RESUMING_FROM_S3 flag.
- Pushes saved RIP onto the stack and uses `ret`.
- **Kernel exposes `s3_resume_address()`** that acpid writes
to FACS.waking_vector via the kernel AcpiScheme.
- **Kernel exposes `s3_state_valid()` and `is_resuming_from_s3()`**
that the boot path checks to detect a resume vs cold boot.
- **Hardware-agnostic**: works on any x86_64 system with
standard ACPI S3 support (Dell, HP, Lenovo, LG Gram 14).
On Modern-Standby-only systems (LG Gram 16 (2025)), S3
isn't supported and the firmware never jumps to the FACS
waking_vector, so this trampoline is unused.
- **Build**: redbear-mini.iso (512 MB) builds successfully.
The S3 resume path is verified to compile and be present
in the ISO. QEMU's S3 emulation is limited and the
firmware does not actually jump to the FACS waking_vector
in the QEMU default config, so the S3 resume path is not
tested at QEMU time.
- **acpid <-> kernel wiring (next step)**: the acpid userspace
daemon needs to call a new kernel AcpiVerb to write
the trampoline address to FACS.waking_vector before
\_PTS(3). This is a separate Phase II.X.W commit.
## 2026-07-01 — Build system: explicit patch verification
The user requested "build system must report complete when