qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL v3 47/55] linux headers: update against Linux 5.2


From: Aleksandar Markovic
Subject: Re: [Qemu-devel] [PULL v3 47/55] linux headers: update against Linux 5.2-rc1
Date: Thu, 23 May 2019 23:15:19 +0200

On May 22, 2019 3:50 PM, "Cornelia Huck" <address@hidden> wrote:
>
> On Wed, 22 May 2019 15:22:23 +0200
> Aleksandar Markovic <address@hidden> wrote:
>
> > On May 22, 2019 2:24 PM, "Cornelia Huck" <address@hidden> wrote:
> > >
> > > On Wed, 22 May 2019 14:10:39 +0200
> > > Laurent Vivier <address@hidden> wrote:
> > >
> > > > On 22/05/2019 14:07, Cornelia Huck wrote:
> > > > > On Wed, 22 May 2019 13:47:25 +0200
> > > > > Philippe Mathieu-Daudé <address@hidden> wrote:
> > > > >
> > > > >> On 5/21/19 5:28 PM, Cornelia Huck wrote:
> > > > >>> commit a188339ca5a396acc588e5851ed7e19f66b0ebd9
> > > > >>>
> > > > >>> Signed-off-by: Cornelia Huck <address@hidden>
> > > > >>> ---
> > > > >> [...]
> > > > >>>   #define __NR_mq_notify 184
> > > > >>>   __SC_COMP(__NR_mq_notify, sys_mq_notify, compat_sys_mq_notify)
> > > > >>>   #define __NR_mq_getsetattr 185
> > > > >>> @@ -536,8 +567,10 @@ __SC_COMP(__NR_msgsnd, sys_msgsnd,
> > compat_sys_msgsnd)
> > > > >>>   __SYSCALL(__NR_semget, sys_semget)
> > > > >>>   #define __NR_semctl 191
> > > > >>>   __SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl)
> > > > >>> +#if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG !=
32
> > > > >
> > > > > Eww. It seems only aarch64 sets __ARCH_WANT_TIME32_SYSCALLS, and
the
> > > > > second condition probably catches others but not mipsel.
> > > > >
> > > > >>>   #define __NR_semtimedop 192
> > > > >>> -__SC_COMP(__NR_semtimedop, sys_semtimedop,
compat_sys_semtimedop)
> > > > >>> +__SC_COMP(__NR_semtimedop, sys_semtimedop,
sys_semtimedop_time32)
> > > > >>> +#endif
> > > > >>>   #define __NR_semop 193
> > > > >>>   __SYSCALL(__NR_semop, sys_semop)
> > > > >> [...]
> > > > >>
> > > > >>
https://app.shippable.com/github/qemu/qemu/runs/1703/summary/console
> > > > >>
> > > > >> It seems this commit introduce a regression on mips32:
> > > > >>
> > > > >>    CC      mipsel-linux-user/linux-user/syscall.o
> > > > >> ./linux-user/syscall.c: In function 'safe_semtimedop':
> > > > >> ./linux-user/syscall.c:697:25: error: '__NR_semtimedop'
undeclared
> > > > >> (first use in this function)
> > > > >>       return safe_syscall(__NR_##name, arg1, arg2, arg3, arg4);
\
> > > > >
> > > > > So, we unconditionally deal with this syscall, i.e. we assume it
is
> > > > > always present? (I'm not sure of the logic in linux-user code.)
> > > > >
> > > >
> > > > linux-user assumes it is present if __NR_msgsnd is present.
> > >
> > > Hm. The kernel change seems to break that assumption. Does anyone with
> > > mips knowledge have an idea whether that was intentional (and the
> > > linux-user code needs to be changed), or whether that's an issue on
the
> > > kernel side?
> > >
> >
> > Hi, Cornelia.
> >
> > Thanks for your involving into this issue!
> >
> > It could be that (not-originating-from-MIPS) kernel commit:
> >
> >
https://github.com/torvalds/linux/commit/1a787fc5ba18ac767e635c58d06a0b46876184e3
> >
> > made a mess with system call availability for MIPS (I will forward this
to
> > MIPS kernel maintainer Paul Burton). My impression is that this was not
> > intentional, and is a temporary instability of kernel interface.
>
> I don't think that's the problematic commit; that one seems to be a
> follow-up on c8ce48f06503 ("asm-generic: Make time32 syscall numbers
> optional") for tools usage (we sync from the 'normal' headers).
>
> The stated intention of the asm-generic commit is to keep 32 bit
> architectures working as before via defining
> __ARCH_WANT_TIME32_SYSCALLS, but it seems that was not done for mips
> (but it should, right?)
>
> > However, I think that QEMU nevertheless should not make the assumption
that
> > if __NR_MSGSND, than semtimedop() is present. It could be true, but it
is
> > still just self-imposed belief in QEMU, kernel never guarantied such
things.
>
> I'm not too familiar with that family of syscalls; is there a better
> way to check for syscall availability here?
>
> > The alternative way of invoking via IPCV6 (else part of “ifdef
> > __NR_MSGSND”) should work for MIPS in the present stage of headers and
> > kernel.
>
> If my assumption above (mips skipped by accident) is correct, we need
> to fix the kernel headers instead :/ -- unless we want to add a
> temporary build fix.
>
> > As a side note, perhaps we shoul update kernel headers only off of
stable
> > kernel releases.
>
> In the past, we have even updated the kernel headers against
> non-mainline (kvm) versions :)
>
> Breakage here seems to be rare (and if this is a real kernel interface
> bug, it'd be a good thing that we caught it);

Definitely a good thing. I think it is fair to say that you found three or
even more bugs, in two separate software projects, and all of this using a
single patch only. :-o Perhaps you should do it more often. ;)

> I believe getting support
> for new features into QEMU quicker makes that a good trade-off.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]