Re: [PATCH 4/9] bsd-user: Two helper routines oidfmt and sysctl_oldcvt

2023-02-12 Thread Warner Losh
On Sun, Feb 12, 2023 at 10:01 AM Warner Losh wrote: > Hey Richard > > Thanks for the very interesting question... This kept me up... > > Kyle, > > Please double check what I've written below to make sure I've not missed > anything. > This might well be the source of some of the weird errors we're

Re: [PATCH 4/9] bsd-user: Two helper routines oidfmt and sysctl_oldcvt

2023-02-12 Thread Warner Losh
Hey Richard Thanks for the very interesting question... This kept me up... Kyle, Please double check what I've written below to make sure I've not missed anything. This might well be the source of some of the weird errors we're seeing on some ports, but sysctl is rare enough I'm guessing that an

Re: [PATCH 4/9] bsd-user: Two helper routines oidfmt and sysctl_oldcvt

2023-02-11 Thread Warner Losh
On Sat, Feb 11, 2023 at 3:17 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 2/10/23 13:18, Warner Losh wrote: > > +static int sysctl_oldcvt(void *holdp, size_t *holdlen, uint32_t kind) > > +{ > > +switch (kind & CTLTYPE) { > > +case CTLTYPE_INT: > > +case CTLTYPE_UINT

Re: [PATCH 4/9] bsd-user: Two helper routines oidfmt and sysctl_oldcvt

2023-02-11 Thread Richard Henderson
On 2/10/23 13:18, Warner Losh wrote: +static int sysctl_oldcvt(void *holdp, size_t *holdlen, uint32_t kind) +{ +switch (kind & CTLTYPE) { +case CTLTYPE_INT: +case CTLTYPE_UINT: +*(uint32_t *)holdp = tswap32(*(uint32_t *)holdp); +break; + +#ifdef TARGET_ABI32 +case

[PATCH 4/9] bsd-user: Two helper routines oidfmt and sysctl_oldcvt

2023-02-10 Thread Warner Losh
From: Stacey Son oidfmt uses undocumented system call to get the type of the sysctl. sysctl_oldcvt does the byte swapping in the data to return it to the target. Co-Authored-by: Sean Bruno Signed-off-by: Sean Bruno Co-Authored-by: Juergen Lock Signed-off-by: Juergen Lock Co-Authored-by: Raph