From 5cb619ff7ccbf0147ea375f194fffdcc7abd8e5b Mon Sep 17 00:00:00 2001 From: Oliver Anderson Date: Fri, 20 Mar 2026 11:17:46 +0100 Subject: [PATCH] hypervisor: Implement common traits for CpuVendor Serialized CPU profiles will contain information about the CPU vendor. While there are other ways to encode this, such as going via CPUID, we find simply serializing the pre-existing enum the simplest. We also implement some other common traits such as `Debug` and `Eq` which make it more convenient to work with this type. Signed-off-by: Oliver Anderson On-behalf-of: SAP oliver.anderson@sap.com --- hypervisor/src/cpu.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hypervisor/src/cpu.rs b/hypervisor/src/cpu.rs index aaf741129..fa0984c56 100644 --- a/hypervisor/src/cpu.rs +++ b/hypervisor/src/cpu.rs @@ -27,7 +27,7 @@ use crate::kvm::{TdxExitDetails, TdxExitStatus}; use crate::{CpuState, MpState, StandardRegisters}; #[cfg(target_arch = "x86_64")] -#[derive(Copy, Clone, Default)] +#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)] pub enum CpuVendor { #[default] Unknown,