Skip to content

Commit 58cecdf

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. While here, let's call Box64 Box64 and not Box. Signed-off-by: Val Packett <[email protected]>
1 parent f5ded9b commit 58cecdf

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

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

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

0 commit comments

Comments
 (0)