From owner-freebsd-arm@FreeBSD.ORG Fri Apr 10 06:44:11 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB527956 for ; Fri, 10 Apr 2015 06:44:11 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5D69FC7 for ; Fri, 10 Apr 2015 06:44:11 +0000 (UTC) Received: by wiun10 with SMTP id n10so14813776wiu.1 for ; Thu, 09 Apr 2015 23:44:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=KnJIoClDZWRMb7sEamjVnRaVlM/YanOtFNujCLSFlGE=; b=clBWBJMpe2X24Vmh4miRl8mvA2534s4J9DUBObHRG25bBP5q+JPl6xi3VHtOwawbNh Nr3tfWNIFP8GbqSOP9KsySNAEeX8V/gdKJHpetoYD3FUN6Vgh7P6MG/J58plNiLm6lw2 wG3cQl9hOZWpHt/YSwZ6x3xMt9aFHqg6zuc6G88/MK5TiVg/whrBB2fQMljs+08sXTym ZuXw7Yuc/37RiG4YEIWVPgpN1f7hpW+pT8M2gKKeJqqIu8ovm2U7VGdfZDSpGfa7tPoV DdYTOPINLLOUrih5YLLuiYxEl7zmdvf5d0la2Pwe67PJr5FO2it4FmMb6ONqeLRqehVT klMQ== MIME-Version: 1.0 X-Received: by 10.180.80.65 with SMTP id p1mr12577819wix.70.1428648250081; Thu, 09 Apr 2015 23:44:10 -0700 (PDT) Received: by 10.27.91.75 with HTTP; Thu, 9 Apr 2015 23:44:10 -0700 (PDT) In-Reply-To: References: Date: Thu, 9 Apr 2015 23:44:10 -0700 Message-ID: Subject: Re: kvm_nlist failing on arm? From: Waitman Gobble To: "freebsd-arm@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2015 06:44:12 -0000 On Mon, Apr 6, 2015 at 7:09 PM, Waitman Gobble wrote: > On Mon, Apr 6, 2015 at 5:32 PM, Waitman Gobble wrote: >> Hi, >> >> I'm having an issue with kvm_nlist failing on armv6 machine, but works >> on amd64 machines. Anyone have an idea about this? >> >> >> simple example >> >> static struct nlist nl[] = { >> #define N_HCI_RAW 0 >> { "_ng_btsocket_hci_raw_sockets" }, >> }; >> >> kvm_t *kvmd = NULL; >> kvmd = kvm_openfiles(NULL, memf, NULL, O_RDONLY, errbuf); >> kvm_nlist(kvmd, nl); >> if (nl[0].n_type == 0) { >> /* bomb - problem */ >> } >> >> >> >> # uname -a >> FreeBSD ARTiming150301 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r279488: >> Sun Mar 1 10:27:33 PST 2015 >> waitman@rpidev.waitman.net:/usr/home/waitman/crochet-freebsd/work/obj/arm.armv6/usr/src/sys/TMRDEV >> arm >> >> >> Thanks, >> >> -- >> Waitman Gobble >> Los Altos California USA >> 510-830-7975 > > > OOPs, the error: > > kvm_nlist: no namelist > > > -- > Waitman Gobble > Los Altos California USA > 510-830-7975 I'm not yet sure if this is a netgraph or bluetooth kernel module issue, or something else. kvm_nlist does not seem to resolve netgraph/bluetooth names on RPI/armv6 which causes btsockstat in base to fail with error. # btsockstat btsockstat: kvm_nlist: no namelist uname -a FreeBSD ARTiming150301 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r279488: Sun Mar 1 10:27:33 PST 2015 waitman@rpidev.waitman.net:/usr/home/waitman/crochet-freebsd/work/obj/arm.armv6/usr/src/sys/TMRDEV arm # kldstat | grep ng_ 5 1 0xc2ba0000 e000 ng_ubt.ko 7 1 0xc2bcb000 12000 ng_hci.ko 8 3 0xc2bde000 a000 ng_bluetooth.ko 13 1 0xc2cc0000 16000 ng_l2cap.ko 14 1 0xc2cd8000 24000 ng_btsocket.ko 15 1 0xc2d05000 c000 ng_socket.ko test, some things we know should not resolve and some things should. #include #include #include #include #include #include #include static struct nlist nl[] = { { "kernel_l1pa" }, { "KPML4phys" }, { "_rtstat" }, { "booha" }, { "_ng_btsocket_hci_raw_debug_level" }, { "_ng_btsocket_hci_raw_sockets" }, { "_ng_btsocket_l2cap_raw_sockets" }, { "_ng_btsocket_l2cap_sockets" }, { "_ng_btsocket_l2cap_raw_rt" }, { "_ng_btsocket_l2cap_rt" }, { "_ng_btsocket_rfcomm_sockets" }, { "_ng_btsocket_rfcomm_sessions" }, { "_rttrash" }, { "_rt_tables" }, { "" }, }; int main(int argc, char *argv[]) { int i; kvm_t *kvmd = NULL; char errbuf[_POSIX2_LINE_MAX]; kvmd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf); kvm_nlist(kvmd, nl); for (i=0;i<14;i++) { if (nl[i].n_type == 0) { printf("error: no match %i (%s)\n",i,nl[i].n_name); } else { printf("OK: %i %s\n",i,nl[i].n_name); } } return(0); } # clang -lkvm -o test test.c # ./test OK: 0 kernel_l1pa error: no match 1 (KPML4phys) OK: 2 _rtstat error: no match 3 (booha) error: no match 4 (_ng_btsocket_hci_raw_debug_level) error: no match 5 (_ng_btsocket_hci_raw_sockets) error: no match 6 (_ng_btsocket_l2cap_raw_sockets) error: no match 7 (_ng_btsocket_l2cap_sockets) error: no match 8 (_ng_btsocket_l2cap_raw_rt) error: no match 9 (_ng_btsocket_l2cap_rt) error: no match 10 (_ng_btsocket_rfcomm_sockets) error: no match 11 (_ng_btsocket_rfcomm_sessions) OK: 12 _rttrash OK: 13 _rt_tables Hopefully someone can shed some light on this problem. Thank you, -- Waitman Gobble Los Altos California USA 510-830-7975