Skip to content

Commit ca1a473

Browse files
tjeznachrbradford
authored andcommitted
acpi_tables: Fix VIOT endpoint_id remapping
For non-zero segment remappings it's very likely that target endpoint identifiers namespace will start at 0, without requester segment number encoded in the translation request. Signed-off-by: Tomasz Jeznach <[email protected]>
1 parent 76e8552 commit ca1a473

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/viot.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,6 @@ impl PciDevice {
148148
fn as_bdf(&self) -> u16 {
149149
(self.bus as u16) << 8 | (self.device as u16) << 3 | self.function as u16
150150
}
151-
152-
fn as_segment(&self) -> u16 {
153-
self.segment
154-
}
155-
156-
fn as_endpoint(&self) -> u32 {
157-
(self.as_segment() as u32) << 16 | self.as_bdf() as u32
158-
}
159151
}
160152

161153
/// This structure describes a range of PCI endpoints
@@ -188,7 +180,7 @@ impl Aml for PciRange {
188180
sink.byte(ViotEntryType::PciRange as u8);
189181
sink.byte(0); // reserved
190182
sink.word(Self::len() as u16);
191-
sink.dword(self.first.as_endpoint());
183+
sink.dword(self.first.as_bdf() as u32);
192184
sink.word(self.first.segment);
193185
sink.word(self.last.segment);
194186
sink.word(self.first.as_bdf());

0 commit comments

Comments
 (0)