From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 26 08:00:16 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 E7E061065670 for ; Tue, 26 Oct 2010 08:00:15 +0000 (UTC) (envelope-from selphie.keller@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9FACB8FC17 for ; Tue, 26 Oct 2010 08:00:15 +0000 (UTC) Received: by iwn39 with SMTP id 39so5497668iwn.13 for ; Tue, 26 Oct 2010 01:00:15 -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:content-type :content-transfer-encoding; bh=mmVBE7Y22clxlynp24eur+teSvJQjUdg/tGN6+uWNbM=; b=M9rccneN0gBtcCNsfjFy3poo7a2nl7wsNYxBHUjYaNoiKU2jww7vm39gvza+8e4tT4 KNycM4Iw/8cfKd/EBnouwqPOTvgxr/C0r7dUDKWTep6Oxj7Cnp09Bgvg3iScCiyYKzqF dz/Q1qyK7fu+YCZK1+kKdfzy/h7YNDV8aZMnA= 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 :content-type:content-transfer-encoding; b=YIyPpD//wRhE9cRR0RkkXWR6e2qH7g+uSsnHEj/+fA9C24jIw+5rrQLLl4kNRi3qzW XOVLkUd5mQFSY3Y1xQShD80y+7RfV/FPPRETwDq1YT6AeBSD7rfbij8lpSXprWXJvVVY zF8Mefo5GHS0W+B+JBTCxLI8QmAvZLstEFjOo= MIME-Version: 1.0 Received: by 10.42.170.197 with SMTP id g5mr5536333icz.347.1288080014968; Tue, 26 Oct 2010 01:00:14 -0700 (PDT) Received: by 10.42.164.68 with HTTP; Tue, 26 Oct 2010 01:00:14 -0700 (PDT) In-Reply-To: <4CC6830A.10701@icyb.net.ua> References: <4CC6830A.10701@icyb.net.ua> Date: Tue, 26 Oct 2010 01:00:14 -0700 Message-ID: From: Selphie Keller To: Andriy Gapon , freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: 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 08:00:16 -0000 Thanks Andriy, Took a look at the change to src/sys/sys/sysent.h @@ -149,7 +149,7 @@ static struct syscall_module_data name## }; \ \ static moduledata_t name##_mod =3D { \ - #name, \ + "sys/" #name, \ syscall_module_handler, \ &name##_syscall_mod \ }; \ applied the MFC prefix to pmap port: --- /usr/ports/sysutils/pmap/work/pmap/pmap/pmap.c.orig 2010-10-26 00:55:32.000000000 -0700 +++ /usr/ports/sysutils/pmap/work/pmap/pmap/pmap.c 2010-10-26 00:56:10.000000000 -0700 @@ -86,12 +86,12 @@ main(int argc, char **argv) struct kinfo_proc *kp; int pmap_helper_syscall; - if ((modid =3D modfind("pmap_helper")) =3D=3D -1) { + if ((modid =3D modfind("sys/pmap_helper")) =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 modfind("pmap_helper"); + modid =3D modfind("sys/pmap_helper"); if (modid =3D=3D -1) err(1, "pmap_helper module loaded but not found"); } which restored functionality on freebsd 8.1. -Estella Mystagic (Selphie) On Tue, Oct 26, 2010 at 12:28 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 modu= le with > "sys/". =A0For example: > modstat(modfind("sys/syscall"), &stat); > > P.S. > Perhaps a KPI breakage in a stable branch? > -- > Andriy Gapon >