@@ -22,7 +22,6 @@ use axaddrspace::{
2222use axdevice_base:: BaseDeviceOps ;
2323use axerrno:: { AxResult , ax_err, ax_err_type} ;
2424use axvcpu:: { AxArchVCpu , AxVCpuExitReason , AxVCpuHal } ;
25- use axvisor_api:: vmm:: { VCpuId , VMId } ;
2625
2726use super :: VmxExitInfo ;
2827use super :: as_axerr;
@@ -32,13 +31,16 @@ use super::vmcs::{
3231 self , ApicAccessExitType , VmcsControl32 , VmcsControl64 , VmcsControlNW , VmcsGuest16 ,
3332 VmcsGuest32 , VmcsGuest64 , VmcsGuestNW , VmcsHost16 , VmcsHost32 , VmcsHost64 , VmcsHostNW ,
3433} ;
35- use crate :: { ept:: GuestPageWalkInfo , msr:: Msr , regs:: GeneralRegisters } ;
34+ use crate :: { Hal , ept:: GuestPageWalkInfo , msr:: Msr , regs:: GeneralRegisters } ;
3635
3736const VMX_PREEMPTION_TIMER_SET_VALUE : u32 = 1_000_000 ;
3837
3938const QEMU_EXIT_PORT : u16 = 0x604 ;
4039const QEMU_EXIT_MAGIC : u64 = 0x2000 ;
4140
41+ pub type VCpuId = usize ;
42+ pub type VMId = usize ;
43+
4244pub struct XState {
4345 host_xcr0 : u64 ,
4446 guest_xcr0 : u64 ,
@@ -153,7 +155,7 @@ const CR0_PE: usize = 1 << 0;
153155
154156/// A virtual CPU within a guest.
155157#[ repr( C ) ]
156- pub struct VmxVcpu < H : AxVCpuHal > {
158+ pub struct VmxVcpu < H : Hal > {
157159 // The order of `guest_regs` and `host_stack_top` is mandatory. They must be the first two fields. If you want to
158160 // change the order or the type of these fields, you must also change the assembly in this file.
159161 /// Guest general-purpose registers.
@@ -175,11 +177,11 @@ pub struct VmxVcpu<H: AxVCpuHal> {
175177
176178 // VMCS-related fields
177179 /// The VMCS region.
178- vmcs : VmxRegion < H :: MmHal > ,
180+ vmcs : VmxRegion < H > ,
179181 /// The I/O bitmap for the VMCS.
180- io_bitmap : IOBitmap < H :: MmHal > ,
182+ io_bitmap : IOBitmap < H > ,
181183 /// The MSR bitmap for the VMCS.
182- msr_bitmap : MsrBitmap < H :: MmHal > ,
184+ msr_bitmap : MsrBitmap < H > ,
183185
184186 // Interrupt-related fields
185187 /// Pending events to be injected to the guest.
0 commit comments