Skip to content

spinlock: handle missing raw-spin symbols for KP-owned locks - #4

Open
qssn70 wants to merge 1 commit into
LyraVoid:mainfrom
qssn70:codex/fix-missing-raw-spinlock-fallback-lyra
Open

qssn70 wants to merge 1 commit into
LyraVoid:mainfrom
qssn70:codex/fix-missing-raw-spinlock-fallback-lyra

Conversation

@qssn70

@qssn70 qssn70 commented Sep 7, 2026

Copy link
Copy Markdown

On kernels that inline the generic _raw_spin_* wrappers, kallsyms lookup leaves the function pointers unset and the first task-extension lock acquisition can branch to address zero. This failure was isolated on Xiaomi Mi MIX 2S (polaris), Linux 4.9.327, as documented in bmax121/KernelPatch#302, which has been merged upstream.

This ports that fix unchanged (upstream commit b77855640f80c6c0af706a9e20aa5c8a203145d6) onto LyraVoid main at 1de1a37.

  • Use the native _raw_spin_lock_irqsave / _raw_spin_unlock_irqrestore pair when both resolve.
  • Otherwise save DAIF, mask IRQs, acquire a local 0/1 TAS lock, release with store-release, and restore DAIF.
  • Route taskob and kstorage private locks through the paired helpers. The fallback is restricted to zero-initialized KP-owned locks; the generic spinlock API is unchanged.

Validation for this port: the upstream patch applies without conflicts, all four changed files have the same resulting contents as the upstream fix, and git diff --cached --check passes. The upstream PR documents ARM64 compilation/disassembly checks and device boot evidence for the fallback prototype. This LyraVoid-based commit has not been rebuilt or device-tested; boot and concurrent task/kstorage testing remain to be done.

Scope: four files, 96 additions and 14 deletions. No other upstream commits are included.

Port bmax121/KernelPatch#302 (b77855640f80c6c0af706a9e20aa5c8a203145d6) unchanged to LyraVoid main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant