From 4e45ee4248e5fa7ca95ac81145d5e94e3abc5e65 Mon Sep 17 00:00:00 2001 From: Tomasz Jeznach Date: Tue, 19 Mar 2024 14:15:26 -0700 Subject: [PATCH] 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 --- src/viot.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/viot.rs b/src/viot.rs index a5d2dfa..cc1023a 100644 --- a/src/viot.rs +++ b/src/viot.rs @@ -148,14 +148,6 @@ impl PciDevice { fn as_bdf(&self) -> u16 { (self.bus as u16) << 8 | (self.device as u16) << 3 | self.function as u16 } - - fn as_segment(&self) -> u16 { - self.segment - } - - fn as_endpoint(&self) -> u32 { - (self.as_segment() as u32) << 16 | self.as_bdf() as u32 - } } /// This structure describes a range of PCI endpoints @@ -188,7 +180,7 @@ impl Aml for PciRange { sink.byte(ViotEntryType::PciRange as u8); sink.byte(0); // reserved sink.word(Self::len() as u16); - sink.dword(self.first.as_endpoint()); + sink.dword(self.first.as_bdf() as u32); sink.word(self.first.segment); sink.word(self.last.segment); sink.word(self.first.as_bdf());