Page MenuHomeFreeBSD

[POWERPC] Switch endian of common dev information
ClosedPublic

Authored by leonardo.bianconi_eldorado.org.br on Feb 26 2021, 6:22 PM.
Referenced Files
F106106557: D28947.diff
Wed, Dec 25, 12:25 PM
Unknown Object (File)
Mon, Dec 9, 3:42 AM
Unknown Object (File)
Thu, Dec 5, 9:51 PM
Unknown Object (File)
Wed, Dec 4, 11:43 AM
Unknown Object (File)
Thu, Nov 28, 11:19 PM
Unknown Object (File)
Nov 25 2024, 12:13 PM
Unknown Object (File)
Nov 14 2024, 9:15 AM
Unknown Object (File)
Nov 14 2024, 7:05 AM

Details

Summary

Virtio modern has the common data organized in little endian.
POWERPC architecture, as BE, was reading and writing in the wrong
format.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[POWERPC] Switch endian of common dev information

Virtio modern has the common data organized in little endian.
POWERPC architecture, as BE, was reading and writing in the wrong
format.

Checking endian when reading and writing in dev common.

bryanv requested changes to this revision.Mar 8 2021, 10:38 PM
bryanv added inline comments.
sys/dev/virtio/pci/virtio_pci_modern.c
149

This method signature of void pointer and size is too easy to get wrong, difficult to read, and really only makes sense as a DEVMETHOD to avoid interface explosion. Add methods for each size like already exists instead.

This revision now requires changes to proceed.Mar 8 2021, 10:38 PM

Avoid creating new function and convert endian in existing functions.

leonardo.bianconi_eldorado.org.br added inline comments.
sys/dev/virtio/pci/virtio_pci_modern.c
149

I've added the call to convert endian inside existing functions, avoiding the new one created before.

leonardo.bianconi_eldorado.org.br added inline comments.
sys/dev/virtio/pci/virtio_pci_modern.c
149

@bryanv I have added the endian change inside the existent functions, to be generic, since I didn't identify any call to these functions outside this file.
If you prefer to create specific functions for these calls, I can change it, let me know.
Thanks!

Thanks Leonardo. I've being testing this patch, it looks good to me.

@bryanv, are you ok with this change?

This revision is now accepted and ready to land.May 4 2021, 2:54 PM