From owner-freebsd-virtualization@FreeBSD.ORG Tue Mar 6 21:30:27 2012 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8FBA31065673 for ; Tue, 6 Mar 2012 21:30:27 +0000 (UTC) (envelope-from monthadar@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4982A8FC22 for ; Tue, 6 Mar 2012 21:30:27 +0000 (UTC) Received: by iahk25 with SMTP id k25so10312617iah.13 for ; Tue, 06 Mar 2012 13:30:26 -0800 (PST) Received-SPF: pass (google.com: domain of monthadar@gmail.com designates 10.43.48.65 as permitted sender) client-ip=10.43.48.65; Authentication-Results: mr.google.com; spf=pass (google.com: domain of monthadar@gmail.com designates 10.43.48.65 as permitted sender) smtp.mail=monthadar@gmail.com; dkim=pass header.i=monthadar@gmail.com Received: from mr.google.com ([10.43.48.65]) by 10.43.48.65 with SMTP id uv1mr17215631icb.57.1331069426858 (num_hops = 1); Tue, 06 Mar 2012 13:30:26 -0800 (PST) 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 :cc:content-type; bh=zJSWgSffipBXpvb0R131x8aa5p8tKjv/KxC6J9bCtB4=; b=lAXLQYq/HeyKRtus/IdpilwpyPttfpE74lpUBSvXTVY5MAhISp7anBy69yS0Imp7+s I2vWvhGtpi5uEIJJ9JfQKvpMtVmKR+W6wgXur18IytpIozLsO8/azbxkKWQEO8Qsu2bh ySL4aiubW5cYLkq4NQuwyFx2WUiq1naejOQ5T1WEs+IOaHVETOU4MV5UmxNb+U6nBXhY nyiTHhHBCNmiRDXttLbtjyDxAaKHy9kX31UDrW3NOULIlG7OMvJa7S3HEzD3RtmmmFrK lifK94x6EL25deBjwWJ/BdDPWOkOmAB1yhfPVSfgY+InsKUgvyjXa2TFinLm6CgN5eYy Sj8Q== MIME-Version: 1.0 Received: by 10.43.48.65 with SMTP id uv1mr14221998icb.57.1331069426237; Tue, 06 Mar 2012 13:30:26 -0800 (PST) Received: by 10.50.236.67 with HTTP; Tue, 6 Mar 2012 13:30:26 -0800 (PST) In-Reply-To: <201203062157.22390.zec@fer.hr> References: <201203062122.15426.zec@fer.hr> <201203062157.22390.zec@fer.hr> Date: Tue, 6 Mar 2012 22:30:26 +0100 Message-ID: From: Monthadar Al Jaberi To: Marko Zec Content-Type: multipart/mixed; boundary=bcaec529a06152812404ba99c000 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Adrian Chadd , freebsd-virtualization@freebsd.org Subject: Re: VIMAGE + kldload wlan + kldload wtap panic X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 21:30:27 -0000 --bcaec529a06152812404ba99c000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Mar 6, 2012 at 9:57 PM, Marko Zec wrote: > On Tuesday 06 March 2012 21:29:32 Monthadar Al Jaberi wrote: >> On Tue, Mar 6, 2012 at 9:22 PM, Marko Zec wrote: >> > On Tuesday 06 March 2012 21:13:00 Monthadar Al Jaberi wrote: >> >> I am confused so whats the difference between having wlan in kernel >> >> config or not? Cuase that seems the reason why we panic... linker >> >> problems? >> > >> > Its not impossible. >> > >> > Have you tried to do CURVNET_SET(ss->ss_vap->iv_ifp->if_vnet) on entry= to > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^^^^^^^^^^^^^^^^^^^^^= ^^^^^^^^^^^^^^^ >> > scan_task() as I suggested earlier in this thread? >> >> this is the code I added: >> diff --git a/sys/net80211/ieee80211_scan.c b/sys/net80211/ieee80211_scan= .c >> index 5c1e3d9..bd20653 100644 >> --- a/sys/net80211/ieee80211_scan.c >> +++ b/sys/net80211/ieee80211_scan.c >> @@ -850,6 +850,7 @@ scan_task(void *arg, int pending) >> =A0 =A0 =A0 =A0 int scandone =3D 0; >> >> =A0 =A0 =A0 =A0 IEEE80211_LOCK(ic); >> + =A0 =A0 =A0CURVNET_SET((struct ieee80211_scan_state *) >> ss->ss_vap->iv_ifp->if_curvnet); > =A0^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > You couldn't have ever compiled this, so you must be booting an old kerne= l. Whats wrong with this line, I am running new kernel remember I compile wlan afterward and kldload it it seems to compile fine if I type wrong names inside CURVNET_SET hmm... I cant copy/paste db output from VBox butI am attaching two pictures. > > Pls. make sure you have actually rebuilt and rebooted a new kernel, an le= t us > know the outcome. > > Thanks > > Marko > > >> =A0 =A0 =A0 =A0 if (vap =3D=3D NULL || (ic->ic_flags & IEEE80211_F_SCAN)= =3D=3D 0 || >> =A0 =A0 =A0 =A0 =A0 =A0 (SCAN_PRIVATE(ss)->ss_iflags & ISCAN_ABORT)) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Cancelled before we started */ >> @@ -1004,6 +1005,7 @@ scan_task(void *arg, int pending) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ss->ss_ops->scan_restart(ss, vap); =A0 = =A0 =A0/* XXX? */ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ieee80211_runtask(ic, &SCAN_PRIVATE(ss)-= >ss_scan_task); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 IEEE80211_UNLOCK(ic); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 CURVNET_RESTORE(); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; >> =A0 =A0 =A0 =A0 } >> >> @@ -1043,6 +1045,7 @@ done: >> =A0 =A0 =A0 =A0 SCAN_PRIVATE(ss)->ss_iflags &=3D ~(ISCAN_CANCEL|ISCAN_AB= ORT); >> =A0 =A0 =A0 =A0 ss->ss_flags &=3D ~(IEEE80211_SCAN_ONCE | IEEE80211_SCAN= _PICK1ST); >> =A0 =A0 =A0 =A0 IEEE80211_UNLOCK(ic); >> + =A0 =A0 =A0 CURVNET_RESTORE(); >> =A0#undef ISCAN_REP >> =A0} >> >> same panic... >> >> > Cheers, >> > >> > Marko >> > >> >> On Tue, Mar 6, 2012 at 9:06 PM, Adrian Chadd > wrote: >> >> > Hi, >> >> > >> >> > The trouble here is that net80211 has quite a few other contexts th= at >> >> > things are called from: >> >> > >> >> > * driver taskqueue; >> >> > * net80211 taskqueue; >> >> > * driver callouts; >> >> > * net80211 callouts; >> >> > * ioctls via net80211. >> >> > >> >> > That's in parallel with frame tx/rx and device ioctls. >> >> > >> >> > I don't personally have the time to go through net80211 and driver(= s) >> >> > at the moment to figure out what's going on. Since ath(4) does a bu= nch >> >> > of frame processing in taskqueue context (and I'm trying to elimina= te >> >> > frame processing in _callout_ context, ew..) things can potentially >> >> > get a bit hairy. >> >> > >> >> > >> >> > Adrian >> >> > >> >> > On 6 March 2012 11:59, Marko Zec wrote: >> >> >> On Tuesday 06 March 2012 20:49:38 Monthadar Al Jaberi wrote: >> >> >>> I added VNET_DEBUG and noticed this warning (original scan_task >> >> >>> code): >> >> >>> >> >> >>> CURVNET_SET() recursion in sosend() line 1350, prev in >> >> >>> kern_kldload() 0xfffffe0002202c40 -> 0xfffffe0002202c40 >> >> >>> KDB: stack backtrace: >> >> >>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2a >> >> >>> kdb_backtrace() at kdb_backtrace+0x37 >> >> >>> sosend() at sosend+0xbd >> >> >>> clnt_vc_call() at clnt_vc_call+0x3e6 >> >> >>> clnt_reconnect_call() at clnt_reconnect_call+0xf5 >> >> >>> newnfs_request() at newnfs_request+0x9fb >> >> >>> nfscl_request() at nfscl_request+0x72 >> >> >>> nfsrpc_lookup() at nfsrpc_lookup+0x1be >> >> >>> nfs_lookup() at nfs_lookup+0x297 >> >> >>> VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0x95 >> >> >>> lookup() at lookup+0x3b8 >> >> >>> namei() at namei+0x484 >> >> >>> vn_open_cred() at vn_open_cred+0x1e2 >> >> >>> link_elf_load_file() at link_elf_load_file+0xb3 >> >> >>> linker_load_module() at linker_load_module+0x794 >> >> >>> kern_kldload() at kern_kldload+0x145 >> >> >>> sys_kldload() at sys_kldload+0x84 >> >> >>> amd64_syscall() at amd64_syscall+0x39e >> >> >>> Xfast_syscall() at Xfast_syscall+0xf7 >> >> >> >> >> >> You can safely ignore those. =A0Recursing on curvnet is harmless, = but >> >> >> in certain cases can't be avoided. >> >> >> >> >> >> When injecting new CURVNET_SET() / CURVNET_RESTORE() points in the >> >> >> existing code, those warnings are here to help us becoming aware t= hat >> >> >> we are setting curvnet in a function which was invoked with an >> >> >> already valid curvnet context. >> >> >> >> >> >> Marko > > --=20 Monthadar Al Jaberi --bcaec529a06152812404ba99c000--