Skip to content

Commit 5acf2a3

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 e6bec16 commit 5acf2a3

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

0 commit comments

Comments
 (0)