From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLyNc-00HBE9-2p for linux-um@lists.infradead.org; Tue, 16 Mar 2021 01:20:18 +0000 Received: by mail-pl1-x62a.google.com with SMTP id n17so12615096plc.7 for ; Mon, 15 Mar 2021 18:20:15 -0700 (PDT) Date: Tue, 16 Mar 2021 10:20:13 +0900 Message-ID: From: Hajime Tazaki Subject: Re: [RFC v8 13/20] um: lkl: integrate with irq infrastructure of UML In-Reply-To: <5e1f64997ffca8267bde7955fe2eb214dfb9e891.camel@sipsolutions.net> References: <46935454bf02224fb325f0e74d60d0ed674a59f9.1611103406.git.thehajime@gmail.com> <5e1f64997ffca8267bde7955fe2eb214dfb9e891.camel@sipsolutions.net> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: johannes@sipsolutions.net Cc: linux-um@lists.infradead.org, jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, tavi.purdila@gmail.com, linux-kernel-library@freelists.org, linux-arch@vger.kernel.org, retrage01@gmail.com On Mon, 15 Mar 2021 05:45:23 +0900, Johannes Berg wrote: > = > On Wed, 2021-01-20 at 11:27 +0900, Hajime Tazaki wrote: > > =A0static irqreturn_t um_timer(int irq, void *dev) > > =A0{ > > +#ifndef CONFIG_UMMODE_LIB > > =A0 if (get_current()->mm !=3D NULL) > = > Why is the ifdef needed - get_current()->mm should always be NULL for > LKL? Surely get_current() must still work? What we tried to ifdef is to avoid the following call; os_alarm_process(get_current()->mm->context.id.u.pid); because we didn't use/update get_current()->mm->context.id (struct mm_id) and calling kill(0, SIGALRM) makes a program puzzled thus, eliminate it. > > =A0 sigemptyset(&sig_mask); > > =A0 sigaddset(&sig_mask, sig); > > - if (sigprocmask(SIG_UNBLOCK, &sig_mask, NULL) < 0) > > - panic("sigprocmask failed - errno =3D %d\n", errno); > > + if (pthread_sigmask(SIG_UNBLOCK, &sig_mask, NULL) < 0) > > + panic("pthread_sigmask failed - errno =3D %d\n", errno); > = > UML doesn't normally link with libpthread, and LKL doesn't actually > appear to require it either (since it has its lkl_thread and all), so > this seems wrong? I think both UML/LKL link with libpthread. See old scripts/link-vmlinux.sh, or [01/20] patch. - ${CC} ${CFLAGS_vmlinux} \ - ${strip_debug} \ - -o ${output} \ - -Wl,-T,${lds} \ - ${objects} \ - -lutil -lrt -lpthread - rm -f linux -- Hajime _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um