Skip to content

Adjust local_cpus datatype to prevent overflow on multicore systems

This PR fixes an overflow that I encountered while testing this library for use in PCI device enumeration.

The issue is that the PCI attribute local_cpus is using the kernel datatype cpumask, which size is dependent on CPU and Architecture.

To keep it simple I used the type alias found in the crate Nix, which defines cpumask as u64.

Switching from u8 to u64 solves the overflow issue on my Ryzen 7 3700X 8 Core system.

Merge request reports

Loading