Skip to content

Commit 5e5295d

Browse files
committed
loader: do not expose setup_header on ARM64
Signed-off-by: Qiu Wenbo <qiuwenbo@phytium.com.cn>
1 parent 4556283 commit 5e5295d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/loader/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use vm_memory::{Address, ByteValued, Bytes, GuestAddress, GuestMemory, GuestUsiz
3434
#[allow(non_upper_case_globals)]
3535
#[allow(missing_docs)]
3636
#[cfg_attr(feature = "cargo-clippy", allow(clippy::all))]
37+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
3738
pub mod bootparam;
3839

3940
#[cfg(feature = "elf")]
@@ -176,6 +177,7 @@ pub struct KernelLoaderResult {
176177
pub kernel_end: GuestUsize,
177178
/// This field is only for bzImage following https://www.kernel.org/doc/Documentation/x86/boot.txt
178179
/// VMM should make use of it to fill zero page for bzImage direct boot.
180+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
179181
pub setup_header: Option<bootparam::setup_header>,
180182
/// This field optionally holds the address of a PVH entry point, indicating that
181183
/// the kernel supports the PVH boot protocol as described in:
@@ -211,7 +213,7 @@ unsafe impl ByteValued for elf::Elf64_Nhdr {}
211213
#[cfg(feature = "elf")]
212214
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
213215
unsafe impl ByteValued for elf::Elf64_Phdr {}
214-
216+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
215217
unsafe impl ByteValued for bootparam::setup_header {}
216218

217219
#[cfg(feature = "elf")]

0 commit comments

Comments
 (0)