From 5f0aa1618431abb282a5e8fd52a27a3bd17aacf5 Mon Sep 17 00:00:00 2001 From: Ben Larson Date: Mon, 6 May 2019 00:34:51 -0600 Subject: [PATCH] platform_drv/x86: fix report for many PCI devices When there are too many PCI devices, the Expanding_reporter regenerates the report. However, this doesn't reset the BDF counter used to iterate over the devices. This results in starting the new report after the PCI device that triggered the report buffer overflow. This commit fixes the issue by putting the BDF counter initialization inside the lambda function used to generate the report. Fixes #3317 --- repos/os/src/drivers/platform/spec/x86/pci_session_component.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h index aada315538..2a31dfa04d 100644 --- a/repos/os/src/drivers/platform/spec/x86/pci_session_component.h +++ b/repos/os/src/drivers/platform/spec/x86/pci_session_component.h @@ -1078,9 +1078,10 @@ class Platform::Root : public Genode::Root_component Config_access config_access(*_pci_confspace); Device_config config; - int bus = 0, device = 0, function = -1; _pci_reporter->generate([&] (Genode::Reporter::Xml_generator &xml) { + int bus = 0, device = 0, function = -1; + /* iterate over pci devices */ while (true) { function += 1;