Page MenuHomeFreeBSD

compat32: add size CTASSERTs for non-amd64 cases
ClosedPublic

Authored by emaste on Mar 30 2022, 3:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 22, 3:02 AM
Unknown Object (File)
Tue, Oct 22, 2:47 AM
Unknown Object (File)
Oct 18 2024, 8:35 AM
Unknown Object (File)
Oct 18 2024, 1:19 AM
Unknown Object (File)
Oct 3 2024, 8:09 PM
Unknown Object (File)
Oct 2 2024, 6:19 PM
Unknown Object (File)
Oct 1 2024, 10:08 AM
Unknown Object (File)
Oct 1 2024, 2:50 AM
Subscribers

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste created this revision.

This review prompted by looking at stat32 on arm64 and f90cd1ae30b5f49e9f6ea58a0628ce1c8d8822bc.

I believe[1] that we can avoid translating to stat32 on arm64 (and other LE non-x86 architectures); stat and stat32 have the same layout except that in kernel we write an int64_t to the timespecs tv_nsec which userland interprets as an int32_t followed by 4 bytes of padding.

I think we could then revert f90cd1ae30b5f49e9f6ea58a0628ce1c8d8822bc and have arm64 just do

int
freebsd32_fstatat(struct thread *td, struct freebsd32_fstatat_args *uap)
{
       return (sys_fstatat(td, uap));
}

(It would be convenient if we could tell config to avoid emitting a compat ABI sysent for specific architectures, but we don't have this capability today.)

[1] We'd need to validate this carefully and confirm I haven't missed anything if we're going to go ahead.

This built on arm64 in Cirrus-CI, although it seems the smoke test doesn't boot at present.
Log at https://api.cirrus-ci.com/v1/task/6107605943713792/logs/test.log

virtio_pci0: <VirtIO PCI (legacy) Block adapter> mem 0x10000000-0x10000fff,0x8000000000-0x8000003fff at device 1.0 on pci0
pcib0: Failed to translate resource 0-ffffffffffffffff type 4 for virtio_pci0
virtio_pci0: 0x80 bytes of rid 0x10 res 4 failed (0, 0xffffffffffffffff).
pci0: child virtio_pci0 requested type 3 for rid 0x10, but the BAR says it is an ioport
pci0: child virtio_pci0 requested type 3 for rid 0x10, but the BAR says it is an ioport
pcib0: Failed to translate resource 0-ffffffffffffffff type 4 for virtio_pci0
virtio_pci0: 0x80 bytes of rid 0x10 res 4 failed (0, 0xffffffffffffffff).
pcib0: Failed to translate resource 0-ffffffffffffffff type 4 for virtio_pci0
virtio_pci0: 0x80 bytes of rid 0x10 res 4 failed (0, 0xffffffffffffffff).
pcib0: Failed to translate resource 0-ffffffffffffffff type 4 for virtio_pci0
virtio_pci0: 0x80 bytes of rid 0x10 res 4 failed (0, 0xffffffffffffffff).
pcib0: Failed to translate resource 0-ffffffffffffffff type 4 for virtio_pci0
virtio_pci0: 0x80 bytes of rid 0x10 res 4 failed (0, 0xffffffffffffffff).
pci0: child virtio_pci0 requested type 3 for rid 0x10, but the BAR says it is an ioport
pci0: child virtio_pci0 requested type 3 for rid 0x10, but the BAR says it is an ioport
pci0: child virtio_pci0 requested type 3 for rid 0x10, but the BAR says it is an ioport
...
pci0: child virtio_pci0 requested type 3 for rid 0x10, but the BAR says it is an ioport
pcib0: Failed to translate resource 0-ffffffffffffffff type 4 for virtio_pci0
virtio_pci0: 0x80 bytes of rid 0x10 res 4 failed (0, 0xffffffffffffffff).
pci0: child virtio_pci0 requested type 3 for rid 0x10, but the BAR says it is an ioport
pcib0: Failed to translate resource 0-ffffffffffffffff type 4 for virtio_pci0
virtio_pci0: 0x80 bytes of rid 0x10 res 4 failed (0, 0xffffffffffffffff).
pcib0: Failed to translate resource 0-ffffffffffffffff type 4 for virtio_pci0
virtio_pci0: 0x80 bytes of rid 0x10 res 4 failed (0, 0xffffffffffffffff).
pcib0: Failed to translate resource 0-ffffffffffffffff type 4 for virtio_pci0
virtio_pci0: 0x80 bytes of rid 0x10 res 4 failed (0, 0xffffffffffffffff).
...
This revision is now accepted and ready to land.Mar 30 2022, 5:00 PM