Skip to content

Commit 274cb52

Browse files
committed
muvm-guest: only auto-initialize emulation on aarch64
Running x86_64 emulators on x86_64 is not typically desired, so only try initializing them without flags on aarch64. Signed-off-by: Val Packett <[email protected]>
1 parent b2269b2 commit 274cb52

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

crates/muvm/src/guest/bin/muvm-guest.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,16 @@ fn main() -> Result<()> {
9494
Emulator::Box => setup_box()?,
9595
Emulator::Fex => setup_fex()?,
9696
};
97-
} else if let Err(err) = setup_fex() {
98-
eprintln!("Error setting up FEX in binfmt_misc: {err}");
99-
eprintln!("Failed to find or configure FEX, falling back to Box");
100-
101-
if let Err(err) = setup_box() {
102-
eprintln!("Error setting up Box in binfmt_misc: {err}");
103-
eprintln!("No emulators were configured, x86 emulation may not work");
97+
} else {
98+
#[cfg(target_arch = "aarch64")]
99+
if let Err(err) = setup_fex() {
100+
eprintln!("Error setting up FEX in binfmt_misc: {err}");
101+
eprintln!("Failed to find or configure FEX, falling back to Box");
102+
103+
if let Err(err) = setup_box() {
104+
eprintln!("Error setting up Box in binfmt_misc: {err}");
105+
eprintln!("No emulators were configured, x86 emulation may not work");
106+
}
104107
}
105108
}
106109

0 commit comments

Comments
 (0)