From 42477207e2c642580c18ec02b1e1c3603db5b95b Mon Sep 17 00:00:00 2001 From: Jinank Jain Date: Fri, 15 Dec 2023 03:14:21 +0000 Subject: [PATCH] misc: Add check for sev_snp and target_arch Feature 'sev_snp' can only be enabled when the target_arch is 'x86_64' Signed-off-by: Jinank Jain --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index 2edd116a4..21634a274 100644 --- a/src/main.rs +++ b/src/main.rs @@ -733,6 +733,9 @@ fn main() { #[cfg(all(feature = "tdx", feature = "sev_snp"))] compile_error!("Feature 'tdx' and 'sev_snp' are mutually exclusive."); + #[cfg(all(feature = "sev_snp", not(target_arch = "x86_64")))] + compile_error!("Feature 'sev_snp' needs target 'x86_64'"); + #[cfg(feature = "dhat-heap")] let _profiler = dhat::Profiler::new_heap();