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)
Fri, Oct 18, 10:00 PM
Unknown Object (File)
Fri, Oct 18, 12:22 AM
Unknown Object (File)
Thu, Oct 17, 6:37 PM
Unknown Object (File)
Oct 4 2024, 11:49 PM
Unknown Object (File)
Oct 2 2024, 12:13 PM
Unknown Object (File)
Sep 29 2024, 10:01 PM
Unknown Object (File)
Sep 29 2024, 9:53 PM
Unknown Object (File)
Sep 29 2024, 7:04 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