Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtio-pci: use 2 32-bit writes for 64-bit fields #306

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

Lencerf
Copy link
Contributor

@Lencerf Lencerf commented Dec 26, 2023

As per virtio spec 4.1.3.1 [1]:

For device configuration access, the driver MUST use 8-bit wide
accesses for 8-bit wide fields, 16-bit wide and aligned accesses for
16-bit wide fields and 32-bit wide and aligned accesses for 32-bit
and 64-bit wide fields.

This patch makes the virtio-pci driver sets 64-bit addresses with 2 32-bit writes to align with the spec.

[1] https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-1220001

As per virtio spec 4.1.3.1 [1]:

> For device configuration access, the driver MUST use 8-bit wide
> accesses for 8-bit wide fields, 16-bit wide and aligned accesses for
> 16-bit wide fields and 32-bit wide and aligned accesses for 32-bit
> and 64-bit wide fields.

This patch makes the virtio-pci driver sets 64-bit addresses with 2
32-bit writes to align with the spec.

[1] https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-1220001

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
@retrage retrage self-requested a review December 27, 2023 03:51
Copy link
Contributor

@retrage retrage left a comment

Choose a reason for hiding this comment

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

Thank you for the fix. It looks good to me!

@retrage retrage merged commit 84725ef into cloud-hypervisor:main Dec 27, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants