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)
Feb 14 2024, 4:16 AM
Unknown Object (File)
Jan 29 2024, 5:20 AM
Unknown Object (File)
Dec 23 2023, 6:32 AM
Unknown Object (File)
Dec 11 2023, 6:11 AM
Unknown Object (File)
Oct 10 2023, 12:49 AM
Unknown Object (File)
Sep 5 2023, 11:27 PM
Unknown Object (File)
Aug 21 2023, 8:35 PM
Unknown Object (File)
Aug 14 2023, 4:41 PM
Subscribers

Diff Detail

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

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