From de3ca97095bd2a4ad1398e475bf8bc29ca8da8db Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 14 Feb 2023 12:38:42 +0000 Subject: [PATCH] hypervisor: rename get_cpuid to get_supported_cpuid To better reflect its nature and avoid confusion with get_cpuid2. No functional change. Signed-off-by: Wei Liu --- arch/src/x86_64/mod.rs | 4 +++- hypervisor/src/hypervisor.rs | 2 +- hypervisor/src/kvm/mod.rs | 2 +- hypervisor/src/mshv/mod.rs | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/src/x86_64/mod.rs b/arch/src/x86_64/mod.rs index c209eb889..aacacd06e 100644 --- a/arch/src/x86_64/mod.rs +++ b/arch/src/x86_64/mod.rs @@ -609,7 +609,9 @@ pub fn generate_common_cpuid( ]; // Supported CPUID - let mut cpuid = hypervisor.get_cpuid().map_err(Error::CpuidGetSupported)?; + let mut cpuid = hypervisor + .get_supported_cpuid() + .map_err(Error::CpuidGetSupported)?; CpuidPatch::patch_cpuid(&mut cpuid, cpuid_patches); diff --git a/hypervisor/src/hypervisor.rs b/hypervisor/src/hypervisor.rs index 08daee461..fb93a622e 100644 --- a/hypervisor/src/hypervisor.rs +++ b/hypervisor/src/hypervisor.rs @@ -108,7 +108,7 @@ pub trait Hypervisor: Send + Sync { /// /// Get the supported CpuID /// - fn get_cpuid(&self) -> Result>; + fn get_supported_cpuid(&self) -> Result>; /// /// Check particular extensions if any /// diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 5b4c65679..62fe5bf03 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -1023,7 +1023,7 @@ impl hypervisor::Hypervisor for KvmHypervisor { /// /// X86 specific call to get the system supported CPUID values. /// - fn get_cpuid(&self) -> hypervisor::Result> { + fn get_supported_cpuid(&self) -> hypervisor::Result> { let kvm_cpuid = self .kvm .get_supported_cpuid(kvm_bindings::KVM_MAX_CPUID_ENTRIES) diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs index b2d046edc..d66231a89 100644 --- a/hypervisor/src/mshv/mod.rs +++ b/hypervisor/src/mshv/mod.rs @@ -270,7 +270,7 @@ impl hypervisor::Hypervisor for MshvHypervisor { /// /// Get the supported CpuID /// - fn get_cpuid(&self) -> hypervisor::Result> { + fn get_supported_cpuid(&self) -> hypervisor::Result> { Ok(Vec::new()) } }