Skip to content

Commit 6e529b8

Browse files
committed
fix(OVMF): Default non-x86 arch to edk2-stable202508_r1
1 parent a1f64e8 commit 6e529b8

File tree

3 files changed

+34
-24
lines changed

3 files changed

+34
-24
lines changed

uefi-test-runner/src/proto/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub fn test() {
3030
usb::test();
3131
misc::test();
3232

33-
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
33+
#[cfg(target_arch = "x86_64")]
3434
iommu::test();
3535

3636
// disable the ATA test on aarch64 for now. The aarch64 UEFI Firmware does not yet seem

uefi/src/proto/dma/iommu.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
//! EDK2 IOMMU protocol.
3+
//! EDKII IOMMU protocol.
44
5+
use crate::data_types::PhysicalAddress;
6+
use crate::mem::memory_map::MemoryType;
7+
use crate::proto::unsafe_protocol;
8+
use crate::{Handle, Result, StatusExt};
59
use core::ffi::c_void;
6-
use uefi::data_types::PhysicalAddress;
7-
use uefi::mem::memory_map::MemoryType;
8-
use uefi::proto::unsafe_protocol;
9-
use uefi::{Handle, Result, StatusExt};
1010
use uefi_raw::table::boot::AllocateType;
1111

1212
pub use crate::proto::dma::{DmaBuffer, Mapping};
13-
pub use crate::uefi_raw::protocol::iommu::{
13+
pub use uefi_raw::protocol::iommu::{
1414
EdkiiIommuAccess, EdkiiIommuAttribute, EdkiiIommuOperation, EdkiiIommuProtocol,
1515
};
1616

@@ -33,10 +33,10 @@ impl Iommu {
3333
///
3434
/// # Errors
3535
///
36-
/// * [`Status::INVALID_PARAMETER`]: invalid device handle, mapping, or access flags
37-
/// * [`Status::UNSUPPORTED`]: operation not supported by this IOMMU
38-
/// * [`Status::OUT_OF_RESOURCES`]: insufficient resources to modify IOMMU access
39-
/// * [`Status::DEVICE_ERROR`]: IOMMU device reported an error
36+
/// * [`crate::Status::INVALID_PARAMETER`]: invalid device handle, mapping, or access flags
37+
/// * [`crate::Status::UNSUPPORTED`]: operation not supported by this IOMMU
38+
/// * [`crate::Status::OUT_OF_RESOURCES`]: insufficient resources to modify IOMMU access
39+
/// * [`crate::Status::DEVICE_ERROR`]: IOMMU device reported an error
4040
pub fn set_attribute(
4141
&self,
4242
device_handle: Handle,
@@ -58,10 +58,10 @@ impl Iommu {
5858
///
5959
/// # Errors
6060
///
61-
/// * [`Status::INVALID_PARAMETER`]: invalid operation or buffer
62-
/// * [`Status::UNSUPPORTED`]: host address cannot be mapped as a common buffer
63-
/// * [`Status::OUT_OF_RESOURCES`]: insufficient resources
64-
/// * [`Status::DEVICE_ERROR`]: system hardware could not map the requested address
61+
/// * [`crate::Status::INVALID_PARAMETER`]: invalid operation or buffer
62+
/// * [`crate::Status::UNSUPPORTED`]: host address cannot be mapped as a common buffer
63+
/// * [`crate::Status::OUT_OF_RESOURCES`]: insufficient resources
64+
/// * [`crate::Status::DEVICE_ERROR`]: system hardware could not map the requested address
6565
pub fn map(
6666
&self,
6767
operation: EdkiiIommuOperation,
@@ -104,9 +104,9 @@ impl Iommu {
104104
///
105105
/// # Errors
106106
///
107-
/// * [`Status::INVALID_PARAMETER`]: invalid memory type or attributes
108-
/// * [`Status::UNSUPPORTED`]: unsupported attributes
109-
/// * [`Status::OUT_OF_RESOURCES`]: memory pages could not be allocated
107+
/// * [`crate::Status::INVALID_PARAMETER`]: invalid memory type or attributes
108+
/// * [`crate::Status::UNSUPPORTED`]: unsupported attributes
109+
/// * [`crate::Status::OUT_OF_RESOURCES`]: memory pages could not be allocated
110110
pub fn allocate_buffer(
111111
&self,
112112
memory_type: MemoryType,

xtask/src/qemu.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ use tempfile::TempDir;
2020
#[cfg(target_os = "linux")]
2121
use {std::fs::Permissions, std::os::unix::fs::PermissionsExt};
2222

23-
/// Name of the ovmf-prebuilt release to use by default.
24-
const OVMF_PREBUILT_SOURCE: Source = Source::EDK2_STABLE202511_R2;
23+
/// OVMF source for x86_64 — includes IOMMU support.
24+
const OVMF_PREBUILT_SOURCE_X64: Source = Source::EDK2_STABLE202602_R1;
25+
26+
/// OVMF source for all other architectures.
27+
const OVMF_PREBUILT_SOURCE_DEFAULT: Source = Source::EDK2_STABLE202508_R1;
2528

2629
/// Directory into which the prebuilts will be download (relative to the repo root).
2730
const OVMF_PREBUILT_DIR: &str = "target/ovmf";
@@ -76,7 +79,11 @@ impl OvmfPaths {
7679
);
7780
}
7881
} else {
79-
let prebuilt = Prebuilt::fetch(OVMF_PREBUILT_SOURCE, OVMF_PREBUILT_DIR)?;
82+
let source = match arch {
83+
UefiArch::X86_64 => OVMF_PREBUILT_SOURCE_X64,
84+
_ => OVMF_PREBUILT_SOURCE_DEFAULT,
85+
};
86+
let prebuilt = Prebuilt::fetch(source, OVMF_PREBUILT_DIR)?;
8087

8188
Ok(prebuilt.get_file(arch.into(), file_type))
8289
}
@@ -364,9 +371,12 @@ pub fn run_qemu(arch: UefiArch, opt: &QemuOpt) -> Result<()> {
364371
}
365372
UefiArch::IA32 | UefiArch::X86_64 => {
366373
// Use a modern machine. kernel-irqchip=split is required by
367-
// intel-iommu with interrupt remapping enabled.
368-
cmd.args(["-machine", "q35,kernel-irqchip=split"]);
369-
cmd.args(["-device", "intel-iommu,intremap=on,caching-mode=on"]);
374+
if arch == UefiArch::X86_64 {
375+
cmd.args(["-machine", "q35,kernel-irqchip=split"]);
376+
cmd.args(["-device", "intel-iommu,intremap=on,caching-mode=on"]);
377+
} else {
378+
cmd.args(["-machine", "q35"]);
379+
}
370380

371381
// Multi-processor services protocol test needs exactly 4 CPUs.
372382
cmd.args(["-smp", "4"]);

0 commit comments

Comments
 (0)