@@ -82,12 +82,12 @@ fn add_virtio_aml(
8282 dsdt_data : & mut Vec < u8 > ,
8383 addr : u64 ,
8484 len : u64 ,
85- irq : u32 ,
85+ gsi : u32 ,
8686) -> Result < ( ) , aml:: AmlError > {
87- let dev_id = irq - crate :: arch:: GSI_BASE ;
87+ let dev_id = gsi - crate :: arch:: GSI_LEGACY_START ;
8888 debug ! (
89- "acpi: Building AML for VirtIO device _SB_.V{:03}. memory range: {:#010x}:{} irq : {}" ,
90- dev_id, addr, len, irq
89+ "acpi: Building AML for VirtIO device _SB_.V{:03}. memory range: {:#010x}:{} gsi : {}" ,
90+ dev_id, addr, len, gsi
9191 ) ;
9292 aml:: Device :: new (
9393 format ! ( "V{:03}" , dev_id) . as_str ( ) . try_into ( ) ?,
@@ -103,7 +103,7 @@ fn add_virtio_aml(
103103 addr. try_into( ) . unwrap( ) ,
104104 len. try_into( ) . unwrap( ) ,
105105 ) ,
106- & aml:: Interrupt :: new( true , true , false , false , irq ) ,
106+ & aml:: Interrupt :: new( true , true , false , false , gsi ) ,
107107 ] ) ,
108108 ) ?,
109109 ] ,
@@ -156,9 +156,9 @@ impl MMIODeviceManager {
156156 resource_allocator : & mut ResourceAllocator ,
157157 irq_count : u32 ,
158158 ) -> Result < MMIODeviceInfo , MmioError > {
159- let irq = match resource_allocator. allocate_gsi ( irq_count) ?[ ..] {
159+ let gsi = match resource_allocator. allocate_gsi_legacy ( irq_count) ?[ ..] {
160160 [ ] => None ,
161- [ irq ] => Some ( irq ) ,
161+ [ gsi ] => Some ( gsi ) ,
162162 _ => return Err ( MmioError :: InvalidIrqConfig ) ,
163163 } ;
164164
@@ -169,7 +169,7 @@ impl MMIODeviceManager {
169169 AllocPolicy :: FirstMatch ,
170170 ) ?,
171171 len : MMIO_LEN ,
172- irq,
172+ irq : gsi ,
173173 } ;
174174 Ok ( device_info)
175175 }
@@ -183,7 +183,7 @@ impl MMIODeviceManager {
183183 ) -> Result < ( ) , MmioError > {
184184 // Our virtio devices are currently hardcoded to use a single IRQ.
185185 // Validate that requirement.
186- let irq = device. resources . irq . ok_or ( MmioError :: InvalidIrqConfig ) ?;
186+ let gsi = device. resources . irq . ok_or ( MmioError :: InvalidIrqConfig ) ?;
187187 let identifier;
188188 {
189189 let mmio_device = device. inner . lock ( ) . expect ( "Poisoned lock" ) ;
@@ -197,7 +197,7 @@ impl MMIODeviceManager {
197197 . register_ioevent ( queue_evt, & io_addr, u32:: try_from ( i) . unwrap ( ) )
198198 . map_err ( MmioError :: RegisterIoEvent ) ?;
199199 }
200- vm. register_irq ( & mmio_device. interrupt . irq_evt , irq )
200+ vm. register_irq ( & mmio_device. interrupt . irq_evt , gsi )
201201 . map_err ( MmioError :: RegisterIrqFd ) ?;
202202 }
203203
@@ -276,7 +276,7 @@ impl MMIODeviceManager {
276276 let device_info = if let Some ( device_info) = device_info_opt {
277277 device_info
278278 } else {
279- let gsi = vm. resource_allocator ( ) . allocate_gsi ( 1 ) ?;
279+ let gsi = vm. resource_allocator ( ) . allocate_gsi_legacy ( 1 ) ?;
280280 MMIODeviceInfo {
281281 addr : SERIAL_MEM_START ,
282282 len : MMIO_LEN ,
@@ -335,7 +335,7 @@ impl MMIODeviceManager {
335335 let device_info = if let Some ( device_info) = device_info_opt {
336336 device_info
337337 } else {
338- let gsi = vm. resource_allocator ( ) . allocate_gsi ( 1 ) ?;
338+ let gsi = vm. resource_allocator ( ) . allocate_gsi_legacy ( 1 ) ?;
339339 MMIODeviceInfo {
340340 addr : RTC_MEM_START ,
341341 len : MMIO_LEN ,
@@ -612,15 +612,15 @@ pub(crate) mod tests {
612612 let dev = device_manager. get_virtio_device ( 0 , "dummy" ) . unwrap ( ) ;
613613 assert_eq ! ( dev. resources. addr, arch:: MEM_32BIT_DEVICES_START ) ;
614614 assert_eq ! ( dev. resources. len, MMIO_LEN ) ;
615- assert_eq ! ( dev. resources. irq, Some ( arch:: GSI_BASE ) ) ;
615+ assert_eq ! ( dev. resources. irq, Some ( arch:: GSI_LEGACY_START ) ) ;
616616
617617 device_manager
618618 . for_each_virtio_device ( |virtio_type, device_id, mmio_device| {
619619 assert_eq ! ( * virtio_type, 0 ) ;
620620 assert_eq ! ( device_id, "dummy" ) ;
621621 assert_eq ! ( mmio_device. resources. addr, arch:: MEM_32BIT_DEVICES_START ) ;
622622 assert_eq ! ( mmio_device. resources. len, MMIO_LEN ) ;
623- assert_eq ! ( mmio_device. resources. irq, Some ( arch:: GSI_BASE ) ) ;
623+ assert_eq ! ( mmio_device. resources. irq, Some ( arch:: GSI_LEGACY_START ) ) ;
624624 Ok :: < ( ) , ( ) > ( ( ) )
625625 } )
626626 . unwrap ( ) ;
@@ -643,7 +643,7 @@ pub(crate) mod tests {
643643 #[ cfg( target_arch = "aarch64" ) ]
644644 vm. setup_irqchip ( 1 ) . unwrap ( ) ;
645645
646- for _i in crate :: arch:: GSI_BASE ..=crate :: arch:: GSI_MAX {
646+ for _i in crate :: arch:: GSI_LEGACY_START ..=crate :: arch:: GSI_LEGACY_END {
647647 device_manager
648648 . register_virtio_test_device (
649649 & vm,
@@ -711,7 +711,7 @@ pub(crate) mod tests {
711711 . addr
712712 ) ;
713713 assert_eq ! (
714- crate :: arch:: GSI_BASE ,
714+ crate :: arch:: GSI_LEGACY_START ,
715715 device_manager. virtio_devices[ & ( type_id, id) ]
716716 . resources
717717 . irq
@@ -762,7 +762,7 @@ pub(crate) mod tests {
762762 let device_info = device_manager
763763 . allocate_mmio_resources ( & mut resource_allocator, 1 )
764764 . unwrap ( ) ;
765- assert_eq ! ( device_info. irq. unwrap( ) , crate :: arch:: GSI_BASE ) ;
765+ assert_eq ! ( device_info. irq. unwrap( ) , crate :: arch:: GSI_LEGACY_START ) ;
766766 }
767767
768768 #[ test]
0 commit comments