Page MenuHomeFreeBSD

Only enable COMPAT_43 changes for syscalls ABI for a.out processes.
ClosedPublic

Authored by kib on Fri, Aug 9, 9:04 PM.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kib created this revision.Fri, Aug 9, 9:04 PM
imp accepted this revision.Sat, Aug 10, 12:15 AM

I think these are good. There's comments in the Linux emulator that says they do different things because of this ifdef:

compat/linux/linux_misc.c: * td->td_retval[1] when COMPAT_43 is defined. This clobbers registers that
compat/linux/linux_uid16.c: * when COMPAT_43 is defined. This clobbers registers that are assumed to

maybe that means there can be a simplification?

This revision is now accepted and ready to land.Sat, Aug 10, 12:15 AM
jhb accepted this revision.Sat, Aug 10, 12:19 AM
jhb added a subscriber: jhb.

I think a related question on the mail thread was if COMPAT_43 should be in any non-x86 config files at all. E.g. it shouldn't be in sys/conf/notes but should move to sys/x86/conf/NOTES once we start that.

imp added a comment.Sat, Aug 10, 12:26 AM
In D21200#460958, @jhb wrote:

I think a related question on the mail thread was if COMPAT_43 should be in any non-x86 config files at all. E.g. it shouldn't be in sys/conf/notes but should move to sys/x86/conf/NOTES once we start that.

Let's see, these changes would mean COMPAT_43 is just a normal 'include old code' stuff.

sparc64 wouldn't need it, since it didn't do a.out But it's frankly irrelevant...
powerpc I'm unsure about, but I don't think it needs it, despite it being in several kernels
powerpc64 I'm pretty sure doesn't need it since it doesn't support a.out.
mips doesn't need it since binary compatibility has been busted several times and we've never supported a.out.
I'm pretty sure it's close to a no op on 32-bit arm. There's no really old binaries that matter: we broke compatibility with EABI changes, and then again with the move to v6/v7, so compat for anything before FreeBSD 9 (or was it 10) is a don't care.
arm64 doesn't need it if arm doesn't need it.
riscv doesn't need it since it's too new.

I'd be willing to do the legwork unless kib@ knows some reason you and I are overlooking.

kib added a comment.Sat, Aug 10, 1:35 PM
In D21200#460954, @imp wrote:

I think these are good. There's comments in the Linux emulator that says they do different things because of this ifdef:
compat/linux/linux_misc.c: * td->td_retval[1] when COMPAT_43 is defined. This clobbers registers that
compat/linux/linux_uid16.c: * when COMPAT_43 is defined. This clobbers registers that are assumed to
maybe that means there can be a simplification?

The comments are partially outdated. They provide motivation why these syscalls needed a linuxolator reimplementation initially, but now there are much more serious reasons to have them in linuxolator, e.g. tid support. I removed the comments altogether, they only accumulated the confusion over the time.

kib added a comment.Sat, Aug 10, 1:37 PM
In D21200#460959, @imp wrote:
In D21200#460958, @jhb wrote:

I think a related question on the mail thread was if COMPAT_43 should be in any non-x86 config files at all. E.g. it shouldn't be in sys/conf/notes but should move to sys/x86/conf/NOTES once we start that.

Let's see, these changes would mean COMPAT_43 is just a normal 'include old code' stuff.
sparc64 wouldn't need it, since it didn't do a.out But it's frankly irrelevant...
powerpc I'm unsure about, but I don't think it needs it, despite it being in several kernels
powerpc64 I'm pretty sure doesn't need it since it doesn't support a.out.
mips doesn't need it since binary compatibility has been busted several times and we've never supported a.out.
I'm pretty sure it's close to a no op on 32-bit arm. There's no really old binaries that matter: we broke compatibility with EABI changes, and then again with the move to v6/v7, so compat for anything before FreeBSD 9 (or was it 10) is a don't care.
arm64 doesn't need it if arm doesn't need it.
riscv doesn't need it since it's too new.
I'd be willing to do the legwork unless kib@ knows some reason you and I are overlooking.

a.out was only supported on i386, and then was ported to amd64 to only have an ability to run i386 a.out on modern hardware. I think all other arches never ever had FreeBSD a.out support at all, so COMPAT_43 for them, after this patch lands, would mean the additional set of obsolete syscalls provided. I think that we can axe COMPAT_43 from the corresponding kernel configs safely, as a followup to this review.

kib updated this revision to Diff 60633.Sat, Aug 10, 1:39 PM

Remove confusing comments in linuxolator that mention COMPAT_43.

This revision now requires review to proceed.Sat, Aug 10, 1:39 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.