From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 26 19:41:30 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C7FE106564A for ; Tue, 26 Oct 2010 19:41:30 +0000 (UTC) (envelope-from selphie.keller@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id E45498FC14 for ; Tue, 26 Oct 2010 19:41:29 +0000 (UTC) Received: by gwaa18 with SMTP id a18so2848265gwa.13 for ; Tue, 26 Oct 2010 12:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3wjGaiPkw1dTGnBEe8LHM8y5PmfvtLd2kqV1xd1GYFY=; b=EjAmkz/4doBsY6DXpKIuGnp6tUPX7wTpUq6ZSyO1X3pSO/IA0993BWnQ70x2/jsISW wAaOm6NBz/yT4RSzjDnq9n9rIlLksTdSNtNg4Bozf03aljk0d1KOPNSzHxHxr6yfdq/9 QRBzUfdFRwObgUl7XcCH/7y6kURD4y2p+ks4o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=i+Z1e5n2Ae0jInATlpf0IDbRw5A8TUXdUK0nSmvY3JTTMt8Ovs/ogwZc8O2v5bnEu3 o/bnG/TZRsKjSl9rTJd6UIuGUoUKgZNUzj5+yz6DkAljMAku1REmU9x/2oWhOPQAsggv b9nVduInKAqIRV6bzlTPSwMNLxVniN2sn+RIQ= MIME-Version: 1.0 Received: by 10.42.220.66 with SMTP id hx2mr968399icb.63.1288122088956; Tue, 26 Oct 2010 12:41:28 -0700 (PDT) Received: by 10.42.164.68 with HTTP; Tue, 26 Oct 2010 12:41:28 -0700 (PDT) In-Reply-To: <201010260931.36342.jhb@freebsd.org> References: <4CC6830A.10701@icyb.net.ua> <201010260931.36342.jhb@freebsd.org> Date: Tue, 26 Oct 2010 12:41:28 -0700 Message-ID: From: Selphie Keller To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Konstantin Belousov , Andriy Gapon , romanp@wuppy.net.ru Subject: Re: SYSCALL_MODULE() macro and modfind() issues X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 19:41:30 -0000 John, Yes, your approach is the optimal solution for making pmap work on both 8.1 and lower. I wonder if there is something similiar could be done to the modfind() function itself, but I understand that the goal of "sys/" prefix is to reduce the conflicts and for now can use functions like your pmap_find() to resolve the issue. Thanks John -Estella Mystagic (Selphie) static int pmap_find(void) { int modid; modid =3D modfind("pmap_helper"); if (modid =3D=3D -1) modid =3D modfind("sys/pmap_helper"); return (modid); } then in the original main() routine use this: if ((modid =3D pmap_find()) =3D=3D -1) { /* module not found, try to load */ modid =3D kldload("pmap_helper.ko"); if (modid =3D=3D -1) err(1, "unable to load pmap_helper module"); modid =3D pmap_find(); if (modid =3D=3D -1) err(1, "pmap_helper module loaded but not found"); } On Tue, Oct 26, 2010 at 6:31 AM, John Baldwin wrote: > On Tuesday, October 26, 2010 3:28:10 am Andriy Gapon wrote: >> on 26/10/2010 01:01 Selphie Keller said the following: >> > hi fbsd-hackers, >> > >> > Noticed a issue in 8.1-release, 8.1p1-release and 8.1-stable >> > amd64/i386, to where modfind() will no longer find pmap_helper for the >> > /usr/ports/sysutils/pmap port, or other syscall modules using >> > SYSCALL_MODULE() macro. >> > The issue is that modfind() function no longer finds any modules using >> > SYSCALL_MODULE() macro to register the kernel module. Making it >> > difficult for userland apps to call the syscall provided. modfind() >> > always returns -1 which prevents modstat() from getting the required >> > information to perform the syscall. >> > >> > Also tested, the demo syscall module: >> >> After commit r205320 and, apparently, its MFC you need to prefix the mod= ule with >> "sys/". =A0For example: >> modstat(modfind("sys/syscall"), &stat); >> >> P.S. >> Perhaps a KPI breakage in a stable branch? > > Ugh, it was a breakage though it's too late to back it out at this point. > > -- > John Baldwin >