mips, i386, loongarch: tighten Penguin hypercall match#4
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The MIPS Penguin hypercall recognizer was too broad. It treated any conditional move into
$zeroas a Penguin hypercall, and also intercepted anymfc0into$zero. The igloo driver hypercall instruction is specificallymovz $zero, $zero, $zero, so ordinary no-op conditional moves could be dispatched into Penguin unexpectedly.This narrows the MIPS translator hook to the exact
movz $zero,$zero,$zeroinstruction and removes the unrelated broadmfc0 rt==0hook.A follow-up audit found two additional loose matches and tightens those too:
cpucfg $r0,$r0sentinel instead of anycpucfgwriting$r0.0x88, matching the driver'soutl %%eax,$0x88, instead of accepting byte/word writes to the same port.Other Penguin TCG instruction hooks already match their guest-side sentinel shape exactly: ARM32
mcr p7,0,r0,c0,c0,0, ARM64msr S0_0_c5_c0_0,xzr, RISC-Vxori x0,x0,0, and PPCxori 10,10,0.Repro / validation
Observed with a penguin PR image using
igloo_driver v0.0.75:mipsel 4.10basic target repeatedly hangs during IGLOO driver init, typically afterIGLOO: Initializing ioctl hypercalls.mipsel 4.10basic target passed 5 consecutive runs.Command shape used locally:
The trigger showed up after igloo_driver PR #70 because the changed devfs registration path altered startup timing/portal traffic, but the underlying bug is in QEMU's MIPS hypercall recognition.