From 814114c64cf1e75b958c9c478969e8c63e58570d Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 24 Jun 2022 15:46:26 -0700 Subject: [PATCH] x86_64: call set_lint() for BIOS as well This configures the IRQ chip and is not called anywhere else for the normal BIOS path, so it should be moved above the `if has_bios` check. BUG=b:237095693 TEST=crosvm run --bios u-boot.rom --disk test.img # virtio-blk works Change-Id: I1813d59d7921a824c46a49de98d272f639cc5c07 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3723801 Reviewed-by: Steven Richman Tested-by: kokoro Commit-Queue: Daniel Verkamp Reviewed-by: Alexandre Courbot --- x86_64/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs index ebe1a26fc5..bbbe4db49c 100644 --- a/x86_64/src/lib.rs +++ b/x86_64/src/lib.rs @@ -823,6 +823,8 @@ impl arch::LinuxArch for X8664arch { vcpu.set_msrs(&msrs).map_err(Error::SetupMsrs)?; + interrupts::set_lint(vcpu_id, irq_chip).map_err(Error::SetLint)?; + if has_bios { regs::set_reset_vector(vcpu).map_err(Error::SetupRegs)?; return Ok(()); @@ -831,7 +833,6 @@ impl arch::LinuxArch for X8664arch { let guest_mem = vm.get_memory(); vcpu.set_regs(&vcpu_init.regs).map_err(Error::WriteRegs)?; regs::setup_sregs(guest_mem, vcpu).map_err(Error::SetupSregs)?; - interrupts::set_lint(vcpu_id, irq_chip).map_err(Error::SetLint)?; Ok(()) }