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
Unknown Object (File)
Thu, Apr 11, 9:21 AM
Unknown Object (File)
Mar 21 2024, 8:56 PM
Unknown Object (File)
Mar 21 2024, 1:54 AM
Unknown Object (File)
Mar 21 2024, 1:54 AM
Unknown Object (File)
Mar 21 2024, 1:53 AM
Unknown Object (File)
Mar 21 2024, 1:53 AM
Unknown Object (File)
Mar 21 2024, 1:41 AM
Unknown Object (File)
Jan 21 2024, 9:14 PM

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