From nobody Mon Jun 21 11:00:23 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 855677C9085 for ; Mon, 21 Jun 2021 11:00:33 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from mail.rlwinm.de (mail.rlwinm.de [138.201.35.217]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4G7mlj2t4Tz4pmJ for ; Mon, 21 Jun 2021 11:00:33 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from alteisen.fritz.box (200116b864038700dc61450ab429fa26.dip.versatel-1u1.de [IPv6:2001:16b8:6403:8700:dc61:450a:b429:fa26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.rlwinm.de (Postfix) with ESMTPSA id DA327115A1 for ; Mon, 21 Jun 2021 11:00:25 +0000 (UTC) Subject: Re: How to run script on network address change? To: freebsd-hackers@freebsd.org References: <20210620165215.0f3dd15c@rimwks.local> <20210620193744.39eae64f@rimwks.local> From: Crest Message-ID: Date: Mon, 21 Jun 2021 13:00:23 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 In-Reply-To: <20210620193744.39eae64f@rimwks.local> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4G7mlj2t4Tz4pmJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 20.06.21 18:37, Rozhuk Ivan wrote: > On Sun, 20 Jun 2021 16:23:38 +0200 > "dmilith ." wrote: > >> Have you tried `route monitor`? > > No, and I do not want keep running some daemon that will parse output. > > But thanks, I found good place to add devctl_notify() calls. > Now devd have new events. > > > run: > ifconfig lan0 alias 192.168.1.1/24 > ifconfig lan0 -alias 192.168.1.1 > ifconfig lan0 inet6 1111:: > > devd output: > !system=IFNET subsystem=lan0 type=ADDR_ADD 192.168.1.1 > !system=IFNET subsystem=lan0 type=ADDR_DEL 192.168.1.1 > !system=IFNET subsystem=lan0 type=ADDR_ADD 1111:: > > > And even for netif rename: > ifconfig lan0 name lan1 > ifconfig lan1 name lan0 > > devd output: > !system=IFNET subsystem=lan0 type=RENAME lan1 > !system=IFNET subsystem=lan1 type=RENAME lan0 Those events would be *very* useful to me although it's probably a good idea to add a sysctl to disable their generation on systems with very high address churn. From nobody Tue Jun 22 16:04:16 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6A9CC11DC9AA; Tue, 22 Jun 2021 16:04:21 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G8WRm46t4z4vfR; Tue, 22 Jun 2021 16:04:20 +0000 (UTC) (envelope-from rozhuk.im@gmail.com) Received: by mail-lj1-x22a.google.com with SMTP id u11so19935689ljh.2; Tue, 22 Jun 2021 09:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gkdkY5AZRpib/ApJozzWv8nvdTy3Sw271CPX4BV6TQ4=; b=DGxCZKwcRy2j4g/Tq1BPaJ5PsgHtu4HfHRUKlyD67HuPOhOSDJ+EQvGTHHB20ebgCZ dG1NI73DVPehiePiAMsMmu/K+YiMs3wzckEap4Sy+ZQrejB/NIpjZqzYq+RnkrSHa0jX an/CJTUtaqCsRInhY/PYSM2p1f/zCKqa1yg6SFI6daqnCNm9GxwEz0b4b5VKkb5YP9Rj vrZ2aKVjDSuRhzwkSPVCkp2V/PZ6Wxcd6Q08pJrspiXk7Ox4nVOsf3de4VHtshw3seZT KXVEOtwLoJuQZhg1otgjL2vt01BGHU9bLcVli4pCY9atWrdy/rOTKCy3Ba36n6JInmJO muFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gkdkY5AZRpib/ApJozzWv8nvdTy3Sw271CPX4BV6TQ4=; b=n8uH0n4OqA9HByUcS2JqZDEFWM+h8oxvMaqCcqPzpbY5fnS+vqtVdgFQjJjOeo79ie iggQq6QHdEskxPG+u4H749XZtQzYftVJxxQBJpEm8/oA87Z8BRG/x+Q5d9lEhewD5MPh xIgledBs9Wurg69I0nrY3W7XnlNBQoU6FsQmg6hBMQBDRj5vx7OxTGMGJeKDR6KK4NDl 9/hrvLE1wXZVDs4tBjqQ+6tcNhDpIpiJbQlO7MIwRHDwq8ArK0e1WzJd3HcNflyzF8aB dFiJ/wjJ9cAxVkXm2Yu1VfYbuWblNS+W4Q3OjmAtRV33zcsR/jewQigtxnS0FkGhKNi9 hpew== X-Gm-Message-State: AOAM532xDeD6BdXBLi/faBHGR+54r/dQaB8ZDak0vnj18txBUPTSOaH0 Eq3wDKA0LKBtZ4IwtzW4joU= X-Google-Smtp-Source: ABdhPJxoavmgdxw/ND3oXwYZI/wKE91ZTTwXE9W+Y1+PH+Xc9QUKsSqPI3erhjgSvvfIW2PTA2orTg== X-Received: by 2002:a05:651c:10b9:: with SMTP id k25mr3966252ljn.256.1624377859030; Tue, 22 Jun 2021 09:04:19 -0700 (PDT) Received: from rimwks.local ([2001:470:1f15:3d8:7285:c2ff:fe37:5722]) by smtp.gmail.com with ESMTPSA id k16sm2259188lfo.61.2021.06.22.09.04.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 09:04:18 -0700 (PDT) From: Rozhuk Ivan X-Google-Original-From: Rozhuk Ivan Date: Tue, 22 Jun 2021 19:04:16 +0300 To: Warner Losh Cc: "dmilith ." , freebsd-net@freebsd.org, "freebsd-hackers@freebsd.org" Subject: Re: How to run script on network address change? Message-ID: <20210622190416.039d87c4@rimwks.local> In-Reply-To: References: <20210620165215.0f3dd15c@rimwks.local> <20210620193744.39eae64f@rimwks.local> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; amd64-portbld-freebsd13.0) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Rspamd-Queue-Id: 4G8WRm46t4z4vfR X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=DGxCZKwc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rozhukim@gmail.com designates 2a00:1450:4864:20::22a as permitted sender) smtp.mailfrom=rozhukim@gmail.com X-Spamd-Result: default: False [-2.90 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; MIME_BASE64_TEXT(0.10)[]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-0.999]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::22a:from]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::22a:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::22a:from]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org,FreeBSD.org]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-net,freebsd-hackers] X-ThisMailContainsUnwantedMimeParts: N T24gVHVlLCAyMiBKdW4gMjAyMSAwOTo1MjoxOCAtMDYwMA0KV2FybmVyIExvc2ggPHdsb3NoQGJz ZGltcC5jb20+IHdyb3RlOg0KDQo+IFRoZXNlIHR3byBwYXRjaGVzIGFwcGVhciB0byBiZSBnb29k IChJ4oCZbGwgbmVlZCB0byBkbyBhIGxpdHRsZSB0ZXN0aW5nKQ0KPiANCj4gQnV0LCBjYW4geW91 IHVwZGF0ZSBkZXZkLmNvbmYoNSkgbWFuIHBhZ2UgdG8gaW5jbHVkZSB0aGVzZSBuZXcgZXZlbnRz DQo+IGluIHRoZSBJRk5FVCBzZWN0aW9uPyBJZiBzbywgSeKAmWxsIGxhbmQgdGhpcyBpbiB0aGUg dHJlZS4uLg0KPiANCg0KVGhpcyBpcyB1cGRhdGVkIHZlcnNpb24sIHRoZXkgYWRkIHBhcmFtIG5h bWUgZm9yIGxhc3QgYXJnLCBzbzoNCiIhc3lzdGVtPUlGTkVUIHN1YnN5c3RlbT1sYW4wIHR5cGU9 UkVOQU1FIGxhbjEiIC0+ICIhc3lzdGVtPUlGTkVUIHN1YnN5c3RlbT1sYW4wIHR5cGU9UkVOQU1F IG5hbWU9bGFuMSINCiIhc3lzdGVtPUlGTkVUIHN1YnN5c3RlbT1sYW4wIHR5cGU9QUREUl9BREQg MTkyLjE2OC4xLjEiIC0+ICIhc3lzdGVtPUlGTkVUIHN1YnN5c3RlbT1sYW4wIHR5cGU9QUREUl9B REQgYWRkcmVzcz0xOTIuMTY4LjEuMSINCg0KaHR0cHM6Ly9yZXZpZXdzLmZyZWVic2Qub3JnL0Qz MDgzOQ0KaHR0cHM6Ly9yZXZpZXdzLmZyZWVic2Qub3JnL0QzMDg0MA0K From nobody Wed Jun 23 13:24:20 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D56B711E1511 for ; Wed, 23 Jun 2021 13:24:33 +0000 (UTC) (envelope-from ionut.mihalache1506@gmail.com) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G93rw2LVxz4g9t for ; Wed, 23 Jun 2021 13:24:32 +0000 (UTC) (envelope-from ionut.mihalache1506@gmail.com) Received: by mail-io1-xd2f.google.com with SMTP id f10so3381448iok.6 for ; Wed, 23 Jun 2021 06:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=bhk6AeTlY8XYAn+DqEWnJdCKakSaClCXh18n65WJFc8=; b=JIlTWeztbkwOS1k/2m8DB6PGiaiEMfk4lIuO/XS+uvkIeeuzlvVUz1v7vE307qtXD8 5zyopfeAYHZGzFc1l1vScxrb+Q8IAakjQ7GERja9SacLqtCoDSvkuffTb4ygCRKcOapd nHWsxoX1Np68thvPHPVFV+LDarkTfWJIt0PM1+43aZHJ1q3vg37296VBxEl46kVD5xQJ JOVKcvO9e6hYeW5cNQ2XJ2AXunQHASatCssrHRiFxW/c1kRX0QnUSFpi6oyi4ZutacjR uoFG/EgwEJhgyJIG/r7SK0Vg0cbwwO8hXguZqwkEIhx7z5eNzJ4swUtafDMu41GfPK1O 1p8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=bhk6AeTlY8XYAn+DqEWnJdCKakSaClCXh18n65WJFc8=; b=Nubr03zZdHMw7B0d2BFSoNN51Wg+OYJ9a4KHfKQD3+Zy/AN70QRpbTzVJUn13Kjc5s 72P4ToyeOop6L2zZ5TMZbUZsn8H9ypQyxLzoSVFd5CjUqs9bqNlyuz1r5pS7ta/Fn6ZZ svDdhK8SWKLjVmQ96FB7ZGxMH+Ug7iUyNsGnbdoIBaAUzjP69TOirOg7Ju+/7uVt1LfM XBMucgspi8RYEvxFdyXIMbM0IgptAQvTTyet4ASvUdCjIW6CgwSb5C19r3fpmwx7Ir5x BBTv0mgTPx64YGUdcvGGCDPAdsYwYz+PNhAWgdllYarcknH0sGAK4V0BShT+VlMncMuY UtZg== X-Gm-Message-State: AOAM532rh0NEOhZDWI6muO+SxhJYFq4VhfYKsH6ZQfr5eQKNBnzYcXAR hnDmIIlj9pm8pOwbiTNzDw1BhJfzO2A0b2y2rEyZEbMT X-Google-Smtp-Source: ABdhPJwyfxoNs5g9pFhwho9nfzVi2K/sEWz2rekVvASudOeLfv1xHBZgfZYmUGNOphL8W1m9RFwFq4zICA71mirneXk= X-Received: by 2002:a6b:760e:: with SMTP id g14mr7099826iom.119.1624454671152; Wed, 23 Jun 2021 06:24:31 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 From: =?UTF-8?Q?Ionu=C8=9B_Mihalache?= Date: Wed, 23 Jun 2021 16:24:20 +0300 Message-ID: Subject: libzfs.h and libnvpair.h To: freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="000000000000a0bac505c56ed33d" X-Rspamd-Queue-Id: 4G93rw2LVxz4g9t X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=JIlTWezt; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of ionutmihalache1506@gmail.com designates 2607:f8b0:4864:20::d2f as permitted sender) smtp.mailfrom=ionutmihalache1506@gmail.com X-Spamd-Result: default: False [-3.28 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-0.998]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_MIXED_CHARSET(0.71)[subject]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::d2f:from]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::d2f:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d2f:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-ThisMailContainsUnwantedMimeParts: Y --000000000000a0bac505c56ed33d Content-Type: text/plain; charset="UTF-8" Hello, I am working into bringing the checkpoint functionality for bhyve and I think I could use the zfs functionalities for the implementation. I tried to build the world with -DWITH_ZFS and -DWITH_CDDL(I don't exactly know what macro or macros should be defined or if there are any, these two I tried based on the analysis of the Makefiles) but this doesn't seem to work. When I include libzfs.h in order to use the functions from there, I get a compilation error saying that libnvpair.h is not found. After investigating the problem I saw that in /usr/include libnvpair.h is not present. I copied the files from /usr/local/include but after this there was a problem with the redefinition of some functions. Is it a way to use(or 'activate') the zfs functionalities directly in the code without using syscalls like system or exec(I would like to avoid them as much as possible). Thank you. --000000000000a0bac505c56ed33d-- From nobody Wed Jun 23 15:19:03 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1F75F5D1771 for ; Wed, 23 Jun 2021 15:19:04 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from udns.ultimatedns.net (static-24-113-41-81.wavecable.com [24.113.41.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "ultimatedns.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G96P36MnDz4sJs for ; Wed, 23 Jun 2021 15:19:03 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.16.1/8.16.1) with ESMTP id 15NFJ36A063011; Wed, 23 Jun 2021 08:19:09 -0700 (PDT) (envelope-from bsd-lists@bsdforge.com) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Date: Wed, 23 Jun 2021 08:19:03 -0700 From: Chris To: =?UTF-8?Q?Ionu=C8=9B_Mihalache?= Cc: freebsd-hackers@freebsd.org Subject: Re: libzfs.h and libnvpair.h In-Reply-To: References: User-Agent: UDNSMS/17.0 Message-ID: X-Sender: bsd-lists@bsdforge.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4G96P36MnDz4sJs X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 2021-06-23 06:24, Ionuț Mihalache wrote: > Hello, > > I am working into bringing the checkpoint functionality for bhyve and I > think I could use the zfs functionalities for the implementation. I tried > to build the world with -DWITH_ZFS and -DWITH_CDDL(I don't exactly know > what macro or macros should be defined or if there are any, these two I > tried based on the analysis of the Makefiles) but this doesn't seem to > work. When I include libzfs.h in order to use the functions from there, I > get a compilation error saying that libnvpair.h is not found. After > investigating the problem I saw that in /usr/include libnvpair.h is not > present. I copied the files from /usr/local/include but after this there > was a problem with the redefinition of some functions. Is it a way to > use(or 'activate') the zfs functionalities directly in the code without > using syscalls like system or exec(I would like to avoid them as much as > possible). I regret I haven't got the time to investigate this for you. But on a 13/amd64 system, a cd /usr/src followed by a grep -r -F libnvpair.h . returned some results that may be of interest to you in sorting this out. ./lib/libbe/be.h:#include for example. The same could be performed against libzfs.h. If including libzfs.h didn't work, and including first libzfs.h along with libnvpair.h errored with duplicates. It may be the case that you need to only include libnvpair.h, which may pull in libzfs.h. IDK but thought I'd mention it. Sorry, that's all I've got. HTH --Chris > > Thank you. From nobody Wed Jun 23 15:52:21 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 573105D5055 for ; Wed, 23 Jun 2021 15:52:33 +0000 (UTC) (envelope-from ionut.mihalache1506@gmail.com) Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G977j1Rs3z3D4B for ; Wed, 23 Jun 2021 15:52:32 +0000 (UTC) (envelope-from ionut.mihalache1506@gmail.com) Received: by mail-io1-xd2d.google.com with SMTP id r12so4052166ioa.7 for ; Wed, 23 Jun 2021 08:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GxrN2R8drkuoZD/Ji7pwuwXuUZqdmdGKVpAEXYG3SKY=; b=JGqa14r4vLqwuE/lSnQglke/ayJrzF3bolRK7DBvJ+WKPe6bpG1F7TYvXRNASkg4HX op5NN7Tl5qzg6Zuzew3JrmzjkYGVFgs9PHex6BWTpoCH+vCq8uU4OgaQMHi/51JFOMac dJ1SkuLrX+NxbrhHo78Gtr5Jam6uLPNmY9r5Zn7IMa2WTKUqTgWxObVBd/HmOO/UdyWB lHFgMvq6OAvhrI3XfM2BEt0Z18iPigLcl3eEb5ZppuN9vFlLs4NfNYQjzc52/R/YVGcT R0qEV9ukCu/NMIQopZ8z1CZAIkTi3jwtlinpXUS2stsTMUSaEpoWDgBCoE62CyNbTj+i 0ISA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GxrN2R8drkuoZD/Ji7pwuwXuUZqdmdGKVpAEXYG3SKY=; b=kqWKf8AW4V4VG9ozkMVHjhUW0AFBFoxgpzBd1F6oHQQKwykOPcCJeJAVmpsK2dSfdH U6NmfIUMy4SQKuTsvJmYSfw5UUZ9Qoy7GT7MWoiz8Q90DLZkA+90cL05YpJTD9j+UM1N D+/6rPIM1z5kyE4RQ5ipqXyD7+cBLDgPHoxlX1JQhjMlb06PLBopARqzHo3tHrnGAEXj MTQSKQn5f0fjUr3Qn+NY7yBncjD1dFKRCq4ZHMnGiMN/E1aLs0x6i5BvApaKDMxLe6xz uTj+IFiVJEePlbqOSTl8exeH9CVNAHGPCPqWwlipvAahO86xnLE5QiRmBbFrL4j1Mx2w Q2vg== X-Gm-Message-State: AOAM5313BhiL/TEVf5GQHRXAGSvgkJrT179oAPwpqQm18GsUM9a5YcWz NUzi8/bkIuZYBf+XZecSW4EvQKTVppE4AIx77MerTvEt X-Google-Smtp-Source: ABdhPJywruMBVDmMXtvK9xG8URMr0e0NH7khGf/uFxmjR3cWK6I23+3xjAdGuBLZ5SbEtGxrlr0kvETBKtxq8AgBJSs= X-Received: by 2002:a02:c808:: with SMTP id p8mr229904jao.109.1624463552306; Wed, 23 Jun 2021 08:52:32 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Ionu=C8=9B_Mihalache?= Date: Wed, 23 Jun 2021 18:52:21 +0300 Message-ID: Subject: Re: libzfs.h and libnvpair.h To: Chris Cc: freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="000000000000fc631b05c570e4e4" X-Rspamd-Queue-Id: 4G977j1Rs3z3D4B X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: Y --000000000000fc631b05c570e4e4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable When including there is another include for the header which redefines functions from . and don't seem to have problems, includes , I don't have to include it myself. =C3=8En mie., 23 iun. 2021 la 18:19, Chris a scris= : > On 2021-06-23 06:24, Ionu=C8=9B Mihalache wrote: > > Hello, > > > > I am working into bringing the checkpoint functionality for bhyve and I > > think I could use the zfs functionalities for the implementation. I tri= ed > > to build the world with -DWITH_ZFS and -DWITH_CDDL(I don't exactly know > > what macro or macros should be defined or if there are any, these two I > > tried based on the analysis of the Makefiles) but this doesn't seem to > > work. When I include libzfs.h in order to use the functions from there,= I > > get a compilation error saying that libnvpair.h is not found. After > > investigating the problem I saw that in /usr/include libnvpair.h is not > > present. I copied the files from /usr/local/include but after this ther= e > > was a problem with the redefinition of some functions. Is it a way to > > use(or 'activate') the zfs functionalities directly in the code without > > using syscalls like system or exec(I would like to avoid them as much a= s > > possible). > I regret I haven't got the time to investigate this for you. But on a > 13/amd64 > system, a cd /usr/src followed by a grep -r -F libnvpair.h . > returned some results that may be of interest to you in sorting this out. > ./lib/libbe/be.h:#include for example. The same could be > performed > against libzfs.h. > If including libzfs.h didn't work, and including first libzfs.h along wit= h > libnvpair.h errored with duplicates. It may be the case that you need to > only include libnvpair.h, which may pull in libzfs.h. IDK but thought I'd > mention it. Sorry, that's all I've got. > > HTH > > --Chris > > > > > > Thank you. > --000000000000fc631b05c570e4e4-- From nobody Fri Jun 25 02:30:52 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1D6EC11D0A83 for ; Fri, 25 Jun 2021 02:30:55 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GB1Fq0DFxz4jmw for ; Fri, 25 Jun 2021 02:30:55 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from ice.alameda.xse.com (unknown [IPv6:2600:1700:a570:e20:f2ad:4eff:fe09:150e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: leres) by smtp.freebsd.org (Postfix) with ESMTPSA id B2F03A1B for ; Fri, 25 Jun 2021 02:30:54 +0000 (UTC) (envelope-from leres@freebsd.org) From: Craig Leres Subject: nvidia_drv.so/Xorg crashes To: freebsd-hackers@freebsd.org Message-ID: Date: Thu, 24 Jun 2021 19:30:52 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N I have four (12.2-RELEASE) systems between the office at home that are full or part time FreeBSD desktops. All have pny nvidia quadro 410's. These have been mostly working well for about 6 years. For months I've started seeing screen corruption when using chrome or kicad; firefox and thunderbird are always ok. But just starting eeschema always damages the root window a little. And it's common when running chrome/kicad to see lines in the console xterm window jump up and down two lines. But for the last week or two Xorg has been crashing: [ 74574.029] (EE) Backtrace: [ 74574.032] (EE) 0: /usr/local/bin/Xorg (?+0x0) [0x41c98a] [ 74574.033] (EE) unw_get_proc_name failed: no unwind info found [-10] [ 74574.033] (EE) 1: /lib/libthr.so.3 (?+0x0) [0x800929b7e] [ 74574.035] (EE) unw_get_proc_name failed: no unwind info found [-10] [ 74574.035] (EE) 2: /lib/libthr.so.3 (?+0x0) [0x80092913f] [ 74574.037] (EE) 3: ? (?+0x0) [0x7ffffffff003] [ 74574.038] (EE) 4: /usr/local/lib/xorg/modules/drivers/nvidia_drv.so (?+0x0) [0x801cc8c20] [ 74574.038] (EE) [ 74574.038] (EE) Segmentation fault at address 0x50 [ 74574.038] (EE) Fatal server error: [ 74574.038] (EE) Caught signal 11 (Segmentation fault). Server aborting The crashes are always preceded by at least one nvidia "Xid" kernel message: Jun 23 ... kernel: : NVRM: Xid (PCI:0000:05:00): 69, pid=6327, Class Error: ChId 0009, Class 0000902d, Offset 000008b4, Data fffffffb, ErrorCode 00000004 Jun 23 ... kernel: : NVRM: Xid (PCI:0000:05:00): 69, pid=6327, Class Error: ChId 0009, Class 0000902d, Offset 000008b4, Data fffffffb, ErrorCode 00000004 Jun 23 ... kernel: : NVRM: Xid (PCI:0000:05:00): 69, pid=6327, Class Error: ChId 0009, Class 0000902d, Offset 000008b4, Data ffffffb9, ErrorCode 00000004 Jun 23 ... kernel: : pid 6327 (Xorg), jid 0, uid 0: exited on signal 6 Worth noting is that it was not unusual to see many Xid ErrorCode 4 kernel messages without crashes. (And it's the only ErrorCode I've ever seen.) My first thought was bad nvidia-driver version. But after working my way, one by one, down to 460.39 (circa February 2021 -- months before the first crashes) I gave up on that theory. My next guess bad hardware but I swapped quadro's between two systems and the crashes persisted. Yesterday Xorg crashed often enough for me to zero on the trigger; it's the use of tvtwm's f.forcemove action (which is like f.move but allows moving a windows off the screen) if I move a window slightly off the bottom of the screen. Here's the .twmrc binding I use: Button2 = m s : window : f.forcemove The crash doesn't happen 100% of the time but it's pretty easy to trigger with half a dozen windows open. Just grab a window and randomly dip part of it past the bottom of the screen. So my new theory is a frame buffer operation in one of the libraries the path between Xorg and the nvidia driver has regressed and is asking the nvidia driver to do something that causes it to do something bad. I run a custom version of tvtwm but was able to easily crash Xorg using x11-wm/twm on a spare quadro 410 workstation; the key is f.forcemove. Does anybody know what this issue is? What are likely candidates of recently changed port libraries that I could try downgrading? Should I try opening a ticket with nvidia? Should I try even older 460.XX drivers? What else can I try? (Thanks for reading this far!) Craig From nobody Fri Jun 25 05:54:25 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A63955D35EC for ; Fri, 25 Jun 2021 05:58:26 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GB5sG427pz3DnV; Fri, 25 Jun 2021 05:58:26 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by mail-yb1-xb2e.google.com with SMTP id b64so2955245yba.0; Thu, 24 Jun 2021 22:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vSJUhcQRcGtZbJ9++z9l3ZsKiAwb4hVrGeXX/pCGerk=; b=XcyIbUp7vhGa4NEkctvUezoflfe1fxOmlpFqlkftsFs9zBCWzOsciAo86/UTke2I+q WGCZMRxtJnT/8DBfCiR9CVURxK4VLj76UdAbe3RZotninGTt189bP2XwsQOJG/vXOxSE 6g2Pirdtne8mKDw5Y0OOeW0g/CR6k9VGzgzCCF/Rq8HgqeGSutf0VJAEgDSyY+AHuDSL cowZC05cwYMMvlyn1NALzlvHXOJxPU+uVDFBuSEOn8r5/u1a1Int11EungbEXQTkkY9H Z/QbWYzbbhuMZ2VXlUuI/tfhuYQfiCKzBqkdh34NsY1Iyo6bZ4h5qun4cBbq3bHv0jRf h+xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vSJUhcQRcGtZbJ9++z9l3ZsKiAwb4hVrGeXX/pCGerk=; b=V4oxUjK49lcqvXhjSYzrfv9fdTz0shYszBcLYKD9sRS2EFE1/pONXurAIujO1DW4C6 s5HtAE55ZtKFaBdZJhomI9rKBRTNafsG1E8eLTQpMhJFK8H0S1AitUNlmuqEeK3B3/01 JzthxvxuVpxHWLv5KYwYzOjcYYVPTzbsaQxdKjV/blyufFl90wQYnIPAMWrmjYz27xNn /DYxAFyUjfUE5J4lmH1IbM7HwYDkmWJRDj5A8nF8ZhadMG1cQ66jbyZ7mTBD1EmXTxVd f5tYgkzLIAEZ+Rxf79v+UXdLqAIK3dO6oCp/wIxsx7F4s9SmEVJeyKEsNXEJe6l3XOTx xTMQ== X-Gm-Message-State: AOAM530E28U2s1cFR/hBTBqZ3CBeSVnGZ+7ZVkPkC+YEO/g1EicHk7pL A9MBWK8B95dTKgljuNlg0c6gPT0XubNyc0y6PW1C0o4y3/s= X-Google-Smtp-Source: ABdhPJxxW5bQX9fNrdJNrVfydLrWVOa+B/g5VivKcVS4zfNSPhaW8McBi2LU3wZOef4FXdT96/7yPscY8medL/AgwnI= X-Received: by 2002:a25:69c7:: with SMTP id e190mr10691228ybc.187.1624600705409; Thu, 24 Jun 2021 22:58:25 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Date: Fri, 25 Jun 2021 07:54:25 +0200 Message-ID: Subject: Re: nvidia_drv.so/Xorg crashes To: Craig Leres Cc: FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4GB5sG427pz3DnV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, Jun 25, 2021 at 4:31 AM Craig Leres wrote: > > I have four (12.2-RELEASE) systems between the office at home that are > full or part time FreeBSD desktops. All have pny nvidia quadro 410's. > These have been mostly working well for about 6 years. > > For months I've started seeing screen corruption when using chrome or > kicad; firefox and thunderbird are always ok. But just starting eeschema > always damages the root window a little. And it's common when running > chrome/kicad to see lines in the console xterm window jump up and down > two lines. But for the last week or two Xorg has been crashing: > > [ 74574.029] (EE) Backtrace: > [ 74574.032] (EE) 0: /usr/local/bin/Xorg (?+0x0) [0x41c98a] > [ 74574.033] (EE) unw_get_proc_name failed: no unwind info found [-10] > [ 74574.033] (EE) 1: /lib/libthr.so.3 (?+0x0) [0x800929b7e] > [ 74574.035] (EE) unw_get_proc_name failed: no unwind info found [-10] > [ 74574.035] (EE) 2: /lib/libthr.so.3 (?+0x0) [0x80092913f] > [ 74574.037] (EE) 3: ? (?+0x0) [0x7ffffffff003] > [ 74574.038] (EE) 4: > /usr/local/lib/xorg/modules/drivers/nvidia_drv.so (?+0x0) [0x801cc8c20] > [ 74574.038] (EE) > [ 74574.038] (EE) Segmentation fault at address 0x50 > [ 74574.038] (EE) > Fatal server error: > [ 74574.038] (EE) Caught signal 11 (Segmentation fault). Server > aborting > > The crashes are always preceded by at least one nvidia "Xid" kernel message: > > Jun 23 ... kernel: : NVRM: Xid (PCI:0000:05:00): 69, pid=6327, > Class Error: ChId 0009, Class 0000902d, Offset 000008b4, Data fffffffb, > ErrorCode 00000004 > Jun 23 ... kernel: : NVRM: Xid (PCI:0000:05:00): 69, pid=6327, > Class Error: ChId 0009, Class 0000902d, Offset 000008b4, Data fffffffb, > ErrorCode 00000004 > Jun 23 ... kernel: : NVRM: Xid (PCI:0000:05:00): 69, pid=6327, > Class Error: ChId 0009, Class 0000902d, Offset 000008b4, Data ffffffb9, > ErrorCode 00000004 > Jun 23 ... kernel: : pid 6327 (Xorg), jid 0, uid 0: exited on signal 6 > > Worth noting is that it was not unusual to see many Xid ErrorCode 4 > kernel messages without crashes. (And it's the only ErrorCode I've ever > seen.) > > My first thought was bad nvidia-driver version. But after working my > way, one by one, down to 460.39 (circa February 2021 -- months before > the first crashes) I gave up on that theory. > > My next guess bad hardware but I swapped quadro's between two systems > and the crashes persisted. > > Yesterday Xorg crashed often enough for me to zero on the trigger; it's > the use of tvtwm's f.forcemove action (which is like f.move but allows > moving a windows off the screen) if I move a window slightly off the > bottom of the screen. Here's the .twmrc binding I use: > > Button2 = m s : window : f.forcemove > > The crash doesn't happen 100% of the time but it's pretty easy to > trigger with half a dozen windows open. Just grab a window and randomly > dip part of it past the bottom of the screen. So my new theory is a > frame buffer operation in one of the libraries the path between Xorg and > the nvidia driver has regressed and is asking the nvidia driver to do > something that causes it to do something bad. > > I run a custom version of tvtwm but was able to easily crash Xorg using > x11-wm/twm on a spare quadro 410 workstation; the key is f.forcemove. > > Does anybody know what this issue is? What are likely candidates of > recently changed port libraries that I could try downgrading? Should I > try opening a ticket with nvidia? Should I try even older 460.XX > drivers? What else can I try? (Thanks for reading this far!) Long shot, but libglvnd update affected x11/nvidia-driver. Have a look at UPDATING 20210617 HTH > > Craig > From nobody Sat Jun 26 00:53:39 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BB58811D35FD for ; Sat, 26 Jun 2021 00:53:41 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBb394zvWz3pn8; Sat, 26 Jun 2021 00:53:41 +0000 (UTC) (envelope-from leres@freebsd.org) Received: from ice.alameda.xse.com (unknown [IPv6:2600:1700:a570:e20:f2ad:4eff:fe09:150e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: leres) by smtp.freebsd.org (Postfix) with ESMTPSA id 2877AB6B4; Sat, 26 Jun 2021 00:53:41 +0000 (UTC) (envelope-from leres@freebsd.org) Subject: Re: nvidia_drv.so/Xorg crashes To: Stefan Blachmann , =?UTF-8?Q?Fernando_Apestegu=c3=ada?= References: From: Craig Leres Cc: FreeBSD Hackers Message-ID: <1891eb32-87fa-6ae0-b351-b01eb77652d9@freebsd.org> Date: Fri, 25 Jun 2021 17:53:39 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 6/24/21 5:45 PM, Stefan Blachmann wrote: > I'd suggest to ditch the packaged drivers (nvidia-driver-...) and try > using the nvidia driver from the nvidia driver site. > You have to build and install them according the README in the archive. > > The packaged drivers have some changes that are not approved by nvidia. > This can cause problems, for example with suspend/resume. Good idea. I downloaded/built/installed 460.84... and was able to crash Xorg within 60 seconds of launching it. And looking at what the nvidia-driver port patches, they seem mostly related to allowing use without having the linux framework present. On 6/24/21 8:54 PM, Fernando Apesteguía wrote: > Long shot, but libglvnd update affected x11/nvidia-driver. Have a look > at UPDATING 20210617 I noticed the switch from the bundled libglvnd to the port version but I was having crashes well before that change (June 16th). Looking for Xid errors in /var/log/messages I think I started having this problem on May 25th. Craig From nobody Sat Jun 26 04:58:05 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0FF295D41F0 for ; Sat, 26 Jun 2021 04:58:11 +0000 (UTC) (envelope-from saimabaig11@gmail.com) Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBhTF61j9z4vPG for ; Sat, 26 Jun 2021 04:58:09 +0000 (UTC) (envelope-from saimabaig11@gmail.com) Received: by mail-pg1-x52b.google.com with SMTP id h4so9980168pgp.5 for ; Fri, 25 Jun 2021 21:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding:thread-index:content-language; bh=EKpW0AtL7FsNpXmvxzfRJ00U9qAdMCuVhJvZfp9aItQ=; b=bB3+Zxw4KjYiYqaCEVX8dp/a7G6LkZSZK9qia+ydkb2BnF0ZPx+z+pwascMNE5DIlX g2uGxAJbZ8pnDv6FeGECgwUiXu/RMm2P1VernzZnz/gT9e746rghBH1sGpqf36nOsDze 6TrHQqja4p+GsdV0a9muS9VSr+Pin/ib4aWmwpIgDwDi9D/4xFnESPsfsMy4dSf/i4ad RjtaNhfPrgc84Npyy80id8pGtTurDOzq/c9Y+53CTfdVc+1ckpOfIptxyhMnRFmmaEoM BFH9o7Qi4dYZOO+yALGR7uKGJkRP+/La+7Djzf56ErRVn+DWWZ59DN3SAMVLL9KfKmxC KzkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding:thread-index:content-language; bh=EKpW0AtL7FsNpXmvxzfRJ00U9qAdMCuVhJvZfp9aItQ=; b=SdAXOAP7XExGUgzZ7yLOK8ftorPF3vgdsnK3aWOQ/2FjyTvHAk3b2i9cqP6vD9gi8J STpwwwKOAyBfcs0BCatQe5S/c9uIjYqAze3R+FhxrwpOpvw37zF5OTxB2USPNBhiXdL2 McHhljwQnHB7mnz7Mvnq7Xr41qpq44DVz70nkzsYLmKhcKwqpfAFhtghK9lLZpdfQ6iW pmDrXG6a8YlxQzEH1lvu9inXTC+c2UrFuZfRoKywR0k7su3bFwk8rCe2r5foNwvTbAgT oKbitLLH9xf4OQr2gsqhpsCZXX8ThaDSyghpNvRwTi7TgQTUC8NzkfcTa7KcLP0FU77v nLrA== X-Gm-Message-State: AOAM533Ykulv/3G9DkwAov3EbT+3CCixCid3Smw4xhPwHJRTzv8oMeuR oFAEVfK/mH1B3X7RwnUNbBTyR+3ofugUrA== X-Google-Smtp-Source: ABdhPJxtt9+d39PdZ9VNsOOMH3udvX7ONbmfK4CtfbDrOBlcEfpmvC+9cAuBzsR8WP9BHYNX8qOlNA== X-Received: by 2002:a63:1c53:: with SMTP id c19mr12555708pgm.332.1624683487817; Fri, 25 Jun 2021 21:58:07 -0700 (PDT) Received: from ABDESKTOP ([103.208.71.171]) by smtp.gmail.com with ESMTPSA id q21sm12295786pjg.43.2021.06.25.21.58.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jun 2021 21:58:07 -0700 (PDT) From: To: Subject: PCI probing in the kernel Date: Sat, 26 Jun 2021 10:28:05 +0530 Message-ID: <003201d76a47$dae98bc0$90bca340$@gmail.com> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AddqR9l0VrAdZEv4SrGAxQEyaKbqNQ== Content-Language: en-us X-Rspamd-Queue-Id: 4GBhTF61j9z4vPG X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=bB3+Zxw4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of saimabaig11@gmail.com designates 2607:f8b0:4864:20::52b as permitted sender) smtp.mailfrom=saimabaig11@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RECEIVED_SPAMHAUS_PBL(0.00)[103.208.71.171:received]; FROM_EQ_ENVFROM(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::52b:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MIME_TRACE(0.00)[0:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::52b:from:127.0.2.255]; FROM_NO_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::52b:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-ThisMailContainsUnwantedMimeParts: N My question relates to how does the kernel go about its business of discovering PCI devices (after boot time) . I am loading the e1000(em) driver by kldloading the `if_em` module. The kernel seems to be calling the probe routine multiple times. So the log below includes messages coming from the kernel and also includes my own debug logs. ``` Jun 25 11:16:45 FreeBSD12 kernel: em probing Jun 25 11:16:45 FreeBSD12 syslogd: last message repeated 5 times Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register Jun 25 11:16:45 FreeBSD12 kernel: em probing Jun 25 11:16:45 FreeBSD12 syslogd: last message repeated 5 times Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register Jun 25 11:16:45 FreeBSD12 kernel: em probing Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register Jun 25 11:16:45 FreeBSD12 kernel: em0: port 0x2000-0x203f mem 0xfd5c0000-0xfd5dffff,0xfdff0000-0xfdffffff irq 19 at device 1.0 on pci2 Jun 25 11:16:45 FreeBSD12 kernel: em attaching Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register Jun 25 11:17:34 FreeBSD12 kernel: em0: Using 2048 TX descriptors and 2048 RX descriptors Jun 25 11:17:35 FreeBSD12 kernel: em probing Jun 25 11:17:35 FreeBSD12 syslogd: last message repeated 5 times Jun 25 11:17:35 FreeBSD12 kernel: em1: +++ Calling em_register Jun 25 11:17:35 FreeBSD12 kernel: em probing Jun 25 11:17:36 FreeBSD12 kernel: Base = 5ee7e000, Length = 8000 ``` It seems that the `probe->register` sequence seems to be getting repeated multiple times until the adapter is identified properly and its resources allocated. Isn't multiple registration a cause of concern? Or may something is wrong with the way I think. May be I am not getting it right? Could someone elaborate? From nobody Sat Jun 26 05:09:30 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 79CCF5D6A54 for ; Sat, 26 Jun 2021 05:09:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBhkZ2n0Mz3FHJ for ; Sat, 26 Jun 2021 05:09:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id d5so9204041qtd.5 for ; Fri, 25 Jun 2021 22:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YJaG79+bsLvasRKgirBjvG1q1DHNDhao9mX5sNY/xTg=; b=1wJqBIwWIsep5ye19UHPrhMAcqBfqNyzjIP3rxY9n8aVyXA10V4+7w0ZSgnVImPTGt NSETVWeGSlPBJXKWhr62JiEXVzlfVEjPRG6iB47nha4RwzbGEZJl16oOX96XJZrhCvaf 3f4t0lI6hinOtBjSV+YNFpigFH2JgHR/lqL9aQ+H7uxtweeNbry9+UN3xEh5rxT77BDU 6I6M1A1b1HkFh/NRl1VxDkwqSm8H1FDFAM6IpxCMKhIMPlGnDKelZ51ZaA/frbLhUw0s TFeuerXkS3c4hsJkgh8MXEldz3+5pO2QCBnEer746dOb7EWrybmTw1PqH66tN4tKXfkK CTgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YJaG79+bsLvasRKgirBjvG1q1DHNDhao9mX5sNY/xTg=; b=sl6PHAukTmHxVHY1c6yFUqXUoNA/L9yumh9wLlivohjqRvGOOWH61ou6Tg0v7o5+KB 0zvVVEajLnHi9v8yyDI2I835UJK/GHBSiIImal1V+wdk/KvWzyNMbconOd+fqj289KUT iPOUH9yKMzFl8MfeUyAKfhBxcet4/eLvT2hlwudag5v43TJ94TwBWKmEE4+dBMGTRJ0h HTrXMv683lTfr9H2rvPQTMb0GYrTvRVeuQL2zlNPylCGy3H3WIwRh9tCPkrGe6R2W/mq +V6Wc5Qfv6B+Nq2yjWsnTOJzBJ5ngl4TtAFbWckYHnwX68s/egeK87y1xMKldlWt4+zz +Tqg== X-Gm-Message-State: AOAM5333/QKGCXCFG9TQU/6bhEjNBI9FwbbUhN3m9W3ZG/cOXZf45a99 8GDxVgSypzBDPjANQ2FK8syqqc0/LIg2ykwLnM1l7Q== X-Google-Smtp-Source: ABdhPJyJxgnFQ92pGq7sRcnpvurW2e9aeS1sqb1eAK+ELp+2xVbAVPLIHEbBeQ3665neflaZCAwUBsuuDbltFHnMQ7w= X-Received: by 2002:a05:622a:164d:: with SMTP id y13mr12708206qtj.244.1624684181186; Fri, 25 Jun 2021 22:09:41 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: <003201d76a47$dae98bc0$90bca340$@gmail.com> In-Reply-To: <003201d76a47$dae98bc0$90bca340$@gmail.com> From: Warner Losh Date: Fri, 25 Jun 2021 23:09:30 -0600 Message-ID: Subject: Re: PCI probing in the kernel To: saimabaig11@gmail.com Cc: FreeBSD Hackers Content-Type: multipart/alternative; boundary="0000000000007e000305c5a443e4" X-Rspamd-Queue-Id: 4GBhkZ2n0Mz3FHJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: Y --0000000000007e000305c5a443e4 Content-Type: text/plain; charset="UTF-8" On Fri, Jun 25, 2021 at 10:59 PM wrote: > My question relates to how does the kernel go about its business of > discovering PCI devices (after boot time) . I am loading the e1000(em) > driver by kldloading the `if_em` module. The kernel seems to be calling the > probe routine multiple times. So the log below includes messages coming > from > the kernel and also includes my own debug logs. > > > > ``` > > Jun 25 11:16:45 FreeBSD12 kernel: em probing > > Jun 25 11:16:45 FreeBSD12 syslogd: last message repeated 5 times > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:16:45 FreeBSD12 kernel: em probing > > Jun 25 11:16:45 FreeBSD12 syslogd: last message repeated 5 times > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:16:45 FreeBSD12 kernel: em probing > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:16:45 FreeBSD12 kernel: em0: Connection> port 0x2000-0x203f mem > 0xfd5c0000-0xfd5dffff,0xfdff0000-0xfdffffff irq 19 at device 1.0 on pci2 > > Jun 25 11:16:45 FreeBSD12 kernel: em attaching > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:17:34 FreeBSD12 kernel: em0: Using 2048 TX descriptors and 2048 > RX > descriptors > > Jun 25 11:17:35 FreeBSD12 kernel: em probing > > Jun 25 11:17:35 FreeBSD12 syslogd: last message repeated 5 times > > Jun 25 11:17:35 FreeBSD12 kernel: em1: +++ Calling em_register > > Jun 25 11:17:35 FreeBSD12 kernel: em probing > > Jun 25 11:17:36 FreeBSD12 kernel: Base = 5ee7e000, Length = 8000 > > ``` > > It seems that the `probe->register` sequence seems to be getting repeated > multiple times until the adapter is identified properly and its resources > allocated. Isn't multiple registration a cause of concern? Or may something > is wrong with the way I think. May be I am not getting it right? Could > someone elaborate? > When you load a driver, we call probe on all the devices on the bus that don't yet have drivers. I believe you are seeing this. The probe routine tries a bunch of different devices until finding the NIC that doesn't have a driver. It's completely normal and ordinary. Warner --0000000000007e000305c5a443e4-- From nobody Sat Jun 26 05:14:58 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 368A75D7F8B for ; Sat, 26 Jun 2021 05:15:07 +0000 (UTC) (envelope-from saimabaig11@gmail.com) Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBhrp6Wzlz3GTW for ; Sat, 26 Jun 2021 05:15:06 +0000 (UTC) (envelope-from saimabaig11@gmail.com) Received: by mail-pf1-x42b.google.com with SMTP id d12so1444544pfj.2 for ; Fri, 25 Jun 2021 22:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:thread-index :content-language; bh=lTR+ZaKKZEHGjhpdip/Avp2hYAwdlPgq8NyR6x4GlD4=; b=iC4eE/zqDUCD4efgIMHBg4uQaKIycFhaqVXvtNU3RgywN8aiTaky3W/YlzBcWj+bZ0 oEzj/wj9tRnDL0iE+uSF8f7AflDyFCEbl0QN1uX0WlcdQ4VK7ja33PQIpFa7WePmOI70 62B6NCS1rqA8pubagKFKd8HcciFE4NUkt1/9yPNGMraoxOgXw/hYzM3f7wiU1elCihNr N+zt9sWv5mA/NaInaZoCvaHzIc2RLGi0RurymJX4YtXVkjLVc9U2XMpKdiZa5CfTPVIC l6lcxD60Ob7NVSPl5519QNRbXOp16/n7OBi0rr5AObIJ2YXY1Yqc3vHwjCfyujC+uC2l p0XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:thread-index :content-language; bh=lTR+ZaKKZEHGjhpdip/Avp2hYAwdlPgq8NyR6x4GlD4=; b=WDMkpE2U7eHB3YGv3PNRZcFv9yPFhgAGFRC3eNEf1Of7/PaOTf0vbGsOOs59DwEBhq VGQt2cycQTRpynBxjeIC59o3bjabwDdjnrJlG+8SEK6aoKqQ9rLNsD8S6tpZMVfzkB2q IWXUIXGvvfb9PtpkQ8W17NrBISdf4CruH0u4TyPyGmKqRF7HESJ5Ywd+g+k/YdAGt/hy Q6iR7AqeAQWKdF8FQ8NMpbwo6V02qNdqSF6yfQxzR7bhrIewSHLpps2Jx7P8tXfai8g0 YFLCJ9CQTWQAg6k/QO4EWmn+FNOMeXgfflqdBsrKdV+XU/MFet94LyHQi/5Wcb/3nCte PDZw== X-Gm-Message-State: AOAM531tXw8XZFGVnP1vSsGNeQRl8xQ90W/1ttfLfwzW0+y1CEAf0Ky/ uiXhVqBFJiubiXeFhq2KdKYccI9A81c/+g== X-Google-Smtp-Source: ABdhPJypswdBvb2LYSQy5m4NOAnBlM8I5U1Ov4bceLxJgWhjIUKuwDh8gighXQXnGyiL0OSJ6wXqrw== X-Received: by 2002:a05:6a00:23d0:b029:2de:c1a2:f1e with SMTP id g16-20020a056a0023d0b02902dec1a20f1emr14127633pfc.60.1624684505054; Fri, 25 Jun 2021 22:15:05 -0700 (PDT) Received: from ABDESKTOP ([103.208.71.171]) by smtp.gmail.com with ESMTPSA id 10sm7347296pfh.174.2021.06.25.22.15.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jun 2021 22:15:04 -0700 (PDT) From: To: "'Warner Losh'" Cc: "'FreeBSD Hackers'" References: <003201d76a47$dae98bc0$90bca340$@gmail.com> In-Reply-To: Subject: RE: PCI probing in the kernel Date: Sat, 26 Jun 2021 10:44:58 +0530 Message-ID: <004401d76a4a$393dbaf0$abb930d0$@gmail.com> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHO02fCKo5d0HP9TDmrcKSdSiVnugEaiQsXqy4YRJA= Content-Language: en-us X-Rspamd-Queue-Id: 4GBhrp6Wzlz3GTW X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N It specifically says *em* probing and then it calls the *em_register* = function repeatedly which is the registration routine that the em driver = defines as part of its initialization. This is whats confusing me as to = why is it repeatedly calling these functions for a specific module = repeatedly =20 From: Warner Losh =20 Sent: Saturday, June 26, 2021 10:40 AM To: saimabaig11@gmail.com Cc: FreeBSD Hackers Subject: Re: PCI probing in the kernel =20 =20 =20 On Fri, Jun 25, 2021 at 10:59 PM > wrote: My question relates to how does the kernel go about its business of discovering PCI devices (after boot time) . I am loading the e1000(em) driver by kldloading the `if_em` module. The kernel seems to be calling = the probe routine multiple times. So the log below includes messages coming = from the kernel and also includes my own debug logs. ``` Jun 25 11:16:45 FreeBSD12 kernel: em probing Jun 25 11:16:45 FreeBSD12 syslogd: last message repeated 5 times Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register Jun 25 11:16:45 FreeBSD12 kernel: em probing Jun 25 11:16:45 FreeBSD12 syslogd: last message repeated 5 times Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register Jun 25 11:16:45 FreeBSD12 kernel: em probing Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register Jun 25 11:16:45 FreeBSD12 kernel: em0: port 0x2000-0x203f mem 0xfd5c0000-0xfd5dffff,0xfdff0000-0xfdffffff irq 19 at device 1.0 on pci2 Jun 25 11:16:45 FreeBSD12 kernel: em attaching Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register Jun 25 11:17:34 FreeBSD12 kernel: em0: Using 2048 TX descriptors and = 2048 RX descriptors Jun 25 11:17:35 FreeBSD12 kernel: em probing Jun 25 11:17:35 FreeBSD12 syslogd: last message repeated 5 times Jun 25 11:17:35 FreeBSD12 kernel: em1: +++ Calling em_register Jun 25 11:17:35 FreeBSD12 kernel: em probing Jun 25 11:17:36 FreeBSD12 kernel: Base =3D 5ee7e000, Length =3D 8000 ``` It seems that the `probe->register` sequence seems to be getting = repeated multiple times until the adapter is identified properly and its = resources allocated. Isn't multiple registration a cause of concern? Or may = something is wrong with the way I think. May be I am not getting it right? Could someone elaborate? =20 When you load a driver, we call probe on all the devices on the bus that = don't yet have drivers. I believe you are seeing this. The probe routine tries = a bunch of different devices until finding the NIC that doesn't have a driver. = It's completely normal and ordinary. =20 Warner From nobody Sat Jun 26 05:43:26 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 14AB3CFBD4B for ; Sat, 26 Jun 2021 05:43:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBjTl69zmz3LgS for ; Sat, 26 Jun 2021 05:43:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x836.google.com with SMTP id g3so4942358qth.11 for ; Fri, 25 Jun 2021 22:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JnadZqkFmUYeZjAzEpMOP/2uHZIxxE2KENcGhebfmkY=; b=Qus8ViQ2cQkE86F34paCygUmCMsA9hUlMCwg9AWY2H2/T1y7Z81BBNRQaULR8sK9R6 oXzSl2AAK30uFoWxEfGpMMaGuHUPDEhIboNXiy7XDJCgcgmzt8bEie/a/7nCDQrQwGpW o02zukH1JejQA1ZlLbWLRYucAbEGkWwVrttlR+/LzLzKb+dRp9MDFo7eCJpuKdSRWXZ+ OJXp+VgdEtjQMIDidL9ab5XuHxVKZdCwbu8rz6ODt38E3WisVYqQ2yLKY9wLyYjR0qwr xkbTUNrMvU4IVI3N2g3wWne2jbGlRxHJtyLbUpR6toqsWWc3j0qMXx/p6WqL6p58k5T7 NL9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JnadZqkFmUYeZjAzEpMOP/2uHZIxxE2KENcGhebfmkY=; b=GNjWSlZIF5CrrhPoSTCSJIBAC6iRYUFXHokZK6znlb/7zK5xZM4/e4VwTJRUCpNG+6 399qZfqOCy4x+Y7JaHIh1Ff4Z6+/WGfp6HGVKACuQ6NaugWHZVDQfzFKiuXzsdkBfqyu 0IQx77RP67tKw3vPD/CmPQ6k6MNb4a2mRKuWTm1nB+EUoAhjXuZeIyrVXVqRJU1o3tgO X0WQdPfRHxLLvllzmfgvXXAPbPkZKTZOXHvkrsxlUbOgS98t6Rz/ELj/caiKmtTKjmHg fMOv5PlSsUqzP7V/ZXTPScrCjLDlpsqRWcImx6fPEtKQEPK+qPI9odvL+kfPN5GF0CCO YlEg== X-Gm-Message-State: AOAM531A5WRvfNvigzDaHmycjAhJG7iKjybw7XFewmTxqEn0oL9f6TXf jTxYM2C/eNOrRi5CH9CCyR0cjH0JtpUVmT/Jqgbt7A== X-Google-Smtp-Source: ABdhPJxqpUOwEHCQldpOqVrrP7IjliPv5vLfcYp/e1QgwA40eUyra2zUAA5yBbtIfv02+ErSUO7O81ri8QVRFiUY4Fo= X-Received: by 2002:ac8:2:: with SMTP id a2mr12691066qtg.101.1624686218555; Fri, 25 Jun 2021 22:43:38 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: <003201d76a47$dae98bc0$90bca340$@gmail.com> <003f01d76a4a$38767350$a96359f0$@gmail.com> In-Reply-To: <003f01d76a4a$38767350$a96359f0$@gmail.com> From: Warner Losh Date: Fri, 25 Jun 2021 23:43:26 -0600 Message-ID: Subject: Re: PCI probing in the kernel To: saimabaig11@gmail.com Cc: FreeBSD Hackers Content-Type: multipart/alternative; boundary="000000000000edc49805c5a4bcb4" X-Rspamd-Queue-Id: 4GBjTl69zmz3LgS X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=Qus8ViQ2; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::836) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::836:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::836:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::836:from]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[freebsd-hackers] X-ThisMailContainsUnwantedMimeParts: Y --000000000000edc49805c5a4bcb4 Content-Type: text/plain; charset="UTF-8" On Fri, Jun 25, 2021, 11:15 PM wrote: > It specifically says **em** probing and then it calls the **em_register** > function repeatedly which is the registration routine that the em driver > defines as part of its initialization. > The log you sent just shows em_register once. This is whats confusing me as to why is it repeatedly calling these > functions for a specific module repeatedly > It calls em probe 6 times, finds one and call em_register, then calls em probe 6 more times. Warner *From:* Warner Losh > *Sent:* Saturday, June 26, 2021 10:40 AM > *To:* saimabaig11@gmail.com > *Cc:* FreeBSD Hackers > *Subject:* Re: PCI probing in the kernel > > > > > > > > On Fri, Jun 25, 2021 at 10:59 PM wrote: > > My question relates to how does the kernel go about its business of > discovering PCI devices (after boot time) . I am loading the e1000(em) > driver by kldloading the `if_em` module. The kernel seems to be calling the > probe routine multiple times. So the log below includes messages coming > from > the kernel and also includes my own debug logs. > > > > ``` > > Jun 25 11:16:45 FreeBSD12 kernel: em probing > > Jun 25 11:16:45 FreeBSD12 syslogd: last message repeated 5 times > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:16:45 FreeBSD12 kernel: em probing > > Jun 25 11:16:45 FreeBSD12 syslogd: last message repeated 5 times > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:16:45 FreeBSD12 kernel: em probing > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:16:45 FreeBSD12 kernel: em0: Connection> port 0x2000-0x203f mem > 0xfd5c0000-0xfd5dffff,0xfdff0000-0xfdffffff irq 19 at device 1.0 on pci2 > > Jun 25 11:16:45 FreeBSD12 kernel: em attaching > > Jun 25 11:16:45 FreeBSD12 kernel: em0: +++ Calling em_register > > Jun 25 11:17:34 FreeBSD12 kernel: em0: Using 2048 TX descriptors and 2048 > RX > descriptors > > Jun 25 11:17:35 FreeBSD12 kernel: em probing > > Jun 25 11:17:35 FreeBSD12 syslogd: last message repeated 5 times > > Jun 25 11:17:35 FreeBSD12 kernel: em1: +++ Calling em_register > > Jun 25 11:17:35 FreeBSD12 kernel: em probing > > Jun 25 11:17:36 FreeBSD12 kernel: Base = 5ee7e000, Length = 8000 > > ``` > > It seems that the `probe->register` sequence seems to be getting repeated > multiple times until the adapter is identified properly and its resources > allocated. Isn't multiple registration a cause of concern? Or may something > is wrong with the way I think. May be I am not getting it right? Could > someone elaborate? > > > > When you load a driver, we call probe on all the devices on the bus that > don't > > yet have drivers. I believe you are seeing this. The probe routine tries a > bunch > > of different devices until finding the NIC that doesn't have a driver. > It's completely > > normal and ordinary. > > > > Warner > --000000000000edc49805c5a4bcb4-- From nobody Sat Jun 26 07:12:37 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3D51411CA50E for ; Sat, 26 Jun 2021 07:12:45 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBlSX1BFQz3kB2 for ; Sat, 26 Jun 2021 07:12:43 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm1-x335.google.com with SMTP id a5-20020a7bc1c50000b02901e3bbe0939bso7286520wmj.0 for ; Sat, 26 Jun 2021 00:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=u4Ih/5c+9otv0TfnW1JTWdjvCKOtTuDByfvmePUymfA=; b=Lqhs6AwydSsGbMBv+BwmLXOKS6QcNHDicULCLK48FIGiSKdISLGQ41X5H1rp4p5Qu6 MyADjYe2zfxsA7GJjNOkOjN2gLEjbN3En0v6zAshB0Cg5b6QMqn/oXI67NCPtNSYj08F fbJqsXVEWX3weYJRrtCjVDY/8gimhyw4sBemJPvLPq/kjLNvSL5NkGgf7rzbm3lFNTJd nOt5rY2TmqWuefZpaUamgMPITlJxIckKSMgEaN59ZuuoZrrDbC3ATqD631jBSz56F3sU 50dHkOWUaT9ICHp3q4UdPpdkzrAqWKi1xVYFlZS8R73uS4GNE5IGkb41EW8qF9c4c+wz zicA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=u4Ih/5c+9otv0TfnW1JTWdjvCKOtTuDByfvmePUymfA=; b=pEVSGCf5MIdYqQdaQFPLAixmCX43gsz791/nJEfpDY2mLOJh/jsK8FzipUv5Y2tOAG fXQU0yg/dEQe+XUzyLGSKk/3f9aFvpE8leRVisxlD2cNRu8O/NT7gF2AaeqkzeVAmYYT 77zIqZC1tU/raRFovCNF39UutVhzHHPK7IZFFqcVIxcgUT92nBS+DjiDm0zjeJG2OnL0 nZ+SHZyhluVoTcFK0WBwvzbIhZFOKrT6b43zP7A4n5jlSi0abnrxMFrykeIj/vIEJKf4 wi9MvvYpvN8mqNZMzgb/Llx4wpiEGyXKpS/RxzoVzPIT/k26c5TVRiSwORIrr2v3fe/A VSsw== X-Gm-Message-State: AOAM531ataBodiYg+PoF5WaRtzEsAHRQzrxsOtQBtsFQvxAlLDAhjBot VbtzgARFbuo2vt1iuFj5beqqvmlRlKA= X-Google-Smtp-Source: ABdhPJw85XT5J9aQg7FcVsRh1wwL0I7ZZTNKv8Vfj8SygQZA72lp5k6fNUSt6d0Fg3JNyd6w6+zpCA== X-Received: by 2002:a1c:1f49:: with SMTP id f70mr14886486wmf.57.1624691562226; Sat, 26 Jun 2021 00:12:42 -0700 (PDT) Received: from ernst.home (pd9e2360f.dip0.t-ipconnect.de. [217.226.54.15]) by smtp.gmail.com with ESMTPSA id d4sm7628374wmd.42.2021.06.26.00.12.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Jun 2021 00:12:41 -0700 (PDT) Date: Sat, 26 Jun 2021 09:12:37 +0200 From: Gary Jennejohn To: FreeBSD Hackers Subject: Re: nvidia_drv.so/Xorg crashes Message-ID: <20210626071237.70eb320c@ernst.home> In-Reply-To: <1891eb32-87fa-6ae0-b351-b01eb77652d9@freebsd.org> References: <1891eb32-87fa-6ae0-b351-b01eb77652d9@freebsd.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4GBlSX1BFQz3kB2 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Lqhs6Awy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gljennjohn@gmail.com designates 2a00:1450:4864:20::335 as permitted sender) smtp.mailfrom=gljennjohn@gmail.com X-Spamd-Result: default: False [-3.99 / 15.00]; HAS_REPLYTO(0.00)[gljennjohn@gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.99)[-0.991]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::335:from]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RECEIVED_SPAMHAUS_PBL(0.00)[217.226.54.15:received]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::335:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::335:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-ThisMailContainsUnwantedMimeParts: N On Fri, 25 Jun 2021 17:53:39 -0700 Craig Leres wrote: > On 6/24/21 5:45 PM, Stefan Blachmann wrote: > > I'd suggest to ditch the packaged drivers (nvidia-driver-...) and try > > using the nvidia driver from the nvidia driver site. > > You have to build and install them according the README in the archive. > > > > The packaged drivers have some changes that are not approved by nvidia. > > This can cause problems, for example with suspend/resume. > > Good idea. I downloaded/built/installed 460.84... and was able to crash Xorg within 60 seconds of launching it. And looking at what the nvidia-driver port patches, they seem mostly related to allowing use without having the linux framework present. > > On 6/24/21 8:54 PM, Fernando Apestegu__a wrote: > > Long shot, but libglvnd update affected x11/nvidia-driver. Have a look > > at UPDATING 20210617 > > I noticed the switch from the bundled libglvnd to the port version but I was having crashes well before that change (June 16th). Looking for Xid errors in /var/log/messages I think I started having this problem on May 25th. > This raises a question for me. I have nvidia-driver 460.67 built Thu Mar 11 00:03:14 UTC 2021 installed and working without any problem. I disabled Linux support in the port config. On my system libglvnd is not to be found anywhere outside the ports tree, i.e. the shared library was never installed under /usr/local. So, why is this library suddenly being required for nividia-driver? -- Gary Jennejohn From nobody Sat Jun 26 09:01:22 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8EBF511D0CE3 for ; Sat, 26 Jun 2021 09:01:35 +0000 (UTC) (envelope-from pj@smo.de) Received: from mail.adebahr.de (mail.adebahr.de [185.66.179.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.adebahr.de", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBnt732sWz3sb4 for ; Sat, 26 Jun 2021 09:01:34 +0000 (UTC) (envelope-from pj@smo.de) Received: from localhost (localhost [127.0.0.1]) by mail.adebahr.de (Postfix) with ESMTP id C9A0061434EE1; Sat, 26 Jun 2021 11:01:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=smo.de; h= content-transfer-encoding:content-type:content-type:in-reply-to :mime-version:user-agent:date:date:message-id:from:from :references:subject:subject; s=mail; t=1624698086; x=1626512487; bh=KUNwU+QOHLtX9R4wPfW6cn5RaNCJlcFMfqBHfDa1pAw=; b=EFbgdmNGAFAW XSKYbUQ3kGjo4HULhuC/bmml5qwR6xD9ZrRFaGOx0znUR0xWKFzm32bPgPhY2iy7 3/6DNxQti9paqC5jaSTgFJPAsKwrAYMb+mFIRQvUT1B949O5sKYnmNVhqacsXstb Gm7nd8ecwrI+R7BGOWWqrRvjMud0724= Received: from mail.adebahr.de ([127.0.0.1]) by localhost (mail.adebahr.de [127.0.0.1]) (amavisd-new, port 10026) with LMTP id FMeZCPIhMT_3; Sat, 26 Jun 2021 11:01:26 +0200 (CEST) Received: from [192.168.153.201] (p5b239a2d.dip0.t-ipconnect.de [91.35.154.45]) by mail.adebahr.de (Postfix) with ESMTPSA id 914A5617EC074; Sat, 26 Jun 2021 11:01:26 +0200 (CEST) Subject: Re: nvidia_drv.so/Xorg crashes To: gljennjohn@gmail.com, FreeBSD Hackers References: <1891eb32-87fa-6ae0-b351-b01eb77652d9@freebsd.org> <20210626071237.70eb320c@ernst.home> From: Philipp-Joachim Ost Message-ID: <4a37ffcd-a7b0-a681-d0aa-7c769399d814@smo.de> Date: Sat, 26 Jun 2021 11:01:22 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 In-Reply-To: <20210626071237.70eb320c@ernst.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4GBnt732sWz3sb4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N Am 26.06.2021 um 09:12 schrieb Gary Jennejohn: [...] > > So, why is this library suddenly being required for nividia-driver? > UPDATING entry 20210617 may be relevant. ;-) From nobody Sat Jun 26 09:27:12 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DE57911D428E for ; Sat, 26 Jun 2021 09:27:15 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBpRl5fwBz4SDT for ; Sat, 26 Jun 2021 09:27:15 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm1-x32a.google.com with SMTP id r3so3237658wmq.1 for ; Sat, 26 Jun 2021 02:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=tvUm+aVOnMqn5wlbIF48hRupC6ewh7d4y9DSfT9Y2gc=; b=ed91bQKG08kKbizascYdAdcS25DNdToBCJYPluAVAXNyWtKbiIhFD3UVxbUj+iQiSI UrfJE0JkvrOHXp5hSPO+kV7yuL/TjtF+AsiqerbFIlr6SRnSYuHvcEK3YVgOeZV5Kf4j en6fvJM2JZwiPMYONrWyN/0UC+1Xd9+W5N8zyCYVuZj4XWbtqyXjmqSggNkVnvh7tgwJ Nq/ModEFHBtQRaarT6Oj2hzAqd5a4Kd3mNdHfjyfQef5EE/iKhZAojr2yPFal6kWNCMN rpKrvR8nBTR99qDttFii6rRm11reYNKm8XV60YSC3pPvdTGMWsGqtUInnh0/RRnhDVnw xGhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=tvUm+aVOnMqn5wlbIF48hRupC6ewh7d4y9DSfT9Y2gc=; b=e9KS5f4F6CViragRKZZ9QoGYodGdG7IOoZc7GO8n+Anle8LP47xR2xk98+9imOL+qP XZIqLPJUMsFXltK3V+ADMVM31NtfBM+Yad2xqTLdA9Ao0+jbvoq5q8W8rJnVE8MbWBqF 3ZacVfZXKF47MCZrtnNkyN2ifW1Cm0UCqZrKB65toOEPCayufiUBsyn8iOPlbDqx4uGi W/cqfEtZA28XpiShW9zwX0fNAQQwEEq9MXvbvYky46E5DXuQp+oYL6sVSl4fufiyZKlK x0awynAmEgCAfE/LHW8rh3lVyMJvASTvXTqA5JAW2ZzGLUQs+Q4pqtrQVFc1CUbVQIvG J1gg== X-Gm-Message-State: AOAM532h2igvsV+DTkInw8bTkw6zNfOro5SxAPOsyfevUY6REb6jTOa7 oZpNLIS82lkSD442F/0cH3e+fo3ceSY= X-Google-Smtp-Source: ABdhPJzKJMbOWWLaW+nQ/mp330ROfR4i3XX8DWjjd6mpl+Srfp7VQd0vvKIn0/1DCWyT7BlJGDqwyw== X-Received: by 2002:a1c:6a10:: with SMTP id f16mr8885769wmc.113.1624699634296; Sat, 26 Jun 2021 02:27:14 -0700 (PDT) Received: from ernst.home (pd9e2360f.dip0.t-ipconnect.de. [217.226.54.15]) by smtp.gmail.com with ESMTPSA id m6sm9824123wrw.9.2021.06.26.02.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Jun 2021 02:27:13 -0700 (PDT) Date: Sat, 26 Jun 2021 11:27:12 +0200 From: Gary Jennejohn To: Philipp-Joachim Ost Cc: FreeBSD Hackers Subject: Re: nvidia_drv.so/Xorg crashes Message-ID: <20210626092712.3e6136e6@ernst.home> In-Reply-To: <4a37ffcd-a7b0-a681-d0aa-7c769399d814@smo.de> References: <1891eb32-87fa-6ae0-b351-b01eb77652d9@freebsd.org> <20210626071237.70eb320c@ernst.home> <4a37ffcd-a7b0-a681-d0aa-7c769399d814@smo.de> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4GBpRl5fwBz4SDT X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, 26 Jun 2021 11:01:22 +0200 Philipp-Joachim Ost wrote: > Am 26.06.2021 um 09:12 schrieb Gary Jennejohn: > [...] > > > > So, why is this library suddenly being required for nividia-driver? > > > > UPDATING entry 20210617 may be relevant. ;-) Ah, yes. Now I see it in an old dist tarball. It's not installed as libglvnd but as various GL libraries, which are installed. Thanks. -- Gary Jennejohn From nobody Sat Jun 26 12:16:28 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 343B511CF2AA for ; Sat, 26 Jun 2021 12:16:32 +0000 (UTC) (envelope-from soralx@cydem.org) Received: from smtp.triumf.ca (smtp.triumf.ca [142.90.100.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GBtC32m15z4hGN for ; Sat, 26 Jun 2021 12:16:30 +0000 (UTC) (envelope-from soralx@cydem.org) Received: from mscad14 (mscad14.triumf.ca [142.90.115.36]) by smtp.triumf.ca (Postfix) with ESMTPS id 3C81A20259B for ; Sat, 26 Jun 2021 05:16:29 -0700 (PDT) Date: Sat, 26 Jun 2021 05:16:28 -0700 From: To: Subject: Shell process hang in -CURRENT Message-ID: <20210626051628.2ec423a4@mscad14> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; amd64-portbld-freebsd9.3) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4GBtC32m15z4hGN X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=neutral (mx1.freebsd.org: 142.90.100.195 is neither permitted nor denied by domain of soralx@cydem.org) smtp.mailfrom=soralx@cydem.org X-Spamd-Result: default: False [-2.23 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.43)[-0.430]; MID_RHS_NOT_FQDN(0.50)[]; R_SPF_NEUTRAL(0.00)[?all]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[cydem.org]; RCVD_IN_DNSWL_MED(-0.20)[142.90.100.195:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_NO_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:36391, ipnet:142.90.64.0/18, country:CA]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-hackers] X-ThisMailContainsUnwantedMimeParts: N FWIW: # alias s sync; sync; sync; root@soralx:/usr/src# s load: 0.58 cmd: csh 29319 [suspended] 444444.50r 0.02u 0.00s 0% 5120k mi_switch+0xbe thread_suspend_switch+0xca cursig+0x634 ast+0x30f fast_syscall_common+0x1a5 load: 0.29 cmd: csh 29319 [suspended] 444482.97r 0.02u 0.00s 0% 5120k mi_switch+0xbe thread_suspend_switch+0xca cursig+0x634 ast+0x30f fast_syscall_common+0x1a5 ^C load: 0.36 cmd: csh 29319 [suspended] 444505.34r 0.02u 0.00s 0% 5120k mi_switch+0xbe thread_suspend_switch+0xca cursig+0x634 ast+0x30f fast_syscall_common+0x1a5 Had to `kill -CONT 29319` a few times to end the process and restore shell. `s` worked fine in other terminal windows during this time. # uname -a FreeBSD soralx.cydem.org 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n247386-870e197d52c-dirty: Tue Jun 15 18:24:00 PDT 2021 root@soralx.cydem.org:/usr/obj/usr/src/amd64.amd64/sys/SORALX amd64 Please ignore if this is a fixed/known behaviour. -- [SorAlx] ridin' VN2000 Classic LT From nobody Sun Jun 27 19:39:35 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BE10311E255C for ; Sun, 27 Jun 2021 19:39:42 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [IPv6:2001:19f0:6400:80a1:5054:ff:fe7a:a27d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GCgzx6yZyz4mwC for ; Sun, 27 Jun 2021 19:39:41 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.16.1/8.16.1) with ESMTP id 15RJdZGT010812 for ; Sun, 27 Jun 2021 22:39:35 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.16.1/8.16.1/Submit) id 15RJdZBq010811 for freebsd-hackers@freebsd.org; Sun, 27 Jun 2021 22:39:35 +0300 (MSK) (envelope-from dchagin) Date: Sun, 27 Jun 2021 22:39:35 +0300 From: Dmitry Chagin To: freebsd-hackers@freebsd.org Subject: pondering pi futexes Message-ID: List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4GCgzx6yZyz4mwC X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of dchagin@heemeyer.club has no SPF policy when checking 2001:19f0:6400:80a1:5054:ff:fe7a:a27d) smtp.mailfrom=dchagin@heemeyer.club X-Spamd-Result: default: False [0.10 / 15.00]; TO_DOM_EQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[dchagin]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:19f0:6400:80a1:5054:ff:fe7a:a27d:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2001:19f0:6400:80a1:5054:ff:fe7a:a27d:from:127.0.2.255]; RCVD_TLS_LAST(0.00)[]; NEURAL_SPAM_SHORT(0.90)[0.901]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[dchagin@freebsd.org,dchagin@heemeyer.club]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:20473, ipnet:2001:19f0:6400::/38, country:US]; FROM_NEQ_ENVFROM(0.00)[dchagin@freebsd.org,dchagin@heemeyer.club]; MAILMAN_DEST(0.00)[freebsd-hackers] X-ThisMailContainsUnwantedMimeParts: N Hi, some time ago I have changed Linuxulator futexes from sx lock to mtx. sx was used as it allows copyin/copyout with sx lock held. to use mtx I have changed the code like: 1. lock mtx; 2. disable_pagefaults; 3. copyin() 4. enable_pagefaults; 5. if error - unlock mtx; copyin(); if error == 0 goto 1. it works (needto replace copyin() by fueword32()), but pondering pi futexes imlementation, I see that it is not possible to drop the futex lock on a return from msleep() path. below a simplified FUTEX_LOCK_PI operation, where on enter to the kernel current thread: 0. acquire futex lock (which is mtx) 1. cmpset(0 -> current thread TID), return (0) on success; 2. fetch() from futex *uaddr (for TID of owner): - check EDEADLK case (the futex word at *uaddr is already locked by the caller); - check that is no waiters on *uaddr exists which is waiting via FUTEX_WAIT or FUTEX_WAIT_BITSET, return (EINVAL) if so; - cmpset(TID -> (FUTEX_WAITERS|TID)); - on error, the futex owner changed in user-space, repeat from 1. 3. Here we have: the owner, one waiter (current thread) and 0 or more waiters sleeping on a waiting_proc. FUTEX_WAITERS bit is set, so any new waiters go to the kernel and owner should unlock futex via the FUTEX_UNLOCK_PI op; 4. Try to find the thread which is associated with the owner’s TID: - on error, something bad happened, owner died? Clean owner state link? return (ESRCH). Or if no other waiters? Check this... - on success: - save owner state link to the struct futex (save priority); - check the owner's priority, bump it if needed; - put the current thread to the waiters list in descending priority order; - change priority of all waiters if needed; - msleep on a futex waiting_proc; come back with futex lock held; - restore own priority? If last waiter?; [ponders..] - on timeout return (ETIMEDOUT); - the current thread is the new owner: bah!! - store() the owner TID to *uaddr; [check what should I do on error..] - release futex lock; - return (0). is it possible to hold *uaddr page to prevent page faults?