Skip to content

Conversation

rbradford
Copy link
Member

The BAR calculation code was incorrect for calculating I/O BARs but also
has misleading comments (mixing bits and bytes, first and least
significant, etc).

This change adjusts the algorithm to more closely match the version
described in the PCI specification and takes advantage of Rust's binary
literals for ease of reading. Although this is slightly longer by
calculating the 64-bit and 32-bit paths separately I think this is
easier to read.

Signed-off-by: Rob Bradford robert.bradford@intel.com

@rbradford rbradford force-pushed the 2021-07-02-fix-vfio-bar-calculation branch from 34b8ac6 to 13952bc Compare July 2, 2021 15:34
The BAR calculation code was incorrect for calculating I/O BARs but also
has misleading comments (mixing bits and bytes, first and least
significant, etc).

This change adjusts the algorithm to more closely match the version
described in the PCI specification and takes advantage of Rust's binary
literals for ease of reading. Although this is slightly longer by
calculating the 64-bit and 32-bit paths separately I think this is
easier to read.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
@rbradford rbradford force-pushed the 2021-07-02-fix-vfio-bar-calculation branch from 13952bc to 23a78c5 Compare July 2, 2021 15:38
Copy link
Member

@sboeuf sboeuf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but before we go ahead and merge it, could you modify the Jenkinsfile to make this PR run the VFIO baremetal CI as well? Just want to make sure it doesn't break real VFIO use case.

@rbradford
Copy link
Member Author

Looks good to me, but before we go ahead and merge it, could you modify the Jenkinsfile to make this PR run the VFIO baremetal CI as well? Just want to make sure it doesn't break real VFIO use case.

Yup, it went green.

@rbradford rbradford force-pushed the 2021-07-02-fix-vfio-bar-calculation branch from fdcd0f6 to 23a78c5 Compare July 5, 2021 13:43
@sboeuf sboeuf merged commit 6e63df9 into cloud-hypervisor:master Jul 5, 2021
@rbradford rbradford added the bug-fix Bug fix to include in release notes label Jul 21, 2021
@rbradford rbradford deleted the 2021-07-02-fix-vfio-bar-calculation branch August 11, 2021 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix Bug fix to include in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants