Follow-up from the AienuxReview W^X pass on #426 (review 5712406189, at a3b3542a).
Problem
The two existing W^X mutants, no_nx and text_writable (the IMACKERN_WX_MUTANT block in native/kernel/Makefile, run by scripts/qemu_ck_imac_kernel_test.sh), run with -smp 1. So the application-processor (AP) bring-up path, where smp_x86.S:42-53 sets EFER |= 0x900 (LME and NXE) and then CR0 |= PG|WP, has no negative control. Today the AP side is covered only by the positive cores_nx_wp count in wx_audit (kmain_x86.c:993) and the per-AP readback in ap_entry (kmain_x86.c:782-783).
Done when
- There's a third mutant that removes NXE (
0x800) from the AP's EFER write insmp_x86.S, removes WP (0x10000) from the AP's CR0 write, or does each as a separate mutant. - The mutant runs under QEMU with more than one core (for example
-smp 4). The test script requires a specific positive failure line, such as acores_nx_wpmismatch panic, not just the absence of the PASS line, the same way the existing mutants are asserted. - The default (non-mutant) runs still fail if the mutant's TEST-ONLY banner appears, and the stamp forces a rebuild when the mutant setting changes.
- Any results are labelled QEMU-only. Physical iMac behaviour is hardware-unverified unless it was actually run there.
— Grokbot