@@ -82,12 +82,12 @@ fn add_virtio_aml(
82
82
dsdt_data : & mut Vec < u8 > ,
83
83
addr : u64 ,
84
84
len : u64 ,
85
- irq : u32 ,
85
+ gsi : u32 ,
86
86
) -> Result < ( ) , aml:: AmlError > {
87
- let dev_id = irq - crate :: arch:: GSI_BASE ;
87
+ let dev_id = gsi - crate :: arch:: GSI_LEGACY_START ;
88
88
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
91
91
) ;
92
92
aml:: Device :: new (
93
93
format ! ( "V{:03}" , dev_id) . as_str ( ) . try_into ( ) ?,
@@ -103,7 +103,7 @@ fn add_virtio_aml(
103
103
addr. try_into( ) . unwrap( ) ,
104
104
len. try_into( ) . unwrap( ) ,
105
105
) ,
106
- & aml:: Interrupt :: new( true , true , false , false , irq ) ,
106
+ & aml:: Interrupt :: new( true , true , false , false , gsi ) ,
107
107
] ) ,
108
108
) ?,
109
109
] ,
@@ -156,9 +156,9 @@ impl MMIODeviceManager {
156
156
resource_allocator : & mut ResourceAllocator ,
157
157
irq_count : u32 ,
158
158
) -> Result < MMIODeviceInfo , MmioError > {
159
- let irq = match resource_allocator. allocate_gsi ( irq_count) ?[ ..] {
159
+ let gsi = match resource_allocator. allocate_gsi_legacy ( irq_count) ?[ ..] {
160
160
[ ] => None ,
161
- [ irq ] => Some ( irq ) ,
161
+ [ gsi ] => Some ( gsi ) ,
162
162
_ => return Err ( MmioError :: InvalidIrqConfig ) ,
163
163
} ;
164
164
@@ -169,7 +169,7 @@ impl MMIODeviceManager {
169
169
AllocPolicy :: FirstMatch ,
170
170
) ?,
171
171
len : MMIO_LEN ,
172
- irq,
172
+ irq : gsi ,
173
173
} ;
174
174
Ok ( device_info)
175
175
}
@@ -183,7 +183,7 @@ impl MMIODeviceManager {
183
183
) -> Result < ( ) , MmioError > {
184
184
// Our virtio devices are currently hardcoded to use a single IRQ.
185
185
// Validate that requirement.
186
- let irq = device. resources . irq . ok_or ( MmioError :: InvalidIrqConfig ) ?;
186
+ let gsi = device. resources . irq . ok_or ( MmioError :: InvalidIrqConfig ) ?;
187
187
let identifier;
188
188
{
189
189
let mmio_device = device. inner . lock ( ) . expect ( "Poisoned lock" ) ;
@@ -197,7 +197,7 @@ impl MMIODeviceManager {
197
197
. register_ioevent ( queue_evt, & io_addr, u32:: try_from ( i) . unwrap ( ) )
198
198
. map_err ( MmioError :: RegisterIoEvent ) ?;
199
199
}
200
- vm. register_irq ( & mmio_device. interrupt . irq_evt , irq )
200
+ vm. register_irq ( & mmio_device. interrupt . irq_evt , gsi )
201
201
. map_err ( MmioError :: RegisterIrqFd ) ?;
202
202
}
203
203
@@ -276,7 +276,7 @@ impl MMIODeviceManager {
276
276
let device_info = if let Some ( device_info) = device_info_opt {
277
277
device_info
278
278
} else {
279
- let gsi = vm. resource_allocator ( ) . allocate_gsi ( 1 ) ?;
279
+ let gsi = vm. resource_allocator ( ) . allocate_gsi_legacy ( 1 ) ?;
280
280
MMIODeviceInfo {
281
281
addr : SERIAL_MEM_START ,
282
282
len : MMIO_LEN ,
@@ -335,7 +335,7 @@ impl MMIODeviceManager {
335
335
let device_info = if let Some ( device_info) = device_info_opt {
336
336
device_info
337
337
} else {
338
- let gsi = vm. resource_allocator ( ) . allocate_gsi ( 1 ) ?;
338
+ let gsi = vm. resource_allocator ( ) . allocate_gsi_legacy ( 1 ) ?;
339
339
MMIODeviceInfo {
340
340
addr : RTC_MEM_START ,
341
341
len : MMIO_LEN ,
@@ -612,15 +612,15 @@ pub(crate) mod tests {
612
612
let dev = device_manager. get_virtio_device ( 0 , "dummy" ) . unwrap ( ) ;
613
613
assert_eq ! ( dev. resources. addr, arch:: MEM_32BIT_DEVICES_START ) ;
614
614
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 ) ) ;
616
616
617
617
device_manager
618
618
. for_each_virtio_device ( |virtio_type, device_id, mmio_device| {
619
619
assert_eq ! ( * virtio_type, 0 ) ;
620
620
assert_eq ! ( device_id, "dummy" ) ;
621
621
assert_eq ! ( mmio_device. resources. addr, arch:: MEM_32BIT_DEVICES_START ) ;
622
622
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 ) ) ;
624
624
Ok :: < ( ) , ( ) > ( ( ) )
625
625
} )
626
626
. unwrap ( ) ;
@@ -643,7 +643,7 @@ pub(crate) mod tests {
643
643
#[ cfg( target_arch = "aarch64" ) ]
644
644
vm. setup_irqchip ( 1 ) . unwrap ( ) ;
645
645
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 {
647
647
device_manager
648
648
. register_virtio_test_device (
649
649
& vm,
@@ -711,7 +711,7 @@ pub(crate) mod tests {
711
711
. addr
712
712
) ;
713
713
assert_eq ! (
714
- crate :: arch:: GSI_BASE ,
714
+ crate :: arch:: GSI_LEGACY_START ,
715
715
device_manager. virtio_devices[ & ( type_id, id) ]
716
716
. resources
717
717
. irq
@@ -762,7 +762,7 @@ pub(crate) mod tests {
762
762
let device_info = device_manager
763
763
. allocate_mmio_resources ( & mut resource_allocator, 1 )
764
764
. unwrap ( ) ;
765
- assert_eq ! ( device_info. irq. unwrap( ) , crate :: arch:: GSI_BASE ) ;
765
+ assert_eq ! ( device_info. irq. unwrap( ) , crate :: arch:: GSI_LEGACY_START ) ;
766
766
}
767
767
768
768
#[ test]
0 commit comments