Skip to content
  • Alexandru Elisei's avatar
    Check that a PCI device's memory size is power of two · d7b6a894
    Alexandru Elisei authored
    According to the PCI local bus specification [1], a device's memory size
    must be a power of two. This is also implicit in the mechanism that a CPU
    uses to get the memory size requirement for a PCI device.
    
    The vesa device requests a memory size that isn't a power of two.
    According to the same spec [1], a device is allowed to consume more memory
    than it actually requires. As a result, the amount of memory that the vesa
    device now reserves has been increased.
    
    To prevent slip-ups in the future, a few BUILD_BUG_ON statements were added
    in places where the memory size is known at compile time.
    
    [1] PCI Local Bus Specification Revision 3.0, section 6.2.5.1
    d7b6a894