Skip to content

Commit a6e2b89

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 d024fcc commit a6e2b89

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

0 commit comments

Comments
 (0)