From 57215e76811f451692fac35f184b844a148f3237 Mon Sep 17 00:00:00 2001 From: Nuno Das Neves Date: Thu, 28 Mar 2024 17:54:07 +0000 Subject: [PATCH] hypervisor: Remove redefinition of HV_PAGE_SIZE in mshv HV_PAGE_SIZE is defined as a usize in mshv_bindings. Remove the redefinition, and perform casts where necessary. Signed-off-by: Nuno Das Neves --- hypervisor/src/mshv/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs index 1833be7d0..cc88cb5d3 100644 --- a/hypervisor/src/mshv/mod.rs +++ b/hypervisor/src/mshv/mod.rs @@ -54,8 +54,6 @@ use crate::arch::x86::{CpuIdEntry, FpuState, MsrEntry}; const DIRTY_BITMAP_CLEAR_DIRTY: u64 = 0x4; const DIRTY_BITMAP_SET_DIRTY: u64 = 0x8; -#[cfg(feature = "sev_snp")] -const HV_PAGE_SIZE: u64 = 4096; /// /// Export generically-named wrappers of mshv-bindings for Unix-based platforms @@ -653,9 +651,9 @@ impl cpu::Vcpu for MshvVcpu { "Releasing pages: gfn_start: {:x?}, gfn_count: {:?}", gfn_start, gfn_count ); - let gpa_start = gfn_start * HV_PAGE_SIZE; + let gpa_start = gfn_start * HV_PAGE_SIZE as u64; for i in 0..gfn_count { - gpas.push(gpa_start + i * HV_PAGE_SIZE); + gpas.push(gpa_start + i * HV_PAGE_SIZE as u64); } let mut gpa_list =