@@ -11,7 +11,6 @@ use hvdef::HvMessageType;
1111use hvdef:: HvSynicSimpSiefp ;
1212use hvdef:: HvSynicStimerConfig ;
1313use hvdef:: TimerMessagePayload ;
14- use hvdef:: Vtl ;
1514use hvdef:: HV_MESSAGE_SIZE ;
1615use hvdef:: HV_PAGE_SIZE ;
1716use hvdef:: HV_PAGE_SIZE_USIZE ;
@@ -247,30 +246,15 @@ impl GlobalSynic {
247246 }
248247
249248 /// Adds a virtual processor to the synthetic interrupt controller state.
250- pub fn add_vp ( & self , vp_index : VpIndex , vtl : Vtl ) -> ProcessorSynic {
251- match vtl {
252- Vtl :: Vtl0 => {
253- let shared = self . vps [ vp_index. index ( ) as usize ] . clone ( ) ;
254- let old_shared =
255- std:: mem:: replace ( & mut * shared. write ( ) , SharedProcessorState :: AT_RESET ) ;
256- assert ! ( !old_shared. online) ;
257-
258- ProcessorSynic {
259- sints : SintState :: AT_RESET ,
260- timers : array:: from_fn ( |_| Timer :: default ( ) ) ,
261- shared,
262- }
263- }
264- Vtl :: Vtl1 => {
265- // TODO CVM GUEST VSM, these values are just placeholders to prevent
266- // messing with VTL 0's state
267- ProcessorSynic {
268- sints : SintState :: AT_RESET ,
269- timers : array:: from_fn ( |_| Timer :: default ( ) ) ,
270- shared : Arc :: new ( RwLock :: new ( SharedProcessorState :: AT_RESET ) ) ,
271- }
272- }
273- Vtl :: Vtl2 => unreachable ! ( ) ,
249+ pub fn add_vp ( & self , vp_index : VpIndex ) -> ProcessorSynic {
250+ let shared = self . vps [ vp_index. index ( ) as usize ] . clone ( ) ;
251+ let old_shared = std:: mem:: replace ( & mut * shared. write ( ) , SharedProcessorState :: AT_RESET ) ;
252+ assert ! ( !old_shared. online) ;
253+
254+ ProcessorSynic {
255+ sints : SintState :: AT_RESET ,
256+ timers : array:: from_fn ( |_| Timer :: default ( ) ) ,
257+ shared,
274258 }
275259 }
276260}
0 commit comments