From owner-dev-commits-src-main@freebsd.org Mon Aug 2 00:30:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F50F669354; Mon, 2 Aug 2021 00:30:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdJnk1NH2z4V2N; Mon, 2 Aug 2021 00:30:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17A6C15F59; Mon, 2 Aug 2021 00:30:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1720UnxC004140; Mon, 2 Aug 2021 00:30:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1720UnCK004129; Mon, 2 Aug 2021 00:30:49 GMT (envelope-from git) Date: Mon, 2 Aug 2021 00:30:49 GMT Message-Id: <202108020030.1720UnCK004129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 665895db262f - main - amd64 pmap_vm_page_alloc_check(): loose the assert MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 665895db262fa596b347e40f6857b37e0f43b184 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 00:30:50 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=665895db262fa596b347e40f6857b37e0f43b184 commit 665895db262fa596b347e40f6857b37e0f43b184 Author: Konstantin Belousov AuthorDate: 2021-08-01 21:58:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-02 00:28:33 +0000 amd64 pmap_vm_page_alloc_check(): loose the assert Current expression checks that vm_page_alloc(9) never returns a page belonging to the preload area. This is not true if something was freed from there, for instance a preloaded module was unloaded, or ucode update freed. Only check that we never allow to allocate a page belonging to the kernel proper, check against _end. Reported and tested by: dhw Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/include/pmap.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h index 518dc544ac0d..375a86f95e9f 100644 --- a/sys/amd64/include/pmap.h +++ b/sys/amd64/include/pmap.h @@ -457,9 +457,10 @@ extern int invpcid_works; #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) #define pmap_vm_page_alloc_check(m) \ - KASSERT(m->phys_addr < kernphys || m->phys_addr >= KERNend, \ - ("allocating kernel page %p pa %#lx kernphys %#lx kernend %#lx", \ - m, m->phys_addr, kernphys, KERNend)); + KASSERT(m->phys_addr < kernphys || \ + m->phys_addr >= kernphys + (vm_offset_t)&_end - KERNSTART, \ + ("allocating kernel page %p pa %#lx kernphys %#lx end %p", \ + m, m->phys_addr, kernphys, &_end)); struct thread; From owner-dev-commits-src-main@freebsd.org Mon Aug 2 02:58:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAE6866AE0C; Mon, 2 Aug 2021 02:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdN4C47bKz4fNC; Mon, 2 Aug 2021 02:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7628617C6C; Mon, 2 Aug 2021 02:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1722wZUD094129; Mon, 2 Aug 2021 02:58:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1722wZcf094128; Mon, 2 Aug 2021 02:58:35 GMT (envelope-from git) Date: Mon, 2 Aug 2021 02:58:35 GMT Message-Id: <202108020258.1722wZcf094128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 2668bb2add8d - main - sched_ule(4): Reduce duplicate search for load. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2668bb2add8d11c56524ce9014b510412f8f6aa9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 02:58:35 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=2668bb2add8d11c56524ce9014b510412f8f6aa9 commit 2668bb2add8d11c56524ce9014b510412f8f6aa9 Author: Alexander Motin AuthorDate: 2021-08-02 02:07:51 +0000 Commit: Alexander Motin CommitDate: 2021-08-02 02:07:51 +0000 sched_ule(4): Reduce duplicate search for load. When sched_highest() called for some CPU group returns nothing, idle thread calls it for the parent CPU group. But the parent CPU group also includes the CPU group we've just searched, and unless there is a race going on, it is unlikely we find anything new this time. Avoid the double search in case of parent group having only two sub- groups (the most prominent case). Instead of escalating to the parent group run the next search over the sibling subgroup and escalate two levels up after if that fail too. In case of more than two siblings the difference is less significant, while searching the parent group can result in better decision if we find several candidate CPUs. On 2-socket 40-core Xeon system I am measuring ~25% reduction of CPU time spent inside cpu_search_highest() in both SMT (2x20x2) and non- SMT (2x20) cases. MFC after: 1 month --- sys/kern/sched_ule.c | 63 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 2b55b0a7a8c5..028e07efa889 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -933,10 +933,10 @@ tdq_move(struct tdq *from, struct tdq *to) static int tdq_idled(struct tdq *tdq) { - struct cpu_group *cg; + struct cpu_group *cg, *parent; struct tdq *steal; cpuset_t mask; - int cpu, switchcnt; + int cpu, switchcnt, goup; if (smp_started == 0 || steal_idle == 0 || tdq->tdq_cg == NULL) return (1); @@ -944,7 +944,7 @@ tdq_idled(struct tdq *tdq) CPU_CLR(PCPU_GET(cpuid), &mask); restart: switchcnt = tdq->tdq_switchcnt + tdq->tdq_oldswitchcnt; - for (cg = tdq->tdq_cg; ; ) { + for (cg = tdq->tdq_cg, goup = 0; ; ) { cpu = sched_highest(cg, &mask, steal_thresh); /* * We were assigned a thread but not preempted. Returning @@ -952,10 +952,29 @@ tdq_idled(struct tdq *tdq) */ if (tdq->tdq_load) return (0); + + /* + * We found no CPU to steal from in this group. Escalate to + * the parent and repeat. But if parent has only two children + * groups we can avoid searching this group again by searching + * the other one specifically and then escalating two levels. + */ if (cpu == -1) { - cg = cg->cg_parent; - if (cg == NULL) + if (goup) { + cg = cg->cg_parent; + goup = 0; + } + parent = cg->cg_parent; + if (parent == NULL) return (1); + if (parent->cg_children == 2) { + if (cg == &parent->cg_child[0]) + cg = &parent->cg_child[1]; + else + cg = &parent->cg_child[0]; + goup = 1; + } else + cg = parent; continue; } steal = TDQ_CPU(cpu); @@ -1868,10 +1887,10 @@ lend: static void tdq_trysteal(struct tdq *tdq) { - struct cpu_group *cg; + struct cpu_group *cg, *parent; struct tdq *steal; cpuset_t mask; - int cpu, i; + int cpu, i, goup; if (smp_started == 0 || trysteal_limit == 0 || tdq->tdq_cg == NULL) return; @@ -1880,7 +1899,7 @@ tdq_trysteal(struct tdq *tdq) /* We don't want to be preempted while we're iterating. */ spinlock_enter(); TDQ_UNLOCK(tdq); - for (i = 1, cg = tdq->tdq_cg; ; ) { + for (i = 1, cg = tdq->tdq_cg, goup = 0; ; ) { cpu = sched_highest(cg, &mask, steal_thresh); /* * If a thread was added while interrupts were disabled don't @@ -1890,13 +1909,35 @@ tdq_trysteal(struct tdq *tdq) TDQ_LOCK(tdq); break; } + + /* + * We found no CPU to steal from in this group. Escalate to + * the parent and repeat. But if parent has only two children + * groups we can avoid searching this group again by searching + * the other one specifically and then escalating two levels. + */ if (cpu == -1) { - i++; - cg = cg->cg_parent; - if (cg == NULL || i > trysteal_limit) { + if (goup) { + cg = cg->cg_parent; + goup = 0; + } + if (++i > trysteal_limit) { + TDQ_LOCK(tdq); + break; + } + parent = cg->cg_parent; + if (parent == NULL) { TDQ_LOCK(tdq); break; } + if (parent->cg_children == 2) { + if (cg == &parent->cg_child[0]) + cg = &parent->cg_child[1]; + else + cg = &parent->cg_child[0]; + goup = 1; + } else + cg = parent; continue; } steal = TDQ_CPU(cpu); From owner-dev-commits-src-main@freebsd.org Mon Aug 2 02:58:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B345766ADCB; Mon, 2 Aug 2021 02:58:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdN4D4d4yz4fW5; Mon, 2 Aug 2021 02:58:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8730C17CED; Mon, 2 Aug 2021 02:58:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1722waXZ094153; Mon, 2 Aug 2021 02:58:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1722walG094152; Mon, 2 Aug 2021 02:58:36 GMT (envelope-from git) Date: Mon, 2 Aug 2021 02:58:36 GMT Message-Id: <202108020258.1722walG094152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 8bb173fb5bc3 - main - sched_ule(4): Use trylock when stealing load. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8bb173fb5bc33a02d5a4670c9a60bba0ece07bac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 02:58:36 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=8bb173fb5bc33a02d5a4670c9a60bba0ece07bac commit 8bb173fb5bc33a02d5a4670c9a60bba0ece07bac Author: Alexander Motin AuthorDate: 2021-08-02 02:42:01 +0000 Commit: Alexander Motin CommitDate: 2021-08-02 02:42:01 +0000 sched_ule(4): Use trylock when stealing load. On some load patterns it is possible for several CPUs to try steal thread from the same CPU despite randomization introduced. It may cause significant lock contention when holding one queue lock idle thread tries to acquire another one. Use of trylock on the remote queue allows both reduce the contention and handle lock ordering easier. If we can't get lock inside tdq_trysteal() we just return, allowing tdq_idled() handle it. If it happens in tdq_idled(), then we repeat search for load skipping this CPU. On 2-socket 80-thread Xeon system I am observing dramatic reduction of the lock spinning time when doing random uncached 4KB reads from 12 ZVOLs, while IOPS increase from 327K to 403K. MFC after: 1 month --- sys/kern/sched_ule.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 028e07efa889..1bdcfb1f793d 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -300,6 +300,8 @@ static struct tdq tdq_cpu; #define TDQ_LOCK_ASSERT(t, type) mtx_assert(TDQ_LOCKPTR((t)), (type)) #define TDQ_LOCK(t) mtx_lock_spin(TDQ_LOCKPTR((t))) #define TDQ_LOCK_FLAGS(t, f) mtx_lock_spin_flags(TDQ_LOCKPTR((t)), (f)) +#define TDQ_TRYLOCK(t) mtx_trylock_spin(TDQ_LOCKPTR((t))) +#define TDQ_TRYLOCK_FLAGS(t, f) mtx_trylock_spin_flags(TDQ_LOCKPTR((t)), (f)) #define TDQ_UNLOCK(t) mtx_unlock_spin(TDQ_LOCKPTR((t))) #define TDQ_LOCKPTR(t) ((struct mtx *)(&(t)->tdq_lock)) @@ -989,13 +991,22 @@ tdq_idled(struct tdq *tdq) if (steal->tdq_load < steal_thresh || steal->tdq_transferable == 0) goto restart; - tdq_lock_pair(tdq, steal); /* - * We were assigned a thread while waiting for the locks. - * Switch to it now instead of stealing a thread. + * Try to lock both queues. If we are assigned a thread while + * waited for the lock, switch to it now instead of stealing. + * If we can't get the lock, then somebody likely got there + * first so continue searching. */ - if (tdq->tdq_load) - break; + TDQ_LOCK(tdq); + if (tdq->tdq_load > 0) { + mi_switch(SW_VOL | SWT_IDLE); + return (0); + } + if (TDQ_TRYLOCK_FLAGS(steal, MTX_DUPOK) == 0) { + TDQ_UNLOCK(tdq); + CPU_CLR(cpu, &mask); + continue; + } /* * The data returned by sched_highest() is stale and * the chosen CPU no longer has an eligible thread, or @@ -1948,18 +1959,18 @@ tdq_trysteal(struct tdq *tdq) if (steal->tdq_load < steal_thresh || steal->tdq_transferable == 0) continue; - tdq_lock_pair(tdq, steal); /* - * If we get to this point, unconditonally exit the loop - * to bound the time spent in the critcal section. - * - * If a thread was added while interrupts were disabled don't - * steal one here. + * Try to lock both queues. If we are assigned a thread while + * waited for the lock, switch to it now instead of stealing. + * If we can't get the lock, then somebody likely got there + * first. At this point unconditonally exit the loop to + * bound the time spent in the critcal section. */ - if (tdq->tdq_load > 0) { - TDQ_UNLOCK(steal); + TDQ_LOCK(tdq); + if (tdq->tdq_load > 0) + break; + if (TDQ_TRYLOCK_FLAGS(steal, MTX_DUPOK) == 0) break; - } /* * The data returned by sched_highest() is stale and * the chosen CPU no longer has an eligible thread. From owner-dev-commits-src-main@freebsd.org Mon Aug 2 03:44:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7287666AFF3; Mon, 2 Aug 2021 03:44:05 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) (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 4GdP4j28yFz4hV5; Mon, 2 Aug 2021 03:44:05 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lj1-x22d.google.com with SMTP id h9so22142091ljq.8; Sun, 01 Aug 2021 20:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6bZTynY+Z2ApvDJDwouTTpLSDunc7mJcE3e8Bzl/Ask=; b=hXGVJJcacqNSLEzjbHJkZ2YFu9/gNhfTPIkrfU4Zifsi8hGwwhtUsRhepp6KSyWMJ5 6dLjn91BNof0tWguH1B9dnP4GheXHd1l3U54D2kiLlF2s16HV0Z584m+JC8Vsx056Cwz inEVoF831EZn6sEHi5uic5sNqldq6GiFSZlfoXDdlFwKcRWicHDBEWWpvIM+wHRXOzk3 oJJ2rnb/tNe+k1QPlhe49nRiO0J3AwFfAQgSAPNQefbI7j3UG+48M50++6wu7x9VD4/v I4hya+mqTJBgXFoNlORsKQ3OUEiIM54D3EUTjeUgNn3QhO90T8JhSw1/QIL3DhsV67IF UULQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6bZTynY+Z2ApvDJDwouTTpLSDunc7mJcE3e8Bzl/Ask=; b=JygNfEhtfXszzDWMNowc1KwRLGrKSUBMEX887Z8lkaRe9RP2OQODkGxPcENKk0lKtV rz13gKOk90fkCF1ZADNXXcsk2sR2yDHMy4+XPlISqPaS9B8HRT4EpCl1MbRZ1WHwXZLp kL6exYBsK4Ew0L6yA8OtjpjINS1+gHui1X2HEBmGUiCB7N4kIcr8tqyZ8eVvA/Dzm3Sl 95ZjPO92o6f/eLQgEzUugZ0Xj3c7adwa4hu3w03vkK8UELOaRaJhQsbFPe/lFEbDh5xp X2XnH2LoFit5HqeqG6ijVY/ROJTRU4AyZL320ZG87DXfzDThBYXQZentHSBDsOQZaeLl V7SA== X-Gm-Message-State: AOAM531L8z3u4zob5l33YJgPQWKHrUdAZ1SPbzumtNbeSZ1J62RIQRdt v5N9Y1gkfJewTwIxBZlS7SzXzHHQzAJ7c+qgsxryrDqr X-Google-Smtp-Source: ABdhPJzGnasRktCRFkXZlLWzldSube0yky6y+z5ZXFs7su24UQKS9t/vrs/PgmhDVCQC+ZRCSQLtBZ6YZ+9VPtqVDIk= X-Received: by 2002:a2e:b81c:: with SMTP id u28mr9610751ljo.483.1627875838332; Sun, 01 Aug 2021 20:43:58 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:a40d:0:0:0:0:0 with HTTP; Sun, 1 Aug 2021 20:43:57 -0700 (PDT) In-Reply-To: <202108020258.1722walG094152@gitrepo.freebsd.org> References: <202108020258.1722walG094152@gitrepo.freebsd.org> From: Mateusz Guzik Date: Mon, 2 Aug 2021 05:43:57 +0200 Message-ID: Subject: Re: git: 8bb173fb5bc3 - main - sched_ule(4): Use trylock when stealing load. To: Alexander Motin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4GdP4j28yFz4hV5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 03:44:05 -0000 Mostly related, I just had a look at the code and noticed: static uint32_t sched_random(void) { uint32_t *rndptr; rndptr = DPCPU_PTR(randomval); *rndptr = *rndptr * 69069 + 5; return (*rndptr >> 16); } Except randomval starts at 0 for all CPUs. Should be easy to pre-init with an actual random value. Is that something you played with? On 8/2/21, Alexander Motin wrote: > The branch main has been updated by mav: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=8bb173fb5bc33a02d5a4670c9a60bba0ece07bac > > commit 8bb173fb5bc33a02d5a4670c9a60bba0ece07bac > Author: Alexander Motin > AuthorDate: 2021-08-02 02:42:01 +0000 > Commit: Alexander Motin > CommitDate: 2021-08-02 02:42:01 +0000 > > sched_ule(4): Use trylock when stealing load. > > On some load patterns it is possible for several CPUs to try steal > thread from the same CPU despite randomization introduced. It may > cause significant lock contention when holding one queue lock idle > thread tries to acquire another one. Use of trylock on the remote > queue allows both reduce the contention and handle lock ordering > easier. If we can't get lock inside tdq_trysteal() we just return, > allowing tdq_idled() handle it. If it happens in tdq_idled(), then > we repeat search for load skipping this CPU. > > On 2-socket 80-thread Xeon system I am observing dramatic reduction > of the lock spinning time when doing random uncached 4KB reads from > 12 ZVOLs, while IOPS increase from 327K to 403K. > > MFC after: 1 month > --- > sys/kern/sched_ule.c | 39 +++++++++++++++++++++++++-------------- > 1 file changed, 25 insertions(+), 14 deletions(-) > > diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c > index 028e07efa889..1bdcfb1f793d 100644 > --- a/sys/kern/sched_ule.c > +++ b/sys/kern/sched_ule.c > @@ -300,6 +300,8 @@ static struct tdq tdq_cpu; > #define TDQ_LOCK_ASSERT(t, type) mtx_assert(TDQ_LOCKPTR((t)), (type)) > #define TDQ_LOCK(t) mtx_lock_spin(TDQ_LOCKPTR((t))) > #define TDQ_LOCK_FLAGS(t, f) mtx_lock_spin_flags(TDQ_LOCKPTR((t)), (f)) > +#define TDQ_TRYLOCK(t) mtx_trylock_spin(TDQ_LOCKPTR((t))) > +#define TDQ_TRYLOCK_FLAGS(t, f) mtx_trylock_spin_flags(TDQ_LOCKPTR((t)), > (f)) > #define TDQ_UNLOCK(t) mtx_unlock_spin(TDQ_LOCKPTR((t))) > #define TDQ_LOCKPTR(t) ((struct mtx *)(&(t)->tdq_lock)) > > @@ -989,13 +991,22 @@ tdq_idled(struct tdq *tdq) > if (steal->tdq_load < steal_thresh || > steal->tdq_transferable == 0) > goto restart; > - tdq_lock_pair(tdq, steal); > /* > - * We were assigned a thread while waiting for the locks. > - * Switch to it now instead of stealing a thread. > + * Try to lock both queues. If we are assigned a thread while > + * waited for the lock, switch to it now instead of stealing. > + * If we can't get the lock, then somebody likely got there > + * first so continue searching. > */ > - if (tdq->tdq_load) > - break; > + TDQ_LOCK(tdq); > + if (tdq->tdq_load > 0) { > + mi_switch(SW_VOL | SWT_IDLE); > + return (0); > + } > + if (TDQ_TRYLOCK_FLAGS(steal, MTX_DUPOK) == 0) { > + TDQ_UNLOCK(tdq); > + CPU_CLR(cpu, &mask); > + continue; > + } > /* > * The data returned by sched_highest() is stale and > * the chosen CPU no longer has an eligible thread, or > @@ -1948,18 +1959,18 @@ tdq_trysteal(struct tdq *tdq) > if (steal->tdq_load < steal_thresh || > steal->tdq_transferable == 0) > continue; > - tdq_lock_pair(tdq, steal); > /* > - * If we get to this point, unconditonally exit the loop > - * to bound the time spent in the critcal section. > - * > - * If a thread was added while interrupts were disabled don't > - * steal one here. > + * Try to lock both queues. If we are assigned a thread while > + * waited for the lock, switch to it now instead of stealing. > + * If we can't get the lock, then somebody likely got there > + * first. At this point unconditonally exit the loop to > + * bound the time spent in the critcal section. > */ > - if (tdq->tdq_load > 0) { > - TDQ_UNLOCK(steal); > + TDQ_LOCK(tdq); > + if (tdq->tdq_load > 0) > + break; > + if (TDQ_TRYLOCK_FLAGS(steal, MTX_DUPOK) == 0) > break; > - } > /* > * The data returned by sched_highest() is stale and > * the chosen CPU no longer has an eligible thread. > -- Mateusz Guzik From owner-dev-commits-src-main@freebsd.org Mon Aug 2 03:47:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C6E566BA04; Mon, 2 Aug 2021 03:47:38 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (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 4GdP8p3Fr2z4hXH; Mon, 2 Aug 2021 03:47:38 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-qk1-x72a.google.com with SMTP id t66so15520909qkb.0; Sun, 01 Aug 2021 20:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4CjCuYTuuhunBpUawLkExsoHRoGyxR7zBr3lQgIslSY=; b=mWNHyeBWIe/uYrW6tmZYHwz9334sf9oc93xosmdpiYo1nYBg5SgTmYJyD7kd72RiGS eOxiZNbtoASVkd9wrFRVr6Qm1KcO+EnJXK44nbNdStaa6T27QTOHHDHpv2dU/yih5Hno g0fFNfH1uduGgfNf63UmJdkp1JMqcVSdomrw1oKu/23HBd1H7ltrbYr4QtFJFm3Kwrpw q2pG+SH1KoruBUalK+zAWl5B4MjnDoekwct6MiIUAUrLGSZOzMSWIvz8jwO2dH3K9+IK 6Kp0wfcXUX82W2+108AQMQfDL8U6TDa/v7FRS7SruaLYqsfCkQnkkdviUCLu3c06EK0c d+kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4CjCuYTuuhunBpUawLkExsoHRoGyxR7zBr3lQgIslSY=; b=Qc8uBS+rH7sYqEkhRUmp7Eg7QHfd2Q8WcQT5AQ1CyULhk39D2VviOLnUAfGq+mYzhQ echFaFzv9GO+MFa/c/QnrSZbiZFKcuthNAsgC/k2b3xA0imJdVvxIgKPLQB4ALp00GHc 4Tu+k8xGFP5CauTemiKKT6t0mJqUpBApxSKbxULOu2an1MNDYCHjE0s5KGGxsvz8B5EI YcQSVeXvmIQxIlIzC6ILwRr2Z3i4+9ZyA9vxa22beE5R0F62gG+fPdf09yKnuSgk3m7C by4kh54VlohazSKNRBSynvcTYbDjtyq5F/WhLPjH8vFkIwKDPqmbHE7UpYDVns70gFFg 94qA== X-Gm-Message-State: AOAM531z7HM29f96NehbNAjBsVecBPjpdwtKt+TwuWDLeChQ9teUX/ij 8tf1ggZg7Li2ylHjl+olJeCclhRu8Qg= X-Google-Smtp-Source: ABdhPJyO7zYu3m0b7y88H5rllandvCRWpCy1lfZO405k0oMRHbkQC55eo9DKVD80VV6E6amQeCwCWg== X-Received: by 2002:a37:bca:: with SMTP id 193mr14100255qkl.120.1627876057211; Sun, 01 Aug 2021 20:47:37 -0700 (PDT) Received: from spectre.mavhome.dp.ua (104-55-12-234.lightspeed.knvltn.sbcglobal.net. [104.55.12.234]) by smtp.gmail.com with ESMTPSA id w5sm4061675qtv.3.2021.08.01.20.47.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Aug 2021 20:47:36 -0700 (PDT) Sender: Alexander Motin Subject: Re: git: 8bb173fb5bc3 - main - sched_ule(4): Use trylock when stealing load. To: Mateusz Guzik Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202108020258.1722walG094152@gitrepo.freebsd.org> From: Alexander Motin Message-ID: <443ba55d-aff1-1f36-e3e7-00df95f4abdc@FreeBSD.org> Date: Sun, 1 Aug 2021 23:47:35 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4GdP8p3Fr2z4hXH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 03:47:38 -0000 On 01.08.2021 23:43, Mateusz Guzik wrote: > Mostly related, I just had a look at the code and noticed: > > static uint32_t > sched_random(void) > { > uint32_t *rndptr; > > rndptr = DPCPU_PTR(randomval); > *rndptr = *rndptr * 69069 + 5; > > return (*rndptr >> 16); > } > > Except randomval starts at 0 for all CPUs. Should be easy to pre-init > with an actual random value. Is that something you played with? It is pretty old code, so no, at least not this time. But I doubt it would make a any difference, since different CPUs should have different number of calls to this, so they should naturally run away from each-other. -- Alexander Motin From owner-dev-commits-src-main@freebsd.org Mon Aug 2 06:26:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 963FF66E4C5; Mon, 2 Aug 2021 06:26:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdSgj3pnXz4tkk; Mon, 2 Aug 2021 06:26:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B1FB1AD09; Mon, 2 Aug 2021 06:26:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1726Q9Co075624; Mon, 2 Aug 2021 06:26:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1726Q9CB075623; Mon, 2 Aug 2021 06:26:09 GMT (envelope-from git) Date: Mon, 2 Aug 2021 06:26:09 GMT Message-Id: <202108020626.1726Q9CB075623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 9340ebd404ef - main - Add missing file to sys/conf/files after 469884cf04a9b92677c7c83e229ca6b8814f8b0a . MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9340ebd404efad7068b5a45fd3b3d8bb21187b91 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 06:26:09 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=9340ebd404efad7068b5a45fd3b3d8bb21187b91 commit 9340ebd404efad7068b5a45fd3b3d8bb21187b91 Author: Hans Petter Selasky AuthorDate: 2021-08-02 06:24:22 +0000 Commit: Hans Petter Selasky CommitDate: 2021-08-02 06:25:04 +0000 Add missing file to sys/conf/files after 469884cf04a9b92677c7c83e229ca6b8814f8b0a . Found by: vishwin@ Differential Revision: https://reviews.freebsd.org/D29921 MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/conf/files | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/conf/files b/sys/conf/files index ae3fd61ed7a1..44eda0e8bae6 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4578,6 +4578,8 @@ compat/linuxkpi/common/src/linux_domain.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_firmware.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" +compat/linuxkpi/common/src/linux_fpu.c optional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_hrtimer.c optional compat_linuxkpi \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_kthread.c optional compat_linuxkpi \ From owner-dev-commits-src-main@freebsd.org Mon Aug 2 06:26:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBC6566E2C9; Mon, 2 Aug 2021 06:26:52 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 4GdShX4hZ4z4tl1; Mon, 2 Aug 2021 06:26:52 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2EC932600CB; Mon, 2 Aug 2021 08:26:44 +0200 (CEST) Subject: Re: git: 469884cf04a9 - main - LinuxKPI: Make FPU sections thread-safe and use the NOCTX flag. To: Charlie Li , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202107311338.16VDcaSh006994@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Mon, 2 Aug 2021 08:26:33 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4GdShX4hZ4z4tl1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 06:26:52 -0000 On 8/1/21 12:32 PM, Charlie Li wrote: > Hans Petter Selasky wrote: >> commit 469884cf04a9b92677c7c83e229ca6b8814f8b0a >> Author: Hans Petter Selasky >> AuthorDate: 2021-07-31 13:32:52 +0000 >> Commit: Hans Petter Selasky >> CommitDate: 2021-07-31 13:36:48 +0000 >> >> LinuxKPI: Make FPU sections thread-safe and use the NOCTX flag. >> >> Reviewed by: kib >> Submitted by: greg@unrelenting.technology >> Differential Revision: https://reviews.freebsd.org/D29921 >> MFC after: 1 week >> Sponsored by: NVIDIA Networking >> --- >> sys/compat/linuxkpi/common/include/asm/fpu/api.h | 40 ++++------------------ >> sys/compat/linuxkpi/common/include/linux/sched.h | 3 +- >> sys/compat/linuxkpi/common/src/linux_fpu.c | 43 ++++++++++++++++++------ >> sys/conf/files.amd64 | 3 -- >> sys/conf/files.arm64 | 4 --- >> sys/conf/files.i386 | 3 -- >> sys/modules/linuxkpi/Makefile | 3 +- >> 7 files changed, 43 insertions(+), 56 deletions(-) >> > i915kms from drm-kmod, while successfully built against the commit after > (__FreeBSD_version bump), fails to load on that same commit: > > link_elf_obj: symbol lkpi_kernel_fpu_begin undefined > linker_load_file: /boot/modules/i915kms.ko - unsupported file type > Should be fixed by: https://cgit.freebsd.org/src/commit/?id=9340ebd404efad7068b5a45fd3b3d8bb21187b91 --HPS From owner-dev-commits-src-main@freebsd.org Mon Aug 2 09:32:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBEF967151A; Mon, 2 Aug 2021 09:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdXqC63h2z3PNv; Mon, 2 Aug 2021 09:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B82DF1D58F; Mon, 2 Aug 2021 09:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1729WtiX027663; Mon, 2 Aug 2021 09:32:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1729WtwJ027662; Mon, 2 Aug 2021 09:32:55 GMT (envelope-from git) Date: Mon, 2 Aug 2021 09:32:55 GMT Message-Id: <202108020932.1729WtwJ027662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Roger Pau Monn=C3=A9?= Subject: git: 82bf6a2566ba - main - xen/timer: fix amd64 LINT kernel build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82bf6a2566ba51f2516c16aa7cca6398972c3123 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 09:32:56 -0000 The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=82bf6a2566ba51f2516c16aa7cca6398972c3123 commit 82bf6a2566ba51f2516c16aa7cca6398972c3123 Author: Roger Pau MonnĂ© AuthorDate: 2021-08-02 08:22:22 +0000 Commit: Roger Pau MonnĂ© CommitDate: 2021-08-02 08:33:35 +0000 xen/timer: fix amd64 LINT kernel build On amd64 XENHVM depends on the xentimer device for PVH early startup, so both should be added or removed together (like the current dependency with xenpci). Fix this by adding xentimer to NOTES and updating the comments on the config files. Note that on i386 there's no such dependency between xentimer and XENHVM, since there's no PVH support. While there also fix the MINIMAL i386 build to include the xentimer, so it keeps the same functionality as before xentimer was split from XENHVM. Reported by: lwhsu PR: 257549 Fixes: ae5981274815 ('xen/timer: make xen timer optional') --- sys/amd64/conf/GENERIC | 4 ++-- sys/amd64/conf/MINIMAL | 4 +++- sys/amd64/conf/NOTES | 1 + sys/i386/conf/MINIMAL | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index fa531e13a3b9..f7b41919575d 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -380,8 +380,8 @@ device virtio_balloon # VirtIO Memory Balloon device device hyperv # HyperV drivers # Xen HVM Guest Optimizations -# NOTE: XENHVM and xenpci interdepend. They must be added or removed -# together. xentimer depends on XENHVM and isn't required. +# NOTE: XENHVM depends on xenpci and xentimer. +# They must be added or removed together. options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver device xentimer # Xen x86 PV timer device diff --git a/sys/amd64/conf/MINIMAL b/sys/amd64/conf/MINIMAL index 6678f0a7ee63..14f91e6c8eaf 100644 --- a/sys/amd64/conf/MINIMAL +++ b/sys/amd64/conf/MINIMAL @@ -132,9 +132,11 @@ device ether # Ethernet support device bpf # Berkeley packet filter # Xen HVM Guest Optimizations -# NOTE: XENHVM depends on xenpci. They must be added or removed together. +# NOTE: XENHVM depends on xenpci and xentimer. +# They must be added or removed together. options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver +device xentimer # Xen x86 PV timer device # evdev interface options EVDEV_SUPPORT # evdev support in legacy drivers diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index f5bdf15ebb08..501ceaedb222 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -504,6 +504,7 @@ device hyperv # HyperV drivers # Xen HVM Guest Optimizations options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver +device xentimer # Xen x86 PV timer device ##################################################################### diff --git a/sys/i386/conf/MINIMAL b/sys/i386/conf/MINIMAL index f80c5cf40b48..37b8e074ac65 100644 --- a/sys/i386/conf/MINIMAL +++ b/sys/i386/conf/MINIMAL @@ -149,6 +149,7 @@ device bpf # Berkeley packet filter # NOTE: XENHVM depends on xenpci. They must be added or removed together. options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver +device xentimer # Xen x86 PV timer device # evdev interface options EVDEV_SUPPORT # evdev support in legacy drivers From owner-dev-commits-src-main@freebsd.org Mon Aug 2 09:58:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80407671A63; Mon, 2 Aug 2021 09:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdYNq3Bckz3h0C; Mon, 2 Aug 2021 09:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 551B21DA91; Mon, 2 Aug 2021 09:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1729wZ9w055120; Mon, 2 Aug 2021 09:58:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1729wZqj055119; Mon, 2 Aug 2021 09:58:35 GMT (envelope-from git) Date: Mon, 2 Aug 2021 09:58:35 GMT Message-Id: <202108020958.1729wZqj055119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: df95cc76affb - main - vmm: Bump vmname buffer in struct vm to VM_MAX_NAMELEN + 1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df95cc76affbbf114c9ff2e4ee011b6f162aa8bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 09:58:35 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=df95cc76affbbf114c9ff2e4ee011b6f162aa8bd commit df95cc76affbbf114c9ff2e4ee011b6f162aa8bd Author: Ka Ho Ng AuthorDate: 2021-08-02 09:54:40 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-02 09:55:08 +0000 vmm: Bump vmname buffer in struct vm to VM_MAX_NAMELEN + 1 In hw.vmm.create sysctl handler the maximum length of vm name is VM_MAX_NAMELEN. However in vm_create() the maximum length allowed is only VM_MAX_NAMELEN - 1 chars. Bump the length of the internal buffer to allow the length of VM_MAX_NAMELEN for vm name. MFC after: 3 days Reviewed by: grehan Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31372 --- sys/amd64/vmm/vmm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 5c2a404f45a7..80fcde8d80fa 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -174,7 +174,7 @@ struct vm { struct mem_map mem_maps[VM_MAX_MEMMAPS]; /* (i) guest address space */ struct mem_seg mem_segs[VM_MAX_MEMSEGS]; /* (o) guest memory regions */ struct vmspace *vmspace; /* (o) guest's address space */ - char name[VM_MAX_NAMELEN]; /* (o) virtual machine name */ + char name[VM_MAX_NAMELEN+1]; /* (o) virtual machine name */ struct vcpu vcpu[VM_MAXCPU]; /* (i) guest vcpus */ /* The following describe the vm cpu topology */ uint16_t sockets; /* (o) num of sockets */ @@ -480,7 +480,8 @@ vm_create(const char *name, struct vm **retvm) if (!vmm_initialized) return (ENXIO); - if (name == NULL || strlen(name) >= VM_MAX_NAMELEN) + if (name == NULL || strnlen(name, VM_MAX_NAMELEN + 1) == + VM_MAX_NAMELEN + 1) return (EINVAL); vmspace = vmmops_vmspace_alloc(0, VM_MAXUSER_ADDRESS_LA48); From owner-dev-commits-src-main@freebsd.org Mon Aug 2 11:11:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D1F367289E; Mon, 2 Aug 2021 11:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gdb1T2YDvz3lJW; Mon, 2 Aug 2021 11:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FEC21E675; Mon, 2 Aug 2021 11:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172BBvSE060972; Mon, 2 Aug 2021 11:11:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172BBvgt060971; Mon, 2 Aug 2021 11:11:57 GMT (envelope-from git) Date: Mon, 2 Aug 2021 11:11:57 GMT Message-Id: <202108021111.172BBvgt060971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aleksandr Rybalko Subject: git: aed2afeb51e4 - main - Ignore ResourceProducer flag for: o Arm CoreLink TM CMN-600 Coherent Mesh Network controller, o Arm CoreLink DMC-620 Dynamic Memory Controller. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ray X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aed2afeb51e474628d508cc4c6dea223b78b9789 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 11:11:57 -0000 The branch main has been updated by ray: URL: https://cgit.FreeBSD.org/src/commit/?id=aed2afeb51e474628d508cc4c6dea223b78b9789 commit aed2afeb51e474628d508cc4c6dea223b78b9789 Author: Aleksandr Rybalko AuthorDate: 2021-08-02 10:41:14 +0000 Commit: Aleksandr Rybalko CommitDate: 2021-08-02 11:11:20 +0000 Ignore ResourceProducer flag for: o Arm CoreLink TM CMN-600 Coherent Mesh Network controller, o Arm CoreLink DMC-620 Dynamic Memory Controller. Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. --- sys/dev/acpica/acpi_resource.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index 2e813276af8f..d7945f03e402 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -511,10 +511,12 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle, */ if (acpi_MatchHid(handle, "ARMHC500") != ACPI_MATCHHID_NOMATCH || acpi_MatchHid(handle, "ARMHC502") != ACPI_MATCHHID_NOMATCH || + acpi_MatchHid(handle, "ARMHC600") != ACPI_MATCHHID_NOMATCH || acpi_MatchHid(handle, "ARMHC979") != ACPI_MATCHHID_NOMATCH || acpi_MatchHid(handle, "ARMHC97C") != ACPI_MATCHHID_NOMATCH || acpi_MatchHid(handle, "ARMHC98D") != ACPI_MATCHHID_NOMATCH || - acpi_MatchHid(handle, "ARMHC9FF") != ACPI_MATCHHID_NOMATCH) + acpi_MatchHid(handle, "ARMHC9FF") != ACPI_MATCHHID_NOMATCH || + acpi_MatchHid(handle, "ARMHD620") != ACPI_MATCHHID_NOMATCH) arc.ignore_producer_flag = true; status = AcpiWalkResources(handle, "_CRS", acpi_parse_resource, &arc); From owner-dev-commits-src-main@freebsd.org Mon Aug 2 12:44:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C198B673F6F; Mon, 2 Aug 2021 12:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gdd3r4z9Hz3sHC; Mon, 2 Aug 2021 12:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 929821F576; Mon, 2 Aug 2021 12:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172Ci8Rh083051; Mon, 2 Aug 2021 12:44:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172Ci84b083050; Mon, 2 Aug 2021 12:44:08 GMT (envelope-from git) Date: Mon, 2 Aug 2021 12:44:08 GMT Message-Id: <202108021244.172Ci84b083050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 1b1bb6f17880 - main - loader: tftp client should use server address from rootip MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b1bb6f178802a4522824e0268634a99cdbda098 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 12:44:08 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=1b1bb6f178802a4522824e0268634a99cdbda098 commit 1b1bb6f178802a4522824e0268634a99cdbda098 Author: Toomas Soome AuthorDate: 2021-08-02 12:27:38 +0000 Commit: Toomas Soome CommitDate: 2021-08-02 12:43:54 +0000 loader: tftp client should use server address from rootip servip is set from bootp bp_siaddr (if present) and rootip is set immediately from servip in tha sane bootp code. However, the common/dev_net.c does only set rootip (based on url processing etc). Therefore, we should also use rootip in tftp reader. Fixes hung tftp based boot when bp_siaddr is not provided. MFC after: 1 week --- stand/libsa/tftp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stand/libsa/tftp.c b/stand/libsa/tftp.c index 3892f2aad86a..22e03ab58da1 100644 --- a/stand/libsa/tftp.c +++ b/stand/libsa/tftp.c @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); * Simple TFTP implementation for libsa. * Assumes: * - socket descriptor (int) at open_file->f_devdata - * - server host IP in global servip + * - server host IP in global rootip * Restrictions: * - read only * - lseek only with SEEK_SET or SEEK_CUR @@ -83,8 +83,6 @@ struct fs_ops tftp_fsops = { .fo_readdir = null_readdir }; -extern struct in_addr servip; - static int tftpport = 2000; static int is_open = 0; @@ -460,7 +458,7 @@ tftp_open(const char *path, struct open_file *f) return (EINVAL); } - io->destip = servip; + io->destip = rootip; tftpfile->off = 0; pathsize = (strlen(rootpath) + 1 + strlen(path) + 1) * sizeof(char); tftpfile->path = malloc(pathsize); From owner-dev-commits-src-main@freebsd.org Mon Aug 2 13:35:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2D066744A7; Mon, 2 Aug 2021 13:35:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdfBc6KQ4z4RWd; Mon, 2 Aug 2021 13:35:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1C6A20903; Mon, 2 Aug 2021 13:35:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172DZ48A050524; Mon, 2 Aug 2021 13:35:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172DZ4hE050523; Mon, 2 Aug 2021 13:35:04 GMT (envelope-from git) Date: Mon, 2 Aug 2021 13:35:04 GMT Message-Id: <202108021335.172DZ4hE050523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 5f6c8ce2452d - main - tools/build: Don't redefine open() for the linux bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f6c8ce2452da2da233e37bf4c2b6fccde8594b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 13:35:05 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=5f6c8ce2452da2da233e37bf4c2b6fccde8594b1 commit 5f6c8ce2452da2da233e37bf4c2b6fccde8594b1 Author: Alex Richardson AuthorDate: 2021-08-02 08:45:05 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 13:33:23 +0000 tools/build: Don't redefine open() for the linux bootstrap This is needed to bootstrap llvm-tblgen on Linux since LLVM calls `::open(...)` which does not work if open is a statement macro. Also stop defining O_SHLOCK/O_EXLOCK and update the only bootstrap tools user of those flags to deal with missing definitions. Reviewed By: jrtc27 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31226 --- lib/libc/db/db/db.c | 6 ++++++ tools/build/cross-build/include/linux/fcntl.h | 25 ++++--------------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/lib/libc/db/db/db.c b/lib/libc/db/db/db.c index a9a5b060da62..7158cc80e44e 100644 --- a/lib/libc/db/db/db.c +++ b/lib/libc/db/db/db.c @@ -49,6 +49,12 @@ static int __dberr(void); #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif +#ifndef O_EXLOCK +#define O_EXLOCK 0 +#endif +#ifndef O_SHLOCK +#define O_SHLOCK 0 +#endif DB * dbopen(const char *fname, int flags, int mode, DBTYPE type, const void *openinfo) diff --git a/tools/build/cross-build/include/linux/fcntl.h b/tools/build/cross-build/include/linux/fcntl.h index 94662befddad..4fa169d4ed4c 100644 --- a/tools/build/cross-build/include/linux/fcntl.h +++ b/tools/build/cross-build/include/linux/fcntl.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright 2018-2020 Alex Richardson + * Copyright 2018-2021 Alex Richardson * * This software was developed by SRI International and the University of * Cambridge Computer Laboratory (Department of Computer Science and @@ -12,6 +12,9 @@ * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) * ("CTSRD"), as part of the DARPA CRASH research programme. * + * This work was supported by Innovate UK project 105694, "Digital Security by + * Design (DSbD) Technology Platform Prototype". + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -37,29 +40,9 @@ */ #pragma once - /* includes which contains a member __unused */ #include "__unused_workaround_start.h" #include_next #include "__unused_workaround_end.h" -#ifdef __unused_undefd -#undef __unused_undefd -#define __unused __attribute__((unused)) -#endif - #include - -#ifndef O_EXLOCK -#define O_EXLOCK (1 << 30) -#endif -#ifndef O_SHLOCK -#define O_SHLOCK (1 << 31) -#endif - -#undef open -#define open(path, flags, ...) ({ \ - int __fd = (open)(path, flags, ##__VA_ARGS__); \ - if (flags & O_EXLOCK) flock(__fd, LOCK_EX); \ - if (flags & O_SHLOCK) flock(__fd, LOCK_SH); \ - __fd; }) From owner-dev-commits-src-main@freebsd.org Mon Aug 2 13:35:06 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64D3D674697; Mon, 2 Aug 2021 13:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdfBf1bDRz4RQk; Mon, 2 Aug 2021 13:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEC7D20458; Mon, 2 Aug 2021 13:35:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172DZ5G9050548; Mon, 2 Aug 2021 13:35:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172DZ5xV050547; Mon, 2 Aug 2021 13:35:05 GMT (envelope-from git) Date: Mon, 2 Aug 2021 13:35:05 GMT Message-Id: <202108021335.172DZ5xV050547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 7bc797e3f380 - main - Add build system support for ASAN+UBSAN instrumentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7bc797e3f3807660cf98e5b1bd63545cafe820f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 13:35:06 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=7bc797e3f3807660cf98e5b1bd63545cafe820f8 commit 7bc797e3f3807660cf98e5b1bd63545cafe820f8 Author: Alex Richardson AuthorDate: 2021-08-02 08:48:21 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 13:33:24 +0000 Add build system support for ASAN+UBSAN instrumentation This adds two new options WITH_ASAN/WITH_UBSAN that can be set to enable instrumentation of all binaries with AddressSanitizer and/or UndefinedBehaviourSanitizer. This current patch is almost sufficient to get a complete buildworld with sanitizer instrumentation but in order to actually build and boot a system it depends on a few more follow-up commits. Reviewed By: brooks, kib, markj Differential Revision: https://reviews.freebsd.org/D31043 --- Makefile.inc1 | 12 ++++++++++++ Makefile.libcompat | 1 + lib/Makefile | 2 ++ lib/csu/Makefile.inc | 3 +++ lib/libclang_rt/Makefile.inc | 2 ++ lib/libgcc_eh/Makefile.inc | 8 ++++++++ lib/libgcc_s/Makefile | 3 +++ libexec/rtld-elf/Makefile | 3 +++ share/mk/bsd.README | 2 +- share/mk/bsd.compat.mk | 1 + share/mk/bsd.lib.mk | 8 ++++++-- share/mk/bsd.opts.mk | 4 +++- share/mk/bsd.prog.mk | 2 ++ share/mk/bsd.progs.mk | 2 +- share/mk/bsd.sanitizer.mk | 43 +++++++++++++++++++++++++++++++++++++++++++ share/mk/sys.mk | 2 +- 16 files changed, 92 insertions(+), 6 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 213b32a97ed3..8fa55f5cea2e 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -718,6 +718,7 @@ BSARGS= DESTDIR= \ MK_HTML=no NO_LINT=yes MK_MAN=no MK_MAN_UTILS=yes \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WERROR=no MK_CTF=no \ + MK_ASAN=no MK_UBSAN=no \ MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \ MK_INCLUDES=yes @@ -739,6 +740,7 @@ TMAKE= \ SSP_CFLAGS= \ -DNO_LINT \ -DNO_CPU_CFLAGS MK_WERROR=no MK_CTF=no \ + MK_ASAN=no MK_UBSAN=no \ MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no @@ -2844,6 +2846,16 @@ _prereq_libs= lib/libcompiler_rt .if ${MK_SSP} != "no" _prereq_libs+= lib/libssp_nonshared .endif +.if ${MK_ASAN} != "no" +_prereq_libs+= lib/libclang_rt/asan +_prereq_libs+= lib/libclang_rt/asan-preinit +_prereq_libs+= lib/libclang_rt/asan_cxx +.endif +.if ${MK_UBSAN} != "no" +_prereq_libs+= lib/libclang_rt/ubsan_minimal +_prereq_libs+= lib/libclang_rt/ubsan_standalone +_prereq_libs+= lib/libclang_rt/ubsan_standalone_cxx +.endif # These dependencies are not automatically generated: # diff --git a/Makefile.libcompat b/Makefile.libcompat index c400cef6fbe3..c2be63c29e73 100644 --- a/Makefile.libcompat +++ b/Makefile.libcompat @@ -104,6 +104,7 @@ build${libcompat}: .PHONY OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \ + MK_ASAN=no MK_UBSAN=no \ MK_CTF=no MK_RETPOLINE=no MK_WERROR=no \ ${_t} .endfor diff --git a/lib/Makefile b/lib/Makefile index a06e77dee022..674368a19ffd 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -180,6 +180,8 @@ SUBDIR.${MK_STATS}+= libstats ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "powerpc") _libclang_rt= libclang_rt +.elif ${MK_ASAN} != "no" || ${MK_UBSAN} != "no" +.error "Requested build with sanitizers but cannot build runtime libraries!" .endif .if ${MK_CXX} != "no" diff --git a/lib/csu/Makefile.inc b/lib/csu/Makefile.inc index 5681ef65117a..b089e1a947b1 100644 --- a/lib/csu/Makefile.inc +++ b/lib/csu/Makefile.inc @@ -3,6 +3,9 @@ SSP_CFLAGS= NO_WMISSING_VARIABLE_DECLARATIONS= +# Can't instrument these files since that breaks non-sanitized programs. +MK_ASAN:= no +MK_UBSAN:= no .include diff --git a/lib/libclang_rt/Makefile.inc b/lib/libclang_rt/Makefile.inc index 946d3f4c77a7..19b8868b60e3 100644 --- a/lib/libclang_rt/Makefile.inc +++ b/lib/libclang_rt/Makefile.inc @@ -12,6 +12,8 @@ SHLIBDIR= ${LIBDIR} NO_PIC= MK_PROFILE= no +MK_ASAN:= no +MK_UBSAN:= no WARNS?= 0 diff --git a/lib/libgcc_eh/Makefile.inc b/lib/libgcc_eh/Makefile.inc index 4fe1eff406e1..9e386992e78c 100644 --- a/lib/libgcc_eh/Makefile.inc +++ b/lib/libgcc_eh/Makefile.inc @@ -20,9 +20,17 @@ SRCS_EXC+= libunwind.cpp SRCS+= ${SRCS_EXC} .for file in ${SRCS_EXC:M*.c} CFLAGS.${file}+= -fno-exceptions -funwind-tables +.if ${MK_ASAN} != "no" +# False-positives during stack unwinding +CFLAGS.${file}+= -fno-sanitize=address +.endif .endfor .for file in ${SRCS_EXC:M*.cpp} CXXFLAGS.${file}+= -fno-exceptions -funwind-tables +.if ${MK_ASAN} != "no" +# False-positives during stack unwinding +CXXFLAGS.${file}+= -fno-sanitize=address +.endif .endfor CFLAGS+= -I${UNWINDINCDIR} diff --git a/lib/libgcc_s/Makefile b/lib/libgcc_s/Makefile index 84477ee00818..aa097d7255de 100644 --- a/lib/libgcc_s/Makefile +++ b/lib/libgcc_s/Makefile @@ -4,6 +4,9 @@ PACKAGE= clibs SHLIB_NAME= libgcc_s.so.1 SHLIBDIR?= /lib +# Enabling UBSan triggers "undefined reference to vtable for __cxxabiv1::__function_type_info" +MK_UBSAN:= no + .include MK_SSP= no diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index 9ae998942a12..db1bf70ca59e 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -9,7 +9,10 @@ RTLD_ELF_DIR:= ${.PARSEDIR} .include PACKAGE= clibs MK_PIE= no # Always position independent using local rules +# Not compatible with sanitizer instrumentation or SSP. +MK_ASAN= no MK_SSP= no +MK_UBSAN= no CONFS= libmap.conf PROG?= ld-elf.so.1 diff --git a/share/mk/bsd.README b/share/mk/bsd.README index 9eb91c1bce3c..8004d742d649 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -118,7 +118,7 @@ The profiled libraries are no longer built in a different directory than the regular libraries. A new suffix, ".po", is used to denote a profiled object, and ".pico" denotes a position-independent relocatable object. ".nossppico" denotes a position-independent relocatable object without -stack smashing protection. +stack smashing protection and without sanitizer instrumentation. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk index e063415bcbfc..6787209dcd25 100644 --- a/share/mk/bsd.compat.mk +++ b/share/mk/bsd.compat.mk @@ -162,6 +162,7 @@ LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} LIBDIR_BASE:= /usr/lib${libcompat} _LIB_OBJTOP= ${LIBCOMPAT_OBJTOP} LIBDESTDIR:= ${LIBCOMPATTMP} +SYSROOT:= ${LIBCOMPATTMP} CFLAGS+= ${LIBCOMPATCFLAGS} LDFLAGS+= ${CFLAGS} ${LIBCOMPATLDFLAGS} MACHINE= ${LIBCOMPAT_MACHINE} diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index db54055b7ae0..5de74b6fa056 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -6,6 +6,8 @@ .include .include +____: + .if defined(LIB_CXX) || defined(SHLIB_CXX) _LD= ${CXX} .else @@ -106,6 +108,8 @@ CXXFLAGS+= -ftrivial-auto-var-init=pattern .endif .endif +.include "bsd.sanitizer.mk" + .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf*) CFLAGS+= ${DEBUG_FILES_CFLAGS} @@ -147,7 +151,7 @@ PO_FLAG=-pg ${CTFCONVERT_CMD} .c.nossppico: - ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS:C/^-fstack-protector.*$//} ${CFLAGS:C/^-fstack-protector.*$//} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS:C/^-fstack-protector.*$//:C/^-fsanitize.*$//} ${CFLAGS:C/^-fstack-protector.*$//:C/^-fsanitize.*$//} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .c.pieo: @@ -161,7 +165,7 @@ PO_FLAG=-pg ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .cc.nossppico .C.nossppico .cpp.nossppico .cxx.nossppico: - ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS:C/^-fstack-protector.*$//} ${CXXFLAGS:C/^-fstack-protector.*$//} -c ${.IMPSRC} -o ${.TARGET} + ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS:C/^-fstack-protector.*$//:C/^-fsanitize.*$//} ${CXXFLAGS:C/^-fstack-protector.*$//:C/^-fsanitize.*$//} -c ${.IMPSRC} -o ${.TARGET} .cc.pieo .C.pieo .cpp.pieo .cxx.pieo: ${CXX} ${PIEFLAG} ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 33d843593427..6e81484a09ab 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -69,6 +69,7 @@ __DEFAULT_YES_OPTIONS = \ WERROR __DEFAULT_NO_OPTIONS = \ + ASAN \ BIND_NOW \ CCACHE_BUILD \ CTF \ @@ -77,7 +78,8 @@ __DEFAULT_NO_OPTIONS = \ INSTALL_AS_USER \ MANSPLITPKG \ RETPOLINE \ - STALE_STAGED + STALE_STAGED \ + UBSAN __DEFAULT_DEPENDENT_OPTIONS = \ MAKE_CHECK_USE_SANDBOX/TESTS \ diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 89eddb24abb0..96d72daf2611 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -81,6 +81,8 @@ CXXFLAGS+= -ftrivial-auto-var-init=pattern .endif .endif +.include "bsd.sanitizer.mk" + .if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == "" CFLAGS += -mno-relax .endif diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index 54266a335177..79397f595688 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -23,7 +23,7 @@ PROGS += ${PROGS_CXX} .if defined(PROG) # just one of many PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE CSTD CXXSTD DPSRCS MAN \ - NO_SHARED MK_WERROR PROGNAME SRCS STRIP WARNS + NO_SHARED MK_WERROR PROGNAME SRCS STRIP WARNS MK_ASAN MK_UBSAN PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} diff --git a/share/mk/bsd.sanitizer.mk b/share/mk/bsd.sanitizer.mk new file mode 100644 index 000000000000..56d010767906 --- /dev/null +++ b/share/mk/bsd.sanitizer.mk @@ -0,0 +1,43 @@ +.include + +.include "../../lib/libclang_rt/compiler-rt-vars.mk" +_use_sanitizers= no +# Add the necessary sanitizer flags if requested +.if ${MK_ASAN} == "yes" && ${NO_SHARED:Uno:tl} == "no" +SANITIZER_CFLAGS+= -fsanitize=address -fPIC +# TODO: remove this once all basic errors have been fixed: +# https://github.com/google/sanitizers/wiki/AddressSanitizer#faq +SANITIZER_CFLAGS+= -fsanitize-recover=address +SANITIZER_LDFLAGS+= -fsanitize=address +_use_sanitizers= yes +.endif # ${MK_ASAN} == "yes" + +.if ${MK_UBSAN} == "yes" && ${NO_SHARED:Uno:tl} == "no" +# Unlike the other sanitizers, UBSan could also work for static libraries. +# However, this currently results in linker errors (even with the +# -fsanitize-minimal-runtime flag), so only enable it for dynamically linked +# code for now. +SANITIZER_CFLAGS+= -fsanitize=undefined +SANITIZER_CFLAGS+= -fsanitize-recover=undefined +SANITIZER_LDFLAGS+= -fsanitize=undefined +_use_sanitizers= yes +.endif # ${MK_UBSAN} == "yes" + +.if !defined(BOOTSTRAPPING) && ${_use_sanitizers} != 0 && \ + ${COMPILER_TYPE} != "clang" +.error "Sanitizer instrumentation currently only supported with clang" +.endif + +# For libraries we only instrument the shared and PIE libraries by setting +# SHARED_CFLAGS instead of CFLAGS. We do this since static executables are not +# compatible with the santizers (interceptors do not work). +.if ${_use_sanitizers} != "no" +.if target(____) +SHARED_CFLAGS+= ${SANITIZER_CFLAGS} +SOLINKOPTS+= ${SANITIZER_LDFLAGS} +LDFLAGS:= ${LDFLAGS:N-Wl,-no-undefined:N-Wl,--no-undefined} +.else +CFLAGS+= ${SANITIZER_CFLAGS} +LDFLAGS+= ${SANITIZER_LDFLAGS} +.endif +.endif # ${_use_sanitizers} != "no" diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 89ac2c549656..462002ce7d18 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -242,7 +242,7 @@ LFLAGS ?= # compiler driver flags (e.g. -mabi=*) that conflict with flags to LD. LD ?= ld LDFLAGS ?= -_LDFLAGS = ${LDFLAGS:S/-Wl,//g:N-mabi=*:N-fuse-ld=*:N--ld-path=*} +_LDFLAGS = ${LDFLAGS:S/-Wl,//g:N-mabi=*:N-fuse-ld=*:N--ld-path=*:N-fsanitize=*:N-fno-sanitize=*} MAKE ?= make From owner-dev-commits-src-main@freebsd.org Mon Aug 2 13:35:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E164673E72; Mon, 2 Aug 2021 13:35:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdfBg123Kz4RYl; Mon, 2 Aug 2021 13:35:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ABAF20628; Mon, 2 Aug 2021 13:35:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172DZ6kx050572; Mon, 2 Aug 2021 13:35:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172DZ6No050571; Mon, 2 Aug 2021 13:35:06 GMT (envelope-from git) Date: Mon, 2 Aug 2021 13:35:06 GMT Message-Id: <202108021335.172DZ6No050571@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 9efbe526e00f - main - libthr: work around an ASAN false-positive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9efbe526e00f47d946b3320f595e73fea26805df Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 13:35:07 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=9efbe526e00f47d946b3320f595e73fea26805df commit 9efbe526e00f47d946b3320f595e73fea26805df Author: Alex Richardson AuthorDate: 2021-08-02 08:49:21 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 13:33:24 +0000 libthr: work around an ASAN false-positive I got the following error with an ASAN-instrument libthr: ==803==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffcdb0 at pc 0x000801863396 bp 0x7ff8 READ of size 4 at 0x7fffffffcdb0 thread T0 #0 0x801863395 in handle_signal /local/scratch/alr48/cheri/freebsd/lib/libthr/thread/thr_sig.c:262:2 #1 0x801860da2 in thr_sighandler /local/scratch/alr48/cheri/freebsd/lib/libthr/thread/thr_sig.c:246:2 Address 0x7fffffffcdb0 is located in stack of thread T0 at offset 208 in frame #0 0x80186080f in thr_sighandler /local/scratch/alr48/cheri/freebsd/lib/libthr/thread/thr_sig.c:213 This frame has 1 object(s): [32, 64) 'act' (line 216) <== Memory access at offset 208 overflows this variable HINT: this may be a false positive if your program uses some custom stack This seems like a false-positive since the line in question is `SIGSETOR(actp->sa_mask, ucp->uc_sigmask);` and it complains about a read operation (from the ucontext_t argument) so this indicates to me that ASAN does not understand that thr_sighandler() is a signal handler. Differential Revision: https://reviews.freebsd.org/D31074 --- lib/libthr/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile index 1a5dfa18dca7..038823413cb2 100644 --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -29,6 +29,12 @@ CFLAGS+=-I${SRCTOP}/lib/libthread_db CFLAGS.thr_stack.c+= -Wno-cast-align CFLAGS.rtld_malloc.c+= -Wno-cast-align CFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations +.if ${MK_ASAN} != "no" +# False-positive ASAN error claiming the local "struct sigaction act;" is +# overflowed by handle_signal() reading from the ucontext_t argument. This +# could be caused by ASAN not treating this function as a signal handler. +CFLAGS.thr_sig.c+= -fno-sanitize=address +.endif .ifndef NO_THREAD_UNWIND_STACK CFLAGS+=-fexceptions From owner-dev-commits-src-main@freebsd.org Mon Aug 2 13:35:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AE5C673FEF; Mon, 2 Aug 2021 13:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdfBh2rJzz4RYp; Mon, 2 Aug 2021 13:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A1FB20729; Mon, 2 Aug 2021 13:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172DZ8Xq050596; Mon, 2 Aug 2021 13:35:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172DZ8ln050595; Mon, 2 Aug 2021 13:35:08 GMT (envelope-from git) Date: Mon, 2 Aug 2021 13:35:08 GMT Message-Id: <202108021335.172DZ8ln050595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: c826e08841fb - main - Fix MK_TESTS build with MK_ASAN/MK_UBSAN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c826e08841fbcc0ba0c5a78aa09d6ee22a95f2f9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 13:35:08 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=c826e08841fbcc0ba0c5a78aa09d6ee22a95f2f9 commit c826e08841fbcc0ba0c5a78aa09d6ee22a95f2f9 Author: Alex Richardson AuthorDate: 2021-08-02 08:49:50 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 13:33:24 +0000 Fix MK_TESTS build with MK_ASAN/MK_UBSAN Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D31049 --- tests/sys/capsicum/Makefile | 6 ++++++ usr.sbin/rpcbind/tests/Makefile | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/tests/sys/capsicum/Makefile b/tests/sys/capsicum/Makefile index ded91803cf8a..1d2543b2ef4d 100644 --- a/tests/sys/capsicum/Makefile +++ b/tests/sys/capsicum/Makefile @@ -43,6 +43,12 @@ PROGS+= $p NO_SHARED.$p= SRCS.$p= mini-me.c .endfor +.if ${MK_ASAN} != "no" || ${MK_UBSAN} != "no" +# mini-me.o is linked into a static binary so we can't use sanitizers. +# Note: We have to set CFLAGS here since it will be built as part of +# _PROGS_COMMON_OBJS and therefore NO_SHARED.$p does not disable ASAN/UBSAN. +CFLAGS.mini-me.c+= -fno-sanitize=address -fno-sanitize=undefined +.endif BINDIR= ${TESTSDIR} diff --git a/usr.sbin/rpcbind/tests/Makefile b/usr.sbin/rpcbind/tests/Makefile index 515214763421..dae57a29fda7 100644 --- a/usr.sbin/rpcbind/tests/Makefile +++ b/usr.sbin/rpcbind/tests/Makefile @@ -14,4 +14,12 @@ CFLAGS+= -DINET6 WARNS?= 3 +.if ${MK_ASAN} != "no" +# Work around "error: duplicate symbol: getifaddrs" when building with ASAN. +# The ASAN interceptors also define getifaddrs, but we want to prefer the local +# stub symbol here, so using a shared sanitizer runtime moves the local +# definition first in the symbol resolution order. +LDFLAGS+=-shared-libasan +.endif + .include From owner-dev-commits-src-main@freebsd.org Mon Aug 2 13:35:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFED16744B4; Mon, 2 Aug 2021 13:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdfBj4S5hz4Rc6; Mon, 2 Aug 2021 13:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56CA12072A; Mon, 2 Aug 2021 13:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172DZ9EV050621; Mon, 2 Aug 2021 13:35:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172DZ9jN050619; Mon, 2 Aug 2021 13:35:09 GMT (envelope-from git) Date: Mon, 2 Aug 2021 13:35:09 GMT Message-Id: <202108021335.172DZ9jN050619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 5e9226f063bc - main - Fix build of stand/ when building world with ASAN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e9226f063bc43574e2168b4aafad8232f08002a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 13:35:09 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=5e9226f063bc43574e2168b4aafad8232f08002a commit 5e9226f063bc43574e2168b4aafad8232f08002a Author: Alex Richardson AuthorDate: 2021-08-02 08:50:16 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 13:33:24 +0000 Fix build of stand/ when building world with ASAN The userboot/test program links against the default userspace libraries (e.g. shared libgcc_s.so) that will be instrumented if WITH_ASAN is set. All other programs link against libsa instead of libc and therefore can't use the sanitizer runtime library. To fix the stand/ build with sanitizers, we disable MK_ASAN/MK_UBSAN if -nostdlib is found in the LDFLAGS (i.e. we are using libsa instead of libc). Reviewed By: imp, tsoome Differential Revision: https://reviews.freebsd.org/D31047 --- stand/defs.mk | 6 ++++++ stand/userboot/userboot/Makefile | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/stand/defs.mk b/stand/defs.mk index d50c89879613..02a03b92577e 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -24,6 +24,12 @@ INTERNALLIB= # enough to make that hassle worth chasing. _CPUCFLAGS= +.if ${LDFLAGS:M-nostdlib} +# Sanitizers won't work unless we link against libc (e.g. in userboot/test). +MK_ASAN:= no +MK_UBSAN:= no +.endif + .include .include diff --git a/stand/userboot/userboot/Makefile b/stand/userboot/userboot/Makefile index 767840101200..60fcf57d9697 100644 --- a/stand/userboot/userboot/Makefile +++ b/stand/userboot/userboot/Makefile @@ -6,6 +6,9 @@ LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no PIC=yes +# Note: -nostdlib needs to be added to LDFLAGS before including defs.mk +LDFLAGS+= -nostdlib -Wl,-Bsymbolic + .include SHLIB_NAME= userboot_${LOADER_INTERP}.so @@ -39,8 +42,6 @@ CFLAGS.main.c+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs CFLAGS.gfx_fb.c+= -I$(SRCTOP)/sys/teken -I${SRCTOP}/contrib/pnglite CWARNFLAGS.main.c += -Wno-implicit-function-declaration -LDFLAGS+= -nostdlib -Wl,-Bsymbolic - NEWVERSWHAT= "User boot ${LOADER_INTERP}" ${MACHINE_CPUARCH} VERSION_FILE= ${.CURDIR}/../userboot/version From owner-dev-commits-src-main@freebsd.org Mon Aug 2 13:35:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECE21674657; Mon, 2 Aug 2021 13:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdfBk3ypxz4Rc8; Mon, 2 Aug 2021 13:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6490D20259; Mon, 2 Aug 2021 13:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172DZA0t050651; Mon, 2 Aug 2021 13:35:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172DZAKC050650; Mon, 2 Aug 2021 13:35:10 GMT (envelope-from git) Date: Mon, 2 Aug 2021 13:35:10 GMT Message-Id: <202108021335.172DZAKC050650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: f0712132b68b - main - Don't instrument the rdtsc ifunc when building with ASAN/UBSAN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0712132b68b4271e0602b06ee5f282718bfb8c5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 13:35:11 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=f0712132b68b4271e0602b06ee5f282718bfb8c5 commit f0712132b68b4271e0602b06ee5f282718bfb8c5 Author: Alex Richardson AuthorDate: 2021-08-02 08:51:01 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 13:33:24 +0000 Don't instrument the rdtsc ifunc when building with ASAN/UBSAN The ifunc resolver is called before the sanitizer runtime is initialized, so any instrumentation results in an immediate crash. Reviewed By: kib Differential Revision: https://reviews.freebsd.org/D31046 --- lib/libc/x86/sys/Makefile.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/libc/x86/sys/Makefile.inc b/lib/libc/x86/sys/Makefile.inc index 41e0d1a8ad66..eff3a1085ec6 100644 --- a/lib/libc/x86/sys/Makefile.inc +++ b/lib/libc/x86/sys/Makefile.inc @@ -12,3 +12,11 @@ MAN+= \ .if ${MACHINE_CPUARCH} == "amd64" && ${MK_HYPERV} != "no" CFLAGS+= -DWANT_HYPERV .endif +# We can't use sanitizer instrumentation on ifuncs called during sanitizer +# runtime startup. +.if ${MK_ASAN} != "no" +CFLAGS.__vdso_gettc.c+=-fno-sanitize=address +.endif +.if ${MK_UBSAN} != "no" +CFLAGS.__vdso_gettc.c+=-fno-sanitize=undefined +.endif From owner-dev-commits-src-main@freebsd.org Mon Aug 2 13:35:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D58816746A8; Mon, 2 Aug 2021 13:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdfBl5CPPz4RXB; Mon, 2 Aug 2021 13:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 906B2208B4; Mon, 2 Aug 2021 13:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172DZB6Y050675; Mon, 2 Aug 2021 13:35:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172DZBO9050674; Mon, 2 Aug 2021 13:35:11 GMT (envelope-from git) Date: Mon, 2 Aug 2021 13:35:11 GMT Message-Id: <202108021335.172DZBO9050674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 8185be330723 - main - libc: Disable ASAN for certain string functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8185be3307232d88ddd1b6468f4ddec54a993f54 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 13:35:12 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=8185be3307232d88ddd1b6468f4ddec54a993f54 commit 8185be3307232d88ddd1b6468f4ddec54a993f54 Author: Alex Richardson AuthorDate: 2021-08-02 08:51:34 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 13:33:24 +0000 libc: Disable ASAN for certain string functions They deliberately read out-of-bounds values to avoid byte-by-byte loads and check multiple bytes at once. While this will work on x86, it is flagged as an out-of-bounds read with ASAN, so we have to disable instrumentation here. This also causes bounds errors for CHERI, so in CheriBSD we use implementations that avoid OOB reads. Differential Revision: https://reviews.freebsd.org/D31045 --- lib/libc/string/Makefile.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc index 6945155812af..1df3d40e329f 100644 --- a/lib/libc/string/Makefile.inc +++ b/lib/libc/string/Makefile.inc @@ -29,6 +29,15 @@ MISRCS+=bcmp.c bcopy.c bzero.c explicit_bzero.c \ SYM_MAPS+= ${LIBC_SRCTOP}/string/Symbol.map +.if ${MK_ASAN} != "no" +# These source files deliberately read out of bounds since they assume that +# out-of-bounds memory accesses that don't cross pages are always legal. +# Note: While this is fine on x86, it does break when running with CHERI. +CFLAGS.strlen.c+= -fno-sanitize=address +CFLAGS.strchrnul.c+= -fno-sanitize=address +CFLAGS.memchr.c+= -fno-sanitize=address +.endif + # machine-dependent string sources .sinclude "${LIBC_SRCTOP}/${LIBC_ARCH}/string/Makefile.inc" From owner-dev-commits-src-main@freebsd.org Mon Aug 2 13:35:13 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FE8C6747F3; Mon, 2 Aug 2021 13:35:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdfBm6CtYz4RXF; Mon, 2 Aug 2021 13:35:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B157120629; Mon, 2 Aug 2021 13:35:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172DZC3w050699; Mon, 2 Aug 2021 13:35:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172DZCeH050698; Mon, 2 Aug 2021 13:35:12 GMT (envelope-from git) Date: Mon, 2 Aug 2021 13:35:12 GMT Message-Id: <202108021335.172DZCeH050698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 2de949cf85d0 - main - Remove mkcsmapper_static and mkesdb_static from build-tools MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2de949cf85d0e0b9ff71e1ffd74153814de96175 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 13:35:13 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=2de949cf85d0e0b9ff71e1ffd74153814de96175 commit 2de949cf85d0e0b9ff71e1ffd74153814de96175 Author: Alex Richardson AuthorDate: 2021-08-02 09:49:01 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 13:33:25 +0000 Remove mkcsmapper_static and mkesdb_static from build-tools Build them as part of the bootstrap-tools phase instead. Reviewed by: emaste (no objections) Differential Revision: https://reviews.freebsd.org/D28181 --- Makefile.inc1 | 9 +++++++-- share/i18n/csmapper/Makefile.inc | 6 ++---- share/i18n/csmapper/Makefile.part | 2 -- share/i18n/esdb/Makefile.inc | 6 ++---- share/i18n/esdb/Makefile.part | 2 -- targets/pseudo/hosttools/Makefile.depend.host | 4 ++-- usr.bin/Makefile | 6 ------ usr.bin/mkcsmapper/Makefile | 6 ++++++ usr.bin/mkcsmapper_static/Makefile.depend | 19 ------------------- usr.bin/mkesdb/Makefile | 6 ++++++ usr.bin/mkesdb_static/Makefile.depend | 19 ------------------- 11 files changed, 25 insertions(+), 60 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 8fa55f5cea2e..e3707c7a504a 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2331,6 +2331,11 @@ _localedef= usr.bin/localedef ${_bt}-usr.bin/localedef: ${_bt}-usr.bin/yacc ${_bt_lex_depend} .endif +.if ${MK_ICONV} != "no" +_mkesdb= usr.bin/mkesdb +_mkcsmapper= usr.bin/mkcsmapper +.endif + .if ${MK_KERBEROS} != "no" _kerberos5_bootstrap_tools= \ kerberos5/tools/make-roken \ @@ -2482,6 +2487,8 @@ bootstrap-tools: ${_bt}-links .PHONY ${_nmtree} \ ${_vtfontcvt} \ ${_localedef} \ + ${_mkcsmapper} \ + ${_mkesdb} \ ${LOCAL_BSTOOL_DIRS} ${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ @@ -2543,8 +2550,6 @@ _bt_clean= ${CLEANDIR} ${_share} \ usr.bin/awk \ ${_libmagic} \ - usr.bin/mkesdb_static \ - usr.bin/mkcsmapper_static \ usr.bin/vi/catalog build-tools_${_tool}: .PHONY ${_+_}@${ECHODIR} "===> ${_tool} (${_bt_clean:D${_bt_clean},}obj,build-tools)"; \ diff --git a/share/i18n/csmapper/Makefile.inc b/share/i18n/csmapper/Makefile.inc index 284900c1bc05..72473764f313 100644 --- a/share/i18n/csmapper/Makefile.inc +++ b/share/i18n/csmapper/Makefile.inc @@ -3,7 +3,5 @@ .include CSMAPPERDIR?= /usr/share/i18n/csmapper -.if ${MK_STAGING} == "yes" -MKCSMAPPER= ${STAGE_HOST_OBJTOP}/usr/bin/mkcsmapper_static -.endif -MKCSMAPPER?= ${.OBJDIR:H:H:H}/usr.bin/mkcsmapper_static/mkcsmapper_static +# mkcsmapper builds as part of bootstrap-tools and can therefore be found in $PATH +MKCSMAPPER?= mkcsmapper diff --git a/share/i18n/csmapper/Makefile.part b/share/i18n/csmapper/Makefile.part index 4dbb4ff313dd..6b472f815bc6 100644 --- a/share/i18n/csmapper/Makefile.part +++ b/share/i18n/csmapper/Makefile.part @@ -1,8 +1,6 @@ # $FreeBSD$ # $NetBSD: Makefile,v 1.13 2007/03/13 16:34:37 tnozaki Exp $ -MKCSMAPPER?= ${.OBJDIR:H:H:H:H}/usr.bin/mkcsmapper_static/mkcsmapper_static - ESUBDIR?= ${CODE} PARTFILE?= ${.CURDIR}/${CODE}.part .if exists(${PARTFILE}) diff --git a/share/i18n/esdb/Makefile.inc b/share/i18n/esdb/Makefile.inc index ab61d2cee22f..096beeb96a62 100644 --- a/share/i18n/esdb/Makefile.inc +++ b/share/i18n/esdb/Makefile.inc @@ -5,7 +5,5 @@ .PATH: ${.CURDIR} ESDBDIR?= /usr/share/i18n/esdb -.if ${MK_STAGING} == "yes" -MKESDB= ${STAGE_HOST_OBJTOP}/usr/bin/mkesdb_static -.endif -MKESDB?= ${.OBJDIR:H:H:H}/usr.bin/mkesdb_static/mkesdb_static +# mkesdb builds as part of bootstrap-tools and can therefore be found in $PATH +MKESDB?= mkesdb diff --git a/share/i18n/esdb/Makefile.part b/share/i18n/esdb/Makefile.part index 703854e6e527..0378b117a5ca 100644 --- a/share/i18n/esdb/Makefile.part +++ b/share/i18n/esdb/Makefile.part @@ -1,8 +1,6 @@ # $FreeBSD$ # $NetBSD: Makefile.part,v 1.6 2008/10/25 22:35:36 apb Exp $ -MKESDB?= ${.OBJDIR:H:H:H:H}/usr.bin/mkesdb_static/mkesdb_static - PARTFILE?= ${.CURDIR}/${CODE}.part ALIASFILE?= ${.CURDIR}/${CODE}.alias .if !defined(NO_SEP) diff --git a/targets/pseudo/hosttools/Makefile.depend.host b/targets/pseudo/hosttools/Makefile.depend.host index 1def9574156b..3d6ab127eec9 100644 --- a/targets/pseudo/hosttools/Makefile.depend.host +++ b/targets/pseudo/hosttools/Makefile.depend.host @@ -12,8 +12,8 @@ DIRDEPS = \ usr.bin/clang/clang-tblgen \ usr.bin/clang/llvm-tblgen \ usr.bin/localedef \ - usr.bin/mkcsmapper_static \ - usr.bin/mkesdb_static \ + usr.bin/mkcsmapper \ + usr.bin/mkesdb \ usr.bin/xinstall \ usr.bin/yacc \ usr.sbin/config \ diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 206da7154ac2..f1b07a7007be 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -283,12 +283,6 @@ SUBDIR.${MK_UTMPX}+= users SUBDIR.${MK_UTMPX}+= who SUBDIR.${MK_OFED}+= ofed -# These are normally only handled for build-tools. -.if make(clean*) -SUBDIR+= mkcsmapper_static -SUBDIR+= mkesdb_static -.endif - .include SUBDIR_PARALLEL= diff --git a/usr.bin/mkcsmapper/Makefile b/usr.bin/mkcsmapper/Makefile index 5d5e8b560bbf..eda8f96bf153 100644 --- a/usr.bin/mkcsmapper/Makefile +++ b/usr.bin/mkcsmapper/Makefile @@ -3,6 +3,12 @@ .PATH: ${SRCTOP}/lib/libc/iconv PROG= mkcsmapper +.if defined(BOOTSTRAPPING) +# When bootstrapping, the host libc might not contain these expected symbols +# so compile them directly into the binary. +SRCS= citrus_bcs.c citrus_db_factory.c citrus_db_hash.c \ + citrus_lookup_factory.c citrus_pivot_factory.c +.endif LDFLAGS+= -L${SRCTOP}/lib/libc NO_WMISSING_VARIABLE_DECLARATIONS= diff --git a/usr.bin/mkcsmapper_static/Makefile.depend b/usr.bin/mkcsmapper_static/Makefile.depend deleted file mode 100644 index f2071f254a6b..000000000000 --- a/usr.bin/mkcsmapper_static/Makefile.depend +++ /dev/null @@ -1,19 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/arpa \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - usr.bin/yacc.host \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/mkesdb/Makefile b/usr.bin/mkesdb/Makefile index d49ecfa88f63..3540dcc8401a 100644 --- a/usr.bin/mkesdb/Makefile +++ b/usr.bin/mkesdb/Makefile @@ -3,6 +3,12 @@ .PATH: ${SRCTOP}/lib/libc/iconv PROG= mkesdb +.if defined(BOOTSTRAPPING) +# When bootstrapping, the host libc might not contain these expected symbols +# so compile them directly into the binary. +SRCS= citrus_bcs.c citrus_db_factory.c citrus_db_hash.c \ + citrus_lookup_factory.c +.endif NO_WMISSING_VARIABLE_DECLARATIONS= diff --git a/usr.bin/mkesdb_static/Makefile.depend b/usr.bin/mkesdb_static/Makefile.depend deleted file mode 100644 index f2071f254a6b..000000000000 --- a/usr.bin/mkesdb_static/Makefile.depend +++ /dev/null @@ -1,19 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/arpa \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - usr.bin/yacc.host \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif From owner-dev-commits-src-main@freebsd.org Mon Aug 2 13:38:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC0D3674ACD; Mon, 2 Aug 2021 13:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdfG93mG5z4SKY; Mon, 2 Aug 2021 13:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E32820631; Mon, 2 Aug 2021 13:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172Dc9Gb051217; Mon, 2 Aug 2021 13:38:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172Dc9QF051216; Mon, 2 Aug 2021 13:38:09 GMT (envelope-from git) Date: Mon, 2 Aug 2021 13:38:09 GMT Message-Id: <202108021338.172Dc9QF051216@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 31ba4ce8898f - main - Allow bootstrapping llvm-tblgen on macOS and Linux MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 13:38:10 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3 commit 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3 Author: Alex Richardson AuthorDate: 2021-08-02 13:36:03 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 13:36:03 +0000 Allow bootstrapping llvm-tblgen on macOS and Linux This is needed in order to build various LLVM binutils (e.g. addr2line) as well as clang/lld/lldb. Co-authored-by: Jessica Clarke Test Plan: Compiles on ubuntu 18.04 and macOS 11.4 Reviewed By: dim Differential Revision: https://reviews.freebsd.org/D31057 --- contrib/llvm-project/lld/tools/lld/lld.cpp | 3 +- lib/clang/include/llvm/Config/config.h | 58 +++++++++++++++++++--- lib/clang/libllvm/Makefile | 3 +- lib/clang/llvm.build.mk | 12 +++++ share/mk/src.opts.mk | 8 --- .../build/cross-build/include/common/sys/sysctl.h | 6 +++ tools/build/make.py | 4 ++ usr.bin/clang/clang.prog.mk | 2 + usr.bin/clang/lld/Makefile | 2 + usr.bin/clang/llvm.prog.mk | 2 + 10 files changed, 83 insertions(+), 17 deletions(-) diff --git a/contrib/llvm-project/lld/tools/lld/lld.cpp b/contrib/llvm-project/lld/tools/lld/lld.cpp index d30362ba7826..8827a883ceb6 100644 --- a/contrib/llvm-project/lld/tools/lld/lld.cpp +++ b/contrib/llvm-project/lld/tools/lld/lld.cpp @@ -146,7 +146,8 @@ static Flavor parseFlavor(std::vector &v) { static int lldMain(int argc, const char **argv, llvm::raw_ostream &stdoutOS, llvm::raw_ostream &stderrOS, bool exitEarly = true) { std::vector args(argv, argv + argc); -#ifdef __FreeBSD__ +#if 1 + /* On FreeBSD we only build the ELF linker. */ return !elf::link(args, exitEarly, stdoutOS, stderrOS); #else switch (parseFlavor(args)) { diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h index 0cd6dabeab17..35ce8c189d2b 100644 --- a/lib/clang/include/llvm/Config/config.h +++ b/lib/clang/include/llvm/Config/config.h @@ -29,7 +29,11 @@ /* #undef HAVE_CRASHREPORTERCLIENT_H */ /* can use __crashreporter_info__ */ +#if defined(__APPLE__) +#define HAVE_CRASHREPORTER_INFO 1 +#else #define HAVE_CRASHREPORTER_INFO 0 +#endif /* Define to 1 if you have the declaration of `arc4random', and to 0 if you don't. */ @@ -125,28 +129,46 @@ #define HAVE_PTHREAD_SETNAME_NP 1 /* Define to 1 if you have the header file. */ +#if __has_include() #define HAVE_LINK_H 1 +#else +#define HAVE_LINK_H 0 +#endif /* Define to 1 if you have the `lseek64' function. */ -/* #undef HAVE_LSEEK64 */ +#if defined(__linux__) +#define HAVE_LSEEK64 1 +#endif /* Define to 1 if you have the header file. */ -/* #undef HAVE_MACH_MACH_H */ +#if __has_include() +#define HAVE_MACH_MACH_H 1 +#endif /* Define to 1 if you have the `mallctl' function. */ +#if defined(__FreeBSD__) #define HAVE_MALLCTL 1 +#endif /* Define to 1 if you have the `mallinfo' function. */ -/* #undef HAVE_MALLINFO */ +#if defined(__linux__) +#define HAVE_MALLINFO 1 +#endif /* Define to 1 if you have the header file. */ -/* #undef HAVE_MALLOC_MALLOC_H */ +#if __has_include() +#define HAVE_MALLOC_MALLOC_H 1 +#endif /* Define to 1 if you have the `malloc_zone_statistics' function. */ -/* #undef HAVE_MALLOC_ZONE_STATISTICS */ +#if defined(__APPLE__) +#define HAVE_MALLOC_ZONE_STATISTICS 1 +#endif /* Define to 1 if you have the `posix_fallocate' function. */ +#if !defined(__APPLE__) #define HAVE_POSIX_FALLOCATE 1 +#endif /* Define to 1 if you have the `posix_spawn' function. */ #define HAVE_POSIX_SPAWN 1 @@ -209,19 +231,31 @@ #define HAVE_SYS_TIME_H 1 /* Define to 1 if stat struct has st_mtimespec member .*/ +#if !defined(__linux__) #define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1 +#endif /* Define to 1 if stat struct has st_mtim member. */ +#if !defined(__APPLE__) #define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 +#endif /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define if the setupterm() function is supported this platform. */ +#if defined(__FreeBSD__) +/* + * This is only needed for terminalHasColors(). When disabled LLVM falls back + * to checking a list of TERM prefixes which is sufficient for a bootstrap tool. + */ #define LLVM_ENABLE_TERMINFO 1 +#endif /* Define if the xar_open() function is supported this platform. */ -/* #undef HAVE_LIBXAR */ +#if defined(__APPLE__) +#define HAVE_LIBXAR +#endif /* Define to 1 if you have the header file. */ #define HAVE_TERMIOS_H 1 @@ -239,7 +273,9 @@ /* #undef HAVE__CHSIZE_S */ /* Define to 1 if you have the `_Unwind_Backtrace' function. */ -/* #undef HAVE__UNWIND_BACKTRACE */ +#if !defined(__FreeBSD__) +#define HAVE__UNWIND_BACKTRACE 1 +#endif /* Have host's __alloca */ /* #undef HAVE___ALLOCA */ @@ -315,7 +351,11 @@ /* #undef LLVM_LIBXML2_ENABLED */ /* Define to the extension used for shared libraries, say, ".so". */ +#if defined(__APPLE__) +#define LTDL_SHLIB_EXT ".dylib" +#else #define LTDL_SHLIB_EXT ".so" +#endif /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "https://bugs.freebsd.org/submit/" @@ -351,6 +391,10 @@ /* #undef LLVM_GISEL_COV_PREFIX */ /* Whether Timers signpost passes in Xcode Instruments */ +#if defined(__APPLE__) +#define LLVM_SUPPORT_XCODE_SIGNPOSTS 1 +#else #define LLVM_SUPPORT_XCODE_SIGNPOSTS 0 +#endif #endif diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index 85440f467a18..09d6336c01d9 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -717,7 +717,8 @@ SRCS_EXL+= LTO/LTOModule.cpp SRCS_EXL+= LTO/SummaryBasedOptimizations.cpp SRCS_EXL+= LTO/ThinLTOCodeGenerator.cpp SRCS_MIN+= LTO/UpdateCompilerUsed.cpp -SRCS_MIN+= LineEditor/LineEditor.cpp +# Only needed for clangd/clang-query, uncomment once we build those. +# SRCS_XDW+= LineEditor/LineEditor.cpp SRCS_MIN+= Linker/IRMover.cpp SRCS_MIN+= Linker/LinkModules.cpp SRCS_MIN+= MC/ConstantPools.cpp diff --git a/lib/clang/llvm.build.mk b/lib/clang/llvm.build.mk index b248fb816364..70b39fdc44ca 100644 --- a/lib/clang/llvm.build.mk +++ b/lib/clang/llvm.build.mk @@ -100,12 +100,24 @@ CFLAGS+= -DLLVM_NATIVE_TARGETMC=LLVMInitialize${LLVM_NATIVE_ARCH}TargetMC CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections +.if ${LINKER_TYPE} == "mac" +LDFLAGS+= -Wl,-dead_strip +.else LDFLAGS+= -Wl,--gc-sections +.endif CXXSTD?= c++14 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti +.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING) +# Building on macOS/Linux needs the real sysctl() not the bootstrap tools stub. +CFLAGS+= -DBOOTSTRAPPING_WANT_NATIVE_SYSCTL +.else CXXFLAGS.clang+= -stdlib=libc++ +.endif +.if defined(BOOTSTRAPPING) && ${.MAKE.OS} == "Linux" +LIBADD+= dl +.endif .if ${MACHINE_ARCH:Mmips64} STATIC_CFLAGS+= -mxgot diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 27de86f6c8d4..bd360dd1ad29 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -360,14 +360,6 @@ __DEFAULT_YES_OPTIONS+=OPENMP __DEFAULT_NO_OPTIONS+=OPENMP .endif -.if ${.MAKE.OS} != "FreeBSD" -# Building the target compiler requires building tablegen on the host -# which is (currently) not possible on non-FreeBSD. -BROKEN_OPTIONS+=CLANG LLD LLDB -# The same also applies to the bootstrap LLVM. -BROKEN_OPTIONS+=CLANG_BOOTSTRAP LLD_BOOTSTRAP -.endif - .include # diff --git a/tools/build/cross-build/include/common/sys/sysctl.h b/tools/build/cross-build/include/common/sys/sysctl.h index 856f6be23421..6d6f5438c557 100644 --- a/tools/build/cross-build/include/common/sys/sysctl.h +++ b/tools/build/cross-build/include/common/sys/sysctl.h @@ -37,6 +37,11 @@ */ #pragma once +#ifdef BOOTSTRAPPING_WANT_NATIVE_SYSCTL +/* We need the real sysctl.h e.g. when bootstrapping the LLVM tools. */ +#include_next +#else +/* Otherwise, avoid sysctls since they might not be supported on the host. */ #include #define sysctlbyname __freebsd_sysctlbyname @@ -44,3 +49,4 @@ int sysctl(const int *, u_int, void *, size_t *, const void *, size_t); int sysctlbyname(const char *, void *, size_t *, const void *, size_t); +#endif diff --git a/tools/build/make.py b/tools/build/make.py index 0cf831a3c966..799ea89b74b3 100755 --- a/tools/build/make.py +++ b/tools/build/make.py @@ -166,6 +166,9 @@ if __name__ == "__main__": "needed if CC/CPP/CXX are not set). ") parser.add_argument("--debug", action="store_true", help="Print information on inferred env vars") + parser.add_argument("--bootstrap-toolchain", action="store_true", + help="Bootstrap the toolchain instead of using an " + "external one (experimental and not recommended)") parser.add_argument("--clean", action="store_true", help="Do a clean rebuild instead of building with " "-DWITHOUT_CLEAN") @@ -195,6 +198,7 @@ if __name__ == "__main__": if "universe" not in sys.argv and "tinderbox" not in sys.argv: sys.exit("TARGET= and TARGET_ARCH= must be set explicitly " "when building on non-FreeBSD") + if not parsed_args.bootstrap_toolchain: # infer values for CC/CXX/CPP if parsed_args.host_compiler_type == "gcc": default_cc, default_cxx, default_cpp = ("gcc", "g++", "cpp") diff --git a/usr.bin/clang/clang.prog.mk b/usr.bin/clang/clang.prog.mk index de5cceac7c6b..d0ed6b8587c5 100644 --- a/usr.bin/clang/clang.prog.mk +++ b/usr.bin/clang/clang.prog.mk @@ -17,8 +17,10 @@ LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a PACKAGE= clang +.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING) LIBADD+= execinfo LIBADD+= ncursesw +.endif LIBADD+= pthread .include diff --git a/usr.bin/clang/lld/Makefile b/usr.bin/clang/lld/Makefile index 3593a4006ba2..8e95ccc07f04 100644 --- a/usr.bin/clang/lld/Makefile +++ b/usr.bin/clang/lld/Makefile @@ -102,8 +102,10 @@ TGHDRS+= ${INCFILE} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} +.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING) LIBADD+= execinfo LIBADD+= ncursesw +.endif LIBADD+= pthread LIBADD+= z diff --git a/usr.bin/clang/llvm.prog.mk b/usr.bin/clang/llvm.prog.mk index 58fd3eedd113..56698c4138d3 100644 --- a/usr.bin/clang/llvm.prog.mk +++ b/usr.bin/clang/llvm.prog.mk @@ -22,8 +22,10 @@ LDADD+= ${OBJTOP}/lib/clang/lib${lib}/lib${lib}.a PACKAGE= clang +.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING) LIBADD+= execinfo LIBADD+= ncursesw +.endif LIBADD+= pthread .include From owner-dev-commits-src-main@freebsd.org Mon Aug 2 14:48:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7CCE675981; Mon, 2 Aug 2021 14:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gdgqp5G1zz4Xfc; Mon, 2 Aug 2021 14:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D10121622; Mon, 2 Aug 2021 14:48:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172EmsSs043948; Mon, 2 Aug 2021 14:48:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172EmsxA043947; Mon, 2 Aug 2021 14:48:54 GMT (envelope-from git) Date: Mon, 2 Aug 2021 14:48:54 GMT Message-Id: <202108021448.172EmsxA043947@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 5c9cb96a239c - main - Fix BUILD_WITH_STRICT_TMPPATH build after adding time to ITOOLS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c9cb96a239cd9793a74ff91baa7296b814948aa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 14:48:54 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=5c9cb96a239cd9793a74ff91baa7296b814948aa commit 5c9cb96a239cd9793a74ff91baa7296b814948aa Author: Alex Richardson AuthorDate: 2021-08-02 14:34:26 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 14:34:26 +0000 Fix BUILD_WITH_STRICT_TMPPATH build after adding time to ITOOLS This is needed after bbd16236e986ef1b0e1da37c9c8a7f9dd2d63b5d (and 99feb137f5f66f903bba816c1d98ced2a92bef12). --- tools/build/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/build/Makefile b/tools/build/Makefile index 31d027f75ce2..948a5f9dfdb2 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -266,8 +266,8 @@ SYSINCS+= ${SRCTOP}/sys/sys/elf.h # Linux/MacOS since we only use flags that are supported by all of them. _host_tools_to_symlink= basename bzip2 bunzip2 chmod chown cmp comm cp date dd \ dirname echo env false find fmt gzip gunzip head hostname id ln ls \ - mkdir mv nice patch rm sh sleep stat tee touch tr true uname uniq unxz \ - wc which xz + mkdir mv nice patch rm sh sleep stat tee time touch tr true uname uniq \ + unxz wc which xz # We also need a symlink to the absolute path to the make binary used for # the toplevel makefile. This is not necessarily the same as `which make` From owner-dev-commits-src-main@freebsd.org Mon Aug 2 14:55:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E3D1675944; Mon, 2 Aug 2021 14:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdgzV182Xz4Y0q; Mon, 2 Aug 2021 14:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F4C521834; Mon, 2 Aug 2021 14:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172EtXTh057285; Mon, 2 Aug 2021 14:55:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172EtX31057284; Mon, 2 Aug 2021 14:55:33 GMT (envelope-from git) Date: Mon, 2 Aug 2021 14:55:33 GMT Message-Id: <202108021455.172EtX31057284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: ca34553b6f63 - main - sched_ule(4): Pre-seed sched_random(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca34553b6f631ec4ec5ae9f3825e3196e172c35d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 14:55:34 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=ca34553b6f631ec4ec5ae9f3825e3196e172c35d commit ca34553b6f631ec4ec5ae9f3825e3196e172c35d Author: Alexander Motin AuthorDate: 2021-08-02 14:50:34 +0000 Commit: Alexander Motin CommitDate: 2021-08-02 14:55:28 +0000 sched_ule(4): Pre-seed sched_random(). I don't think it changes anything, but why not. While there, make cpu_search_highest() use all 8 lower load bits for noise, since it does not use cs_prefer and the code is not shared with cpu_search_lowest() any more. MFC after: 1 month --- sys/kern/sched_ule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 1bdcfb1f793d..9bcc2a64e2b8 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -739,7 +739,7 @@ cpu_search_highest(const struct cpu_group *cg, const struct cpu_search *s, if (l < s->cs_limit || !tdq->tdq_transferable || !CPU_ISSET(c, s->cs_mask)) continue; - load -= sched_random() % 128; + load -= sched_random() % 256; if (load > bload) { bload = load; r->cs_cpu = c; @@ -1416,6 +1416,7 @@ sched_setup_smp(void) tdq->tdq_cg = smp_topo_find(cpu_top, i); if (tdq->tdq_cg == NULL) panic("Can't find cpu group for %d\n", i); + DPCPU_ID_SET(i, randomval, i * 69069 + 5); } PCPU_SET(sched, DPCPU_PTR(tdq)); balance_tdq = TDQ_SELF(); From owner-dev-commits-src-main@freebsd.org Mon Aug 2 15:03:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69E69675DEA; Mon, 2 Aug 2021 15:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gdh8V2QVTz4YHs; Mon, 2 Aug 2021 15:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3107E21B70; Mon, 2 Aug 2021 15:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172F3MIl071024; Mon, 2 Aug 2021 15:03:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172F3M4S071023; Mon, 2 Aug 2021 15:03:22 GMT (envelope-from git) Date: Mon, 2 Aug 2021 15:03:22 GMT Message-Id: <202108021503.172F3M4S071023@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 17d6371e4c85 - main - Fix GCC and -DWITH_CLEAN build after 7bc797e3f3807660cf98e5b1bd63545cafe820f8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17d6371e4c85ca5952118203676cbd764db2b209 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 15:03:22 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=17d6371e4c85ca5952118203676cbd764db2b209 commit 17d6371e4c85ca5952118203676cbd764db2b209 Author: Alex Richardson AuthorDate: 2021-08-02 15:01:30 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 15:03:05 +0000 Fix GCC and -DWITH_CLEAN build after 7bc797e3f3807660cf98e5b1bd63545cafe820f8 Reported by: kib --- lib/libclang_rt/compiler-rt-vars.mk | 7 +++++-- share/mk/bsd.sanitizer.mk | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/libclang_rt/compiler-rt-vars.mk b/lib/libclang_rt/compiler-rt-vars.mk index 974a553e379c..c270009e5d50 100644 --- a/lib/libclang_rt/compiler-rt-vars.mk +++ b/lib/libclang_rt/compiler-rt-vars.mk @@ -15,10 +15,13 @@ CRTARCH?= ${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/} # The only way to set the path to the sanitizer libraries with clang is to # override the resource directory. # Note: lib/freebsd is automatically appended to the -resource-dir value. -SANITIZER_LDFLAGS= -resource-dir=${SYSROOT}${CLANGDIR} +SANITIZER_LDFLAGS+= -resource-dir=${SYSROOT}${CLANGDIR} # Also set RPATH to ensure that the dynamically linked runtime libs are found. SANITIZER_LDFLAGS+= -Wl,--enable-new-dtags SANITIZER_LDFLAGS+= -Wl,-rpath,${SANITIZER_LIBDIR} -.else +.elif ${COMPILER_TYPE} != "none" +# This file can be included with COMPILER_TYPE=none during the cleandir phase, +# only emit an error when trying to compile with an unsupported compiler such +# as GCC. .error "Unknown link flags for -fsanitize=... COMPILER_TYPE=${COMPILER_TYPE}" .endif diff --git a/share/mk/bsd.sanitizer.mk b/share/mk/bsd.sanitizer.mk index 56d010767906..567b1da2afde 100644 --- a/share/mk/bsd.sanitizer.mk +++ b/share/mk/bsd.sanitizer.mk @@ -1,6 +1,5 @@ .include -.include "../../lib/libclang_rt/compiler-rt-vars.mk" _use_sanitizers= no # Add the necessary sanitizer flags if requested .if ${MK_ASAN} == "yes" && ${NO_SHARED:Uno:tl} == "no" @@ -23,7 +22,7 @@ SANITIZER_LDFLAGS+= -fsanitize=undefined _use_sanitizers= yes .endif # ${MK_UBSAN} == "yes" -.if !defined(BOOTSTRAPPING) && ${_use_sanitizers} != 0 && \ +.if !defined(BOOTSTRAPPING) && ${_use_sanitizers} != "no" && \ ${COMPILER_TYPE} != "clang" .error "Sanitizer instrumentation currently only supported with clang" .endif @@ -32,6 +31,7 @@ _use_sanitizers= yes # SHARED_CFLAGS instead of CFLAGS. We do this since static executables are not # compatible with the santizers (interceptors do not work). .if ${_use_sanitizers} != "no" +.include "../../lib/libclang_rt/compiler-rt-vars.mk" .if target(____) SHARED_CFLAGS+= ${SANITIZER_CFLAGS} SOLINKOPTS+= ${SANITIZER_LDFLAGS} From owner-dev-commits-src-main@freebsd.org Mon Aug 2 15:40:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36BA967688D; Mon, 2 Aug 2021 15:40:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gdhyv0nnpz4cxX; Mon, 2 Aug 2021 15:40:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F32E722213; Mon, 2 Aug 2021 15:40:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172Fe6Ax014260; Mon, 2 Aug 2021 15:40:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172Fe6Fk014257; Mon, 2 Aug 2021 15:40:06 GMT (envelope-from git) Date: Mon, 2 Aug 2021 15:40:06 GMT Message-Id: <202108021540.172Fe6Fk014257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 9f1db6c5557b - main - Add missing bsd.linker.mk include after 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f1db6c5557bd01734ee63afacaf07a37fb3cc60 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 15:40:07 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=9f1db6c5557bd01734ee63afacaf07a37fb3cc60 commit 9f1db6c5557bd01734ee63afacaf07a37fb3cc60 Author: Alex Richardson AuthorDate: 2021-08-02 15:38:39 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 15:38:39 +0000 Add missing bsd.linker.mk include after 31ba4ce8898f9dfa5e7f054fdbc26e50a599a6e3 This is needed for -DWITH_CLEAN builds since the cleandir phase does not include bsd.linker.mk from bsd.compiler.mk --- lib/clang/llvm.build.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/clang/llvm.build.mk b/lib/clang/llvm.build.mk index 70b39fdc44ca..3a712cde1703 100644 --- a/lib/clang/llvm.build.mk +++ b/lib/clang/llvm.build.mk @@ -100,6 +100,7 @@ CFLAGS+= -DLLVM_NATIVE_TARGETMC=LLVMInitialize${LLVM_NATIVE_ARCH}TargetMC CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections +.include "bsd.linker.mk" .if ${LINKER_TYPE} == "mac" LDFLAGS+= -Wl,-dead_strip .else From owner-dev-commits-src-main@freebsd.org Mon Aug 2 16:16:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26E6267701B; Mon, 2 Aug 2021 16:16:05 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) (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 4GdjmN1lSlz4gCj; Mon, 2 Aug 2021 16:16:04 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-qv1-xf33.google.com with SMTP id f91so9119670qva.9; Mon, 02 Aug 2021 09:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pK74zS57PZWdJlXnnNhbpQ0cbGzOsnikR8cTDqPYUA0=; b=UV8YYoH8pA+MyaBO/oDYaQNP+Brm7axDSRobeSPjtwS3mgK6kcZ3UG91oUuVniHMcW cq3d3U73BbnCjWtSZQ65lxTKgyerPn2qGLXBWSRKPTV/ve8mPTQoMg//ZPYPSrvgezYq 92Y48S2g7v7UUdTH08TV7oJOXJFFOqEeX3VfaPZ9eU9hHIpL6px4j+VFNwr/ukpYWjXC se8l7V+d3eATl7LhRcv5I0LXXDAIY6RL4ZIb1UxEOFtuUtG9AOoYlgEzoUIj51eRvVDh fcQHgITkWa7OMzKrzNUV9257k8361njNxEjh/3YpAAKkfd7eAaW9y8bNnRP8coAxSlbJ iLkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=pK74zS57PZWdJlXnnNhbpQ0cbGzOsnikR8cTDqPYUA0=; b=Baq62loNxyAjWs2bKeeQtWrsr7YnMk7b7PCIqeNcnxkaBQN1n0WQfSGGg9n+poMTJB 9t1GlJQgoyGfl+lgUldnPyiSInwMaEvmYgq6VeEBb52V3BbdT8fHwi6kHLpjl4enc1cA Sb+FNQLRjztW+Or5xbBIUpBU7pMr84zIG6iRK8McCAmJs6/OSLiZtUS+oz6+t6Y5Ygn3 Zq39JSHeOJyXSdoMihQbpoaXa2WL7JFWB/AUF3/NWI52hipzUqu9wQyIGTKb/fnUnuQf Yi/FjQhw3yxLr2UzPtD5ZIzwWgYnzn1OWcBUB6ru/gb89wAGaLdfarbYHKZeGo35IDtW CuHA== X-Gm-Message-State: AOAM533ko/cM/FjJ12uIDrGc3ItnpoZUhlT/+Ej77ZojC1epQSRbX6qm 7mS3W0Ux6lB2vyPOVQBpzmiuA//usms= X-Google-Smtp-Source: ABdhPJxPVi2m6hx+L2O36aXanVDIDjcyP/dugS1fYyvO0Mmdse8If7cufqcvMIZBwIckO4dfe63UiQ== X-Received: by 2002:a05:6214:a93:: with SMTP id ev19mr17327262qvb.27.1627920957439; Mon, 02 Aug 2021 09:15:57 -0700 (PDT) Received: from mavoffice.ixsystems.com ([38.32.73.2]) by smtp.gmail.com with ESMTPSA id a21sm6156179qkk.74.2021.08.02.09.15.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Aug 2021 09:15:56 -0700 (PDT) Sender: Alexander Motin Subject: Re: git: 74f80bc1af2f - main - coretemp(4): Switch to smp_rendezvous_cpus(). To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202107300326.16U3QGHR070204@gitrepo.freebsd.org> From: Alexander Motin Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raQ= Message-ID: <5b8b9ee4-4c90-ed32-de37-9d03fd812550@FreeBSD.org> Date: Mon, 2 Aug 2021 12:15:55 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4GdjmN1lSlz4gCj X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=UV8YYoH8; dmarc=none; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::f33 as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-3.20 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f33:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-main,dev-commits-src-all] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 16:16:05 -0000 On 31.07.2021 08:48, Konstantin Belousov wrote: >> +static void >> +coretemp_wrmsr(void *arg) >> +{ >> + struct coretemp_args *args = arg; >> + >> + wrmsr(args->msr, args->val); >> +} > We have x86_msr_op(). It covers coretemp_wrmsr(), and with slight > change of the interface would also handle the functionality of > coretemp_rdmsr(). As I see x86_msr_op() is tuned for MSR modification on all CPUs, while this code touches one CPU at a time. -- Alexander Motin From owner-dev-commits-src-main@freebsd.org Mon Aug 2 16:29:13 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C96E6770EA; Mon, 2 Aug 2021 16:29:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gdk3Y0yW2z4gRD; Mon, 2 Aug 2021 16:29:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04F3D22D66; Mon, 2 Aug 2021 16:29:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172GTCOc078683; Mon, 2 Aug 2021 16:29:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172GTCR8078682; Mon, 2 Aug 2021 16:29:12 GMT (envelope-from git) Date: Mon, 2 Aug 2021 16:29:12 GMT Message-Id: <202108021629.172GTCR8078682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8ca384eb1d42 - main - devclass_alloc_unit: move "at" hint test to after device-in-use test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ca384eb1d429aae866f53abfadafc71ab009dc6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 16:29:13 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8ca384eb1d429aae866f53abfadafc71ab009dc6 commit 8ca384eb1d429aae866f53abfadafc71ab009dc6 Author: Adam Fenn AuthorDate: 2021-08-02 16:27:17 +0000 Commit: Kyle Evans CommitDate: 2021-08-02 16:27:17 +0000 devclass_alloc_unit: move "at" hint test to after device-in-use test Only perform this expensive operation when the unit number is a potential candidate (i.e. not already in use), thereby reducing device scan time on systems with many devices, unit numbers, and drivers. Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #61 Differential Revision: https://reviews.freebsd.org/D31381 --- sys/kern/subr_bus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index fc2048561cf6..77b4c4c66c4b 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1638,15 +1638,15 @@ devclass_alloc_unit(devclass_t dc, device_t dev, int *unitp) /* Unwired device, find the next available slot for it */ unit = 0; for (unit = 0;; unit++) { + /* If this device slot is already in use, skip it. */ + if (unit < dc->maxunit && dc->devices[unit] != NULL) + continue; + /* If there is an "at" hint for a unit then skip it. */ if (resource_string_value(dc->name, unit, "at", &s) == 0) continue; - /* If this device slot is already in use, skip it. */ - if (unit < dc->maxunit && dc->devices[unit] != NULL) - continue; - break; } } From owner-dev-commits-src-main@freebsd.org Mon Aug 2 16:30:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD83467716E; Mon, 2 Aug 2021 16:30:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gdk4y5x2rz4gnT; Mon, 2 Aug 2021 16:30:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3D5C22B53; Mon, 2 Aug 2021 16:30:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172GUQa3087069; Mon, 2 Aug 2021 16:30:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172GUQQJ087068; Mon, 2 Aug 2021 16:30:26 GMT (envelope-from git) Date: Mon, 2 Aug 2021 16:30:26 GMT Message-Id: <202108021630.172GUQQJ087068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 600745f1e226 - main - pf: bound DIOCGETSTATES memory use MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 600745f1e2260e7ed3c2e6183b24388ff38c916c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 16:30:26 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=600745f1e2260e7ed3c2e6183b24388ff38c916c commit 600745f1e2260e7ed3c2e6183b24388ff38c916c Author: Kristof Provost AuthorDate: 2021-08-02 07:46:33 +0000 Commit: Kristof Provost CommitDate: 2021-08-02 14:29:23 +0000 pf: bound DIOCGETSTATES memory use Similar to what we did earlier for DIOCGETSTATESV2 we only allocate enough memory for a handful of states and copy those out, bit by bit, rather than allocating memory for all states in one go. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 51 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 7c506b79295b..b2d7fc33d8b8 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2916,7 +2916,9 @@ DIOCCHANGERULE_error: struct pfioc_states *ps = (struct pfioc_states *)addr; struct pf_kstate *s; struct pfsync_state *pstore, *p; - int i, nr; + int i, nr; + size_t slice_count = 16, count; + void *out; if (ps->ps_len <= 0) { nr = uma_zone_get_cur(V_pf_state_z); @@ -2924,34 +2926,59 @@ DIOCCHANGERULE_error: break; } - p = pstore = malloc(ps->ps_len, M_TEMP, M_WAITOK | M_ZERO); + out = ps->ps_states; + pstore = mallocarray(slice_count, + sizeof(struct pfsync_state), M_TEMP, M_WAITOK | M_ZERO); nr = 0; for (i = 0; i <= pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; +DIOCGETSTATES_retry: + p = pstore; + + if (LIST_EMPTY(&ih->states)) + continue; + PF_HASHROW_LOCK(ih); + count = 0; + LIST_FOREACH(s, &ih->states, entry) { + if (s->timeout == PFTM_UNLINKED) + continue; + count++; + } + + if (count > slice_count) { + PF_HASHROW_UNLOCK(ih); + free(pstore, M_TEMP); + slice_count = count * 2; + pstore = mallocarray(slice_count, + sizeof(struct pfsync_state), M_TEMP, + M_WAITOK | M_ZERO); + goto DIOCGETSTATES_retry; + } + + if ((nr+count) * sizeof(*p) > ps->ps_len) { + PF_HASHROW_UNLOCK(ih); + goto DIOCGETSTATES_full; + } + LIST_FOREACH(s, &ih->states, entry) { if (s->timeout == PFTM_UNLINKED) continue; - if ((nr+1) * sizeof(*p) > ps->ps_len) { - PF_HASHROW_UNLOCK(ih); - goto DIOCGETSTATES_full; - } pfsync_state_export(p, s); p++; nr++; } PF_HASHROW_UNLOCK(ih); + error = copyout(pstore, out, + sizeof(struct pfsync_state) * count); + if (error) + break; + out = ps->ps_states + nr; } DIOCGETSTATES_full: - error = copyout(pstore, ps->ps_states, - sizeof(struct pfsync_state) * nr); - if (error) { - free(pstore, M_TEMP); - break; - } ps->ps_len = sizeof(struct pfsync_state) * nr; free(pstore, M_TEMP); From owner-dev-commits-src-main@freebsd.org Mon Aug 2 17:07:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1D99677E84; Mon, 2 Aug 2021 17:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gdkvs4Bk7z4jHt; Mon, 2 Aug 2021 17:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A25123438; Mon, 2 Aug 2021 17:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172H7bt8032251; Mon, 2 Aug 2021 17:07:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172H7bfW032250; Mon, 2 Aug 2021 17:07:37 GMT (envelope-from git) Date: Mon, 2 Aug 2021 17:07:37 GMT Message-Id: <202108021707.172H7bfW032250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d59f1c49e26b - main - cxgbe tom: Permit rcv_nxt mismatches on FIN for iSCSI connections on T6. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d59f1c49e26ba29e7583019bb5d6aa029466fdb6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 17:07:37 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d59f1c49e26ba29e7583019bb5d6aa029466fdb6 commit d59f1c49e26ba29e7583019bb5d6aa029466fdb6 Author: John Baldwin AuthorDate: 2021-08-02 16:41:27 +0000 Commit: John Baldwin CommitDate: 2021-08-02 16:41:27 +0000 cxgbe tom: Permit rcv_nxt mismatches on FIN for iSCSI connections on T6. The remote peer might send a FIN in the middle of a burst of data PDUs. In the case of T6 with data PDU completion moderation, the driver would not have seen these PDUs since the final PDU in the burst was never received resulting in a stale rcv_nxt when the FIN is received. While here, invert the logic in the condition to be more readable and always set tp->rcv_nxt from the sequence number in the CPL. This sets the proper value of rcv_nxt for FINs on connections with data received but not reported via a CPL (e.g. a partial iSCSI PDU burst interrupted by a FIN). Reported by: Jithesh Arakkan @ Chelsio Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D30871 --- sys/dev/cxgbe/tom/t4_cpl_io.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 3af127c6a3a3..a75f93ded5f6 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -1288,7 +1288,21 @@ do_peer_close(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) if (toep->flags & TPF_ABORT_SHUTDOWN) goto done; - tp->rcv_nxt++; /* FIN */ + if (ulp_mode(toep) == ULP_MODE_RDMA || + (ulp_mode(toep) == ULP_MODE_ISCSI && chip_id(sc) >= CHELSIO_T6)) { + /* + * There might be data received via DDP before the FIN + * not reported to the driver. Just assume the + * sequence number in the CPL is correct as the + * sequence number of the FIN. + */ + } else { + KASSERT(tp->rcv_nxt + 1 == be32toh(cpl->rcv_nxt), + ("%s: rcv_nxt mismatch: %u %u", __func__, tp->rcv_nxt, + be32toh(cpl->rcv_nxt))); + } + + tp->rcv_nxt = be32toh(cpl->rcv_nxt); so = inp->inp_socket; socantrcvmore(so); @@ -1300,12 +1314,6 @@ do_peer_close(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) DDP_UNLOCK(toep); } - if (ulp_mode(toep) != ULP_MODE_RDMA) { - KASSERT(tp->rcv_nxt == be32toh(cpl->rcv_nxt), - ("%s: rcv_nxt mismatch: %u %u", __func__, tp->rcv_nxt, - be32toh(cpl->rcv_nxt))); - } - switch (tp->t_state) { case TCPS_SYN_RECEIVED: tp->t_starttime = ticks; From owner-dev-commits-src-main@freebsd.org Mon Aug 2 19:45:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24DC867955D; Mon, 2 Aug 2021 19:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdpQK0LWnz3C7L; Mon, 2 Aug 2021 19:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8F182564C; Mon, 2 Aug 2021 19:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172JjiMd044956; Mon, 2 Aug 2021 19:45:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172Jjinc044955; Mon, 2 Aug 2021 19:45:44 GMT (envelope-from git) Date: Mon, 2 Aug 2021 19:45:44 GMT Message-Id: <202108021945.172Jjinc044955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: 428624130abf - main - Fix lockstat:::thread-spin dtrace probe with LOCK_PROFILING MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 428624130abfc225b479a09a3060d0939569b1ea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 19:45:45 -0000 The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=428624130abfc225b479a09a3060d0939569b1ea commit 428624130abfc225b479a09a3060d0939569b1ea Author: Eric van Gyzen AuthorDate: 2021-08-02 18:54:57 +0000 Commit: Eric van Gyzen CommitDate: 2021-08-02 19:44:23 +0000 Fix lockstat:::thread-spin dtrace probe with LOCK_PROFILING The spinning start time is missing from the calculation due to a misplaced #endif. Return the #endif where it's supposed to be. Submitted by: Alexander Alexeev Reviewed by: bdrewery, mjg MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D31384 --- sys/kern/kern_mutex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index d9db69e2ac09..a85420e62c7a 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -895,6 +895,8 @@ thread_lock_flags_(struct thread *td, int opts, const char *file, int line) doing_lockprof = 1; #elif defined(KDTRACE_HOOKS) doing_lockprof = lockstat_enabled; +#endif +#ifdef KDTRACE_HOOKS if (__predict_false(doing_lockprof)) spin_time -= lockstat_nsecs(&td->td_lock->lock_object); #endif From owner-dev-commits-src-main@freebsd.org Mon Aug 2 20:37:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD00467A60B; Mon, 2 Aug 2021 20:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdqZC4WTfz3Gb1; Mon, 2 Aug 2021 20:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 786B225BE8; Mon, 2 Aug 2021 20:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172Kbd8e011977; Mon, 2 Aug 2021 20:37:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172KbdS5011976; Mon, 2 Aug 2021 20:37:39 GMT (envelope-from git) Date: Mon, 2 Aug 2021 20:37:39 GMT Message-Id: <202108022037.172KbdS5011976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 6162cf885c00 - main - malloc(9): Document/complete aligned variants MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6162cf885c00a0893a0961415f1829942343dcc1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 20:37:39 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=6162cf885c00a0893a0961415f1829942343dcc1 commit 6162cf885c00a0893a0961415f1829942343dcc1 Author: Adam Fenn AuthorDate: 2021-08-02 20:33:31 +0000 Commit: Kyle Evans CommitDate: 2021-08-02 20:36:14 +0000 malloc(9): Document/complete aligned variants Comments on a pending kvmclock driver suggested adding a malloc_aligned() to complement malloc_domainset_aligned(); add it now, and document both. Reviewed by: imp, kib, allanjude (manpages) Differential Revision: https://reviews.freebsd.org/D31004 --- share/man/man9/malloc.9 | 25 ++++++++++++++++++++++++- sys/sys/malloc.h | 2 ++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/share/man/man9/malloc.9 b/share/man/man9/malloc.9 index b8c6e504e0c0..71375e90951f 100644 --- a/share/man/man9/malloc.9 +++ b/share/man/man9/malloc.9 @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd March 6, 2021 +.Dd July 2, 2021 .Dt MALLOC 9 .Os .Sh NAME @@ -58,6 +58,13 @@ .Ft size_t .Fn malloc_usable_size "const void *addr" .Ft void * +.Fo malloc_aligned +.Fa "size_t size" +.Fa "size_t align" +.Fa "struct malloc_type *type" +.Fa "int flags" +.Fc +.Ft void * .Fn malloc_exec "size_t size" "struct malloc_type *type" "int flags" .Fn MALLOC_DECLARE type .In sys/param.h @@ -69,6 +76,14 @@ .Ft void * .Fn malloc_domainset "size_t size" "struct malloc_type *type" "struct domainset *ds" "int flags" .Ft void * +.Fo malloc_domainset_aligned +.Fa "size_t size" +.Fa "size_t align" +.Fa "struct malloc_type *type" +.Fa "struct domainset *ds" +.Fa "int flags" +.Fc +.Ft void * .Fn malloc_domainset_exec "size_t size" "struct malloc_type *type" "struct domainset *ds" "int flags" .Ft void * .Fn mallocarray_domainset "size_t nmemb" "size_t size" "struct malloc_type *type" "struct domainset *ds" "int flags" @@ -88,6 +103,14 @@ See .Xr domainset 9 for some example policies. .Pp +The +.Fn malloc_aligned +and +.Fn malloc_domainset_aligned +variants return allocations aligned as specified by +.Fa align , +which must be non-zero, a power of two, and less than or equal to the page size. +.Pp Both .Fn malloc_exec and diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index b8c2788edd44..3d88460a751e 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -265,6 +265,8 @@ void *realloc(void *addr, size_t size, struct malloc_type *type, int flags) __result_use_check __alloc_size(2); void *reallocf(void *addr, size_t size, struct malloc_type *type, int flags) __result_use_check __alloc_size(2); +void *malloc_aligned(size_t size, size_t align, struct malloc_type *type, + int flags) __malloc_like __result_use_check __alloc_size(1); void *malloc_domainset_aligned(size_t size, size_t align, struct malloc_type *mtp, struct domainset *ds, int flags) __malloc_like __result_use_check __alloc_size(1); From owner-dev-commits-src-main@freebsd.org Mon Aug 2 20:48:10 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20A2967A637; Mon, 2 Aug 2021 20:48:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 4GdqpK5zDWz3Kcs; Mon, 2 Aug 2021 20:48:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 172Km1DW009441 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 2 Aug 2021 23:48:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 172Km1DW009441 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 172Km1gR009440; Mon, 2 Aug 2021 23:48:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 2 Aug 2021 23:48:01 +0300 From: Konstantin Belousov To: Alexander Motin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 74f80bc1af2f - main - coretemp(4): Switch to smp_rendezvous_cpus(). Message-ID: References: <202107300326.16U3QGHR070204@gitrepo.freebsd.org> <5b8b9ee4-4c90-ed32-de37-9d03fd812550@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5b8b9ee4-4c90-ed32-de37-9d03fd812550@FreeBSD.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4GdqpK5zDWz3Kcs X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 20:48:10 -0000 On Mon, Aug 02, 2021 at 12:15:55PM -0400, Alexander Motin wrote: > On 31.07.2021 08:48, Konstantin Belousov wrote: > >> +static void > >> +coretemp_wrmsr(void *arg) > >> +{ > >> + struct coretemp_args *args = arg; > >> + > >> + wrmsr(args->msr, args->val); > >> +} > > We have x86_msr_op(). It covers coretemp_wrmsr(), and with slight > > change of the interface would also handle the functionality of > > coretemp_rdmsr(). > > As I see x86_msr_op() is tuned for MSR modification on all CPUs, while > this code touches one CPU at a time. https://reviews.freebsd.org/D31386 From owner-dev-commits-src-main@freebsd.org Mon Aug 2 21:54:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41D0D67B61C; Mon, 2 Aug 2021 21:54:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdsHM19gHz3QDy; Mon, 2 Aug 2021 21:54:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 012F426F68; Mon, 2 Aug 2021 21:54:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172Lssrc018908; Mon, 2 Aug 2021 21:54:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172LssYo018907; Mon, 2 Aug 2021 21:54:54 GMT (envelope-from git) Date: Mon, 2 Aug 2021 21:54:54 GMT Message-Id: <202108022154.172LssYo018907@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d00131e154d9 - main - clock_id: These symbols weren't in 4.4BSD, adjust copyright MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d00131e154d9d847121292fe67cedcd5ac19d60e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 21:54:55 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d00131e154d9d847121292fe67cedcd5ac19d60e commit d00131e154d9d847121292fe67cedcd5ac19d60e Author: Warner Losh AuthorDate: 2021-08-02 21:49:47 +0000 Commit: Warner Losh CommitDate: 2021-08-02 21:50:32 +0000 clock_id: These symbols weren't in 4.4BSD, adjust copyright Peter Wemm added the first CLOCK_* symbols in 0f5ed9f420528 in 1997 after obtaining them from NetBSD. In NetBSD, jtc@netbsd.org committed them in sys/sys/time.h rev 1.19 dated 1996/11/15, along with all the system calls associated with 1003.1b. FreeBSD's values are, however, different than NetBSD's today. The USL/UCB lawsuit was settled in 1994, so these couldn't have been derived from material provided to University of California covered in that settlement. This file does not need the settlement disclaimer. Furthermore, I rewrote most of the code (except the symbols and their values) when merging it from time.h and sys/time.h. Most of the creative content of the file is new, so update copyright to reflect that. Reviewed by: kaktus Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31369 --- sys/sys/_clock_id.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/sys/sys/_clock_id.h b/sys/sys/_clock_id.h index a88eb063122f..47a551428dc3 100644 --- a/sys/sys/_clock_id.h +++ b/sys/sys/_clock_id.h @@ -1,13 +1,7 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. + * Copyright (c) 2021 Netflix, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -17,9 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -32,8 +23,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)time.h 8.3 (Berkeley) 1/21/94 */ #ifndef _SYS_SYS__CLOCK_ID_H From owner-dev-commits-src-main@freebsd.org Mon Aug 2 21:54:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5848067AC74; Mon, 2 Aug 2021 21:54:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdsHN0m4dz3Q1X; Mon, 2 Aug 2021 21:54:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 020E0271D3; Mon, 2 Aug 2021 21:54:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172LstEq018937; Mon, 2 Aug 2021 21:54:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172LstGd018936; Mon, 2 Aug 2021 21:54:55 GMT (envelope-from git) Date: Mon, 2 Aug 2021 21:54:55 GMT Message-Id: <202108022154.172LstGd018936@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: aaccfdde3d66 - main - awk: Enable tests again MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aaccfdde3d66083af3e239555ba459249733ca08 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 21:54:56 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=aaccfdde3d66083af3e239555ba459249733ca08 commit aaccfdde3d66083af3e239555ba459249733ca08 Author: Warner Losh AuthorDate: 2021-08-02 21:53:26 +0000 Commit: Warner Losh CommitDate: 2021-08-02 21:53:26 +0000 awk: Enable tests again Since we now pass all 24 of the NetBSD awk tests, re-enable these tests. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31370 --- usr.bin/awk/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.bin/awk/Makefile b/usr.bin/awk/Makefile index 89dbf4460f45..28212f75f7d9 100644 --- a/usr.bin/awk/Makefile +++ b/usr.bin/awk/Makefile @@ -29,8 +29,7 @@ DEPENDOBJS+= maketab build-tools: maketab maketab: awkgram.tab.h ${BUILD_TOOLS_META} -# awk needs some work before we can connect these tests to the build -#HAS_TESTS= -#SUBDIR.${MK_TESTS}+= tests +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .include From owner-dev-commits-src-main@freebsd.org Tue Aug 3 02:12:56 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B1F867E702; Tue, 3 Aug 2021 02:12:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gdz141fN7z4Twl; Tue, 3 Aug 2021 02:12:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21D802C10; Tue, 3 Aug 2021 02:12:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1732CuJV065683; Tue, 3 Aug 2021 02:12:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1732Cufb065682; Tue, 3 Aug 2021 02:12:56 GMT (envelope-from git) Date: Tue, 3 Aug 2021 02:12:56 GMT Message-Id: <202108030212.1732Cufb065682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 04cc0c393c31 - main - malloc(9): provide missing malloc_aligned implementation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04cc0c393c317b6d5e28c8dc80cd1b5ea071f28f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 02:12:56 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=04cc0c393c317b6d5e28c8dc80cd1b5ea071f28f commit 04cc0c393c317b6d5e28c8dc80cd1b5ea071f28f Author: Kyle Evans AuthorDate: 2021-08-03 02:11:44 +0000 Commit: Kyle Evans CommitDate: 2021-08-03 02:12:39 +0000 malloc(9): provide missing malloc_aligned implementation Pointy hat: kevans Fixes: 6162cf885c00 ("malloc(9): Document/complete aligned variants") --- sys/kern/kern_malloc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index bd0f46ea5220..0c2f1689d194 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -771,6 +771,13 @@ malloc_domainset_exec(size_t size, struct malloc_type *mtp, struct domainset *ds return (malloc_large(size, mtp, ds, flags DEBUG_REDZONE_ARG)); } +void * +malloc_aligned(size_t size, size_t align, struct malloc_type *type, int flags) +{ + return (malloc_domainset_aligned(size, align, type, DOMAINSET_RR(), + flags)); +} + void * malloc_domainset_aligned(size_t size, size_t align, struct malloc_type *mtp, struct domainset *ds, int flags) From owner-dev-commits-src-main@freebsd.org Tue Aug 3 09:38:52 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CFF1634644; Tue, 3 Aug 2021 09:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gf8vc1DWfz3MtX; Tue, 3 Aug 2021 09:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12941110E2; Tue, 3 Aug 2021 09:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1739cp2o055483; Tue, 3 Aug 2021 09:38:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1739cprS055482; Tue, 3 Aug 2021 09:38:51 GMT (envelope-from git) Date: Tue, 3 Aug 2021 09:38:51 GMT Message-Id: <202108030938.1739cprS055482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 428a32edba4c - main - Use .sinclude for bsd.sanitizer.mk MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 428a32edba4c3bf3cfc0e4cf240c1b29397ecdbb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 09:38:52 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=428a32edba4c3bf3cfc0e4cf240c1b29397ecdbb commit 428a32edba4c3bf3cfc0e4cf240c1b29397ecdbb Author: Alex Richardson AuthorDate: 2021-08-03 09:37:28 +0000 Commit: Alex Richardson CommitDate: 2021-08-03 09:38:20 +0000 Use .sinclude for bsd.sanitizer.mk We don't install this file since MK_ASAN/MK_UBSAN is only supported for src builds. However, some ports also use bsd.lib.mk/bsd.prog.mk so we should not fail the build if it can't be included. Reported by: jkim Fixes: 7bc797e3f380 ("Add build system support for ASAN+UBSAN instrumentation") --- share/mk/bsd.lib.mk | 3 ++- share/mk/bsd.prog.mk | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 5de74b6fa056..aaac0b68d984 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -108,7 +108,8 @@ CXXFLAGS+= -ftrivial-auto-var-init=pattern .endif .endif -.include "bsd.sanitizer.mk" +# bsd.sanitizer.mk is not installed, so don't require it (e.g. for ports). +.sinclude "bsd.sanitizer.mk" .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf*) diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 96d72daf2611..4f00be193874 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -81,7 +81,8 @@ CXXFLAGS+= -ftrivial-auto-var-init=pattern .endif .endif -.include "bsd.sanitizer.mk" +# bsd.sanitizer.mk is not installed, so don't require it (e.g. for ports). +.sinclude "bsd.sanitizer.mk" .if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == "" CFLAGS += -mno-relax From owner-dev-commits-src-main@freebsd.org Tue Aug 3 10:08:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86DC0634FD5; Tue, 3 Aug 2021 10:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gf9YD3F7Fz3Q2w; Tue, 3 Aug 2021 10:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 576EC11716; Tue, 3 Aug 2021 10:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173A80OZ096590; Tue, 3 Aug 2021 10:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173A80UG096589; Tue, 3 Aug 2021 10:08:00 GMT (envelope-from git) Date: Tue, 3 Aug 2021 10:08:00 GMT Message-Id: <202108031008.173A80UG096589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: f5b29d0f3510 - main - etherswitch: Add a new striptagingress port flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5b29d0f35100238068c4b3145e15486f991e911 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 10:08:00 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=f5b29d0f35100238068c4b3145e15486f991e911 commit f5b29d0f35100238068c4b3145e15486f991e911 Author: Kornel Duleba AuthorDate: 2021-06-23 11:13:05 +0000 Commit: Marcin Wojtas CommitDate: 2021-08-03 10:07:48 +0000 etherswitch: Add a new striptagingress port flag Felix switch found in LS1028A supports stripping VLAN tag on ingress, instead of egress. The striptag flag excepts the latter behaviour. Add a new flag to support the feature. Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30922 --- sbin/etherswitchcfg/etherswitchcfg.8 | 6 +++++- sbin/etherswitchcfg/etherswitchcfg.c | 4 ++++ sys/dev/etherswitch/etherswitch.h | 19 ++++++++++--------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/sbin/etherswitchcfg/etherswitchcfg.8 b/sbin/etherswitchcfg/etherswitchcfg.8 index 0695b0eddba4..9380c1f4f055 100644 --- a/sbin/etherswitchcfg/etherswitchcfg.8 +++ b/sbin/etherswitchcfg/etherswitchcfg.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 28, 2019 +.Dd June 23, 2021 .Dt ETHERSWITCHCFG 8 .Os .Sh NAME @@ -139,6 +139,10 @@ Disable the add VLAN tag option. Strip the VLAN tags from the packets sent by the port. .It Fl striptag Disable the strip VLAN tag option. +.It Cm striptagingress +Strip the VLAN tags from the packets received by the port. +.It Fl striptagingress +Disable the strip VLAN tag on ingress option. .It Cm firstlock This options makes the switch port lock on the first MAC address it sees. After that, usually you need to reset the switch to learn different diff --git a/sbin/etherswitchcfg/etherswitchcfg.c b/sbin/etherswitchcfg/etherswitchcfg.c index f3af9f93825a..7f3403918fad 100644 --- a/sbin/etherswitchcfg/etherswitchcfg.c +++ b/sbin/etherswitchcfg/etherswitchcfg.c @@ -223,6 +223,8 @@ set_port_flag(struct cfg *cfg, int argc, char *argv[]) f = ETHERSWITCH_PORT_DOUBLE_TAG; else if (strcasecmp(flag, "ingress") == 0) f = ETHERSWITCH_PORT_INGRESS; + else if (strcasecmp(flag, "striptagingress") == 0) + f = ETHERSWITCH_PORT_STRIPTAGINGRESS; } bzero(&p, sizeof(p)); p.es_port = cfg->unit; @@ -869,6 +871,8 @@ static struct cmds cmds[] = { { MODE_PORT, "-ingress", 0, set_port_flag }, { MODE_PORT, "striptag", 0, set_port_flag }, { MODE_PORT, "-striptag", 0, set_port_flag }, + { MODE_PORT, "striptagingress", 0, set_port_flag }, + { MODE_PORT, "-striptagingress", 0, set_port_flag }, { MODE_PORT, "doubletag", 0, set_port_flag }, { MODE_PORT, "-doubletag", 0, set_port_flag }, { MODE_PORT, "firstlock", 0, set_port_flag }, diff --git a/sys/dev/etherswitch/etherswitch.h b/sys/dev/etherswitch/etherswitch.h index 02bf91cd613c..9d87be03e26d 100644 --- a/sys/dev/etherswitch/etherswitch.h +++ b/sys/dev/etherswitch/etherswitch.h @@ -57,17 +57,18 @@ struct etherswitch_conf { }; typedef struct etherswitch_conf etherswitch_conf_t; -#define ETHERSWITCH_PORT_CPU (1 << 0) -#define ETHERSWITCH_PORT_STRIPTAG (1 << 1) -#define ETHERSWITCH_PORT_ADDTAG (1 << 2) -#define ETHERSWITCH_PORT_FIRSTLOCK (1 << 3) -#define ETHERSWITCH_PORT_DROPUNTAGGED (1 << 4) -#define ETHERSWITCH_PORT_DOUBLE_TAG (1 << 5) -#define ETHERSWITCH_PORT_INGRESS (1 << 6) -#define ETHERSWITCH_PORT_DROPTAGGED (1 << 7) +#define ETHERSWITCH_PORT_CPU (1 << 0) +#define ETHERSWITCH_PORT_STRIPTAG (1 << 1) +#define ETHERSWITCH_PORT_ADDTAG (1 << 2) +#define ETHERSWITCH_PORT_FIRSTLOCK (1 << 3) +#define ETHERSWITCH_PORT_DROPUNTAGGED (1 << 4) +#define ETHERSWITCH_PORT_DOUBLE_TAG (1 << 5) +#define ETHERSWITCH_PORT_INGRESS (1 << 6) +#define ETHERSWITCH_PORT_DROPTAGGED (1 << 7) +#define ETHERSWITCH_PORT_STRIPTAGINGRESS (1 << 8) #define ETHERSWITCH_PORT_FLAGS_BITS \ "\020\1CPUPORT\2STRIPTAG\3ADDTAG\4FIRSTLOCK\5DROPUNTAGGED\6QinQ\7INGRESS" \ -"\10DROPTAGGED" +"\10DROPTAGGED\11STRIPTAGINGRESS" #define ETHERSWITCH_PORT_MAX_LEDS 3 From owner-dev-commits-src-main@freebsd.org Tue Aug 3 10:08:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95F8D6357F7; Tue, 3 Aug 2021 10:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gf9YF3cWjz3Q2y; Tue, 3 Aug 2021 10:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 651141157B; Tue, 3 Aug 2021 10:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173A81OE096618; Tue, 3 Aug 2021 10:08:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173A81mK096617; Tue, 3 Aug 2021 10:08:01 GMT (envelope-from git) Date: Tue, 3 Aug 2021 10:08:01 GMT Message-Id: <202108031008.173A81mK096617@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 451bcf1b3601 - main - Introduce driver for Freescale Felix switch MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 451bcf1b360146af0759ac18c9cc55f0a36cc386 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 10:08:01 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=451bcf1b360146af0759ac18c9cc55f0a36cc386 commit 451bcf1b360146af0759ac18c9cc55f0a36cc386 Author: Marcin Wojtas AuthorDate: 2021-06-09 11:23:26 +0000 Commit: Marcin Wojtas CommitDate: 2021-08-03 10:07:49 +0000 Introduce driver for Freescale Felix switch It is found on boards equipped with LS1028A SoC. 802.1q VLAN grouping is supported. An external MDIO device is used for communicating with PHYs. The driver is built as a module by default, it is not included in GENERIC kernel config. Submitted by: Lukasz Hajec Kornel Duleba Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30923 --- share/man/man4/man4.aarch64/Makefile | 1 + share/man/man4/man4.aarch64/felix.4 | 83 +++ sys/conf/files.arm64 | 2 + sys/dev/etherswitch/felix/felix.c | 996 ++++++++++++++++++++++++++++++++++ sys/dev/etherswitch/felix/felix_reg.h | 100 ++++ sys/dev/etherswitch/felix/felix_var.h | 105 ++++ sys/modules/Makefile | 2 + sys/modules/felix/Makefile | 34 ++ 8 files changed, 1323 insertions(+) diff --git a/share/man/man4/man4.aarch64/Makefile b/share/man/man4/man4.aarch64/Makefile index ef5fcd84ccd4..6d0e427e6b28 100644 --- a/share/man/man4/man4.aarch64/Makefile +++ b/share/man/man4/man4.aarch64/Makefile @@ -12,6 +12,7 @@ MAN= \ aw_syscon.4 \ bcm283x_pwm.4 \ enetc.4 \ + felix.4 \ rk_gpio.4 \ rk_grf.4 \ rk_i2c.4 \ diff --git a/share/man/man4/man4.aarch64/felix.4 b/share/man/man4/man4.aarch64/felix.4 new file mode 100644 index 000000000000..738309a4cc84 --- /dev/null +++ b/share/man/man4/man4.aarch64/felix.4 @@ -0,0 +1,83 @@ +.\" - +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2021 Alstom Group. +.\" Copyright (c) 2021 Semihalf. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd June 21, 2021 +.Dt FELIX 4 +.Os +.Sh NAME +.Nm felix +.Nd "driver for Microchip Ocelot Felix switch" +.Sh SYNOPSIS +To compile this driver into the kernel the following lines must be present +in the kernel configuration file: +.sp +.Cd "options SOC_NXP_LS" +.Cd "device pci" +.Cd "device fdt" +.Cd "device mdio" +.Cd "device enetc" +.Cd "device etherswitch" +.Cd "device felix" +.Sh DESCRIPTION +The +.Nm +driver provides a management interface to Microchip Ocelot Felix switch (VSC9959) +found in NXP LS1028A SoC. It is a PCI device, part of the larger ENETC +root complex. The driver is using +.Xr etherswitch 4 +framework. +.Pp +This driver supports only dot1q vlan. dot1q support port base addtag, striptag, +dropuntagged, dropuntagged. +.Sh EXAMPLES +Configure dot1q vlan by etherswitchcfg command. +.Pp +.Dl # etherswitchcfg config vlan_mode dot1q +.Pp +Configure port 5 is tagging port. +.Pp +.Dl # etherswitchcfg port5 addtag +.Pp +Disable port 5 is tagging port. +.Pp +.Dl # etherswitchcfg port5 -addtag +.Sh SEE ALSO +.Xr etherswitch 4 , +.Xr etherswitchcfg 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 14.0 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Kornel Duleba (mindal@semihalf.com) +and +.An Lukasz Hajec (lha@semihalf.com) + diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 3bc534073634..bfa03dade1db 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -179,6 +179,8 @@ dev/enetc/enetc_mdio.c optional enetc soc_nxp_ls dev/enetc/enetc_mdio_pci.c optional enetc pci soc_nxp_ls dev/enetc/if_enetc.c optional enetc iflib pci fdt soc_nxp_ls +dev/etherswitch/felix/felix.c optional enetc etherswitch fdt felix pci soc_nxp_ls + dev/gpio/pl061.c optional pl061 gpio dev/gpio/pl061_acpi.c optional pl061 gpio acpi dev/gpio/pl061_fdt.c optional pl061 gpio fdt diff --git a/sys/dev/etherswitch/felix/felix.c b/sys/dev/etherswitch/felix/felix.c new file mode 100644 index 000000000000..140811807586 --- /dev/null +++ b/sys/dev/etherswitch/felix/felix.c @@ -0,0 +1,996 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Alstom Group. + * Copyright (c) 2021 Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "etherswitch_if.h" +#include "miibus_if.h" + +MALLOC_DECLARE(M_FELIX); +MALLOC_DEFINE(M_FELIX, "felix", "felix switch"); + +static device_probe_t felix_probe; +static device_attach_t felix_attach; +static device_detach_t felix_detach; + +static etherswitch_info_t* felix_getinfo(device_t); +static int felix_getconf(device_t, etherswitch_conf_t *); +static int felix_setconf(device_t, etherswitch_conf_t *); +static void felix_lock(device_t); +static void felix_unlock(device_t); +static int felix_getport(device_t, etherswitch_port_t *); +static int felix_setport(device_t, etherswitch_port_t *); +static int felix_readreg_wrapper(device_t, int); +static int felix_writereg_wrapper(device_t, int, int); +static int felix_readphy(device_t, int, int); +static int felix_writephy(device_t, int, int, int); +static int felix_setvgroup(device_t, etherswitch_vlangroup_t *); +static int felix_getvgroup(device_t, etherswitch_vlangroup_t *); + +static int felix_parse_port_fdt(felix_softc_t, phandle_t, int *); +static int felix_setup(felix_softc_t); +static void felix_setup_port(felix_softc_t, int); + +static void felix_tick(void *); +static int felix_ifmedia_upd(struct ifnet *); +static void felix_ifmedia_sts(struct ifnet *, struct ifmediareq *); + +static void felix_get_port_cfg(felix_softc_t, etherswitch_port_t *); +static void felix_set_port_cfg(felix_softc_t, etherswitch_port_t *); + +static bool felix_is_phyport(felix_softc_t, int); +static struct mii_data *felix_miiforport(felix_softc_t, unsigned int); +static int felix_phyforport(felix_softc_t, int); + +static struct felix_pci_id felix_pci_ids[] = { + {PCI_VENDOR_FREESCALE, FELIX_DEV_ID, FELIX_DEV_NAME}, + {0, 0, NULL} +}; + +static device_method_t felix_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, felix_probe), + DEVMETHOD(device_attach, felix_attach), + DEVMETHOD(device_detach, felix_detach), + + /* bus interface */ + DEVMETHOD(bus_add_child, device_add_child_ordered), + + /* etherswitch interface */ + DEVMETHOD(etherswitch_getinfo, felix_getinfo), + DEVMETHOD(etherswitch_getconf, felix_getconf), + DEVMETHOD(etherswitch_setconf, felix_setconf), + DEVMETHOD(etherswitch_lock, felix_lock), + DEVMETHOD(etherswitch_unlock, felix_unlock), + DEVMETHOD(etherswitch_getport, felix_getport), + DEVMETHOD(etherswitch_setport, felix_setport), + DEVMETHOD(etherswitch_readreg, felix_readreg_wrapper), + DEVMETHOD(etherswitch_writereg, felix_writereg_wrapper), + DEVMETHOD(etherswitch_readphyreg, felix_readphy), + DEVMETHOD(etherswitch_writephyreg, felix_writephy), + DEVMETHOD(etherswitch_setvgroup, felix_setvgroup), + DEVMETHOD(etherswitch_getvgroup, felix_getvgroup), + + DEVMETHOD_END +}; + +static devclass_t felix_devclass; +DEFINE_CLASS_0(felix, felix_driver, felix_methods, + sizeof(struct felix_softc)); + +DRIVER_MODULE(felix, pci, felix_driver, felix_devclass, NULL, NULL); +DRIVER_MODULE(etherswitch, felix, etherswitch_driver, etherswitch_devclass, + NULL, NULL); +MODULE_VERSION(felix, 1); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, felix, + felix_pci_ids, nitems(felix_pci_ids) - 1); + +static int +felix_probe(device_t dev) +{ + struct felix_pci_id *id; + felix_softc_t sc; + + sc = device_get_softc(dev); + sc->dev = dev; + + for (id = felix_pci_ids; id->vendor != 0; ++id) { + if (pci_get_device(dev) != id->device || + pci_get_vendor(dev) != id->vendor) + continue; + + device_set_desc(dev, id->desc); + + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +felix_parse_port_fdt(felix_softc_t sc, phandle_t child, int *pport) +{ + uint32_t port, status; + phandle_t node; + + if (OF_getencprop(child, "reg", (void *)&port, sizeof(port)) < 0) { + device_printf(sc->dev, "Port node doesn't have reg property\n"); + return (ENXIO); + } + + *pport = port; + + node = OF_getproplen(child, "ethernet"); + if (node <= 0) + sc->ports[port].cpu_port = false; + else + sc->ports[port].cpu_port = true; + + node = ofw_bus_find_child(child, "fixed-link"); + if (node <= 0) { + sc->ports[port].fixed_port = false; + return (0); + } + + sc->ports[port].fixed_port = true;; + + if (OF_getencprop(node, "speed", &status, sizeof(status)) <= 0) { + device_printf(sc->dev, + "Port has fixed-link node without link speed specified\n"); + return (ENXIO); + } + + switch (status) { + case 2500: + status = IFM_2500_T; + break; + case 1000: + status = IFM_1000_T; + break; + case 100: + status = IFM_100_T; + break; + case 10: + status = IFM_10_T; + break; + default: + device_printf(sc->dev, + "Unsupported link speed value of %d\n", + status); + return (ENXIO); + } + + if (OF_hasprop(node, "full-duplex")) + status |= IFM_FDX; + else + status |= IFM_HDX; + + status |= IFM_ETHER; + sc->ports[port].fixed_link_status = status; + return (0); +} + +static int +felix_init_interface(felix_softc_t sc, int port) +{ + char name[IFNAMSIZ]; + + snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->dev)); + + sc->ports[port].ifp = if_alloc(IFT_ETHER); + if (sc->ports[port].ifp == NULL) + return (ENOMEM); + + sc->ports[port].ifp->if_softc = sc; + sc->ports[port].ifp->if_flags = IFF_UP | IFF_BROADCAST | IFF_MULTICAST | + IFF_DRV_RUNNING | IFF_SIMPLEX; + sc->ports[port].ifname = malloc(strlen(name) + 1, M_FELIX, M_NOWAIT); + if (sc->ports[port].ifname == NULL) { + if_free(sc->ports[port].ifp); + return (ENOMEM); + } + + memcpy(sc->ports[port].ifname, name, strlen(name) + 1); + if_initname(sc->ports[port].ifp, sc->ports[port].ifname, port); + return (0); +} + +static void +felix_setup_port(felix_softc_t sc, int port) +{ + + /* Link speed has to be always set to 1000 in the clock register. */ + FELIX_DEVGMII_PORT_WR4(sc, port, FELIX_DEVGMII_CLK_CFG, + FELIX_DEVGMII_CLK_CFG_SPEED_1000); + FELIX_DEVGMII_PORT_WR4(sc, port, FELIX_DEVGMII_MAC_CFG, + FELIX_DEVGMII_MAC_CFG_TX_ENA | FELIX_DEVGMII_MAC_CFG_RX_ENA); + FELIX_WR4(sc, FELIX_QSYS_PORT_MODE(port), + FELIX_QSYS_PORT_MODE_PORT_ENA); + + /* + * Enable "VLANMTU". Each port has a configurable MTU. + * Accept frames that are 8 and 4 bytes longer than it + * for double and single tagged frames respectively. + * Since etherswitch API doesn't provide an option to change + * MTU don't touch it for now. + */ + FELIX_DEVGMII_PORT_WR4(sc, port, FELIX_DEVGMII_VLAN_CFG, + FELIX_DEVGMII_VLAN_CFG_ENA | + FELIX_DEVGMII_VLAN_CFG_LEN_ENA | + FELIX_DEVGMII_VLAN_CFG_DOUBLE_ENA); +} + +static int +felix_setup(felix_softc_t sc) +{ + int timeout, i; + uint32_t reg; + + /* Trigger soft reset, bit is self-clearing, with 5s timeout. */ + FELIX_WR4(sc, FELIX_DEVCPU_GCB_RST, FELIX_DEVCPU_GCB_RST_EN); + timeout = FELIX_INIT_TIMEOUT; + do { + DELAY(1000); + reg = FELIX_RD4(sc, FELIX_DEVCPU_GCB_RST); + if ((reg & FELIX_DEVCPU_GCB_RST_EN) == 0) + break; + } while (timeout-- > 0); + if (timeout == 0) { + device_printf(sc->dev, + "Timeout while waiting for switch to reset\n"); + return (ETIMEDOUT); + } + + FELIX_WR4(sc, FELIX_SYS_RAM_CTRL, FELIX_SYS_RAM_CTRL_INIT); + timeout = FELIX_INIT_TIMEOUT; + do { + DELAY(1000); + reg = FELIX_RD4(sc, FELIX_SYS_RAM_CTRL); + if ((reg & FELIX_SYS_RAM_CTRL_INIT) == 0) + break; + } while (timeout-- > 0); + if (timeout == 0) { + device_printf(sc->dev, + "Timeout while waiting for switch RAM init.\n"); + return (ETIMEDOUT); + } + + FELIX_WR4(sc, FELIX_SYS_CFG, FELIX_SYS_CFG_CORE_EN); + + for (i = 0; i < sc->info.es_nports; i++) + felix_setup_port(sc, i); + + return (0); +} + +static int +felix_attach(device_t dev) +{ + phandle_t child, ports, node; + int error, port, rid; + felix_softc_t sc; + device_t mdio_dev; + uint32_t phy_addr; + ssize_t size; + + sc = device_get_softc(dev); + sc->info.es_nports = 0; + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q; + strlcpy(sc->info.es_name, "Felix TSN Switch", sizeof(sc->info.es_name)); + + rid = PCIR_BAR(FELIX_BAR_REGS); + sc->regs = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->regs == NULL) { + device_printf(dev, "Failed to allocate registers BAR.\n"); + return (ENXIO); + } + + mtx_init(&sc->mtx, "felix lock", NULL, MTX_DEF); + callout_init_mtx(&sc->tick_callout, &sc->mtx, 0); + + node = ofw_bus_get_node(dev); + if (node <= 0) { + error = ENXIO; + goto out_fail; + } + + ports = ofw_bus_find_child(node, "ports"); + if (ports == 0) { + device_printf(dev, + "Failed to find \"ports\" property in DTS.\n"); + error = ENXIO; + goto out_fail; + } + + for (child = OF_child(ports); child != 0; child = OF_peer(child)) { + /* Do not parse disabled ports. */ + if (ofw_bus_node_status_okay(child) == 0) + continue; + + error = felix_parse_port_fdt(sc, child, &port); + if (error != 0) + goto out_fail; + + error = felix_init_interface(sc, port); + if (error != 0) { + device_printf(sc->dev, + "Failed to initialize interface.\n"); + goto out_fail; + } + + if (sc->ports[port].fixed_port) { + sc->info.es_nports++; + continue; + } + + size = OF_getencprop(child, "phy-handle", &node, sizeof(node)); + if (size <= 0) { + device_printf(sc->dev, + "Failed to acquire PHY handle from FDT.\n"); + error = ENXIO; + goto out_fail; + } + + node = OF_node_from_xref(node); + size = OF_getencprop(node, "reg", &phy_addr, sizeof(phy_addr)); + if (size <= 0) { + device_printf(sc->dev, + "Failed to obtain PHY address.\n"); + error = ENXIO; + goto out_fail; + } + + node = OF_parent(node); + if (node <= 0) { + device_printf(sc->dev, + "Failed to obtain MDIO node.\n"); + error = ENXIO; + goto out_fail; + } + + mdio_dev = OF_device_from_xref(node); + if (mdio_dev == NULL) { + device_printf(sc->dev, + "Failed to obtain MDIO driver handle.\n"); + error = ENXIO; + goto out_fail; + } + + sc->ports[port].phyaddr = phy_addr; + sc->ports[port].miibus = NULL; + error = mii_attach(mdio_dev, &sc->ports[port].miibus, sc->ports[port].ifp, + felix_ifmedia_upd, felix_ifmedia_sts, BMSR_DEFCAPMASK, + phy_addr, MII_OFFSET_ANY, 0); + if (error != 0) + goto out_fail; + + sc->info.es_nports++; + } + + error = felix_setup(sc); + if (error != 0) + goto out_fail; + + /* The tick routine has to be called with the lock held. */ + FELIX_LOCK(sc); + felix_tick(sc); + FELIX_UNLOCK(sc); + + /* Allow etherswitch to attach as our child. */ + bus_generic_probe(dev); + bus_generic_attach(dev); + + return (0); + +out_fail: + felix_detach(dev); + return (error); +} + +static int +felix_detach(device_t dev) +{ + felix_softc_t sc; + device_t mdio_dev; + int error; + int i; + + error = 0; + sc = device_get_softc(dev); + bus_generic_detach(dev); + + mtx_lock(&sc->mtx); + callout_stop(&sc->tick_callout); + mtx_unlock(&sc->mtx); + mtx_destroy(&sc->mtx); + + /* + * If we have been fully attached do a soft reset. + * This way after when driver is unloaded switch is left in unmanaged mode. + */ + if (device_is_attached(dev)) + felix_setup(sc); + + for (i = 0; i < sc->info.es_nports; i++) { + if (sc->ports[i].miibus != NULL) { + mdio_dev = device_get_parent(sc->ports[i].miibus); + device_delete_child(mdio_dev, sc->ports[i].miibus); + } + if (sc->ports[i].ifp != NULL) + if_free(sc->ports[i].ifp); + if (sc->ports[i].ifname != NULL) + free(sc->ports[i].ifname, M_FELIX); + } + + if (sc->regs != NULL) + error = bus_release_resource(sc->dev, SYS_RES_MEMORY, + rman_get_rid(sc->regs), sc->regs); + + return (error); +} + +static etherswitch_info_t* +felix_getinfo(device_t dev) +{ + felix_softc_t sc; + + sc = device_get_softc(dev); + return (&sc->info); +} + +static int +felix_getconf(device_t dev, etherswitch_conf_t *conf) +{ + felix_softc_t sc; + + sc = device_get_softc(dev); + + /* Return the VLAN mode. */ + conf->cmd = ETHERSWITCH_CONF_VLAN_MODE; + conf->vlan_mode = sc->vlan_mode; + return (0); +} + +static int +felix_init_vlan(felix_softc_t sc) +{ + int timeout = FELIX_INIT_TIMEOUT; + uint32_t reg; + int i; + + /* Flush VLAN table in hardware. */ + FELIX_WR4(sc, FELIX_ANA_VT, FELIX_ANA_VT_RESET); + do { + DELAY(1000); + reg = FELIX_RD4(sc, FELIX_ANA_VT); + if ((reg & FELIX_ANA_VT_STS) == FELIX_ANA_VT_IDLE) + break; + } while (timeout-- > 0); + if (timeout == 0) { + device_printf(sc->dev, + "Timeout during VLAN table reset.\n"); + return (ETIMEDOUT); + } + + /* Flush VLAN table in sc. */ + for (i = 0; i < sc->info.es_nvlangroups; i++) + sc->vlans[i] = 0; + + /* + * Make all ports VLAN aware. + * Read VID from incoming frames and use it for port grouping + * purposes. + * Don't set this if pvid is set. + */ + for (i = 0; i < sc->info.es_nports; i++) { + reg = FELIX_ANA_PORT_RD4(sc, i, FELIX_ANA_PORT_VLAN_CFG); + if ((reg & FELIX_ANA_PORT_VLAN_CFG_VID_MASK) != 0) + continue; + + reg |= FELIX_ANA_PORT_VLAN_CFG_VID_AWARE; + FELIX_ANA_PORT_WR4(sc, i, FELIX_ANA_PORT_VLAN_CFG, reg); + } + return (0); +} + +static int +felix_setconf(device_t dev, etherswitch_conf_t *conf) +{ + felix_softc_t sc; + int error; + + error = 0; + /* Set the VLAN mode. */ + sc = device_get_softc(dev); + FELIX_LOCK(sc); + if (conf->cmd & ETHERSWITCH_CONF_VLAN_MODE) { + switch (conf->vlan_mode) { + case ETHERSWITCH_VLAN_DOT1Q: + sc->vlan_mode = ETHERSWITCH_VLAN_DOT1Q; + sc->info.es_nvlangroups = FELIX_NUM_VLANS; + error = felix_init_vlan(sc); + break; + default: + error = EINVAL; + } + } + FELIX_UNLOCK(sc); + return (error); +} + +static void +felix_lock(device_t dev) +{ + felix_softc_t sc; + + sc = device_get_softc(dev); + FELIX_LOCK_ASSERT(sc, MA_NOTOWNED); + FELIX_LOCK(sc); +} + +static void +felix_unlock(device_t dev) +{ + felix_softc_t sc; + + sc = device_get_softc(dev); + FELIX_LOCK_ASSERT(sc, MA_OWNED); + FELIX_UNLOCK(sc); +} + +static void +felix_get_port_cfg(felix_softc_t sc, etherswitch_port_t *p) +{ + uint32_t reg; + + p->es_flags = 0; + + reg = FELIX_ANA_PORT_RD4(sc, p->es_port, FELIX_ANA_PORT_DROP_CFG); + if (reg & FELIX_ANA_PORT_DROP_CFG_TAGGED) + p->es_flags |= ETHERSWITCH_PORT_DROPTAGGED; + + if (reg & FELIX_ANA_PORT_DROP_CFG_UNTAGGED) + p->es_flags |= ETHERSWITCH_PORT_DROPUNTAGGED; + + reg = FELIX_DEVGMII_PORT_RD4(sc, p->es_port, FELIX_DEVGMII_VLAN_CFG); + if (reg & FELIX_DEVGMII_VLAN_CFG_DOUBLE_ENA) + p->es_flags |= ETHERSWITCH_PORT_DOUBLE_TAG; + + reg = FELIX_REW_PORT_RD4(sc, p->es_port, FELIX_REW_PORT_TAG_CFG); + if (reg & FELIX_REW_PORT_TAG_CFG_ALL) + p->es_flags |= ETHERSWITCH_PORT_ADDTAG; + + reg = FELIX_ANA_PORT_RD4(sc, p->es_port, FELIX_ANA_PORT_VLAN_CFG); + if (reg & FELIX_ANA_PORT_VLAN_CFG_POP) + p->es_flags |= ETHERSWITCH_PORT_STRIPTAGINGRESS; + + p->es_pvid = reg & FELIX_ANA_PORT_VLAN_CFG_VID_MASK; +} + +static int +felix_getport(device_t dev, etherswitch_port_t *p) +{ + struct ifmediareq *ifmr; + struct mii_data *mii; + felix_softc_t sc; + int error; + + error = 0; + sc = device_get_softc(dev); + FELIX_LOCK_ASSERT(sc, MA_NOTOWNED); + + if (p->es_port >= sc->info.es_nports || p->es_port < 0) + return (EINVAL); + + FELIX_LOCK(sc); + felix_get_port_cfg(sc, p); + if (sc->ports[p->es_port].fixed_port) { + ifmr = &p->es_ifmr; + ifmr->ifm_status = IFM_ACTIVE | IFM_AVALID; + ifmr->ifm_count = 0; + ifmr->ifm_active = sc->ports[p->es_port].fixed_link_status; + ifmr->ifm_current = ifmr->ifm_active; + ifmr->ifm_mask = 0; + } else { + mii = felix_miiforport(sc, p->es_port); + error = ifmedia_ioctl(mii->mii_ifp, &p->es_ifr, + &mii->mii_media, SIOCGIFMEDIA); + } + FELIX_UNLOCK(sc); + return (error); +} + +static void +felix_set_port_cfg(felix_softc_t sc, etherswitch_port_t *p) +{ + uint32_t reg; + + reg = FELIX_ANA_PORT_RD4(sc, p->es_port, FELIX_ANA_PORT_DROP_CFG); + if (p->es_flags & ETHERSWITCH_PORT_DROPTAGGED) + reg |= FELIX_ANA_PORT_DROP_CFG_TAGGED; + else + reg &= ~FELIX_ANA_PORT_DROP_CFG_TAGGED; + + if (p->es_flags & ETHERSWITCH_PORT_DROPUNTAGGED) + reg |= FELIX_ANA_PORT_DROP_CFG_UNTAGGED; + else + reg &= ~FELIX_ANA_PORT_DROP_CFG_UNTAGGED; + + FELIX_ANA_PORT_WR4(sc, p->es_port, FELIX_ANA_PORT_DROP_CFG, reg); + + reg = FELIX_REW_PORT_RD4(sc, p->es_port, FELIX_REW_PORT_TAG_CFG); + if (p->es_flags & ETHERSWITCH_PORT_ADDTAG) + reg |= FELIX_REW_PORT_TAG_CFG_ALL; + else + reg &= ~FELIX_REW_PORT_TAG_CFG_ALL; + + FELIX_REW_PORT_WR4(sc, p->es_port, FELIX_REW_PORT_TAG_CFG, reg); + + reg = FELIX_ANA_PORT_RD4(sc, p->es_port, FELIX_ANA_PORT_VLAN_CFG); + if (p->es_flags & ETHERSWITCH_PORT_STRIPTAGINGRESS) + reg |= FELIX_ANA_PORT_VLAN_CFG_POP; + else + reg &= ~FELIX_ANA_PORT_VLAN_CFG_POP; + + reg &= ~FELIX_ANA_PORT_VLAN_CFG_VID_MASK; + reg |= p->es_pvid & FELIX_ANA_PORT_VLAN_CFG_VID_MASK; + /* + * If port VID is set use it for VLAN classification, + * instead of frame VID. + * By default the frame tag takes precedence. + * Force the switch to ignore it. + */ + if (p->es_pvid != 0) + reg &= ~FELIX_ANA_PORT_VLAN_CFG_VID_AWARE; + else + reg |= FELIX_ANA_PORT_VLAN_CFG_VID_AWARE; + + FELIX_ANA_PORT_WR4(sc, p->es_port, FELIX_ANA_PORT_VLAN_CFG, reg); +} + +static int +felix_setport(device_t dev, etherswitch_port_t *p) +{ + felix_softc_t sc; + struct mii_data *mii; + int error; + + error = 0; + sc = device_get_softc(dev); + FELIX_LOCK_ASSERT(sc, MA_NOTOWNED); + + if (p->es_port >= sc->info.es_nports || p->es_port < 0) + return (EINVAL); + + FELIX_LOCK(sc); + felix_set_port_cfg(sc, p); + if (felix_is_phyport(sc, p->es_port)) { + mii = felix_miiforport(sc, p->es_port); + error = ifmedia_ioctl(mii->mii_ifp, &p->es_ifr, &mii->mii_media, + SIOCSIFMEDIA); + } + FELIX_UNLOCK(sc); + + return (error); +} + +static int +felix_readreg_wrapper(device_t dev, int addr_reg) +{ + felix_softc_t sc; + + sc = device_get_softc(dev); + if (addr_reg > rman_get_size(sc->regs)) + return (UINT32_MAX); /* Can't return errors here. */ + + return (FELIX_RD4(sc, addr_reg)); +} + +static int +felix_writereg_wrapper(device_t dev, int addr_reg, int val) +{ + felix_softc_t sc; + + sc = device_get_softc(dev); + if (addr_reg > rman_get_size(sc->regs)) + return (EINVAL); + + FELIX_WR4(sc, addr_reg, val); + return (0); +} + +static int +felix_readphy(device_t dev, int phy, int reg) +{ + felix_softc_t sc; + device_t mdio_dev; + int port; + + sc = device_get_softc(dev); + port = felix_phyforport(sc, phy); + if (port < 0) + return (UINT32_MAX); /* Can't return errors here. */ + + mdio_dev = device_get_parent(sc->ports[port].miibus); + return (MIIBUS_READREG(mdio_dev, phy, reg)); +} + +static int +felix_writephy(device_t dev, int phy, int reg, int data) +{ + felix_softc_t sc; + device_t mdio_dev; + int port; + + sc = device_get_softc(dev); + port = felix_phyforport(sc, phy); + if (port < 0) + return (ENXIO); + + mdio_dev = device_get_parent(sc->ports[port].miibus); + return (MIIBUS_WRITEREG(mdio_dev, phy, reg, data)); +} + +static int +felix_set_dot1q_vlan(felix_softc_t sc, etherswitch_vlangroup_t *vg) +{ + uint32_t reg; + int i, vid; + + vid = vg->es_vid & ETHERSWITCH_VID_MASK; + + /* Tagged mode is not supported. */ + if (vg->es_member_ports != vg->es_untagged_ports) + return (EINVAL); + + /* + * Hardware support 4096 groups, but we can't do group_id == vid. + * Note that hw_group_id == vid. + */ + if (vid == 0) { + /* Clear VLAN table entry using old VID. */ + FELIX_WR4(sc, FELIX_ANA_VTIDX, sc->vlans[vg->es_vlangroup]); + FELIX_WR4(sc, FELIX_ANA_VT, FELIX_ANA_VT_WRITE); + sc->vlans[vg->es_vlangroup] = 0; + return (0); + } + + /* The VID is already used in a different group. */ + for (i = 0; i < sc->info.es_nvlangroups; i++) + if (i != vg->es_vlangroup && vid == sc->vlans[i]) + return (EINVAL); + + /* This group already uses a different VID. */ + if (sc->vlans[vg->es_vlangroup] != 0 && + sc->vlans[vg->es_vlangroup] != vid) + return (EINVAL); + + sc->vlans[vg->es_vlangroup] = vid; + + /* Assign members to the given group. */ + reg = vg->es_member_ports & FELIX_ANA_VT_PORTMASK_MASK; + reg <<= FELIX_ANA_VT_PORTMASK_SHIFT; + reg |= FELIX_ANA_VT_WRITE; + + FELIX_WR4(sc, FELIX_ANA_VTIDX, vid); + FELIX_WR4(sc, FELIX_ANA_VT, reg); + + /* + * According to documentation read and write commands *** 440 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Tue Aug 3 10:08:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEB27634FDB; Tue, 3 Aug 2021 10:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gf9YG5Dc0z3PyL; Tue, 3 Aug 2021 10:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F18B10EFE; Tue, 3 Aug 2021 10:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173A82ao096645; Tue, 3 Aug 2021 10:08:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173A82or096644; Tue, 3 Aug 2021 10:08:02 GMT (envelope-from git) Date: Tue, 3 Aug 2021 10:08:02 GMT Message-Id: <202108031008.173A82or096644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: bfce69ae9a07 - main - dtb: freescale: Add fsl-ls1028a-rdb to the build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bfce69ae9a0731f87574fcbe96f14e5f8e77f036 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 10:08:02 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=bfce69ae9a0731f87574fcbe96f14e5f8e77f036 commit bfce69ae9a0731f87574fcbe96f14e5f8e77f036 Author: Kornel Duleba AuthorDate: 2021-06-23 12:56:34 +0000 Commit: Marcin Wojtas CommitDate: 2021-08-03 10:07:49 +0000 dtb: freescale: Add fsl-ls1028a-rdb to the build With the recent inclusion of ENETC networking driver we now support this board. Obtained from: Semihalf Sponsored by: Alstom Group --- sys/modules/dtb/freescale/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/modules/dtb/freescale/Makefile b/sys/modules/dtb/freescale/Makefile index 4f211ad53357..77602c4f5ef1 100644 --- a/sys/modules/dtb/freescale/Makefile +++ b/sys/modules/dtb/freescale/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ # All the dts files for Freescale (now NXP) systems we support. -DTS= freescale/fsl-lx2160a-clearfog-cx.dts \ +DTS= freescale/fsl-ls1028a-rdb.dts \ + freescale/fsl-lx2160a-clearfog-cx.dts \ freescale/fsl-lx2160a-honeycomb.dts \ freescale/fsl-lx2160a-qds.dts \ freescale/fsl-lx2160a-rdb.dts From owner-dev-commits-src-main@freebsd.org Tue Aug 3 10:08:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0007C635803; Tue, 3 Aug 2021 10:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gf9YH6C4rz3Ppf; Tue, 3 Aug 2021 10:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B65891157C; Tue, 3 Aug 2021 10:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173A83JM096671; Tue, 3 Aug 2021 10:08:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173A83HA096670; Tue, 3 Aug 2021 10:08:03 GMT (envelope-from git) Date: Tue, 3 Aug 2021 10:08:03 GMT Message-Id: <202108031008.173A83HA096670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 5ad6d28cbe6b - main - enetc: Support building the driver as a loadable module. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ad6d28cbe6b3ff85e49607a7e04cb68db3ed6df Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 10:08:04 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=5ad6d28cbe6b3ff85e49607a7e04cb68db3ed6df commit 5ad6d28cbe6b3ff85e49607a7e04cb68db3ed6df Author: Kornel Duleba AuthorDate: 2021-07-28 09:23:23 +0000 Commit: Marcin Wojtas CommitDate: 2021-08-03 10:07:49 +0000 enetc: Support building the driver as a loadable module. Function level reset has to be done in attach in order to put the hardware in a known state before configuring it. The order of DRIVER_MODULEs was changed to ensure that the miibus driver is loaded when mii_attach is called. Obtained from: Semihalf Sponsored by: Alstom Group --- sys/dev/enetc/if_enetc.c | 6 +++++- sys/modules/Makefile | 2 ++ sys/modules/enetc/Makefile | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c index 54cdc6ea9ad4..46327eb419bf 100644 --- a/sys/dev/enetc/if_enetc.c +++ b/sys/dev/enetc/if_enetc.c @@ -158,8 +158,8 @@ static driver_t enetc_driver = { }; static devclass_t enetc_devclass; -DRIVER_MODULE(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL); DRIVER_MODULE(miibus, enetc, miibus_driver, miibus_devclass, NULL, NULL); +DRIVER_MODULE(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL); MODULE_VERSION(enetc, 1); IFLIB_PNP_INFO(pci, enetc, enetc_vendor_info_array); @@ -366,6 +366,10 @@ enetc_attach_pre(if_ctx_t ctx) sc->shared = scctx; ifp = iflib_get_ifp(ctx); + pci_save_state(sc->dev); + pcie_flr(sc->dev, 1000, false); + pci_restore_state(sc->dev); + rid = PCIR_BAR(ENETC_BAR_REGS); sc->regs = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->regs == NULL) { diff --git a/sys/modules/Makefile b/sys/modules/Makefile index e6e683ecd65e..0ba139977968 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -111,6 +111,7 @@ SUBDIR= \ ${_efirt} \ ${_em} \ ${_ena} \ + ${_enetc} \ esp \ ${_et} \ evdev \ @@ -612,6 +613,7 @@ _allwinner= allwinner _armv8crypto= armv8crypto _dwwdt= dwwdt _em= em +_enetc= enetc _felix= felix _rockchip= rockchip .endif diff --git a/sys/modules/enetc/Makefile b/sys/modules/enetc/Makefile new file mode 100644 index 000000000000..694ec2043f37 --- /dev/null +++ b/sys/modules/enetc/Makefile @@ -0,0 +1,8 @@ +#$FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/enetc + +KMOD = if_enetc +SRCS = if_enetc.c enetc_mdio.c + +.include From owner-dev-commits-src-main@freebsd.org Tue Aug 3 10:08:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62E4A63537D; Tue, 3 Aug 2021 10:08:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gf9YK0vBqz3Ppn; Tue, 3 Aug 2021 10:08:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C173710EFF; Tue, 3 Aug 2021 10:08:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173A84U4096695; Tue, 3 Aug 2021 10:08:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173A84BG096694; Tue, 3 Aug 2021 10:08:04 GMT (envelope-from git) Date: Tue, 3 Aug 2021 10:08:04 GMT Message-Id: <202108031008.173A84BG096694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: dfcaa2c18bf9 - main - enetc_mdio: Support building the driver as a loadable module. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dfcaa2c18bf9c69b94d531364f8913b23f19505f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 10:08:05 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=dfcaa2c18bf9c69b94d531364f8913b23f19505f commit dfcaa2c18bf9c69b94d531364f8913b23f19505f Author: Kornel Duleba AuthorDate: 2021-07-28 11:38:53 +0000 Commit: Marcin Wojtas CommitDate: 2021-08-03 10:07:49 +0000 enetc_mdio: Support building the driver as a loadable module. After recent arm64 GENERIC config cleanup the ENETC MDIO in NXP LS1028A SoC should support being loaded as a module. Obtained from: Semihalf Sponsored by: Alstom Group --- sys/conf/files.arm64 | 4 ++-- sys/dev/enetc/enetc_mdio_pci.c | 8 ++++---- sys/dev/etherswitch/felix/felix.c | 2 ++ sys/modules/Makefile | 2 ++ sys/modules/enetc_mdio/Makefile | 8 ++++++++ 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index bfa03dade1db..5cd1fa396171 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -175,8 +175,8 @@ dev/cpufreq/cpufreq_dt.c optional cpufreq fdt dev/dwc/if_dwc.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 | fdt dwc_socfpga soc_intel_stratix10 dev/dwc/if_dwc_if.m optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 | fdt dwc_socfpga soc_intel_stratix10 -dev/enetc/enetc_mdio.c optional enetc soc_nxp_ls -dev/enetc/enetc_mdio_pci.c optional enetc pci soc_nxp_ls +dev/enetc/enetc_mdio.c optional enetc soc_nxp_ls | enetc_mdio soc_nxp_ls +dev/enetc/enetc_mdio_pci.c optional enetc_mdio pci soc_nxp_ls dev/enetc/if_enetc.c optional enetc iflib pci fdt soc_nxp_ls dev/etherswitch/felix/felix.c optional enetc etherswitch fdt felix pci soc_nxp_ls diff --git a/sys/dev/enetc/enetc_mdio_pci.c b/sys/dev/enetc/enetc_mdio_pci.c index 0fd540008e57..aac236d1c246 100644 --- a/sys/dev/enetc/enetc_mdio_pci.c +++ b/sys/dev/enetc/enetc_mdio_pci.c @@ -159,7 +159,7 @@ enetc_mdio_pci_detach(device_t dev) sc = device_get_softc(dev); - bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_regs); + bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->sc_regs); mtx_destroy(&sc->sc_lock); return (0); @@ -184,8 +184,8 @@ static driver_t enetc_mdio_pci_driver = { static devclass_t enetc_mdio_pci_devclass; -DRIVER_MODULE(enetc_mdio_pci, pci, enetc_mdio_pci_driver, +DRIVER_MODULE(enetc_mdio, pci, enetc_mdio_pci_driver, enetc_mdio_pci_devclass, 0, 0); -DRIVER_MODULE(miibus, enetc_mdio_pci, miibus_driver, miibus_devclass, +DRIVER_MODULE(miibus, enetc_mdio, miibus_driver, miibus_devclass, 0, 0); -MODULE_VERSION(enetc_mdio_pci, 1); +MODULE_VERSION(enetc_mdio, 1); diff --git a/sys/dev/etherswitch/felix/felix.c b/sys/dev/etherswitch/felix/felix.c index 140811807586..1cd1e0e29ca7 100644 --- a/sys/dev/etherswitch/felix/felix.c +++ b/sys/dev/etherswitch/felix/felix.c @@ -138,6 +138,8 @@ MODULE_VERSION(felix, 1); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, felix, felix_pci_ids, nitems(felix_pci_ids) - 1); +MODULE_DEPEND(felix, enetc_mdio, 1, 1, 1); + static int felix_probe(device_t dev) { diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 0ba139977968..fdaea7fa4ec9 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -112,6 +112,7 @@ SUBDIR= \ ${_em} \ ${_ena} \ ${_enetc} \ + ${_enetc_mdio} \ esp \ ${_et} \ evdev \ @@ -614,6 +615,7 @@ _armv8crypto= armv8crypto _dwwdt= dwwdt _em= em _enetc= enetc +_enetc_mdio= enetc_mdio _felix= felix _rockchip= rockchip .endif diff --git a/sys/modules/enetc_mdio/Makefile b/sys/modules/enetc_mdio/Makefile new file mode 100644 index 000000000000..f448fc526705 --- /dev/null +++ b/sys/modules/enetc_mdio/Makefile @@ -0,0 +1,8 @@ +#$FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/enetc + +KMOD = enetc_mdio +SRCS = enetc_mdio_pci.c enetc_mdio.c + +.include From owner-dev-commits-src-main@freebsd.org Tue Aug 3 10:11:15 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96888635A96; Tue, 3 Aug 2021 10:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gf9cz3pFkz3QZQ; Tue, 3 Aug 2021 10:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BE811191F; Tue, 3 Aug 2021 10:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173ABFE7005489; Tue, 3 Aug 2021 10:11:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173ABF3N005488; Tue, 3 Aug 2021 10:11:15 GMT (envelope-from git) Date: Tue, 3 Aug 2021 10:11:15 GMT Message-Id: <202108031011.173ABF3N005488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 29b4fa787621 - main - hdaa: add missing break in hdac_pin_patch(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29b4fa787621cbfb070323ecf2ea2da4d372bd94 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 10:11:15 -0000 The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=29b4fa787621cbfb070323ecf2ea2da4d372bd94 commit 29b4fa787621cbfb070323ecf2ea2da4d372bd94 Author: Gleb Smirnoff AuthorDate: 2021-08-03 10:06:16 +0000 Commit: Gleb Smirnoff CommitDate: 2021-08-03 10:09:32 +0000 hdaa: add missing break in hdac_pin_patch(). Fixes driver attach on my Thinkpad X1 Carbon, and likely on many other ALC family devices. Fixes: ef790cc7407e827db9563d08a52a71ab36436986 --- sys/dev/sound/pci/hda/hdaa_patches.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c index dc404b9ba98e..45577819e897 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -326,6 +326,7 @@ hdac_pin_patch(struct hdaa_widget *w) switch (patch->type) { case PIN_PATCH_TYPE_STRING: patch_str = patch->patch.string; + break; case PIN_PATCH_TYPE_MASK: config &= ~patch->patch.mask[0]; config |= patch->patch.mask[1]; From owner-dev-commits-src-main@freebsd.org Tue Aug 3 10:13:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45510635E01; Tue, 3 Aug 2021 10:13:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gf9h31SK6z3R3j; Tue, 3 Aug 2021 10:13:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A6ED119AD; Tue, 3 Aug 2021 10:13:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173ADtOT009947; Tue, 3 Aug 2021 10:13:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173ADtsD009946; Tue, 3 Aug 2021 10:13:55 GMT (envelope-from git) Date: Tue, 3 Aug 2021 10:13:55 GMT Message-Id: <202108031013.173ADtsD009946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: d3fd2cbbb7f9 - main - nl_NL.ISO8859-1: reinstall the missing LC_MESSAGES MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3fd2cbbb7f9be95025143500ce0a5378135ee1c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 10:13:55 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d3fd2cbbb7f9be95025143500ce0a5378135ee1c commit d3fd2cbbb7f9be95025143500ce0a5378135ee1c Author: Baptiste Daroussin AuthorDate: 2021-08-03 10:10:21 +0000 Commit: Baptiste Daroussin CommitDate: 2021-08-03 10:13:52 +0000 nl_NL.ISO8859-1: reinstall the missing LC_MESSAGES --- share/msgdef/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/share/msgdef/Makefile b/share/msgdef/Makefile index 497c094ffdd7..44f1ca316953 100644 --- a/share/msgdef/Makefile +++ b/share/msgdef/Makefile @@ -50,6 +50,7 @@ LOCALES+= nb_NO.ISO8859-15 LOCALES+= lt_LT.ISO8859-13 LOCALES+= pl_PL.ISO8859-2 +SAME+= nl_NL.ISO8859-15 nl_NL.ISO8859-1 SAME+= nl_NL.ISO8859-15 af_ZA.ISO8859-15 SAME+= nl_NL.ISO8859-15 af_ZA.ISO8859-1 SAME+= es_MX.ISO8859-1 es_ES.ISO8859-15 From owner-dev-commits-src-main@freebsd.org Tue Aug 3 12:27:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44F7963804C; Tue, 3 Aug 2021 12:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfDdd1CtMz3rdF; Tue, 3 Aug 2021 12:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1280D1307B; Tue, 3 Aug 2021 12:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173CR17E084658; Tue, 3 Aug 2021 12:27:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173CR1qN084657; Tue, 3 Aug 2021 12:27:01 GMT (envelope-from git) Date: Tue, 3 Aug 2021 12:27:01 GMT Message-Id: <202108031227.173CR1qN084657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 184d64af1344 - main - locales: stop hardcoding the directories in the mtree MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 184d64af1344d6f3c370499510cede49320f4863 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 12:27:01 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=184d64af1344d6f3c370499510cede49320f4863 commit 184d64af1344d6f3c370499510cede49320f4863 Author: Baptiste Daroussin AuthorDate: 2021-08-03 12:25:00 +0000 Commit: Baptiste Daroussin CommitDate: 2021-08-03 12:25:00 +0000 locales: stop hardcoding the directories in the mtree The framework knows how to create directories and tag them properly for a the creation of a mtree, not need to hardcode all the locales entries in bsd.usr.mk This simplifies addition of new locales but also allow people building with WITHOUT_LOCALES to end up with a directory full of empty files --- etc/mtree/BSD.usr.dist | 383 ----------------------------------- share/colldef/Makefile | 2 + share/colldef_unicode/Makefile | 2 + share/ctypedef/Makefile | 2 + share/monetdef/Makefile | 2 + share/monetdef_unicode/Makefile | 2 + share/msgdef/Makefile | 2 + share/msgdef_unicode/Makefile | 2 + share/numericdef/Makefile | 2 + share/numericdef_unicode/Makefile | 2 + share/timedef/Makefile | 2 + tools/tools/locale/tools/cldr2def.pl | 2 + 12 files changed, 22 insertions(+), 383 deletions(-) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 97d17cedb5a1..c96ec1ea5fb5 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -465,389 +465,6 @@ .. .. locale - af_ZA.ISO8859-1 - .. - af_ZA.ISO8859-15 - .. - af_ZA.UTF-8 - .. - ar_AE.UTF-8 - .. - ar_EG.UTF-8 - .. - ar_JO.UTF-8 - .. - ar_MA.UTF-8 - .. - ar_QA.UTF-8 - .. - ar_SA.UTF-8 - .. - am_ET.UTF-8 - .. - be_BY.CP1131 - .. - be_BY.CP1251 - .. - be_BY.ISO8859-5 - .. - be_BY.UTF-8 - .. - bg_BG.CP1251 - .. - bg_BG.UTF-8 - .. - ca_AD.ISO8859-1 - .. - ca_AD.ISO8859-15 - .. - ca_ES.ISO8859-1 - .. - ca_ES.ISO8859-15 - .. - ca_FR.ISO8859-1 - .. - ca_FR.ISO8859-15 - .. - ca_IT.ISO8859-1 - .. - ca_IT.ISO8859-15 - .. - ca_AD.UTF-8 - .. - ca_ES.UTF-8 - .. - ca_FR.UTF-8 - .. - ca_IT.UTF-8 - .. - cs_CZ.ISO8859-2 - .. - cs_CZ.UTF-8 - .. - da_DK.ISO8859-1 - .. - da_DK.ISO8859-15 - .. - da_DK.UTF-8 - .. - de_AT.ISO8859-1 - .. - de_AT.ISO8859-15 - .. - de_AT.UTF-8 - .. - de_CH.ISO8859-1 - .. - de_CH.ISO8859-15 - .. - de_CH.UTF-8 - .. - de_DE.ISO8859-1 - .. - de_DE.ISO8859-15 - .. - de_DE.UTF-8 - .. - el_GR.ISO8859-7 - .. - el_GR.UTF-8 - .. - en_AU.ISO8859-1 - .. - en_AU.ISO8859-15 - .. - en_AU.US-ASCII - .. - en_AU.UTF-8 - .. - en_CA.ISO8859-1 - .. - en_CA.ISO8859-15 - .. - en_CA.US-ASCII - .. - en_CA.UTF-8 - .. - en_GB.ISO8859-1 - .. - en_GB.ISO8859-15 - .. - en_GB.US-ASCII - .. - en_GB.UTF-8 - .. - en_HK.ISO8859-1 - .. - en_HK.UTF-8 - .. - en_IE.ISO8859-1 - .. - en_IE.ISO8859-15 - .. - en_IE.UTF-8 - .. - en_NZ.ISO8859-1 - .. - en_NZ.ISO8859-15 - .. - en_NZ.US-ASCII - .. - en_NZ.UTF-8 - .. - en_PH.UTF-8 - .. - en_SG.ISO8859-1 - .. - en_SG.UTF-8 - .. - en_US.ISO8859-1 - .. - en_US.ISO8859-15 - .. - en_US.US-ASCII - .. - en_US.UTF-8 - .. - en_ZA.ISO8859-1 - .. - en_ZA.ISO8859-15 - .. - en_ZA.US-ASCII - .. - en_ZA.UTF-8 - .. - es_AR.ISO8859-1 - .. - es_AR.UTF-8 - .. - es_CR.UTF-8 - .. - es_ES.ISO8859-1 - .. - es_ES.ISO8859-15 - .. - es_ES.UTF-8 - .. - es_MX.ISO8859-1 - .. - es_MX.UTF-8 - .. - et_EE.ISO8859-1 - .. - et_EE.ISO8859-15 - .. - et_EE.UTF-8 - .. - eu_ES.ISO8859-1 - .. - eu_ES.ISO8859-15 - .. - eu_ES.UTF-8 - .. - fi_FI.ISO8859-1 - .. - fi_FI.ISO8859-15 - .. - fi_FI.UTF-8 - .. - fr_BE.ISO8859-1 - .. - fr_BE.ISO8859-15 - .. - fr_BE.UTF-8 - .. - fr_CA.ISO8859-1 - .. - fr_CA.ISO8859-15 - .. - fr_CA.UTF-8 - .. - fr_CH.ISO8859-1 - .. - fr_CH.ISO8859-15 - .. - fr_CH.UTF-8 - .. - fr_FR.ISO8859-1 - .. - fr_FR.ISO8859-15 - .. - fr_FR.UTF-8 - .. - ga_IE.UTF-8 - .. - he_IL.UTF-8 - .. - hi_IN.ISCII-DEV - .. - hi_IN.UTF-8 - .. - hr_HR.ISO8859-2 - .. - hr_HR.UTF-8 - .. - hu_HU.ISO8859-2 - .. - hu_HU.UTF-8 - .. - hy_AM.ARMSCII-8 - .. - hy_AM.UTF-8 - .. - is_IS.ISO8859-1 - .. - is_IS.ISO8859-15 - .. - is_IS.UTF-8 - .. - it_CH.ISO8859-1 - .. - it_CH.ISO8859-15 - .. - it_CH.UTF-8 - .. - it_IT.ISO8859-1 - .. - it_IT.ISO8859-15 - .. - it_IT.UTF-8 - .. - ja_JP.SJIS - .. - ja_JP.UTF-8 - .. - ja_JP.eucJP - .. - kk_KZ.UTF-8 - .. - ko_KR.CP949 - .. - ko_KR.UTF-8 - .. - ko_KR.eucKR - .. - lt_LT.ISO8859-13 - .. - lt_LT.UTF-8 - .. - lv_LV.ISO8859-13 - .. - lv_LV.UTF-8 - .. - mn_MN.UTF-8 - .. - nb_NO.ISO8859-1 - .. - nb_NO.ISO8859-15 - .. - nb_NO.UTF-8 - .. - nl_BE.ISO8859-1 - .. - nl_BE.ISO8859-15 - .. - nl_BE.UTF-8 - .. - nl_NL.ISO8859-1 - .. - nl_NL.ISO8859-15 - .. - nl_NL.UTF-8 - .. - nn_NO.ISO8859-1 - .. - nn_NO.ISO8859-15 - .. - nn_NO.UTF-8 - .. - pl_PL.ISO8859-2 - .. - pl_PL.UTF-8 - .. - pt_BR.ISO8859-1 - .. - pt_BR.UTF-8 - .. - pt_PT.ISO8859-1 - .. - pt_PT.ISO8859-15 - .. - pt_PT.UTF-8 - .. - ro_RO.ISO8859-2 - .. - ro_RO.UTF-8 - .. - ru_RU.CP1251 - .. - ru_RU.CP866 - .. - ru_RU.ISO8859-5 - .. - ru_RU.KOI8-R - .. - ru_RU.UTF-8 - .. - se_FI.UTF-8 - .. - se_NO.UTF-8 - .. - sk_SK.ISO8859-2 - .. - sk_SK.UTF-8 - .. - sl_SI.ISO8859-2 - .. - sl_SI.UTF-8 - .. - sr_RS.ISO8859-5 - .. - sr_RS.UTF-8 - .. - sr_RS.ISO8859-2 - .. - sr_RS.UTF-8@latin - .. - sv_FI.ISO8859-1 - .. - sv_FI.ISO8859-15 - .. - sv_FI.UTF-8 - .. - sv_SE.ISO8859-1 - .. - sv_SE.ISO8859-15 - .. - sv_SE.UTF-8 - .. - tr_TR.ISO8859-9 - .. - tr_TR.UTF-8 - .. - uk_UA.CP1251 - .. - uk_UA.ISO8859-5 - .. - uk_UA.KOI8-U - .. - uk_UA.UTF-8 - .. - zh_CN.GB18030 - .. - zh_CN.GB2312 - .. - zh_CN.GBK - .. - zh_CN.eucCN - .. - zh_CN.UTF-8 - .. - zh_HK.UTF-8 - .. - zh_TW.Big5 - .. - zh_TW.UTF-8 .. .. man diff --git a/share/colldef/Makefile b/share/colldef/Makefile index 89454f84a5e4..15e84179c768 100644 --- a/share/colldef/Makefile +++ b/share/colldef/Makefile @@ -133,7 +133,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.LC_COLLATE/} CLEANFILES= ${FILES} +DIRS+= SAMEDIRS .for f t in ${SAME} +SAMEDIRS+= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/colldef_unicode/Makefile b/share/colldef_unicode/Makefile index e84d952a1316..4dd4bf78a36f 100644 --- a/share/colldef_unicode/Makefile +++ b/share/colldef_unicode/Makefile @@ -104,7 +104,9 @@ SAME+= zh_TW.UTF-8 zh_HK.UTF-8 FILES= ${LOCALES:S/$/.LC_COLLATE/} CLEANFILES= ${FILES} +DIRS+= SAMEDIRS .for f t in ${SAME} +SAMEDIRS+= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/ctypedef/Makefile b/share/ctypedef/Makefile index da580d72c32f..ad7eb237f3eb 100644 --- a/share/ctypedef/Makefile +++ b/share/ctypedef/Makefile @@ -215,7 +215,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.LC_CTYPE/} CLEANFILES= ${FILES} +DIRS+= SAMEDIRS .for f t in ${SAME} +SAMEDIRS+= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/monetdef/Makefile b/share/monetdef/Makefile index e5d861da468d..f0b34998f4bd 100644 --- a/share/monetdef/Makefile +++ b/share/monetdef/Makefile @@ -129,7 +129,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} +DIRS+= SAMEDIRS .for f t in ${SAME} +SAMEDIRS+= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/monetdef_unicode/Makefile b/share/monetdef_unicode/Makefile index 6eaab4f0ad94..4655c742669b 100644 --- a/share/monetdef_unicode/Makefile +++ b/share/monetdef_unicode/Makefile @@ -96,7 +96,9 @@ SAME+= sr_RS.UTF-8@latin sr_RS.UTF-8 FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} +DIRS+= SAMEDIRS .for f t in ${SAME} +SAMEDIRS+= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/msgdef/Makefile b/share/msgdef/Makefile index 44f1ca316953..9f0b7f2f3bcf 100644 --- a/share/msgdef/Makefile +++ b/share/msgdef/Makefile @@ -122,7 +122,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} +DIRS+= SAMEDIRS .for f t in ${SAME} +SAMEDIRS+= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/msgdef_unicode/Makefile b/share/msgdef_unicode/Makefile index 3f14010b9fa8..c0bffc05ccc6 100644 --- a/share/msgdef_unicode/Makefile +++ b/share/msgdef_unicode/Makefile @@ -96,7 +96,9 @@ SAME+= zh_TW.UTF-8 zh_HK.UTF-8 FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} +DIRS+= SAMEDIRS .for f t in ${SAME} +SAMEDIRS+= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/numericdef/Makefile b/share/numericdef/Makefile index 1742dd724d1c..f1047e9cb5d3 100644 --- a/share/numericdef/Makefile +++ b/share/numericdef/Makefile @@ -125,7 +125,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} +DIRS+= SAMEDIRS .for f t in ${SAME} +SAMEDIRS+= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/numericdef_unicode/Makefile b/share/numericdef_unicode/Makefile index c7568a4177fb..3f7f3e4f285e 100644 --- a/share/numericdef_unicode/Makefile +++ b/share/numericdef_unicode/Makefile @@ -96,7 +96,9 @@ SAME+= fr_FR.UTF-8 fr_BE.UTF-8 FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} +DIRS+= SAMEDIRS .for f t in ${SAME} +SAMEDIRS+= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/timedef/Makefile b/share/timedef/Makefile index 042f2f0e36f0..428e8067ae18 100644 --- a/share/timedef/Makefile +++ b/share/timedef/Makefile @@ -208,7 +208,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} +DIRS+= SAMEDIRS .for f t in ${SAME} +SAMEDIRS+= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/tools/tools/locale/tools/cldr2def.pl b/tools/tools/locale/tools/cldr2def.pl index 70e0bdad525b..277102d60a49 100755 --- a/tools/tools/locale/tools/cldr2def.pl +++ b/tools/tools/locale/tools/cldr2def.pl @@ -1081,7 +1081,9 @@ EOF FILES= \${LOCALES:S/\$/.${SRCOUT2}/} CLEANFILES= \${FILES} +DIRS+= SAMEDIRS .for f t in \${SAME} +SAMEDIRS+= \${LOCALEDIR}/\$t SYMLINKS+= ../\$f/\${FILESNAME} \\ \${LOCALEDIR}/\$t/\${FILESNAME} .endfor From owner-dev-commits-src-main@freebsd.org Tue Aug 3 12:39:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC343638263; Tue, 3 Aug 2021 12:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfDvt4gGxz3svR; Tue, 3 Aug 2021 12:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83C2E13627; Tue, 3 Aug 2021 12:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173CdMWK098395; Tue, 3 Aug 2021 12:39:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173CdMex098394; Tue, 3 Aug 2021 12:39:22 GMT (envelope-from git) Date: Tue, 3 Aug 2021 12:39:22 GMT Message-Id: <202108031239.173CdMex098394@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 8232bb385989 - main - locales: fix typo preventing installation of collation for ru_RU.CP866 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8232bb38598957b8bb4f3d13738a05e16b05387a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 12:39:22 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=8232bb38598957b8bb4f3d13738a05e16b05387a commit 8232bb38598957b8bb4f3d13738a05e16b05387a Author: Baptiste Daroussin AuthorDate: 2021-08-03 12:37:26 +0000 Commit: Baptiste Daroussin CommitDate: 2021-08-03 12:37:26 +0000 locales: fix typo preventing installation of collation for ru_RU.CP866 --- share/colldef/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/colldef/Makefile b/share/colldef/Makefile index 15e84179c768..765abf9747f3 100644 --- a/share/colldef/Makefile +++ b/share/colldef/Makefile @@ -18,7 +18,7 @@ LOCALES_MAPPED+= af_ZA.ISO8859-1 af_ZA.ISO8859-15 LOCALES_MAPPED+= be_BY.ISO8859-5 be_BY.CP1251 LOCALES_MAPPED+= be_BY.ISO8859-5 be_BY.CP1131 LOCALES_MAPPED+= ru_RU.KOI8-R ru_RU.ISO8859-5 -LOCALES_MAPPED+= ru_RU.KOI8-R RU.CP866 +LOCALES_MAPPED+= ru_RU.KOI8-R ru_RU.CP866 LOCALES_MAPPED+= ru_RU.KOI8-R ru_RU.CP1251 LOCALES_MAPPED+= ru_RU.KOI8-R bg_BG.CP1251 LOCALES_MAPPED+= ca_IT.ISO8859-15 ca_IT.ISO8859-1 From owner-dev-commits-src-main@freebsd.org Tue Aug 3 15:07:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2C0463A31C; Tue, 3 Aug 2021 15:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfJBv58qzz4jGy; Tue, 3 Aug 2021 15:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 962EB15164; Tue, 3 Aug 2021 15:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173F7ZDS004114; Tue, 3 Aug 2021 15:07:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173F7ZWr004113; Tue, 3 Aug 2021 15:07:35 GMT (envelope-from git) Date: Tue, 3 Aug 2021 15:07:35 GMT Message-Id: <202108031507.173F7ZWr004113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: c982a41a0c33 - main - mtree: remove a leftover '..' in BSD.usr.dist making it inconsistent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c982a41a0c33cee21f73f6589576f46c8fd497a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 15:07:35 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=c982a41a0c33cee21f73f6589576f46c8fd497a7 commit c982a41a0c33cee21f73f6589576f46c8fd497a7 Author: Baptiste Daroussin AuthorDate: 2021-08-03 15:05:37 +0000 Commit: Baptiste Daroussin CommitDate: 2021-08-03 15:06:31 +0000 mtree: remove a leftover '..' in BSD.usr.dist making it inconsistent Reported by: Michael Butler --- etc/mtree/BSD.usr.dist | 1 - 1 file changed, 1 deletion(-) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index c96ec1ea5fb5..121af3ffe857 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -465,7 +465,6 @@ .. .. locale - .. .. man man1 From owner-dev-commits-src-main@freebsd.org Tue Aug 3 15:22:18 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B3BF63A5D2; Tue, 3 Aug 2021 15:22:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfJWs6JhLz4nCZ; Tue, 3 Aug 2021 15:22:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B35FF15D85; Tue, 3 Aug 2021 15:22:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173FMHLY030396; Tue, 3 Aug 2021 15:22:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173FMHF9030395; Tue, 3 Aug 2021 15:22:17 GMT (envelope-from git) Date: Tue, 3 Aug 2021 15:22:17 GMT Message-Id: <202108031522.173FMHF9030395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bryan Drewery Subject: git: 36269b823182 - main - Fix native-xtools build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdrewery X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36269b82318280ef184c953b90674f5905e0f53f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 15:22:18 -0000 The branch main has been updated by bdrewery: URL: https://cgit.FreeBSD.org/src/commit/?id=36269b82318280ef184c953b90674f5905e0f53f commit 36269b82318280ef184c953b90674f5905e0f53f Author: Bryan Drewery AuthorDate: 2021-08-03 15:20:57 +0000 Commit: Bryan Drewery CommitDate: 2021-08-03 15:22:14 +0000 Fix native-xtools build Fixes https://github.com/freebsd/poudriere/issues/894 Fixes: d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line") X-MFC-With: d0c737e18 --- Makefile | 2 +- Makefile.inc1 | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c64873fb241b..711854f4693c 100644 --- a/Makefile +++ b/Makefile @@ -218,7 +218,7 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \ ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ SRCCONF=${SRCCONF} SRC_ENV_CONF= \ -f /dev/null -V MAKEOBJDIRPREFIX dummy -.if !empty(_MAKEOBJDIRPREFIX) || !empty(.MAKEOVERRIDES:MMAKEOBJDIRPREFIX) +.if !empty(_MAKEOBJDIRPREFIX) .error MAKEOBJDIRPREFIX can only be set in environment or src-env.conf(5),\ not as a global (in make.conf(5) or src.conf(5)) or command-line variable. .endif diff --git a/Makefile.inc1 b/Makefile.inc1 index e3707c7a504a..b6843177c10b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2739,7 +2739,6 @@ SUBDIR= ${SUBDIR_OVERRIDE} NXBMAKEARGS+= \ OBJTOP=${NXBOBJTOP:Q} \ OBJROOT=${NXBOBJROOT:Q} \ - MAKEOBJDIRPREFIX= \ -DNO_SHARED \ -DNO_CPU_CFLAGS \ -DNO_PIC \ @@ -2763,6 +2762,9 @@ NXBMAKEARGS+= \ MK_WERROR=no \ MK_ZFS=no +NXBMAKEENV+= \ + MAKEOBJDIRPREFIX= + .if make(native-xtools*) && \ (!defined(NXB_TARGET) || !defined(NXB_TARGET_ARCH)) .error Missing NXB_TARGET / NXB_TARGET_ARCH From owner-dev-commits-src-main@freebsd.org Tue Aug 3 15:26:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EE8863A373 for ; Tue, 3 Aug 2021 15:26:28 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 4GfJch33Y1z4pnp for ; Tue, 3 Aug 2021 15:26:28 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f42.google.com with SMTP id k4so14933269wrc.0 for ; Tue, 03 Aug 2021 08:26:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Dapzr5nTubN4XmGhA2Ht9dT3hMZapyn7zixsbO1MVPw=; b=bYY5zPsnbQ1C78ev2A7gLuyX+xOAG2tFIP2xUjdIELDiqmNIRkj73DnpGUOmARHvwa Hh8jeOOp9alcRiCpvtYDOucIJ4PEW/+P+heUbUAPNaXoDhtfBE8cRYbXsBjRtYDTIkaC yp5pHsHvX+V73KBDcw2N8Bat5DXtqd/qIPpa/D3J+BDST3TQL1FAMCVMZbua604GDK+r MzQ6yC/8PW3UVYrlPiW5yXX+GGm6764c4Ym/1PqgW8hf5QSmq/t3ru2sUkf1WvSDfw4k VujYGF0ptp/Nt/x+zJvcuv4SUJ17FLPCYmUysqIJmsF/Kfc/jdz9DziXNBjPaZxEoPye o4tw== X-Gm-Message-State: AOAM531HhnwXelniwIYuG+my8EFqaEXbrwUn3DQ2GVY5DLMFEk0Lvsfl 9hcDrKyXKpsLKo7UdN5mund0dA== X-Google-Smtp-Source: ABdhPJz6dTPQzt15GJqxiWTd3CvxSuhk4mz8+e3I6SZGTDCIkMtOSJJ54dwzMtG6alCAYOHjRXLNOw== X-Received: by 2002:a5d:6908:: with SMTP id t8mr24107524wru.421.1628004380713; Tue, 03 Aug 2021 08:26:20 -0700 (PDT) Received: from smtpclient.apple (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id h9sm13519323wmb.35.2021.08.03.08.26.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Aug 2021 08:26:20 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: git: 36269b823182 - main - Fix native-xtools build From: Jessica Clarke In-Reply-To: <202108031522.173FMHF9030395@gitrepo.freebsd.org> Date: Tue, 3 Aug 2021 16:26:19 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <21EA81CD-0058-4E80-9FAD-424C0ACCD276@freebsd.org> References: <202108031522.173FMHF9030395@gitrepo.freebsd.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Rspamd-Queue-Id: 4GfJch33Y1z4pnp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 15:26:28 -0000 On 3 Aug 2021, at 16:22, Bryan Drewery wrote: >=20 > The branch main has been updated by bdrewery: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D36269b82318280ef184c953b90674f59= 05e0f53f >=20 > commit 36269b82318280ef184c953b90674f5905e0f53f > Author: Bryan Drewery > AuthorDate: 2021-08-03 15:20:57 +0000 > Commit: Bryan Drewery > CommitDate: 2021-08-03 15:22:14 +0000 >=20 > Fix native-xtools build >=20 > Fixes https://github.com/freebsd/poudriere/issues/894 > Fixes: d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX = command-line") > X-MFC-With: d0c737e18 > --- > Makefile | 2 +- > Makefile.inc1 | 4 +++- > 2 files changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/Makefile b/Makefile > index c64873fb241b..711854f4693c 100644 > --- a/Makefile > +++ b/Makefile > @@ -218,7 +218,7 @@ _MAKEOBJDIRPREFIX!=3D /usr/bin/env -i PATH=3D${PATH}= ${MAKE} MK_AUTO_OBJ=3Dno \ > ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=3D*} __MAKE_CONF=3D${__MAKE_CONF} \ > SRCCONF=3D${SRCCONF} SRC_ENV_CONF=3D \ > -f /dev/null -V MAKEOBJDIRPREFIX dummy > -.if !empty(_MAKEOBJDIRPREFIX) || = !empty(.MAKEOVERRIDES:MMAKEOBJDIRPREFIX) > +.if !empty(_MAKEOBJDIRPREFIX) Why was this reverted? This restores the bug I was fixing. Does your change below not fix the actual issue you were seeing? Jess > .error MAKEOBJDIRPREFIX can only be set in environment or = src-env.conf(5),\ > not as a global (in make.conf(5) or src.conf(5)) or command-line = variable. > .endif > diff --git a/Makefile.inc1 b/Makefile.inc1 > index e3707c7a504a..b6843177c10b 100644 > --- a/Makefile.inc1 > +++ b/Makefile.inc1 > @@ -2739,7 +2739,6 @@ SUBDIR=3D ${SUBDIR_OVERRIDE} > NXBMAKEARGS+=3D \ > OBJTOP=3D${NXBOBJTOP:Q} \ > OBJROOT=3D${NXBOBJROOT:Q} \ > - MAKEOBJDIRPREFIX=3D \ > -DNO_SHARED \ > -DNO_CPU_CFLAGS \ > -DNO_PIC \ > @@ -2763,6 +2762,9 @@ NXBMAKEARGS+=3D \ > MK_WERROR=3Dno \ > MK_ZFS=3Dno >=20 > +NXBMAKEENV+=3D \ > + MAKEOBJDIRPREFIX=3D > + > .if make(native-xtools*) && \ > (!defined(NXB_TARGET) || !defined(NXB_TARGET_ARCH)) > .error Missing NXB_TARGET / NXB_TARGET_ARCH From owner-dev-commits-src-main@freebsd.org Tue Aug 3 15:42:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE4D663A84D; Tue, 3 Aug 2021 15:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfJzM507Rz4tFr; Tue, 3 Aug 2021 15:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91C2916059; Tue, 3 Aug 2021 15:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173Fgdrt056307; Tue, 3 Aug 2021 15:42:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173FgdN5056306; Tue, 3 Aug 2021 15:42:39 GMT (envelope-from git) Date: Tue, 3 Aug 2021 15:42:39 GMT Message-Id: <202108031542.173FgdN5056306@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 1a78f44cd205 - main - Move setting arm64 HWCAP values to the ID tables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a78f44cd205b6f9ca11ef5cdb6e1f32c0134193 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 15:42:39 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=1a78f44cd205b6f9ca11ef5cdb6e1f32c0134193 commit 1a78f44cd205b6f9ca11ef5cdb6e1f32c0134193 Author: Andrew Turner AuthorDate: 2021-07-16 13:49:33 +0000 Commit: Andrew Turner CommitDate: 2021-08-03 01:42:39 +0000 Move setting arm64 HWCAP values to the ID tables The HWCAPS values are based on the ID registers. Move setting these to the existing ID register parsing code. Previously we would need to handle all possible ID field values where a HWCAP is set, however as most ID fields follow a scheme where when the field increments it will only add new features meaning we only need to check if the field is greater than when the HWCAP feature was added. While here stop setting HWCAP value that need kernel support, but this support is missing. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31201 --- sys/arm64/arm64/identcpu.c | 595 +++++++++++++++++++++++++-------------------- 1 file changed, 325 insertions(+), 270 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 40f56017b9fd..193ed6427b1d 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -48,11 +48,8 @@ __FBSDID("$FreeBSD$"); #include static void print_cpu_features(u_int cpu); -static u_long parse_cpu_features_hwcap(void); -static u_long parse_cpu_features_hwcap2(void); #ifdef COMPAT_FREEBSD32 static u_long parse_cpu_features_hwcap32(void); -static u_long parse_cpu_features_hwcap32_2(void); #endif char machine[] = "arm64"; @@ -285,16 +282,32 @@ struct mrs_field_value { #define MRS_FIELD_VALUE_END { .desc = NULL } +struct mrs_field_hwcap { + u_long *hwcap; + uint64_t min; + u_long hwcap_val; +}; + +#define MRS_HWCAP(_hwcap, _val, _min) \ +{ \ + .hwcap = (_hwcap), \ + .hwcap_val = (_val), \ + .min = (_min), \ +} + +#define MRS_HWCAP_END { .hwcap = NULL } + struct mrs_field { const char *name; struct mrs_field_value *values; + struct mrs_field_hwcap *hwcaps; uint64_t mask; bool sign; u_int type; u_int shift; }; -#define MRS_FIELD(_register, _name, _sign, _type, _values) \ +#define MRS_FIELD_HWCAP(_register, _name, _sign, _type, _values, _hwcap) \ { \ .name = #_name, \ .sign = (_sign), \ @@ -302,8 +315,12 @@ struct mrs_field { .shift = _register ## _ ## _name ## _SHIFT, \ .mask = _register ## _ ## _name ## _MASK, \ .values = (_values), \ + .hwcaps = (_hwcap), \ } +#define MRS_FIELD(_register, _name, _sign, _type, _values) \ + MRS_FIELD_HWCAP(_register, _name, _sign, _type, _values, NULL) + #define MRS_FIELD_END { .type = MRS_INVALID, } /* ID_AA64AFR0_EL1 */ @@ -409,6 +426,11 @@ static struct mrs_field_value id_aa64isar0_rndr[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_rndr_caps[] = { + MRS_HWCAP(&elf_hwcap2, HWCAP2_RNG, ID_AA64ISAR0_RNDR_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_tlb[] = { MRS_FIELD_VALUE(ID_AA64ISAR0_TLB_NONE, ""), MRS_FIELD_VALUE(ID_AA64ISAR0_TLB_TLBIOS, "TLBI-OS"), @@ -423,78 +445,154 @@ static struct mrs_field_value id_aa64isar0_ts[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_ts_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_FLAGM, ID_AA64ISAR0_TS_CondM_8_4), + MRS_HWCAP(&elf_hwcap2, HWCAP2_FLAGM2, ID_AA64ISAR0_TS_CondM_8_5), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_fhm[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, FHM, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_fhm_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_ASIMDFHM, ID_AA64ISAR0_FHM_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_dp[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, DP, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_dp_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_ASIMDDP, ID_AA64ISAR0_DP_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_sm4[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, SM4, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_sm4_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_SM4, ID_AA64ISAR0_SM4_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_sm3[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, SM3, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_sm3_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_SM3, ID_AA64ISAR0_SM3_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_sha3[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, SHA3, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_sha3_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_SHA3, ID_AA64ISAR0_SHA3_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_rdm[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, RDM, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_rdm_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_ASIMDRDM, ID_AA64ISAR0_RDM_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_atomic[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, Atomic, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_atomic_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_ATOMICS, ID_AA64ISAR0_Atomic_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_crc32[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, CRC32, NONE, BASE), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_crc32_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_CRC32, ID_AA64ISAR0_CRC32_BASE), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_sha2[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, SHA2, NONE, BASE), MRS_FIELD_VALUE(ID_AA64ISAR0_SHA2_512, "SHA2+SHA512"), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_sha2_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_SHA2, ID_AA64ISAR0_SHA2_BASE), + MRS_HWCAP(&elf_hwcap, HWCAP_SHA512, ID_AA64ISAR0_SHA2_512), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_sha1[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, SHA1, NONE, BASE), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_sha1_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_SHA1, ID_AA64ISAR0_SHA1_BASE), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar0_aes[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR0, AES, NONE, BASE), MRS_FIELD_VALUE(ID_AA64ISAR0_AES_PMULL, "AES+PMULL"), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar0_aes_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_AES, ID_AA64ISAR0_AES_BASE), + MRS_HWCAP(&elf_hwcap, HWCAP_PMULL, ID_AA64ISAR0_AES_PMULL), + MRS_HWCAP_END +}; + static struct mrs_field id_aa64isar0_fields[] = { - MRS_FIELD(ID_AA64ISAR0, RNDR, false, MRS_LOWER, id_aa64isar0_rndr), + MRS_FIELD_HWCAP(ID_AA64ISAR0, RNDR, false, MRS_LOWER, + id_aa64isar0_rndr, id_aa64isar0_rndr_caps), MRS_FIELD(ID_AA64ISAR0, TLB, false, MRS_EXACT, id_aa64isar0_tlb), - MRS_FIELD(ID_AA64ISAR0, TS, false, MRS_LOWER, id_aa64isar0_ts), - MRS_FIELD(ID_AA64ISAR0, FHM, false, MRS_LOWER, id_aa64isar0_fhm), - MRS_FIELD(ID_AA64ISAR0, DP, false, MRS_LOWER, id_aa64isar0_dp), - MRS_FIELD(ID_AA64ISAR0, SM4, false, MRS_LOWER, id_aa64isar0_sm4), - MRS_FIELD(ID_AA64ISAR0, SM3, false, MRS_LOWER, id_aa64isar0_sm3), - MRS_FIELD(ID_AA64ISAR0, SHA3, false, MRS_LOWER, id_aa64isar0_sha3), - MRS_FIELD(ID_AA64ISAR0, RDM, false, MRS_LOWER, id_aa64isar0_rdm), - MRS_FIELD(ID_AA64ISAR0, Atomic, false, MRS_LOWER, id_aa64isar0_atomic), - MRS_FIELD(ID_AA64ISAR0, CRC32, false, MRS_LOWER, id_aa64isar0_crc32), - MRS_FIELD(ID_AA64ISAR0, SHA2, false, MRS_LOWER, id_aa64isar0_sha2), - MRS_FIELD(ID_AA64ISAR0, SHA1, false, MRS_LOWER, id_aa64isar0_sha1), - MRS_FIELD(ID_AA64ISAR0, AES, false, MRS_LOWER, id_aa64isar0_aes), + MRS_FIELD_HWCAP(ID_AA64ISAR0, TS, false, MRS_LOWER, id_aa64isar0_ts, + id_aa64isar0_ts_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR0, FHM, false, MRS_LOWER, id_aa64isar0_fhm, + id_aa64isar0_fhm_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR0, DP, false, MRS_LOWER, id_aa64isar0_dp, + id_aa64isar0_dp_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR0, SM4, false, MRS_LOWER, id_aa64isar0_sm4, + id_aa64isar0_sm4_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR0, SM3, false, MRS_LOWER, id_aa64isar0_sm3, + id_aa64isar0_sm3_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR0, SHA3, false, MRS_LOWER, id_aa64isar0_sha3, + id_aa64isar0_sha3_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR0, RDM, false, MRS_LOWER, id_aa64isar0_rdm, + id_aa64isar0_rdm_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR0, Atomic, false, MRS_LOWER, + id_aa64isar0_atomic, id_aa64isar0_atomic_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR0, CRC32, false, MRS_LOWER, + id_aa64isar0_crc32, id_aa64isar0_crc32_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR0, SHA2, false, MRS_LOWER, id_aa64isar0_sha2, + id_aa64isar0_sha2_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR0, SHA1, false, MRS_LOWER, + id_aa64isar0_sha1, id_aa64isar0_sha1_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR0, AES, false, MRS_LOWER, id_aa64isar0_aes, + id_aa64isar0_aes_caps), MRS_FIELD_END, }; @@ -505,16 +603,31 @@ static struct mrs_field_value id_aa64isar1_i8mm[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar1_i8mm_caps[] = { + MRS_HWCAP(&elf_hwcap2, HWCAP2_I8MM, ID_AA64ISAR1_I8MM_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar1_dgh[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, DGH, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar1_dgh_caps[] = { + MRS_HWCAP(&elf_hwcap2, HWCAP2_DGH, ID_AA64ISAR1_DGH_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar1_bf16[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, BF16, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar1_bf16_caps[] = { + MRS_HWCAP(&elf_hwcap2, HWCAP2_BF16, ID_AA64ISAR1_BF16_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar1_specres[] = { MRS_FIELD_VALUE(ID_AA64ISAR1_SPECRES_NONE, ""), MRS_FIELD_VALUE(ID_AA64ISAR1_SPECRES_IMPL, "PredInv"), @@ -526,11 +639,21 @@ static struct mrs_field_value id_aa64isar1_sb[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar1_sb_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_SB, ID_AA64ISAR1_SB_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar1_frintts[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, FRINTTS, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar1_frintts_caps[] = { + MRS_HWCAP(&elf_hwcap2, HWCAP2_FRINT, ID_AA64ISAR1_FRINTTS_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar1_gpi[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, GPI, NONE, IMPL), MRS_FIELD_VALUE_END, @@ -548,16 +671,32 @@ static struct mrs_field_value id_aa64isar1_lrcpc[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar1_lrcpc_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_LRCPC, ID_AA64ISAR1_LRCPC_RCPC_8_3), + MRS_HWCAP(&elf_hwcap, HWCAP_ILRCPC, ID_AA64ISAR1_LRCPC_RCPC_8_4), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar1_fcma[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, FCMA, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar1_fcma_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_FCMA, ID_AA64ISAR1_FCMA_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar1_jscvt[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR1, JSCVT, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar1_jscvt_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_JSCVT, ID_AA64ISAR1_JSCVT_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64isar1_api[] = { MRS_FIELD_VALUE(ID_AA64ISAR1_API_NONE, ""), MRS_FIELD_VALUE(ID_AA64ISAR1_API_PAC, "API PAC"), @@ -579,23 +718,37 @@ static struct mrs_field_value id_aa64isar1_dpb[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64isar1_dpb_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_DCPOP, ID_AA64ISAR1_DPB_DCCVAP), + MRS_HWCAP(&elf_hwcap2, HWCAP2_DCPODP, ID_AA64ISAR1_DPB_DCCVADP), + MRS_HWCAP_END +}; + static struct mrs_field id_aa64isar1_fields[] = { - MRS_FIELD(ID_AA64ISAR1, I8MM, false, MRS_LOWER, id_aa64isar1_i8mm), - MRS_FIELD(ID_AA64ISAR1, DGH, false, MRS_LOWER, id_aa64isar1_dgh), - MRS_FIELD(ID_AA64ISAR1, BF16, false, MRS_LOWER, id_aa64isar1_bf16), + MRS_FIELD_HWCAP(ID_AA64ISAR1, I8MM, false, MRS_LOWER, + id_aa64isar1_i8mm, id_aa64isar1_i8mm_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR1, DGH, false, MRS_LOWER, id_aa64isar1_dgh, + id_aa64isar1_dgh_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR1, BF16, false, MRS_LOWER, + id_aa64isar1_bf16, id_aa64isar1_bf16_caps), MRS_FIELD(ID_AA64ISAR1, SPECRES, false, MRS_EXACT, id_aa64isar1_specres), - MRS_FIELD(ID_AA64ISAR1, SB, false, MRS_LOWER, id_aa64isar1_sb), - MRS_FIELD(ID_AA64ISAR1, FRINTTS, false, MRS_LOWER, - id_aa64isar1_frintts), + MRS_FIELD_HWCAP(ID_AA64ISAR1, SB, false, MRS_LOWER, id_aa64isar1_sb, + id_aa64isar1_sb_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR1, FRINTTS, false, MRS_LOWER, + id_aa64isar1_frintts, id_aa64isar1_frintts_caps), MRS_FIELD(ID_AA64ISAR1, GPI, false, MRS_EXACT, id_aa64isar1_gpi), MRS_FIELD(ID_AA64ISAR1, GPA, false, MRS_EXACT, id_aa64isar1_gpa), - MRS_FIELD(ID_AA64ISAR1, LRCPC, false, MRS_LOWER, id_aa64isar1_lrcpc), - MRS_FIELD(ID_AA64ISAR1, FCMA, false, MRS_LOWER, id_aa64isar1_fcma), - MRS_FIELD(ID_AA64ISAR1, JSCVT, false, MRS_LOWER, id_aa64isar1_jscvt), + MRS_FIELD_HWCAP(ID_AA64ISAR1, LRCPC, false, MRS_LOWER, + id_aa64isar1_lrcpc, id_aa64isar1_lrcpc_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR1, FCMA, false, MRS_LOWER, + id_aa64isar1_fcma, id_aa64isar1_fcma_caps), + MRS_FIELD_HWCAP(ID_AA64ISAR1, JSCVT, false, MRS_LOWER, + id_aa64isar1_jscvt, id_aa64isar1_jscvt_caps), MRS_FIELD(ID_AA64ISAR1, API, false, MRS_EXACT, id_aa64isar1_api), MRS_FIELD(ID_AA64ISAR1, APA, false, MRS_EXACT, id_aa64isar1_apa), - MRS_FIELD(ID_AA64ISAR1, DPB, false, MRS_LOWER, id_aa64isar1_dpb), + MRS_FIELD_HWCAP(ID_AA64ISAR1, DPB, false, MRS_LOWER, id_aa64isar1_dpb, + id_aa64isar1_dpb_caps), MRS_FIELD_END, }; @@ -801,6 +954,11 @@ static struct mrs_field_value id_aa64mmfr2_at[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64mmfr2_at_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_USCAT, ID_AA64MMFR2_AT_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64mmfr2_st[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR2, ST, NONE, IMPL), MRS_FIELD_VALUE_END, @@ -851,7 +1009,8 @@ static struct mrs_field id_aa64mmfr2_fields[] = { MRS_FIELD(ID_AA64MMFR2, TTL, false, MRS_EXACT, id_aa64mmfr2_ttl), MRS_FIELD(ID_AA64MMFR2, FWB, false, MRS_EXACT, id_aa64mmfr2_fwb), MRS_FIELD(ID_AA64MMFR2, IDS, false, MRS_EXACT, id_aa64mmfr2_ids), - MRS_FIELD(ID_AA64MMFR2, AT, false, MRS_LOWER, id_aa64mmfr2_at), + MRS_FIELD_HWCAP(ID_AA64MMFR2, AT, false, MRS_LOWER, id_aa64mmfr2_at, + id_aa64mmfr2_at_caps), MRS_FIELD(ID_AA64MMFR2, ST, false, MRS_EXACT, id_aa64mmfr2_st), MRS_FIELD(ID_AA64MMFR2, NV, false, MRS_EXACT, id_aa64mmfr2_nv), MRS_FIELD(ID_AA64MMFR2, CCIDX, false, MRS_EXACT, id_aa64mmfr2_ccidx), @@ -885,6 +1044,11 @@ static struct mrs_field_value id_aa64pfr0_dit[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64pfr0_dit_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_DIT, ID_AA64PFR0_DIT_PSTATE), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64pfr0_amu[] = { MRS_FIELD_VALUE(ID_AA64PFR0_AMU_NONE, ""), MRS_FIELD_VALUE(ID_AA64PFR0_AMU_V1, "AMUv1"), @@ -906,6 +1070,14 @@ static struct mrs_field_value id_aa64pfr0_sve[] = { MRS_FIELD_VALUE_END, }; +#if 0 +/* Enable when we add SVE support */ +static struct mrs_field_hwcap id_aa64pfr0_sve_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_SVE, ID_AA64PFR0_SVE_IMPL), + MRS_HWCAP_END +}; +#endif + static struct mrs_field_value id_aa64pfr0_ras[] = { MRS_FIELD_VALUE(ID_AA64PFR0_RAS_NONE, ""), MRS_FIELD_VALUE(ID_AA64PFR0_RAS_IMPL, "RAS"), @@ -924,12 +1096,24 @@ static struct mrs_field_value id_aa64pfr0_advsimd[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64pfr0_advsimd_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_ASIMD, ID_AA64PFR0_AdvSIMD_IMPL), + MRS_HWCAP(&elf_hwcap, HWCAP_ASIMDHP, ID_AA64PFR0_AdvSIMD_HP), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64pfr0_fp[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64PFR0, FP, NONE, IMPL), MRS_FIELD_VALUE(ID_AA64PFR0_FP_HP, "FP+HP"), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64pfr0_fp_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_FP, ID_AA64PFR0_FP_IMPL), + MRS_HWCAP(&elf_hwcap, HWCAP_FPHP, ID_AA64PFR0_FP_HP), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64pfr0_el3[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64PFR0, EL3, NONE, 64), MRS_FIELD_VALUE(ID_AA64PFR0_EL3_64_32, "EL3 32"), @@ -957,15 +1141,18 @@ static struct mrs_field_value id_aa64pfr0_el0[] = { static struct mrs_field id_aa64pfr0_fields[] = { MRS_FIELD(ID_AA64PFR0, CSV3, false, MRS_EXACT, id_aa64pfr0_csv3), MRS_FIELD(ID_AA64PFR0, CSV2, false, MRS_EXACT, id_aa64pfr0_csv2), - MRS_FIELD(ID_AA64PFR0, DIT, false, MRS_LOWER, id_aa64pfr0_dit), + MRS_FIELD_HWCAP(ID_AA64PFR0, DIT, false, MRS_LOWER, id_aa64pfr0_dit, + id_aa64pfr0_dit_caps), MRS_FIELD(ID_AA64PFR0, AMU, false, MRS_EXACT, id_aa64pfr0_amu), MRS_FIELD(ID_AA64PFR0, MPAM, false, MRS_EXACT, id_aa64pfr0_mpam), MRS_FIELD(ID_AA64PFR0, SEL2, false, MRS_EXACT, id_aa64pfr0_sel2), MRS_FIELD(ID_AA64PFR0, SVE, false, MRS_EXACT, id_aa64pfr0_sve), MRS_FIELD(ID_AA64PFR0, RAS, false, MRS_EXACT, id_aa64pfr0_ras), MRS_FIELD(ID_AA64PFR0, GIC, false, MRS_EXACT, id_aa64pfr0_gic), - MRS_FIELD(ID_AA64PFR0, AdvSIMD, true, MRS_LOWER, id_aa64pfr0_advsimd), - MRS_FIELD(ID_AA64PFR0, FP, true, MRS_LOWER, id_aa64pfr0_fp), + MRS_FIELD_HWCAP(ID_AA64PFR0, AdvSIMD, true, MRS_LOWER, + id_aa64pfr0_advsimd, id_aa64pfr0_advsimd_caps), + MRS_FIELD_HWCAP(ID_AA64PFR0, FP, true, MRS_LOWER, id_aa64pfr0_fp, + id_aa64pfr0_fp_caps), MRS_FIELD(ID_AA64PFR0, EL3, false, MRS_EXACT, id_aa64pfr0_el3), MRS_FIELD(ID_AA64PFR0, EL2, false, MRS_EXACT, id_aa64pfr0_el2), MRS_FIELD(ID_AA64PFR0, EL1, false, MRS_LOWER, id_aa64pfr0_el1), @@ -989,15 +1176,29 @@ static struct mrs_field_value id_aa64pfr1_ssbs[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_aa64pfr1_ssbs_caps[] = { + MRS_HWCAP(&elf_hwcap, HWCAP_SSBS, ID_AA64PFR1_SSBS_PSTATE), + MRS_HWCAP_END +}; + static struct mrs_field_value id_aa64pfr1_bt[] = { MRS_FIELD_VALUE(ID_AA64PFR1_BT_NONE, ""), MRS_FIELD_VALUE(ID_AA64PFR1_BT_IMPL, "BTI"), MRS_FIELD_VALUE_END, }; +#if 0 +/* Enable when we add BTI support */ +static struct mrs_field_hwcap id_aa64pfr1_bt_caps[] = { + MRS_HWCAP(&elf_hwcap2, HWCAP2_BTI, ID_AA64PFR1_BT_IMPL), + MRS_HWCAP_END +}; +#endif + static struct mrs_field id_aa64pfr1_fields[] = { MRS_FIELD(ID_AA64PFR1, MTE, false, MRS_EXACT, id_aa64pfr1_mte), - MRS_FIELD(ID_AA64PFR1, SSBS, false, MRS_LOWER, id_aa64pfr1_ssbs), + MRS_FIELD_HWCAP(ID_AA64PFR1, SSBS, false, MRS_LOWER, id_aa64pfr1_ssbs, + id_aa64pfr1_ssbs_caps), MRS_FIELD(ID_AA64PFR1, BT, false, MRS_EXACT, id_aa64pfr1_bt), MRS_FIELD_END, }; @@ -1019,22 +1220,43 @@ static struct mrs_field_value id_isar5_crc32[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_isar5_crc32_caps[] = { + MRS_HWCAP(&elf32_hwcap2, HWCAP32_2_CRC32, ID_ISAR5_CRC32_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_isar5_sha2[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SHA2, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_isar5_sha2_caps[] = { + MRS_HWCAP(&elf32_hwcap2, HWCAP32_2_SHA2, ID_ISAR5_SHA2_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_isar5_sha1[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SHA1, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_isar5_sha1_caps[] = { + MRS_HWCAP(&elf32_hwcap2, HWCAP32_2_SHA1, ID_ISAR5_SHA1_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_isar5_aes[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, AES, NONE, BASE), MRS_FIELD_VALUE(ID_ISAR5_AES_VMULL, "AES+VMULL"), MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap id_isar5_aes_caps[] = { + MRS_HWCAP(&elf32_hwcap2, HWCAP32_2_AES, ID_ISAR5_AES_BASE), + MRS_HWCAP(&elf32_hwcap2, HWCAP32_2_PMULL, ID_ISAR5_AES_VMULL), + MRS_HWCAP_END +}; + static struct mrs_field_value id_isar5_sevl[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SEVL, NOP, IMPL), MRS_FIELD_VALUE_END, @@ -1043,10 +1265,14 @@ static struct mrs_field_value id_isar5_sevl[] = { static struct mrs_field id_isar5_fields[] = { MRS_FIELD(ID_ISAR5, VCMA, false, MRS_LOWER, id_isar5_vcma), MRS_FIELD(ID_ISAR5, RDM, false, MRS_LOWER, id_isar5_rdm), - MRS_FIELD(ID_ISAR5, CRC32, false, MRS_LOWER, id_isar5_crc32), - MRS_FIELD(ID_ISAR5, SHA2, false, MRS_LOWER, id_isar5_sha2), - MRS_FIELD(ID_ISAR5, SHA1, false, MRS_LOWER, id_isar5_sha1), - MRS_FIELD(ID_ISAR5, AES, false, MRS_LOWER, id_isar5_aes), + MRS_FIELD_HWCAP(ID_ISAR5, CRC32, false, MRS_LOWER, id_isar5_crc32, + id_isar5_crc32_caps), + MRS_FIELD_HWCAP(ID_ISAR5, SHA2, false, MRS_LOWER, id_isar5_sha2, + id_isar5_sha2_caps), + MRS_FIELD_HWCAP(ID_ISAR5, SHA1, false, MRS_LOWER, id_isar5_sha1, + id_isar5_sha1_caps), + MRS_FIELD_HWCAP(ID_ISAR5, AES, false, MRS_LOWER, id_isar5_aes, + id_isar5_aes_caps), MRS_FIELD(ID_ISAR5, SEVL, false, MRS_LOWER, id_isar5_sevl), MRS_FIELD_END, }; @@ -1079,6 +1305,11 @@ static struct mrs_field_value mvfr0_fpdp[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap mvfr0_fpdp_caps[] = { + MRS_HWCAP(&elf32_hwcap, HWCAP32_VFP, MVFR0_FPDP_VFP_v2), + MRS_HWCAP(&elf32_hwcap, HWCAP32_VFPv3, MVFR0_FPDP_VFP_v3_v4), +}; + static struct mrs_field_value mvfr0_fpsp[] = { MRS_FIELD_VALUE(MVFR0_FPSP_NONE, ""), MRS_FIELD_VALUE(MVFR0_FPSP_VFP_v2, "SP VFPv2"), @@ -1098,7 +1329,8 @@ static struct mrs_field mvfr0_fields[] = { MRS_FIELD(MVFR0, FPSqrt, false, MRS_LOWER, mvfr0_fpsqrt), MRS_FIELD(MVFR0, FPDivide, false, MRS_LOWER, mvfr0_fpdivide), MRS_FIELD(MVFR0, FPTrap, false, MRS_LOWER, mvfr0_fptrap), - MRS_FIELD(MVFR0, FPDP, false, MRS_LOWER, mvfr0_fpdp), + MRS_FIELD_HWCAP(MVFR0, FPDP, false, MRS_LOWER, mvfr0_fpdp, + mvfr0_fpdp_caps), MRS_FIELD(MVFR0, FPSP, false, MRS_LOWER, mvfr0_fpsp), MRS_FIELD(MVFR0, SIMDReg, false, MRS_LOWER, mvfr0_simdreg), MRS_FIELD_END, @@ -1110,6 +1342,11 @@ static struct mrs_field_value mvfr1_simdfmac[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap mvfr1_simdfmac_caps[] = { + MRS_HWCAP(&elf32_hwcap, HWCAP32_VFPv4, MVFR1_SIMDFMAC_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value mvfr1_fphp[] = { MRS_FIELD_VALUE(MVFR1_FPHP_NONE, ""), MRS_FIELD_VALUE(MVFR1_FPHP_CONV_SP, "FPHP SP Conv"), @@ -1140,6 +1377,11 @@ static struct mrs_field_value mvfr1_simdls[] = { MRS_FIELD_VALUE_END, }; +static struct mrs_field_hwcap mvfr1_simdls_caps[] = { + MRS_HWCAP(&elf32_hwcap, HWCAP32_VFPv4, MVFR1_SIMDFMAC_IMPL), + MRS_HWCAP_END +}; + static struct mrs_field_value mvfr1_fpdnan[] = { MRS_FIELD_VALUE_NONE_IMPL(MVFR1, FPDNaN, NONE, IMPL), MRS_FIELD_VALUE_END, @@ -1151,12 +1393,14 @@ static struct mrs_field_value mvfr1_fpftz[] = { }; static struct mrs_field mvfr1_fields[] = { - MRS_FIELD(MVFR1, SIMDFMAC, false, MRS_LOWER, mvfr1_simdfmac), + MRS_FIELD_HWCAP(MVFR1, SIMDFMAC, false, MRS_LOWER, mvfr1_simdfmac, + mvfr1_simdfmac_caps), MRS_FIELD(MVFR1, FPHP, false, MRS_LOWER, mvfr1_fphp), MRS_FIELD(MVFR1, SIMDHP, false, MRS_LOWER, mvfr1_simdhp), MRS_FIELD(MVFR1, SIMDSP, false, MRS_LOWER, mvfr1_simdsp), MRS_FIELD(MVFR1, SIMDInt, false, MRS_LOWER, mvfr1_simdint), - MRS_FIELD(MVFR1, SIMDLS, false, MRS_LOWER, mvfr1_simdls), + MRS_FIELD_HWCAP(MVFR1, SIMDLS, false, MRS_LOWER, mvfr1_simdls, + mvfr1_simdls_caps), MRS_FIELD(MVFR1, FPDNaN, false, MRS_LOWER, mvfr1_fpdnan), MRS_FIELD(MVFR1, FPFtZ, false, MRS_LOWER, mvfr1_fpftz), MRS_FIELD_END, @@ -1424,6 +1668,41 @@ int64_t dcache_line_size; /* The minimum D cache line size */ int64_t icache_line_size; /* The minimum I cache line size */ int64_t idcache_line_size; /* The minimum cache line size */ +/* + * Find the values to export to userspace as AT_HWCAP and AT_HWCAP2. + */ +static void +parse_cpu_features(void) +{ + struct mrs_field_hwcap *hwcaps; + struct mrs_field *fields; + uint64_t min, reg; + int i, j, k; + + for (i = 0; i < nitems(user_regs); i++) { + reg = CPU_DESC_FIELD(user_cpu_desc, i); + fields = user_regs[i].fields; + for (j = 0; fields[j].type != 0; j++) { + hwcaps = fields[j].hwcaps; + if (hwcaps == NULL) + continue; + + for (k = 0; hwcaps[k].hwcap != NULL; k++) { + min = hwcaps[k].min; + + /* + * If the field is greater than the minimum + * value we can set the hwcap; + */ + if (mrs_field_cmp(reg, min, fields[j].shift, + 4, fields[j].sign) >= 0) { + *hwcaps[k].hwcap |= hwcaps[k].hwcap_val; + } + } + } + } +} + static void identify_cpu_sysinit(void *dummy __unused) { @@ -1444,14 +1723,12 @@ identify_cpu_sysinit(void *dummy __unused) idc = false; } - /* Exposed to userspace as AT_HWCAP and AT_HWCAP2 */ - elf_hwcap = parse_cpu_features_hwcap(); - elf_hwcap2 = parse_cpu_features_hwcap2(); + /* Find the values to export to userspace as AT_HWCAP and AT_HWCAP2 */ + parse_cpu_features(); #ifdef COMPAT_FREEBSD32 - /* 32-bit ARM versions of AT_HWCAP/HWCAP2 */ - elf32_hwcap = parse_cpu_features_hwcap32(); - elf32_hwcap2 = parse_cpu_features_hwcap32_2(); + /* Set the default caps and any that need to check multiple fields */ + elf32_hwcap |= parse_cpu_features_hwcap32(); #endif if (dic && idc) { @@ -1485,244 +1762,22 @@ cpu_features_sysinit(void *dummy __unused) /* Log features before APs are released and start printing to the dmesg. */ SYSINIT(cpu_features, SI_SUB_SMP - 1, SI_ORDER_ANY, cpu_features_sysinit, NULL); -static u_long -parse_cpu_features_hwcap(void) -{ - u_long hwcap = 0; - - switch (ID_AA64ISAR0_TS_VAL(user_cpu_desc.id_aa64isar0)) { - case ID_AA64ISAR0_TS_CondM_8_4: - case ID_AA64ISAR0_TS_CondM_8_5: - hwcap |= HWCAP_FLAGM; - break; - default: - break; - } - - if (ID_AA64ISAR0_FHM_VAL(user_cpu_desc.id_aa64isar0) == - ID_AA64ISAR0_FHM_IMPL) - hwcap |= HWCAP_ASIMDFHM; - - if (ID_AA64ISAR0_DP_VAL(user_cpu_desc.id_aa64isar0) == - ID_AA64ISAR0_DP_IMPL) - hwcap |= HWCAP_ASIMDDP; - - if (ID_AA64ISAR0_SM4_VAL(user_cpu_desc.id_aa64isar0) == - ID_AA64ISAR0_SM4_IMPL) - hwcap |= HWCAP_SM4; - - if (ID_AA64ISAR0_SM3_VAL(user_cpu_desc.id_aa64isar0) == - ID_AA64ISAR0_SM3_IMPL) - hwcap |= HWCAP_SM3; - - if (ID_AA64ISAR0_SHA3_VAL(user_cpu_desc.id_aa64isar0) == - ID_AA64ISAR0_SHA3_IMPL) - hwcap |= HWCAP_SHA3; - - if (ID_AA64ISAR0_RDM_VAL(user_cpu_desc.id_aa64isar0) == - ID_AA64ISAR0_RDM_IMPL) - hwcap |= HWCAP_ASIMDRDM; - - if (ID_AA64ISAR0_Atomic_VAL(user_cpu_desc.id_aa64isar0) == - ID_AA64ISAR0_Atomic_IMPL) - hwcap |= HWCAP_ATOMICS; - - if (ID_AA64ISAR0_CRC32_VAL(user_cpu_desc.id_aa64isar0) == - ID_AA64ISAR0_CRC32_BASE) - hwcap |= HWCAP_CRC32; - - switch (ID_AA64ISAR0_SHA2_VAL(user_cpu_desc.id_aa64isar0)) { - case ID_AA64ISAR0_SHA2_BASE: - hwcap |= HWCAP_SHA2; - break; - case ID_AA64ISAR0_SHA2_512: - hwcap |= HWCAP_SHA2 | HWCAP_SHA512; - break; - default: - break; - } - - if (ID_AA64ISAR0_SHA1_VAL(user_cpu_desc.id_aa64isar0) == - ID_AA64ISAR0_SHA1_BASE) - hwcap |= HWCAP_SHA1; - - switch (ID_AA64ISAR0_AES_VAL(user_cpu_desc.id_aa64isar0)) { - case ID_AA64ISAR0_AES_BASE: - hwcap |= HWCAP_AES; - break; - case ID_AA64ISAR0_AES_PMULL: - hwcap |= HWCAP_PMULL | HWCAP_AES; - break; - default: - break; - } - - if (ID_AA64ISAR1_SB_VAL(user_cpu_desc.id_aa64isar1) == - ID_AA64ISAR1_SB_IMPL) - hwcap |= HWCAP_SB; - - switch (ID_AA64ISAR1_LRCPC_VAL(user_cpu_desc.id_aa64isar1)) { - case ID_AA64ISAR1_LRCPC_RCPC_8_3: - hwcap |= HWCAP_LRCPC; - break; - case ID_AA64ISAR1_LRCPC_RCPC_8_4: - hwcap |= HWCAP_LRCPC | HWCAP_ILRCPC; - break; - default: - break; - } - - if (ID_AA64ISAR1_FCMA_VAL(user_cpu_desc.id_aa64isar1) == - ID_AA64ISAR1_FCMA_IMPL) - hwcap |= HWCAP_FCMA; - - if (ID_AA64ISAR1_JSCVT_VAL(user_cpu_desc.id_aa64isar1) == - ID_AA64ISAR1_JSCVT_IMPL) - hwcap |= HWCAP_JSCVT; - - if (ID_AA64ISAR1_DPB_VAL(user_cpu_desc.id_aa64isar1) == - ID_AA64ISAR1_DPB_DCCVAP) - hwcap |= HWCAP_DCPOP; - - if (ID_AA64MMFR2_AT_VAL(user_cpu_desc.id_aa64mmfr2) == - ID_AA64MMFR2_AT_IMPL) - hwcap |= HWCAP_USCAT; - - if (ID_AA64PFR0_DIT_VAL(user_cpu_desc.id_aa64pfr0) == - ID_AA64PFR0_DIT_PSTATE) - hwcap |= HWCAP_DIT; - - if (ID_AA64PFR0_SVE_VAL(user_cpu_desc.id_aa64pfr0) == - ID_AA64PFR0_SVE_IMPL) - hwcap |= HWCAP_SVE; - - switch (ID_AA64PFR0_AdvSIMD_VAL(user_cpu_desc.id_aa64pfr0)) { - case ID_AA64PFR0_AdvSIMD_IMPL: - hwcap |= HWCAP_ASIMD; - break; - case ID_AA64PFR0_AdvSIMD_HP: - hwcap |= HWCAP_ASIMD | HWCAP_ASIMDHP; - break; - default: - break; - } - - switch (ID_AA64PFR0_FP_VAL(user_cpu_desc.id_aa64pfr0)) { - case ID_AA64PFR0_FP_IMPL: - hwcap |= HWCAP_FP; - break; - case ID_AA64PFR0_FP_HP: - hwcap |= HWCAP_FP | HWCAP_FPHP; - break; - default: - break; - } - - if (ID_AA64PFR1_SSBS_VAL(user_cpu_desc.id_aa64pfr1) == - ID_AA64PFR1_SSBS_PSTATE_MSR) - hwcap |= HWCAP_SSBS; - - return (hwcap); -} - -static u_long -parse_cpu_features_hwcap2(void) -{ - u_long hwcap2 = 0; - - if (ID_AA64ISAR0_RNDR_VAL(user_cpu_desc.id_aa64isar0) == - ID_AA64ISAR0_RNDR_IMPL) - hwcap2 |= HWCAP2_RNG; - - if (ID_AA64ISAR0_TS_VAL(user_cpu_desc.id_aa64isar0) == - ID_AA64ISAR0_TS_CondM_8_5) - hwcap2 |= HWCAP2_FLAGM2; - - if (ID_AA64ISAR1_I8MM_VAL(user_cpu_desc.id_aa64isar1) == - ID_AA64ISAR1_I8MM_IMPL) - hwcap2 |= HWCAP2_I8MM; - - if (ID_AA64ISAR1_DGH_VAL(user_cpu_desc.id_aa64isar1) == - ID_AA64ISAR1_DGH_IMPL) - hwcap2 |= HWCAP2_DGH; - - if (ID_AA64ISAR1_BF16_VAL(user_cpu_desc.id_aa64isar1) == - ID_AA64ISAR1_BF16_IMPL) - hwcap2 |= HWCAP2_BF16; - - if (ID_AA64ISAR1_FRINTTS_VAL(user_cpu_desc.id_aa64isar1) == - ID_AA64ISAR1_FRINTTS_IMPL) - hwcap2 |= HWCAP2_FRINT; - - if (ID_AA64ISAR1_DPB_VAL(user_cpu_desc.id_aa64isar1) == - ID_AA64ISAR1_DPB_DCCVADP) - hwcap2 |= HWCAP2_DCPODP; - - if (ID_AA64PFR1_BT_VAL(user_cpu_desc.id_aa64pfr1) == - ID_AA64PFR1_BT_IMPL) - hwcap2 |= HWCAP2_BTI; - - return (hwcap2); -} - #ifdef COMPAT_FREEBSD32 static u_long parse_cpu_features_hwcap32(void) { u_long hwcap = HWCAP32_DEFAULT; - if (MVFR0_FPDP_VAL(user_cpu_desc.mvfr0) >= - MVFR0_FPDP_VFP_v2) { - hwcap |= HWCAP32_VFP; - - if (MVFR0_FPDP_VAL(user_cpu_desc.mvfr0) == - MVFR0_FPDP_VFP_v3_v4) { - hwcap |= HWCAP32_VFPv3; - - if (MVFR1_SIMDFMAC_VAL(user_cpu_desc.mvfr1) == - MVFR1_SIMDFMAC_IMPL) - hwcap |= HWCAP32_VFPv4; - } - } - - if ((MVFR1_SIMDLS_VAL(user_cpu_desc.mvfr1) == + if ((MVFR1_SIMDLS_VAL(user_cpu_desc.mvfr1) >= MVFR1_SIMDLS_IMPL) && - (MVFR1_SIMDInt_VAL(user_cpu_desc.mvfr1) == + (MVFR1_SIMDInt_VAL(user_cpu_desc.mvfr1) >= MVFR1_SIMDInt_IMPL) && - (MVFR1_SIMDSP_VAL(user_cpu_desc.mvfr1) == + (MVFR1_SIMDSP_VAL(user_cpu_desc.mvfr1) >= MVFR1_SIMDSP_IMPL)) hwcap |= HWCAP32_NEON; return (hwcap); } - -static u_long -parse_cpu_features_hwcap32_2(void) -{ - u_long hwcap2 = 0; - - if (ID_ISAR5_AES_VAL(user_cpu_desc.id_isar5) >= - ID_ISAR5_AES_BASE) - hwcap2 |= HWCAP32_2_AES; - - if (ID_ISAR5_AES_VAL(user_cpu_desc.id_isar5) == - ID_ISAR5_AES_VMULL) - hwcap2 |= HWCAP32_2_PMULL; - - if (ID_ISAR5_SHA1_VAL(user_cpu_desc.id_isar5) == - ID_ISAR5_SHA1_IMPL) - hwcap2 |= HWCAP32_2_SHA1; - - if (ID_ISAR5_SHA2_VAL(user_cpu_desc.id_isar5) == - ID_ISAR5_SHA2_IMPL) - hwcap2 |= HWCAP32_2_SHA2; - - if (ID_ISAR5_CRC32_VAL(user_cpu_desc.id_isar5) == - ID_ISAR5_CRC32_IMPL) - hwcap2 |= HWCAP32_2_CRC32; - - return (hwcap2); -} #endif /* COMPAT_FREEBSD32 */ static void From owner-dev-commits-src-main@freebsd.org Tue Aug 3 15:42:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 514D463AF07; Tue, 3 Aug 2021 15:42:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfJzN6fBpz4tJT; Tue, 3 Aug 2021 15:42:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF2BA16108; Tue, 3 Aug 2021 15:42:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173FgenQ056331; Tue, 3 Aug 2021 15:42:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173FgeNG056330; Tue, 3 Aug 2021 15:42:40 GMT (envelope-from git) Date: Tue, 3 Aug 2021 15:42:40 GMT Message-Id: <202108031542.173FgeNG056330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 8b3bd5a2b571 - main - Only store the arm64 ID registers in the cpu_desc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b3bd5a2b571e2681c96dbe5b4a04529ef0d7f53 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 15:42:41 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8b3bd5a2b571e2681c96dbe5b4a04529ef0d7f53 commit 8b3bd5a2b571e2681c96dbe5b4a04529ef0d7f53 Author: Andrew Turner AuthorDate: 2021-07-29 08:55:01 +0000 Commit: Andrew Turner CommitDate: 2021-08-03 01:42:40 +0000 Only store the arm64 ID registers in the cpu_desc There is no need to store a pointer to the CPU implementer and part strings. Switch to load them directly into the sbuf used to print them on boot. While here print the machine ID register when we fail to determine the implementer or part we are booting on. Reviewed by: markj, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31346 --- sys/arm64/arm64/identcpu.c | 112 +++++++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 50 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 193ed6427b1d..37330a8f0e3f 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +static void print_cpu_midr(struct sbuf *sb, u_int cpu); static void print_cpu_features(u_int cpu); #ifdef COMPAT_FREEBSD32 static u_long parse_cpu_features_hwcap32(void); @@ -116,13 +117,6 @@ uint64_t __cpu_affinity[MAXCPU]; static u_int cpu_aff_levels; struct cpu_desc { - u_int cpu_impl; - u_int cpu_part_num; - u_int cpu_variant; - u_int cpu_revision; - const char *cpu_impl_name; - const char *cpu_part_name; - uint64_t mpidr; uint64_t id_aa64afr0; uint64_t id_aa64afr1; @@ -169,7 +163,7 @@ struct cpu_parts { u_int part_id; const char *part_name; }; -#define CPU_PART_NONE { 0, "Unknown Processor" } +#define CPU_PART_NONE { 0, NULL } struct cpu_implementers { u_int impl_id; @@ -180,7 +174,7 @@ struct cpu_implementers { */ const struct cpu_parts *cpu_parts; }; -#define CPU_IMPLEMENTER_NONE { 0, "Unknown Implementer", cpu_parts_none } +#define CPU_IMPLEMENTER_NONE { 0, NULL, NULL } /* * Per-implementer table of (PartNum, CPU Name) pairs. @@ -1435,7 +1429,6 @@ static struct mrs_user_reg user_regs[] = { USER_REG(ID_AA64PFR0_EL1, id_aa64pfr0), USER_REG(ID_AA64PFR1_EL1, id_aa64pfr1), - #ifdef COMPAT_FREEBSD32 USER_REG(ID_ISAR5_EL1, id_isar5), @@ -1754,10 +1747,17 @@ SYSINIT(identify_cpu, SI_SUB_CPU, SI_ORDER_ANY, identify_cpu_sysinit, NULL); static void cpu_features_sysinit(void *dummy __unused) { + struct sbuf sb; u_int cpu; CPU_FOREACH(cpu) print_cpu_features(cpu); + + /* Fill in cpu_model for the hw.model sysctl */ + sbuf_new(&sb, cpu_model, sizeof(cpu_model), SBUF_FIXEDLEN); + print_cpu_midr(&sb, 0); + sbuf_finish(&sb); + sbuf_delete(&sb); } /* Log features before APs are released and start printing to the dmesg. */ SYSINIT(cpu_features, SI_SUB_SMP - 1, SI_ORDER_ANY, cpu_features_sysinit, NULL); @@ -1879,15 +1879,64 @@ print_id_register(struct sbuf *sb, const char *reg_name, uint64_t reg, print_register(sb, reg_name, reg, print_id_fields, fields); } +static void +print_cpu_midr(struct sbuf *sb, u_int cpu) +{ + const struct cpu_parts *cpu_partsp; + const char *cpu_impl_name; + const char *cpu_part_name; + u_int midr; + u_int impl_id; + u_int part_id; + + midr = pcpu_find(cpu)->pc_midr; + + cpu_impl_name = NULL; + cpu_partsp = NULL; + impl_id = CPU_IMPL(midr); + for (int i = 0; cpu_implementers[i].impl_name != NULL; i++) { + if (impl_id == cpu_implementers[i].impl_id) { + cpu_impl_name = cpu_implementers[i].impl_name; + cpu_partsp = cpu_implementers[i].cpu_parts; + break; + } + } + /* Unknown implementer, so unknown part */ + if (cpu_impl_name == NULL) { + sbuf_printf(sb, "Unknown Implementer (midr: %08x)", midr); + return; + } + + KASSERT(cpu_partsp != NULL, ("%s: No parts table for implementer %s", + __func__, cpu_impl_name)); + + cpu_part_name = NULL; + part_id = CPU_PART(midr); + for (int i = 0; cpu_partsp[i].part_name != NULL; i++) { + if (part_id == cpu_partsp[i].part_id) { + cpu_part_name = cpu_partsp[i].part_name; + break; + } + } + /* Known Implementer, Unknown part */ + if (cpu_part_name == NULL) { + sbuf_printf(sb, "%s Unknown CPU r%dp%d (midr: %08x)", + cpu_impl_name, CPU_VAR(midr), CPU_REV(midr), midr); + return; + } + + sbuf_printf(sb, "%s %s r%dp%d", cpu_impl_name, + cpu_part_name, CPU_VAR(midr), CPU_REV(midr)); +} + static void print_cpu_features(u_int cpu) { struct sbuf *sb; sb = sbuf_new_auto(); - sbuf_printf(sb, "CPU%3d: %s %s r%dp%d", cpu, - cpu_desc[cpu].cpu_impl_name, cpu_desc[cpu].cpu_part_name, - cpu_desc[cpu].cpu_variant, cpu_desc[cpu].cpu_revision); + sbuf_printf(sb, "CPU%3u: ", cpu); + print_cpu_midr(sb, cpu); sbuf_cat(sb, " affinity:"); switch(cpu_aff_levels) { @@ -2058,43 +2107,6 @@ identify_cache(uint64_t ctr) void identify_cpu(u_int cpu) { - u_int midr; - u_int impl_id; - u_int part_id; - size_t i; - const struct cpu_parts *cpu_partsp = NULL; - - midr = get_midr(); - - impl_id = CPU_IMPL(midr); - for (i = 0; i < nitems(cpu_implementers); i++) { - if (impl_id == cpu_implementers[i].impl_id || - cpu_implementers[i].impl_id == 0) { - cpu_desc[cpu].cpu_impl = impl_id; - cpu_desc[cpu].cpu_impl_name = - cpu_implementers[i].impl_name; - cpu_partsp = cpu_implementers[i].cpu_parts; - break; - } - } - - part_id = CPU_PART(midr); - for (i = 0; &cpu_partsp[i] != NULL; i++) { - if (part_id == cpu_partsp[i].part_id || - cpu_partsp[i].part_id == 0) { - cpu_desc[cpu].cpu_part_num = part_id; - cpu_desc[cpu].cpu_part_name = cpu_partsp[i].part_name; - break; - } - } - - cpu_desc[cpu].cpu_revision = CPU_REV(midr); - cpu_desc[cpu].cpu_variant = CPU_VAR(midr); - - snprintf(cpu_model, sizeof(cpu_model), "%s %s r%dp%d", - cpu_desc[cpu].cpu_impl_name, cpu_desc[cpu].cpu_part_name, - cpu_desc[cpu].cpu_variant, cpu_desc[cpu].cpu_revision); - /* Save affinity for current CPU */ cpu_desc[cpu].mpidr = get_mpidr(); CPU_AFFINITY(cpu) = cpu_desc[cpu].mpidr & CPU_AFF_MASK; From owner-dev-commits-src-main@freebsd.org Tue Aug 3 16:04:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4566C63B0D9; Tue, 3 Aug 2021 16:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfKSR1JGkz3Dhy; Tue, 3 Aug 2021 16:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 153171659F; Tue, 3 Aug 2021 16:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173G4Msv084190; Tue, 3 Aug 2021 16:04:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173G4MKd084189; Tue, 3 Aug 2021 16:04:22 GMT (envelope-from git) Date: Tue, 3 Aug 2021 16:04:22 GMT Message-Id: <202108031604.173G4MKd084189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 30e1773fdef4 - main - locales: fix abuse of bsd.dirs.mk MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30e1773fdef42cb509bf75e9fa09472e77a333de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 16:04:23 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=30e1773fdef42cb509bf75e9fa09472e77a333de commit 30e1773fdef42cb509bf75e9fa09472e77a333de Author: Baptiste Daroussin AuthorDate: 2021-08-03 16:00:45 +0000 Commit: Baptiste Daroussin CommitDate: 2021-08-03 16:02:15 +0000 locales: fix abuse of bsd.dirs.mk the way SAMEDIRS was defined was an abuse of bsd.dirs.mk resulting in all the directory to be created in one single command, but DESTDIR is only prepend once on the first element of the list Switch to the properway to use bsd.dirs.mk --- share/colldef/Makefile | 4 ++-- share/colldef_unicode/Makefile | 4 ++-- share/ctypedef/Makefile | 4 ++-- share/monetdef/Makefile | 4 ++-- share/monetdef_unicode/Makefile | 4 ++-- share/msgdef/Makefile | 4 ++-- share/msgdef_unicode/Makefile | 4 ++-- share/numericdef/Makefile | 4 ++-- share/numericdef_unicode/Makefile | 4 ++-- share/timedef/Makefile | 4 ++-- tools/tools/locale/tools/cldr2def.pl | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/share/colldef/Makefile b/share/colldef/Makefile index 765abf9747f3..66487fb76984 100644 --- a/share/colldef/Makefile +++ b/share/colldef/Makefile @@ -133,9 +133,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.LC_COLLATE/} CLEANFILES= ${FILES} -DIRS+= SAMEDIRS .for f t in ${SAME} -SAMEDIRS+= ${LOCALEDIR}/$t +DIRS+= LOCALEDIR_$t +LOCALEDIR_$t= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/colldef_unicode/Makefile b/share/colldef_unicode/Makefile index 4dd4bf78a36f..ea895d8e388e 100644 --- a/share/colldef_unicode/Makefile +++ b/share/colldef_unicode/Makefile @@ -104,9 +104,9 @@ SAME+= zh_TW.UTF-8 zh_HK.UTF-8 FILES= ${LOCALES:S/$/.LC_COLLATE/} CLEANFILES= ${FILES} -DIRS+= SAMEDIRS .for f t in ${SAME} -SAMEDIRS+= ${LOCALEDIR}/$t +DIRS+= LOCALEDIR_$t +LOCALEDIR_$t= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/ctypedef/Makefile b/share/ctypedef/Makefile index ad7eb237f3eb..1a57cfeb1444 100644 --- a/share/ctypedef/Makefile +++ b/share/ctypedef/Makefile @@ -215,9 +215,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.LC_CTYPE/} CLEANFILES= ${FILES} -DIRS+= SAMEDIRS .for f t in ${SAME} -SAMEDIRS+= ${LOCALEDIR}/$t +DIRS+= LOCALEDIR_$t +LOCALEDIR_$t= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/monetdef/Makefile b/share/monetdef/Makefile index f0b34998f4bd..bec0b78d9433 100644 --- a/share/monetdef/Makefile +++ b/share/monetdef/Makefile @@ -129,9 +129,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} -DIRS+= SAMEDIRS .for f t in ${SAME} -SAMEDIRS+= ${LOCALEDIR}/$t +DIRS+= LOCALEDIR_$t +LOCALEDIR_$t= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/monetdef_unicode/Makefile b/share/monetdef_unicode/Makefile index 4655c742669b..2fa073f3981d 100644 --- a/share/monetdef_unicode/Makefile +++ b/share/monetdef_unicode/Makefile @@ -96,9 +96,9 @@ SAME+= sr_RS.UTF-8@latin sr_RS.UTF-8 FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} -DIRS+= SAMEDIRS .for f t in ${SAME} -SAMEDIRS+= ${LOCALEDIR}/$t +DIRS+= LOCALEDIR_$t +LOCALEDIR_$t= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/msgdef/Makefile b/share/msgdef/Makefile index 9f0b7f2f3bcf..a176d30c01fc 100644 --- a/share/msgdef/Makefile +++ b/share/msgdef/Makefile @@ -122,9 +122,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} -DIRS+= SAMEDIRS .for f t in ${SAME} -SAMEDIRS+= ${LOCALEDIR}/$t +DIRS+= LOCALEDIR_$t +LOCALEDIR_$t= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/msgdef_unicode/Makefile b/share/msgdef_unicode/Makefile index c0bffc05ccc6..34f8b30ff733 100644 --- a/share/msgdef_unicode/Makefile +++ b/share/msgdef_unicode/Makefile @@ -96,9 +96,9 @@ SAME+= zh_TW.UTF-8 zh_HK.UTF-8 FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} -DIRS+= SAMEDIRS .for f t in ${SAME} -SAMEDIRS+= ${LOCALEDIR}/$t +DIRS+= LOCALEDIR_$t +LOCALEDIR_$t= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/numericdef/Makefile b/share/numericdef/Makefile index f1047e9cb5d3..da04535aa4c9 100644 --- a/share/numericdef/Makefile +++ b/share/numericdef/Makefile @@ -125,9 +125,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} -DIRS+= SAMEDIRS .for f t in ${SAME} -SAMEDIRS+= ${LOCALEDIR}/$t +DIRS+= LOCALEDIR_$t +LOCALEDIR_$t= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/numericdef_unicode/Makefile b/share/numericdef_unicode/Makefile index 3f7f3e4f285e..07290250c6b5 100644 --- a/share/numericdef_unicode/Makefile +++ b/share/numericdef_unicode/Makefile @@ -96,9 +96,9 @@ SAME+= fr_FR.UTF-8 fr_BE.UTF-8 FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} -DIRS+= SAMEDIRS .for f t in ${SAME} -SAMEDIRS+= ${LOCALEDIR}/$t +DIRS+= LOCALEDIR_$t +LOCALEDIR_$t= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/timedef/Makefile b/share/timedef/Makefile index 428e8067ae18..df16c038ba4c 100644 --- a/share/timedef/Makefile +++ b/share/timedef/Makefile @@ -208,9 +208,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.out/} CLEANFILES= ${FILES} -DIRS+= SAMEDIRS .for f t in ${SAME} -SAMEDIRS+= ${LOCALEDIR}/$t +DIRS+= LOCALEDIR_$t +LOCALEDIR_$t= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/tools/tools/locale/tools/cldr2def.pl b/tools/tools/locale/tools/cldr2def.pl index 277102d60a49..78b2634b6250 100755 --- a/tools/tools/locale/tools/cldr2def.pl +++ b/tools/tools/locale/tools/cldr2def.pl @@ -1081,9 +1081,9 @@ EOF FILES= \${LOCALES:S/\$/.${SRCOUT2}/} CLEANFILES= \${FILES} -DIRS+= SAMEDIRS .for f t in \${SAME} -SAMEDIRS+= \${LOCALEDIR}/\$t +DIRS+= LOCALEDIR_\$t +LOCALEDIR_\$t= \${LOCALEDIR}/\$t SYMLINKS+= ../\$f/\${FILESNAME} \\ \${LOCALEDIR}/\$t/\${FILESNAME} .endfor From owner-dev-commits-src-main@freebsd.org Tue Aug 3 16:31:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C869863BC8F for ; Tue, 3 Aug 2021 16:31:26 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound4v.ore.mailhop.org (outbound4v.ore.mailhop.org [44.233.143.45]) (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 4GfL3f3ZpQz3GTd for ; Tue, 3 Aug 2021 16:31:26 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1628008280; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=XOW4hnTVIWv//TWUlaWXPqGQkNjSTxkJ3T+11oqf4ISF9/TFOp8kOcydg48ZkBmV47QF2Q71YwA+I X0qsf0YRlfVQix7Ve+tAUAdRTNOwUdPz24a4/sVHd2HUOUeHq3yH4WHYVRVo6a+d2dElh9GqPIM+Y5 J2jMAAn7kqWc1CzX1Hb8wvtbOVvY4/s3HnQX5yDglGa9w4SKfqokuzz1IKEETCnNe9JnCtKJryDwoo 0TYMc/WsOPdjCeiSmMQjxBcrveNKco6uRy8ji7L+0yNw1cvBecdfU4WUhSUD7RGA9DELbeOo6f/A+6 xxNpaYGqQGX9UDs0nD9QPM9KYhegNaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=oZ0OR14MSJYFlI9Hqn22WatJdqhATMzFbJwOBgbrOYI=; b=TcD6wwYBx+ubqmDCb+JAIml076/VB1OWofMOVvbD+zBT+y+rf7579G3ciVoJtpYh4ZdPOZ7prDHIt Utz+RGZ5NVwGMg0CB68ZozGja1Ds3Q228o/bYqpXnkwYAD8yp19On8qeyjIR+GFUWtSS8fR7OI5Zi6 PhsC8at/CB5ydFtT6O+CUPj3dL/OSP9SP7O1u7+T8rFG43OF2eB8/LNJhuaOTXKnama/XforhQn5QA 1IXz5bEg/LUDWQEWX/JzNNi7lblwcuHzkFIBqPXyGjCqe+g7+r4mavCy5XnaLZdgwCaZC+jsrTDv2p qNcWWtQ6E/hqGfJWP2vITfRBLl+e36g== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=oZ0OR14MSJYFlI9Hqn22WatJdqhATMzFbJwOBgbrOYI=; b=RPVrODoz9jUueiilbgf13uHFbsAP/KJniYDr1BtBwS6HmVkx6X8iIEL9TDJs/eOZikPcU0wLJkmcC 4fKVmFTG3Bb1IGJQ3TYhmQ3kqVd0vi5rYI3kYVH/q2n3Nea2vHnAgy2iF7fiLfZtIJrtIQvIuvOcwl e0G4p6IX0zrFUr2BFR/cJwa5T6kMtkGSfsgscFhsuf/7FTrqoCCa81tpqWkEnWFZSmzS1NqqNRnuhp boP9ZdfBJu9kEWlKGC3rhU62R/+rC2tYHQNuFU3Fo8r4vMq3daCAU4GJTMwS0WbHle0tD8jaRAJrJe Y7AFBs40WtIAtwHwdWtk5ELuxJ6DhCg== X-Originating-IP: 67.177.211.60 X-MHO-RoutePath: aGlwcGll X-MHO-User: 3aa508c1-f478-11eb-a657-89389772cfc7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 3aa508c1-f478-11eb-a657-89389772cfc7; Tue, 03 Aug 2021 16:31:18 +0000 (UTC) Received: from [172.22.42.84] (rev2.hippie.lan [172.22.42.84]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 173GVHYs076666; Tue, 3 Aug 2021 10:31:17 -0600 (MDT) (envelope-from ian@freebsd.org) X-Authentication-Warning: paranoia.hippie.lan: Host rev2.hippie.lan [172.22.42.84] claimed to be [172.22.42.84] Message-ID: Subject: Re: git: dfcaa2c18bf9 - main - enetc_mdio: Support building the driver as a loadable module. From: Ian Lepore To: Marcin Wojtas , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Date: Tue, 03 Aug 2021 10:31:17 -0600 In-Reply-To: <202108031008.173A84BG096694@gitrepo.freebsd.org> References: <202108031008.173A84BG096694@gitrepo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.3 FreeBSD GNOME Team MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4GfL3f3ZpQz3GTd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 16:31:26 -0000 On Tue, 2021-08-03 at 10:08 +0000, Marcin Wojtas wrote: > The branch main has been updated by mw: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=dfcaa2c18bf9c69b94d531364f8913b23f19505f > > commit dfcaa2c18bf9c69b94d531364f8913b23f19505f > Author:     Kornel Duleba > AuthorDate: 2021-07-28 11:38:53 +0000 > Commit:     Marcin Wojtas > CommitDate: 2021-08-03 10:07:49 +0000 > >     enetc_mdio: Support building the driver as a loadable module. >     > [...] > diff --git a/sys/modules/enetc_mdio/Makefile > b/sys/modules/enetc_mdio/Makefile > new file mode 100644 > index 000000000000..f448fc526705 > --- /dev/null > +++ b/sys/modules/enetc_mdio/Makefile > @@ -0,0 +1,8 @@ > +#$FreeBSD$ > + > +.PATH: ${SRCTOP}/sys/dev/enetc > + > +KMOD   = enetc_mdio > +SRCS   = enetc_mdio_pci.c enetc_mdio.c > + > +.include A module makefile must list all the header files it uses which are generated at build time from interface definitions (.m files) in its SRCS list. For this driver, I think that means ifdi_if.h and miibus_if.h. -- Ian From owner-dev-commits-src-main@freebsd.org Tue Aug 3 16:36:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4FD663C2B3; Tue, 3 Aug 2021 16:36:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfL9m4G5nz3HHt; Tue, 3 Aug 2021 16:36:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A54816A66; Tue, 3 Aug 2021 16:36:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173GaiJo023777; Tue, 3 Aug 2021 16:36:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173GaiDC023776; Tue, 3 Aug 2021 16:36:44 GMT (envelope-from git) Date: Tue, 3 Aug 2021 16:36:44 GMT Message-Id: <202108031636.173GaiDC023776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 0fa5403d493b - main - pkgbase: move locales into their own package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0fa5403d493be24dda2bf575c04019ef2dcc9d0c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 16:36:44 -0000 The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0fa5403d493be24dda2bf575c04019ef2dcc9d0c commit 0fa5403d493be24dda2bf575c04019ef2dcc9d0c Author: Baptiste Daroussin AuthorDate: 2021-08-03 15:02:16 +0000 Commit: Baptiste Daroussin CommitDate: 2021-08-03 16:35:26 +0000 pkgbase: move locales into their own package The only exception here being C.UTF-8 as this is the default locales so it needs to always be installed Reviewed by: pkgbase (emaste) Differential Revision: https://reviews.freebsd.org/D31397 --- share/colldef/Makefile | 1 + share/colldef_unicode/Makefile | 2 ++ share/ctypedef/Makefile | 9 ++++++++- share/monetdef/Makefile | 2 ++ share/monetdef_unicode/Makefile | 2 ++ share/msgdef/Makefile | 2 ++ share/msgdef_unicode/Makefile | 2 ++ share/numericdef/Makefile | 2 ++ share/numericdef_unicode/Makefile | 2 ++ share/timedef/Makefile | 2 ++ tools/tools/locale/tools/cldr2def.pl | 2 ++ 11 files changed, 27 insertions(+), 1 deletion(-) diff --git a/share/colldef/Makefile b/share/colldef/Makefile index 66487fb76984..f7e24446342d 100644 --- a/share/colldef/Makefile +++ b/share/colldef/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= locales LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_COLLATE .SUFFIXES: .src .LC_COLLATE diff --git a/share/colldef_unicode/Makefile b/share/colldef_unicode/Makefile index ea895d8e388e..f76a7a94805c 100644 --- a/share/colldef_unicode/Makefile +++ b/share/colldef_unicode/Makefile @@ -2,6 +2,7 @@ # Warning: Do not edit. This file is automatically generated from the # tools in /usr/src/tools/tools/locale. +PACKAGE= locales LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_COLLATE .SUFFIXES: .src .LC_COLLATE @@ -107,6 +108,7 @@ CLEANFILES= ${FILES} .for f t in ${SAME} DIRS+= LOCALEDIR_$t LOCALEDIR_$t= ${LOCALEDIR}/$t +LOCALEDIR_$tPACKAGE= locales SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/ctypedef/Makefile b/share/ctypedef/Makefile index 1a57cfeb1444..912b4e6f4757 100644 --- a/share/ctypedef/Makefile +++ b/share/ctypedef/Makefile @@ -1,5 +1,8 @@ # $FreeBSD$ +PACKAGE= locales +FILESGROUPS= FILES ALWAYS +ALWAYSPACKAGE= runtime LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_CTYPE .SUFFIXES: .src .LC_CTYPE @@ -212,12 +215,15 @@ SAME+= lv_LV.ISO8859-13 lt_LT.ISO8859-13 SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) .endif -FILES= ${LOCALES:S/$/.LC_CTYPE/} +# C.UTF-8 is the default locale, so it should always been installed. +ALWAYS= C.UTF-8.LC_CTYPE +FILES= ${LOCALES:NC.UTF-8:S/$/.LC_CTYPE/} CLEANFILES= ${FILES} .for f t in ${SAME} DIRS+= LOCALEDIR_$t LOCALEDIR_$t= ${LOCALEDIR}/$t +LOCALEDIR_$tPACKAGE= locales SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor @@ -225,6 +231,7 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.LC_CTYPE= ${LOCALEDIR}/${f} .endfor +FILESDIR_C.UTF-8.LC_CTYPEPACKAGE= runtime SYMPAIRS+= zh_CN.eucCN.src zh_CN.GB18030.src SYMPAIRS+= zh_CN.eucCN.src zh_CN.GB2312.src diff --git a/share/monetdef/Makefile b/share/monetdef/Makefile index bec0b78d9433..dd1732bd87c6 100644 --- a/share/monetdef/Makefile +++ b/share/monetdef/Makefile @@ -2,6 +2,7 @@ # Warning: Do not edit. This file is automatically generated from the # tools in /usr/src/tools/tools/locale. +PACKAGE= locales LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_MONETARY .SUFFIXES: .src .out @@ -132,6 +133,7 @@ CLEANFILES= ${FILES} .for f t in ${SAME} DIRS+= LOCALEDIR_$t LOCALEDIR_$t= ${LOCALEDIR}/$t +LOCALEDIR_$tPACKAGE= locales SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/monetdef_unicode/Makefile b/share/monetdef_unicode/Makefile index 2fa073f3981d..2ab442ad51b4 100644 --- a/share/monetdef_unicode/Makefile +++ b/share/monetdef_unicode/Makefile @@ -2,6 +2,7 @@ # Warning: Do not edit. This file is automatically generated from the # tools in /usr/src/tools/tools/locale. +PACKAGE= locales LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_MONETARY .SUFFIXES: .src .out @@ -99,6 +100,7 @@ CLEANFILES= ${FILES} .for f t in ${SAME} DIRS+= LOCALEDIR_$t LOCALEDIR_$t= ${LOCALEDIR}/$t +LOCALEDIR_$tPACKAGE= locales SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/msgdef/Makefile b/share/msgdef/Makefile index a176d30c01fc..4cc6a45b46c6 100644 --- a/share/msgdef/Makefile +++ b/share/msgdef/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= locales LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_MESSAGES .SUFFIXES: .src .out @@ -125,6 +126,7 @@ CLEANFILES= ${FILES} .for f t in ${SAME} DIRS+= LOCALEDIR_$t LOCALEDIR_$t= ${LOCALEDIR}/$t +LOCALEDIR_$tPACKAGE= locales SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/msgdef_unicode/Makefile b/share/msgdef_unicode/Makefile index 34f8b30ff733..608ba8860afb 100644 --- a/share/msgdef_unicode/Makefile +++ b/share/msgdef_unicode/Makefile @@ -2,6 +2,7 @@ # Warning: Do not edit. This file is automatically generated from the # tools in /usr/src/tools/tools/locale. +PACKAGE= locales LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_MESSAGES .SUFFIXES: .src .out @@ -99,6 +100,7 @@ CLEANFILES= ${FILES} .for f t in ${SAME} DIRS+= LOCALEDIR_$t LOCALEDIR_$t= ${LOCALEDIR}/$t +LOCALEDIR_$tPACKAGE= locales SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/numericdef/Makefile b/share/numericdef/Makefile index da04535aa4c9..90e2551570b5 100644 --- a/share/numericdef/Makefile +++ b/share/numericdef/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= locale LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_NUMERIC .SUFFIXES: .src .out @@ -128,6 +129,7 @@ CLEANFILES= ${FILES} .for f t in ${SAME} DIRS+= LOCALEDIR_$t LOCALEDIR_$t= ${LOCALEDIR}/$t +LOCALEDIR_$tPACKAGE= locales SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/numericdef_unicode/Makefile b/share/numericdef_unicode/Makefile index 07290250c6b5..6b7af4799efe 100644 --- a/share/numericdef_unicode/Makefile +++ b/share/numericdef_unicode/Makefile @@ -2,6 +2,7 @@ # Warning: Do not edit. This file is automatically generated from the # tools in /usr/src/tools/tools/locale. +PACKAGE= locales LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_NUMERIC .SUFFIXES: .src .out @@ -99,6 +100,7 @@ CLEANFILES= ${FILES} .for f t in ${SAME} DIRS+= LOCALEDIR_$t LOCALEDIR_$t= ${LOCALEDIR}/$t +LOCALEDIR_$tPACKAGE= locales SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/share/timedef/Makefile b/share/timedef/Makefile index df16c038ba4c..c33461ff36bd 100644 --- a/share/timedef/Makefile +++ b/share/timedef/Makefile @@ -1,5 +1,6 @@ # $FreeBSD$ +PACKAGE= locales LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_TIME .SUFFIXES: .src .out @@ -211,6 +212,7 @@ CLEANFILES= ${FILES} .for f t in ${SAME} DIRS+= LOCALEDIR_$t LOCALEDIR_$t= ${LOCALEDIR}/$t +LOCALEDIR_$tPACKAGE= locales SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} .endfor diff --git a/tools/tools/locale/tools/cldr2def.pl b/tools/tools/locale/tools/cldr2def.pl index 78b2634b6250..e65ec30fa6d5 100755 --- a/tools/tools/locale/tools/cldr2def.pl +++ b/tools/tools/locale/tools/cldr2def.pl @@ -952,6 +952,7 @@ sub make_makefile { # Warning: Do not edit. This file is automatically generated from the # tools in /usr/src/tools/tools/locale. +PACKAGE= locales LOCALEDIR= \${SHAREDIR}/locale FILESNAME= $FILESNAMES{$TYPE} .SUFFIXES: .src .${SRCOUT2} @@ -1084,6 +1085,7 @@ CLEANFILES= \${FILES} .for f t in \${SAME} DIRS+= LOCALEDIR_\$t LOCALEDIR_\$t= \${LOCALEDIR}/\$t +LOCALEDIR_\$tPACKAGE= locales SYMLINKS+= ../\$f/\${FILESNAME} \\ \${LOCALEDIR}/\$t/\${FILESNAME} .endfor From owner-dev-commits-src-main@freebsd.org Tue Aug 3 17:00:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B471D63C3E9; Tue, 3 Aug 2021 17:00:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfLjD4fh7z3J25; Tue, 3 Aug 2021 17:00:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87F4116DCE; Tue, 3 Aug 2021 17:00:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173H0WAe059905; Tue, 3 Aug 2021 17:00:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173H0WpI059904; Tue, 3 Aug 2021 17:00:32 GMT (envelope-from git) Date: Tue, 3 Aug 2021 17:00:32 GMT Message-Id: <202108031700.173H0WpI059904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bryan Drewery Subject: git: b60770fceb2b - main - Fix native-xtools build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdrewery X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b60770fceb2b94efe334221bd13a5e55229babb3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 17:00:32 -0000 The branch main has been updated by bdrewery: URL: https://cgit.FreeBSD.org/src/commit/?id=b60770fceb2b94efe334221bd13a5e55229babb3 commit b60770fceb2b94efe334221bd13a5e55229babb3 Author: Bryan Drewery AuthorDate: 2021-08-03 15:20:57 +0000 Commit: Bryan Drewery CommitDate: 2021-08-03 17:00:28 +0000 Fix native-xtools build Fixes https://github.com/freebsd/poudriere/issues/894 Fixes: d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-line") X-MFC-With: d0c737e18 --- Makefile.inc1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index e3707c7a504a..b6843177c10b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2739,7 +2739,6 @@ SUBDIR= ${SUBDIR_OVERRIDE} NXBMAKEARGS+= \ OBJTOP=${NXBOBJTOP:Q} \ OBJROOT=${NXBOBJROOT:Q} \ - MAKEOBJDIRPREFIX= \ -DNO_SHARED \ -DNO_CPU_CFLAGS \ -DNO_PIC \ @@ -2763,6 +2762,9 @@ NXBMAKEARGS+= \ MK_WERROR=no \ MK_ZFS=no +NXBMAKEENV+= \ + MAKEOBJDIRPREFIX= + .if make(native-xtools*) && \ (!defined(NXB_TARGET) || !defined(NXB_TARGET_ARCH)) .error Missing NXB_TARGET / NXB_TARGET_ARCH From owner-dev-commits-src-main@freebsd.org Tue Aug 3 17:00:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F56D63C6EF; Tue, 3 Aug 2021 17:00:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfLjC3hTcz3JWH; Tue, 3 Aug 2021 17:00:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66DD016DCD; Tue, 3 Aug 2021 17:00:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173H0VKC059878; Tue, 3 Aug 2021 17:00:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173H0VOZ059877; Tue, 3 Aug 2021 17:00:31 GMT (envelope-from git) Date: Tue, 3 Aug 2021 17:00:31 GMT Message-Id: <202108031700.173H0VOZ059877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bryan Drewery Subject: git: 2482ea42fb60 - main - Revert "Fix native-xtools build" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdrewery X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2482ea42fb606ae38a2c518f964f57337a4509e4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 17:00:31 -0000 The branch main has been updated by bdrewery: URL: https://cgit.FreeBSD.org/src/commit/?id=2482ea42fb606ae38a2c518f964f57337a4509e4 commit 2482ea42fb606ae38a2c518f964f57337a4509e4 Author: Bryan Drewery AuthorDate: 2021-08-03 16:59:44 +0000 Commit: Bryan Drewery CommitDate: 2021-08-03 17:00:28 +0000 Revert "Fix native-xtools build" This reverts commit 36269b82318280ef184c953b90674f5905e0f53f. This had an unintended change included. --- Makefile | 2 +- Makefile.inc1 | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 711854f4693c..c64873fb241b 100644 --- a/Makefile +++ b/Makefile @@ -218,7 +218,7 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \ ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ SRCCONF=${SRCCONF} SRC_ENV_CONF= \ -f /dev/null -V MAKEOBJDIRPREFIX dummy -.if !empty(_MAKEOBJDIRPREFIX) +.if !empty(_MAKEOBJDIRPREFIX) || !empty(.MAKEOVERRIDES:MMAKEOBJDIRPREFIX) .error MAKEOBJDIRPREFIX can only be set in environment or src-env.conf(5),\ not as a global (in make.conf(5) or src.conf(5)) or command-line variable. .endif diff --git a/Makefile.inc1 b/Makefile.inc1 index b6843177c10b..e3707c7a504a 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2739,6 +2739,7 @@ SUBDIR= ${SUBDIR_OVERRIDE} NXBMAKEARGS+= \ OBJTOP=${NXBOBJTOP:Q} \ OBJROOT=${NXBOBJROOT:Q} \ + MAKEOBJDIRPREFIX= \ -DNO_SHARED \ -DNO_CPU_CFLAGS \ -DNO_PIC \ @@ -2762,9 +2763,6 @@ NXBMAKEARGS+= \ MK_WERROR=no \ MK_ZFS=no -NXBMAKEENV+= \ - MAKEOBJDIRPREFIX= - .if make(native-xtools*) && \ (!defined(NXB_TARGET) || !defined(NXB_TARGET_ARCH)) .error Missing NXB_TARGET / NXB_TARGET_ARCH From owner-dev-commits-src-main@freebsd.org Tue Aug 3 17:00:46 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D77163C6FE; Tue, 3 Aug 2021 17:00:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfLjV3ptWz3Jg1; Tue, 3 Aug 2021 17:00:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1628010046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yIEWHk/HgNJM/zJoym1//7stV4hF4rEIasYMH6/NeMU=; b=EhIdkk0JWQmQrXevBtNPOJV8WHGB+01IPsrGz6zajTtXkeuRH3U8/oKdvoKBm7Z/LqlxnJ R5Ay9qMcOC1kZ3c9qw37nE68tnL9h31sJXcYmslWHqpz6hnQKzwJKg/e2v+isiynJAOqfi AhP++gfqurZ4DxDDuJ514+x1+yEoxDOSSo7QCwMvyRavASr4Ibsf2E1wRjtTpEZ3tEhwqX NLZJHQPnyEAANkOqzr7Ag4A5LWTMXHG9eXpTYzZEeBeqNWqVp0Vk9eQsdoBFq1vWXAGvMK FDh0lqLlSdIjKjFLs5oevNnzTvtNb38vZIP9KMvjYCkOFGtGS0+cSTTXre7FLw== Received: from mail.xzibition.com (unknown [127.0.1.132]) (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 freefall.freebsd.org (Postfix) with ESMTPS id 5215A1089E; Tue, 3 Aug 2021 17:00:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 45579309E4; Tue, 3 Aug 2021 17:00:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id f4iDVh4KWKFb; Tue, 3 Aug 2021 17:00:42 +0000 (UTC) Subject: Re: git: 36269b823182 - main - Fix native-xtools build DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 6686A309D0 To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202108031522.173FMHF9030395@gitrepo.freebsd.org> <21EA81CD-0058-4E80-9FAD-424C0ACCD276@freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <2ea87511-69e8-084a-6148-c4b071346076@FreeBSD.org> Date: Tue, 3 Aug 2021 10:00:39 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <21EA81CD-0058-4E80-9FAD-424C0ACCD276@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="20FTa2FgqScQfgS62zyXj3XzGhrh4KcDu" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1628010046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yIEWHk/HgNJM/zJoym1//7stV4hF4rEIasYMH6/NeMU=; b=nf5hzB5VlMl1sLyDsbABVVJwHCTKYmtCzcVM1NvtbFUyCGLp1Lg96NY3NuhWZ0RZZykPrE 1tz8Xn7GBZV+E59jsbXjaBd9MW0JX9ht6hYuwC9ro/aXvq0HJNosDQ12NcWizAxhehMSmc Blgq/BAAZfl5BgAcDbD8Y1Q4FpRUdEyND0oo8OzWxZCgY5idhxiziMH9DBldXIxeAKck4o X7cUtcCtMI13qWtuhEgl9uupRTJAJU4Z0JaGluNgO4VkiUfzuCnFoj8bqjHXGgwvf74/fg UkgupK/PoI78PSHZGJjNnikHlsKBginf7sK3SlRI9/luvCypjyprYRB6fo6JLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1628010046; a=rsa-sha256; cv=none; b=LgT8G4uRc9g/VQs0XPBnsksf/AJK8IisKB/Zpu0ZoYHbr/xl70HgRg3zceLE4Y3AxRI2x8 w77/F9zMD8dQI9atP70sbFYM0bvNpBGf4bmtfHnZkmvEVA37DKTsQZuXmmtWQXv+LAusO4 d1JHBYVzZRoX9xW98xp1FG7HH5wZkuDozkZBGinBmFEpPG8tObcWV+wRH8kHthppRPMok1 PR4QJsBSyVuC6SLrXMAm9U8nLWwXoPDBjDYFHLNV6jVDURRocPH3bLVzHgupE0KDhvPy0u PGE4AXsMXc29yMdjHAIh51YvcbEw3nGDW6SatuEarc3ZcDOqwVIjvkyO0DS5Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 17:00:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --20FTa2FgqScQfgS62zyXj3XzGhrh4KcDu Content-Type: multipart/mixed; boundary="ReUHfC152P2qIWeljJMTM3LgYXMgOUAbe"; protected-headers="v1" From: Bryan Drewery To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-ID: <2ea87511-69e8-084a-6148-c4b071346076@FreeBSD.org> Subject: Re: git: 36269b823182 - main - Fix native-xtools build References: <202108031522.173FMHF9030395@gitrepo.freebsd.org> <21EA81CD-0058-4E80-9FAD-424C0ACCD276@freebsd.org> In-Reply-To: <21EA81CD-0058-4E80-9FAD-424C0ACCD276@freebsd.org> --ReUHfC152P2qIWeljJMTM3LgYXMgOUAbe Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/3/2021 8:26 AM, Jessica Clarke wrote: > On 3 Aug 2021, at 16:22, Bryan Drewery wrote: >> >> The branch main has been updated by bdrewery: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D36269b82318280ef184c953= b90674f5905e0f53f >> >> commit 36269b82318280ef184c953b90674f5905e0f53f >> Author: Bryan Drewery >> AuthorDate: 2021-08-03 15:20:57 +0000 >> Commit: Bryan Drewery >> CommitDate: 2021-08-03 15:22:14 +0000 >> >> Fix native-xtools build >> >> Fixes https://github.com/freebsd/poudriere/issues/894 >> Fixes: d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX command-= line") >> X-MFC-With: d0c737e18 >> --- >> Makefile | 2 +- >> Makefile.inc1 | 4 +++- >> 2 files changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/Makefile b/Makefile >> index c64873fb241b..711854f4693c 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -218,7 +218,7 @@ _MAKEOBJDIRPREFIX!=3D /usr/bin/env -i PATH=3D${PAT= H} ${MAKE} MK_AUTO_OBJ=3Dno \ >> ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=3D*} __MAKE_CONF=3D${__MAKE_CONF} \= >> SRCCONF=3D${SRCCONF} SRC_ENV_CONF=3D \ >> -f /dev/null -V MAKEOBJDIRPREFIX dummy >> -.if !empty(_MAKEOBJDIRPREFIX) || !empty(.MAKEOVERRIDES:MMAKEOBJDIRPRE= FIX) >> +.if !empty(_MAKEOBJDIRPREFIX) >=20 > Why was this reverted? This restores the bug I was fixing. Does your > change below not fix the actual issue you were seeing? >=20 Sorry! This was not meant to be removed. It was just a mishap from testin= g. I reverted it and pushed the proper fix just now. > Jess >=20 >> .error MAKEOBJDIRPREFIX can only be set in environment or src-env.conf= (5),\ >> not as a global (in make.conf(5) or src.conf(5)) or command-line v= ariable. >> .endif >> diff --git a/Makefile.inc1 b/Makefile.inc1 >> index e3707c7a504a..b6843177c10b 100644 >> --- a/Makefile.inc1 >> +++ b/Makefile.inc1 >> @@ -2739,7 +2739,6 @@ SUBDIR=3D ${SUBDIR_OVERRIDE} >> NXBMAKEARGS+=3D \ >> OBJTOP=3D${NXBOBJTOP:Q} \ >> OBJROOT=3D${NXBOBJROOT:Q} \ >> - MAKEOBJDIRPREFIX=3D \ >> -DNO_SHARED \ >> -DNO_CPU_CFLAGS \ >> -DNO_PIC \ >> @@ -2763,6 +2762,9 @@ NXBMAKEARGS+=3D \ >> MK_WERROR=3Dno \ >> MK_ZFS=3Dno >> >> +NXBMAKEENV+=3D \ >> + MAKEOBJDIRPREFIX=3D >> + >> .if make(native-xtools*) && \ >> (!defined(NXB_TARGET) || !defined(NXB_TARGET_ARCH)) >> .error Missing NXB_TARGET / NXB_TARGET_ARCH >=20 --=20 Regards, Bryan Drewery --ReUHfC152P2qIWeljJMTM3LgYXMgOUAbe-- --20FTa2FgqScQfgS62zyXj3XzGhrh4KcDu Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAmEJdjcFAwAAAAAACgkQNddxu25Gl89x 5wgArHRmE7H3hQPn6JKvJCKWy2N572dZiWZClyOv45T7eZq3YmeQg9BVNiaxrMRWVwKzS4JF/lI9 djTfDRUZMqdLlaRWvsSiZQXrA+thpQMgWUzH36yR2W0UMuqxMscoZh8aoRoVNgQL1axanFi9giWT KpMzXLVS77IMeYbR+FyNdZfrNQAjxc/gTO9xNQRR4VubEx0PKT54xlFrUEzSWl5uhxApcKE+AU5Q Jw8vZf7nPH8FA+kkKe0PtHgREPnEAAP4fciJpemf9DGMGorbuVc+1VKAADrcAXuvmppkve62QCYQ 9VPOw8QgpX11XTk5RE3anzxNkJqhZg194CNo2auFoA== =qa3z -----END PGP SIGNATURE----- --20FTa2FgqScQfgS62zyXj3XzGhrh4KcDu-- From owner-dev-commits-src-main@freebsd.org Tue Aug 3 17:32:13 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD42D63D337 for ; Tue, 3 Aug 2021 17:32:13 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 4GfMPm6GLmz3M5K for ; Tue, 3 Aug 2021 17:32:12 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f51.google.com with SMTP id n11so12929865wmd.2 for ; Tue, 03 Aug 2021 10:32:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=dpfcn/hTtKIb5g3S4tkUG5cGk+DGMyr0/pkUUcCT5Lw=; b=rx3K52ABkeZ/vyK61VIuWJOYoYj4D1v4rJFWcA/sEBrMlm01Fz9UwZJk3BP+/2jWkf yYqKjSXK90ZH71Z7ozx43VdTnALnT9bznOkMXfUkT2gwavxUYxcPTUozYxo8ZUJ5ekv8 kBUYZT1sZ5zMyeiFG/ydWvdSIXJrvwPh0lIg01By79dQfQjydsf2NGE1KwdggDBTE+Hx sq4qRuHUlfCoYXBSZZbs//I1X4IB/S6fjb9oBumKeZZnIOgyEoFA77g/iTLQIfmssED5 Sw3L/kEbO9yxaik/aFQIvFo+zwGqLbV/i2LtvN65XQBd5woZ4P6FYMJWJ0JVCJ9OXfHv hEZA== X-Gm-Message-State: AOAM531JpBDlWbBQckaAz/APLsoqsJ4XN1KHlCkn3/JVHiZHOxVJT+Xk Agfgf70Xv4rsFnPHlYqCe9ZHTQ== X-Google-Smtp-Source: ABdhPJywWvp2p9IJg11+NH1QTKehK/Hr8u5XdcNj0C1G4x5Mc/Vgu7Q959eJmTDL+32vY2BxPkIq+g== X-Received: by 2002:a1c:7c10:: with SMTP id x16mr23187271wmc.41.1628011925941; Tue, 03 Aug 2021 10:32:05 -0700 (PDT) Received: from smtpclient.apple (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id x18sm7895924wmc.17.2021.08.03.10.32.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Aug 2021 10:32:05 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: git: 36269b823182 - main - Fix native-xtools build From: Jessica Clarke In-Reply-To: <2ea87511-69e8-084a-6148-c4b071346076@FreeBSD.org> Date: Tue, 3 Aug 2021 18:32:05 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <60B4BA12-B543-4FCE-AA8C-05BF461A1F13@freebsd.org> References: <202108031522.173FMHF9030395@gitrepo.freebsd.org> <21EA81CD-0058-4E80-9FAD-424C0ACCD276@freebsd.org> <2ea87511-69e8-084a-6148-c4b071346076@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Rspamd-Queue-Id: 4GfMPm6GLmz3M5K X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.49 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.99)[-0.987]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.51:from,131.111.193.104:received]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.51:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 17:32:13 -0000 On 3 Aug 2021, at 18:00, Bryan Drewery wrote: >=20 > On 8/3/2021 8:26 AM, Jessica Clarke wrote: >> On 3 Aug 2021, at 16:22, Bryan Drewery wrote: >>>=20 >>> The branch main has been updated by bdrewery: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D36269b82318280ef184c953b90674f59= 05e0f53f >>>=20 >>> commit 36269b82318280ef184c953b90674f5905e0f53f >>> Author: Bryan Drewery >>> AuthorDate: 2021-08-03 15:20:57 +0000 >>> Commit: Bryan Drewery >>> CommitDate: 2021-08-03 15:22:14 +0000 >>>=20 >>> Fix native-xtools build >>>=20 >>> Fixes https://github.com/freebsd/poudriere/issues/894 >>> Fixes: d0c737e18 ("Makefile: Fix MAKEOBJDIRPREFIX = command-line") >>> X-MFC-With: d0c737e18 >>> --- >>> Makefile | 2 +- >>> Makefile.inc1 | 4 +++- >>> 2 files changed, 4 insertions(+), 2 deletions(-) >>>=20 >>> diff --git a/Makefile b/Makefile >>> index c64873fb241b..711854f4693c 100644 >>> --- a/Makefile >>> +++ b/Makefile >>> @@ -218,7 +218,7 @@ _MAKEOBJDIRPREFIX!=3D /usr/bin/env -i = PATH=3D${PATH} ${MAKE} MK_AUTO_OBJ=3Dno \ >>> ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=3D*} __MAKE_CONF=3D${__MAKE_CONF} = \ >>> SRCCONF=3D${SRCCONF} SRC_ENV_CONF=3D \ >>> -f /dev/null -V MAKEOBJDIRPREFIX dummy >>> -.if !empty(_MAKEOBJDIRPREFIX) || = !empty(.MAKEOVERRIDES:MMAKEOBJDIRPREFIX) >>> +.if !empty(_MAKEOBJDIRPREFIX) >>=20 >> Why was this reverted? This restores the bug I was fixing. Does your >> change below not fix the actual issue you were seeing? >>=20 >=20 > Sorry! This was not meant to be removed. It was just a mishap from = testing. >=20 > I reverted it and pushed the proper fix just now. Thanks, glad my understanding was correct. I=E2=80=99ll give my commit = longer to bake before MFC=E2=80=99ing with this one to see if any other = regressions pop up. Jess From owner-dev-commits-src-main@freebsd.org Tue Aug 3 17:32:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C956563D35F; Tue, 3 Aug 2021 17:32:41 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfMQK0yb1z3M24; Tue, 3 Aug 2021 17:32:40 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 173HWXaw049196; Tue, 3 Aug 2021 10:32:33 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 173HWXr9049195; Tue, 3 Aug 2021 10:32:33 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202108031732.173HWXr9049195@gndrsh.dnsmgr.net> Subject: Re: git: 184d64af1344 - main - locales: stop hardcoding the directories in the mtree In-Reply-To: <202108031227.173CR1qN084657@gitrepo.freebsd.org> To: Baptiste Daroussin Date: Tue, 3 Aug 2021 10:32:33 -0700 (PDT) CC: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4GfMQK0yb1z3M24 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 17:32:41 -0000 > The branch main has been updated by bapt: > > URL: https://cgit.FreeBSD.org/src/commit/?id=184d64af1344d6f3c370499510cede49320f4863 > > commit 184d64af1344d6f3c370499510cede49320f4863 > Author: Baptiste Daroussin > AuthorDate: 2021-08-03 12:25:00 +0000 > Commit: Baptiste Daroussin > CommitDate: 2021-08-03 12:25:00 +0000 > > locales: stop hardcoding the directories in the mtree > > The framework knows how to create directories and tag them properly > for a the creation of a mtree, not need to hardcode all the locales > entries in bsd.usr.mk > > This simplifies addition of new locales but also allow people building > with WITHOUT_LOCALES to end up with a directory full of empty files The uses of /etc/mtree go beyond the simple directory creation, please cause something to build a BSD.locale.dist file and install it in /etc/mtree to replace the functionality removal you have just performed. Thanks, Rod > --- > etc/mtree/BSD.usr.dist | 383 ----------------------------------- > share/colldef/Makefile | 2 + > share/colldef_unicode/Makefile | 2 + > share/ctypedef/Makefile | 2 + > share/monetdef/Makefile | 2 + > share/monetdef_unicode/Makefile | 2 + > share/msgdef/Makefile | 2 + > share/msgdef_unicode/Makefile | 2 + > share/numericdef/Makefile | 2 + > share/numericdef_unicode/Makefile | 2 + > share/timedef/Makefile | 2 + > tools/tools/locale/tools/cldr2def.pl | 2 + > 12 files changed, 22 insertions(+), 383 deletions(-) > > diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist > index 97d17cedb5a1..c96ec1ea5fb5 100644 > --- a/etc/mtree/BSD.usr.dist > +++ b/etc/mtree/BSD.usr.dist > @@ -465,389 +465,6 @@ > .. > .. > locale > - af_ZA.ISO8859-1 > - .. > - af_ZA.ISO8859-15 > - .. > - af_ZA.UTF-8 > - .. > - ar_AE.UTF-8 > - .. > - ar_EG.UTF-8 > - .. > - ar_JO.UTF-8 > - .. > - ar_MA.UTF-8 > - .. > - ar_QA.UTF-8 > - .. > - ar_SA.UTF-8 > - .. > - am_ET.UTF-8 > - .. > - be_BY.CP1131 > - .. > - be_BY.CP1251 > - .. > - be_BY.ISO8859-5 > - .. > - be_BY.UTF-8 > - .. > - bg_BG.CP1251 > - .. > - bg_BG.UTF-8 > - .. > - ca_AD.ISO8859-1 > - .. > - ca_AD.ISO8859-15 > - .. > - ca_ES.ISO8859-1 > - .. > - ca_ES.ISO8859-15 > - .. > - ca_FR.ISO8859-1 > - .. > - ca_FR.ISO8859-15 > - .. > - ca_IT.ISO8859-1 > - .. > - ca_IT.ISO8859-15 > - .. > - ca_AD.UTF-8 > - .. > - ca_ES.UTF-8 > - .. > - ca_FR.UTF-8 > - .. > - ca_IT.UTF-8 > - .. > - cs_CZ.ISO8859-2 > - .. > - cs_CZ.UTF-8 > - .. > - da_DK.ISO8859-1 > - .. > - da_DK.ISO8859-15 > - .. > - da_DK.UTF-8 > - .. > - de_AT.ISO8859-1 > - .. > - de_AT.ISO8859-15 > - .. > - de_AT.UTF-8 > - .. > - de_CH.ISO8859-1 > - .. > - de_CH.ISO8859-15 > - .. > - de_CH.UTF-8 > - .. > - de_DE.ISO8859-1 > - .. > - de_DE.ISO8859-15 > - .. > - de_DE.UTF-8 > - .. > - el_GR.ISO8859-7 > - .. > - el_GR.UTF-8 > - .. > - en_AU.ISO8859-1 > - .. > - en_AU.ISO8859-15 > - .. > - en_AU.US-ASCII > - .. > - en_AU.UTF-8 > - .. > - en_CA.ISO8859-1 > - .. > - en_CA.ISO8859-15 > - .. > - en_CA.US-ASCII > - .. > - en_CA.UTF-8 > - .. > - en_GB.ISO8859-1 > - .. > - en_GB.ISO8859-15 > - .. > - en_GB.US-ASCII > - .. > - en_GB.UTF-8 > - .. > - en_HK.ISO8859-1 > - .. > - en_HK.UTF-8 > - .. > - en_IE.ISO8859-1 > - .. > - en_IE.ISO8859-15 > - .. > - en_IE.UTF-8 > - .. > - en_NZ.ISO8859-1 > - .. > - en_NZ.ISO8859-15 > - .. > - en_NZ.US-ASCII > - .. > - en_NZ.UTF-8 > - .. > - en_PH.UTF-8 > - .. > - en_SG.ISO8859-1 > - .. > - en_SG.UTF-8 > - .. > - en_US.ISO8859-1 > - .. > - en_US.ISO8859-15 > - .. > - en_US.US-ASCII > - .. > - en_US.UTF-8 > - .. > - en_ZA.ISO8859-1 > - .. > - en_ZA.ISO8859-15 > - .. > - en_ZA.US-ASCII > - .. > - en_ZA.UTF-8 > - .. > - es_AR.ISO8859-1 > - .. > - es_AR.UTF-8 > - .. > - es_CR.UTF-8 > - .. > - es_ES.ISO8859-1 > - .. > - es_ES.ISO8859-15 > - .. > - es_ES.UTF-8 > - .. > - es_MX.ISO8859-1 > - .. > - es_MX.UTF-8 > - .. > - et_EE.ISO8859-1 > - .. > - et_EE.ISO8859-15 > - .. > - et_EE.UTF-8 > - .. > - eu_ES.ISO8859-1 > - .. > - eu_ES.ISO8859-15 > - .. > - eu_ES.UTF-8 > - .. > - fi_FI.ISO8859-1 > - .. > - fi_FI.ISO8859-15 > - .. > - fi_FI.UTF-8 > - .. > - fr_BE.ISO8859-1 > - .. > - fr_BE.ISO8859-15 > - .. > - fr_BE.UTF-8 > - .. > - fr_CA.ISO8859-1 > - .. > - fr_CA.ISO8859-15 > - .. > - fr_CA.UTF-8 > - .. > - fr_CH.ISO8859-1 > - .. > - fr_CH.ISO8859-15 > - .. > - fr_CH.UTF-8 > - .. > - fr_FR.ISO8859-1 > - .. > - fr_FR.ISO8859-15 > - .. > - fr_FR.UTF-8 > - .. > - ga_IE.UTF-8 > - .. > - he_IL.UTF-8 > - .. > - hi_IN.ISCII-DEV > - .. > - hi_IN.UTF-8 > - .. > - hr_HR.ISO8859-2 > - .. > - hr_HR.UTF-8 > - .. > - hu_HU.ISO8859-2 > - .. > - hu_HU.UTF-8 > - .. > - hy_AM.ARMSCII-8 > - .. > - hy_AM.UTF-8 > - .. > - is_IS.ISO8859-1 > - .. > - is_IS.ISO8859-15 > - .. > - is_IS.UTF-8 > - .. > - it_CH.ISO8859-1 > - .. > - it_CH.ISO8859-15 > - .. > - it_CH.UTF-8 > - .. > - it_IT.ISO8859-1 > - .. > - it_IT.ISO8859-15 > - .. > - it_IT.UTF-8 > - .. > - ja_JP.SJIS > - .. > - ja_JP.UTF-8 > - .. > - ja_JP.eucJP > - .. > - kk_KZ.UTF-8 > - .. > - ko_KR.CP949 > - .. > - ko_KR.UTF-8 > - .. > - ko_KR.eucKR > - .. > - lt_LT.ISO8859-13 > - .. > - lt_LT.UTF-8 > - .. > - lv_LV.ISO8859-13 > - .. > - lv_LV.UTF-8 > - .. > - mn_MN.UTF-8 > - .. > - nb_NO.ISO8859-1 > - .. > - nb_NO.ISO8859-15 > - .. > - nb_NO.UTF-8 > - .. > - nl_BE.ISO8859-1 > - .. > - nl_BE.ISO8859-15 > - .. > - nl_BE.UTF-8 > - .. > - nl_NL.ISO8859-1 > - .. > - nl_NL.ISO8859-15 > - .. > - nl_NL.UTF-8 > - .. > - nn_NO.ISO8859-1 > - .. > - nn_NO.ISO8859-15 > - .. > - nn_NO.UTF-8 > - .. > - pl_PL.ISO8859-2 > - .. > - pl_PL.UTF-8 > - .. > - pt_BR.ISO8859-1 > - .. > - pt_BR.UTF-8 > - .. > - pt_PT.ISO8859-1 > - .. > - pt_PT.ISO8859-15 > - .. > - pt_PT.UTF-8 > - .. > - ro_RO.ISO8859-2 > - .. > - ro_RO.UTF-8 > - .. > - ru_RU.CP1251 > - .. > - ru_RU.CP866 > - .. > - ru_RU.ISO8859-5 > - .. > - ru_RU.KOI8-R > - .. > - ru_RU.UTF-8 > - .. > - se_FI.UTF-8 > - .. > - se_NO.UTF-8 > - .. > - sk_SK.ISO8859-2 > - .. > - sk_SK.UTF-8 > - .. > - sl_SI.ISO8859-2 > - .. > - sl_SI.UTF-8 > - .. > - sr_RS.ISO8859-5 > - .. > - sr_RS.UTF-8 > - .. > - sr_RS.ISO8859-2 > - .. > - sr_RS.UTF-8@latin > - .. > - sv_FI.ISO8859-1 > - .. > - sv_FI.ISO8859-15 > - .. > - sv_FI.UTF-8 > - .. > - sv_SE.ISO8859-1 > - .. > - sv_SE.ISO8859-15 > - .. > - sv_SE.UTF-8 > - .. > - tr_TR.ISO8859-9 > - .. > - tr_TR.UTF-8 > - .. > - uk_UA.CP1251 > - .. > - uk_UA.ISO8859-5 > - .. > - uk_UA.KOI8-U > - .. > - uk_UA.UTF-8 > - .. > - zh_CN.GB18030 > - .. > - zh_CN.GB2312 > - .. > - zh_CN.GBK > - .. > - zh_CN.eucCN > - .. > - zh_CN.UTF-8 > - .. > - zh_HK.UTF-8 > - .. > - zh_TW.Big5 > - .. > - zh_TW.UTF-8 > .. > .. > man > diff --git a/share/colldef/Makefile b/share/colldef/Makefile > index 89454f84a5e4..15e84179c768 100644 > --- a/share/colldef/Makefile > +++ b/share/colldef/Makefile > @@ -133,7 +133,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) > FILES= ${LOCALES:S/$/.LC_COLLATE/} > CLEANFILES= ${FILES} > > +DIRS+= SAMEDIRS > .for f t in ${SAME} > +SAMEDIRS+= ${LOCALEDIR}/$t > SYMLINKS+= ../$f/${FILESNAME} \ > ${LOCALEDIR}/$t/${FILESNAME} > .endfor > diff --git a/share/colldef_unicode/Makefile b/share/colldef_unicode/Makefile > index e84d952a1316..4dd4bf78a36f 100644 > --- a/share/colldef_unicode/Makefile > +++ b/share/colldef_unicode/Makefile > @@ -104,7 +104,9 @@ SAME+= zh_TW.UTF-8 zh_HK.UTF-8 > FILES= ${LOCALES:S/$/.LC_COLLATE/} > CLEANFILES= ${FILES} > > +DIRS+= SAMEDIRS > .for f t in ${SAME} > +SAMEDIRS+= ${LOCALEDIR}/$t > SYMLINKS+= ../$f/${FILESNAME} \ > ${LOCALEDIR}/$t/${FILESNAME} > .endfor > diff --git a/share/ctypedef/Makefile b/share/ctypedef/Makefile > index da580d72c32f..ad7eb237f3eb 100644 > --- a/share/ctypedef/Makefile > +++ b/share/ctypedef/Makefile > @@ -215,7 +215,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) > FILES= ${LOCALES:S/$/.LC_CTYPE/} > CLEANFILES= ${FILES} > > +DIRS+= SAMEDIRS > .for f t in ${SAME} > +SAMEDIRS+= ${LOCALEDIR}/$t > SYMLINKS+= ../$f/${FILESNAME} \ > ${LOCALEDIR}/$t/${FILESNAME} > .endfor > diff --git a/share/monetdef/Makefile b/share/monetdef/Makefile > index e5d861da468d..f0b34998f4bd 100644 > --- a/share/monetdef/Makefile > +++ b/share/monetdef/Makefile > @@ -129,7 +129,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) > FILES= ${LOCALES:S/$/.out/} > CLEANFILES= ${FILES} > > +DIRS+= SAMEDIRS > .for f t in ${SAME} > +SAMEDIRS+= ${LOCALEDIR}/$t > SYMLINKS+= ../$f/${FILESNAME} \ > ${LOCALEDIR}/$t/${FILESNAME} > .endfor > diff --git a/share/monetdef_unicode/Makefile b/share/monetdef_unicode/Makefile > index 6eaab4f0ad94..4655c742669b 100644 > --- a/share/monetdef_unicode/Makefile > +++ b/share/monetdef_unicode/Makefile > @@ -96,7 +96,9 @@ SAME+= sr_RS.UTF-8@latin sr_RS.UTF-8 > FILES= ${LOCALES:S/$/.out/} > CLEANFILES= ${FILES} > > +DIRS+= SAMEDIRS > .for f t in ${SAME} > +SAMEDIRS+= ${LOCALEDIR}/$t > SYMLINKS+= ../$f/${FILESNAME} \ > ${LOCALEDIR}/$t/${FILESNAME} > .endfor > diff --git a/share/msgdef/Makefile b/share/msgdef/Makefile > index 44f1ca316953..9f0b7f2f3bcf 100644 > --- a/share/msgdef/Makefile > +++ b/share/msgdef/Makefile > @@ -122,7 +122,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) > FILES= ${LOCALES:S/$/.out/} > CLEANFILES= ${FILES} > > +DIRS+= SAMEDIRS > .for f t in ${SAME} > +SAMEDIRS+= ${LOCALEDIR}/$t > SYMLINKS+= ../$f/${FILESNAME} \ > ${LOCALEDIR}/$t/${FILESNAME} > .endfor > diff --git a/share/msgdef_unicode/Makefile b/share/msgdef_unicode/Makefile > index 3f14010b9fa8..c0bffc05ccc6 100644 > --- a/share/msgdef_unicode/Makefile > +++ b/share/msgdef_unicode/Makefile > @@ -96,7 +96,9 @@ SAME+= zh_TW.UTF-8 zh_HK.UTF-8 > FILES= ${LOCALES:S/$/.out/} > CLEANFILES= ${FILES} > > +DIRS+= SAMEDIRS > .for f t in ${SAME} > +SAMEDIRS+= ${LOCALEDIR}/$t > SYMLINKS+= ../$f/${FILESNAME} \ > ${LOCALEDIR}/$t/${FILESNAME} > .endfor > diff --git a/share/numericdef/Makefile b/share/numericdef/Makefile > index 1742dd724d1c..f1047e9cb5d3 100644 > --- a/share/numericdef/Makefile > +++ b/share/numericdef/Makefile > @@ -125,7 +125,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) > FILES= ${LOCALES:S/$/.out/} > CLEANFILES= ${FILES} > > +DIRS+= SAMEDIRS > .for f t in ${SAME} > +SAMEDIRS+= ${LOCALEDIR}/$t > SYMLINKS+= ../$f/${FILESNAME} \ > ${LOCALEDIR}/$t/${FILESNAME} > .endfor > diff --git a/share/numericdef_unicode/Makefile b/share/numericdef_unicode/Makefile > index c7568a4177fb..3f7f3e4f285e 100644 > --- a/share/numericdef_unicode/Makefile > +++ b/share/numericdef_unicode/Makefile > @@ -96,7 +96,9 @@ SAME+= fr_FR.UTF-8 fr_BE.UTF-8 > FILES= ${LOCALES:S/$/.out/} > CLEANFILES= ${FILES} > > +DIRS+= SAMEDIRS > .for f t in ${SAME} > +SAMEDIRS+= ${LOCALEDIR}/$t > SYMLINKS+= ../$f/${FILESNAME} \ > ${LOCALEDIR}/$t/${FILESNAME} > .endfor > diff --git a/share/timedef/Makefile b/share/timedef/Makefile > index 042f2f0e36f0..428e8067ae18 100644 > --- a/share/timedef/Makefile > +++ b/share/timedef/Makefile > @@ -208,7 +208,9 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) > FILES= ${LOCALES:S/$/.out/} > CLEANFILES= ${FILES} > > +DIRS+= SAMEDIRS > .for f t in ${SAME} > +SAMEDIRS+= ${LOCALEDIR}/$t > SYMLINKS+= ../$f/${FILESNAME} \ > ${LOCALEDIR}/$t/${FILESNAME} > .endfor > diff --git a/tools/tools/locale/tools/cldr2def.pl b/tools/tools/locale/tools/cldr2def.pl > index 70e0bdad525b..277102d60a49 100755 > --- a/tools/tools/locale/tools/cldr2def.pl > +++ b/tools/tools/locale/tools/cldr2def.pl > @@ -1081,7 +1081,9 @@ EOF > FILES= \${LOCALES:S/\$/.${SRCOUT2}/} > CLEANFILES= \${FILES} > > +DIRS+= SAMEDIRS > .for f t in \${SAME} > +SAMEDIRS+= \${LOCALEDIR}/\$t > SYMLINKS+= ../\$f/\${FILESNAME} \\ > \${LOCALEDIR}/\$t/\${FILESNAME} > .endfor > -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-main@freebsd.org Tue Aug 3 18:19:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BCB263DADD; Tue, 3 Aug 2021 18:19:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfNSY33tbz3QJW; Tue, 3 Aug 2021 18:19:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5141B180B4; Tue, 3 Aug 2021 18:19:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173IJfoe060447; Tue, 3 Aug 2021 18:19:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173IJfkv060446; Tue, 3 Aug 2021 18:19:41 GMT (envelope-from git) Date: Tue, 3 Aug 2021 18:19:41 GMT Message-Id: <202108031819.173IJfkv060446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2d319ebe5c08 - main - Style MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d319ebe5c08f3454c4e76564b88fb921f008185 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 18:19:41 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2d319ebe5c08f3454c4e76564b88fb921f008185 commit 2d319ebe5c08f3454c4e76564b88fb921f008185 Author: Konstantin Belousov AuthorDate: 2021-08-02 21:05:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-03 18:19:32 +0000 Style Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31378 --- lib/libc/include/compat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/include/compat.h b/lib/libc/include/compat.h index 72823366c33a..ccb92c0fd930 100644 --- a/lib/libc/include/compat.h +++ b/lib/libc/include/compat.h @@ -37,7 +37,7 @@ #ifndef __LIBC_COMPAT_H__ #define __LIBC_COMPAT_H__ -#define __sym_compat(sym,impl,verid) \ +#define __sym_compat(sym, impl, verid) \ .symver impl, sym@verid #ifndef NO_COMPAT7 @@ -74,7 +74,7 @@ __sym_compat(kevent, freebsd11_kevent, FBSD_1.0); #define __weak_reference(sym,alias) \ .weak alias;.equ alias,sym -__weak_reference(__sys_fcntl,__fcntl_compat) +__weak_reference(__sys_fcntl, __fcntl_compat) #undef __weak_reference From owner-dev-commits-src-main@freebsd.org Tue Aug 3 18:19:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD36D63DDBB; Tue, 3 Aug 2021 18:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfNSZ45ktz3QMZ; Tue, 3 Aug 2021 18:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73AE9180B5; Tue, 3 Aug 2021 18:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 173IJgle060471; Tue, 3 Aug 2021 18:19:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 173IJgPB060470; Tue, 3 Aug 2021 18:19:42 GMT (envelope-from git) Date: Tue, 3 Aug 2021 18:19:42 GMT Message-Id: <202108031819.173IJgPB060470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 49ad342cc10c - main - Add _Fork() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49ad342cc10cba14b3a40ba26cf8bb2150e2925a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 18:19:42 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=49ad342cc10cba14b3a40ba26cf8bb2150e2925a commit 49ad342cc10cba14b3a40ba26cf8bb2150e2925a Author: Konstantin Belousov AuthorDate: 2021-08-02 09:50:32 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-03 18:19:32 +0000 Add _Fork() Current POSIX standard requires fork() to be async-signal safe. Neither our implementation, nor implementations in other operating systems are, and practically it is impossible to make fork() async-signal safe without too much efforts. Also, that would put undue requirement that all atfork handlers should be async-signal safe as well, which contradicts its main use. As result, Austin Group dropped the requirement, and added a new function _Fork() that should be async-signal safe, but it does not call atfork handlers. Basically, _Fork() can be implemented as a raw syscall. Release of glibc 2.34 added _Fork(), do the same for FreeBSD. Clarify threading behavior for fork() in the manpage. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D31378 --- include/unistd.h | 1 + lib/libc/sys/Makefile.inc | 1 + lib/libc/sys/Symbol.map | 4 +++ lib/libc/sys/_Fork.c | 45 +++++++++++++++++++++++++++ lib/libc/sys/fork.2 | 78 ++++++++++++++++++++++++++++++++++++++++++++--- 5 files changed, 125 insertions(+), 4 deletions(-) diff --git a/include/unistd.h b/include/unistd.h index 9fa9bebbc4c0..5f358ad72d9a 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -586,6 +586,7 @@ int undelete(const char *); int unwhiteout(const char *); void *valloc(size_t); /* obsoleted by malloc() */ int funlinkat(int, const char *, int, int); +pid_t _Fork(void); #ifndef _OPTRESET_DECLARED #define _OPTRESET_DECLARED diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 9a417f4a7c74..a1eb9567a380 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -49,6 +49,7 @@ SRCS+= closefrom.c SRCS+= pipe.c SRCS+= shm_open.c SRCS+= vadvise.c +SRCS+= _Fork.c SRCS+= compat-stub.c diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map index 0044c06fd639..80bb2c236191 100644 --- a/lib/libc/sys/Symbol.map +++ b/lib/libc/sys/Symbol.map @@ -417,6 +417,10 @@ FBSD_1.6 { shm_rename; }; +FBSD_1.7 { + _Fork; +}; + FBSDprivate_1.0 { ___acl_aclcheck_fd; __sys___acl_aclcheck_fd; diff --git a/lib/libc/sys/_Fork.c b/lib/libc/sys/_Fork.c new file mode 100644 index 000000000000..a7aaf82429bb --- /dev/null +++ b/lib/libc/sys/_Fork.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2021 The FreeBSD Foundation. + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include "libc_private.h" + +#pragma weak _Fork +pid_t +_Fork(void) +{ + return (__sys_fork()); +} diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2 index 9ea0a6afb96f..bf934d166b03 100644 --- a/lib/libc/sys/fork.2 +++ b/lib/libc/sys/fork.2 @@ -28,7 +28,7 @@ .\" @(#)fork.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 20, 2021 +.Dd August 2, 2021 .Dt FORK 2 .Os .Sh NAME @@ -40,10 +40,12 @@ .In unistd.h .Ft pid_t .Fn fork void +.Ft pid_t +.Fn _Fork void .Sh DESCRIPTION The .Fn fork -system call causes creation of a new process. +function causes creation of a new process. The new process (child process) is an exact copy of the calling process (parent process) except for the following: .Bl -bullet -offset indent @@ -77,6 +79,15 @@ are set to 0; see All interval timers are cleared; see .Xr setitimer 2 . .It +The robust mutexes list (see +.Xr pthread_mutexattr_setrobust 3 ) +is cleared for the child. +.It +The atfork handlers established with the +.Xr pthread_atfork 3 +function are called as appropriate before fork in the parent process, +and after the child is created, in parent and child. +.It The child process has only one thread, corresponding to the calling thread in the parent process. If the process has more than one thread, @@ -87,11 +98,58 @@ and therefore only async-signal-safe functions are guaranteed to work in the child process until a call to .Xr execve 2 or a similar function. +The +.Fx +implementation of +.Fn fork +provides a usable +.Xr malloc 3 , +and +.Xr rtld 1 +services in the child process. .El +.Pp +The +.Fn fork +function is not async-signal safe and creates a cancellation point +in the parent process. +It cannot be safely used from signal handlers, and the atfork handlers +established by +.Xr pthread_atfork 3 +do not need to be async-signal safe either. +.Pp +The +.Fn _Fork +function creates a new process, similarly to +.Fn fork , +but it is async-signal safe. +.Fn _Fork +does not call atfork handlers, and does not create a cancellation point. +It can be used safely from signal handlers, but then no userspace +services ( +.Xr malloc 3 +or +.Xr rtld 1 ) +are available in the child if forked from multi-threaded parent. +In particular, if using dynamic linking, all dynamic symbols used by the +child after +.Fn _Fork +must be pre-resolved. +Note: resolving can be done globally by specifying the +.Ev LD_BIND_NOW +environment variable to the dynamic linker, or per-binary by passing the +.Fl z Ar now +option to the static linker +.Xr ld 1 , +or by using each symbol before the +.Fn _Fork +call to force the binding. .Sh RETURN VALUES Upon successful completion, .Fn fork -returns a value +and +.Fn _Fork +return a value of 0 to the child process and returns the process ID of the child process to the parent process. Otherwise, a value of -1 is returned @@ -176,9 +234,21 @@ There is insufficient swap space for the new process. .Xr setrlimit 2 , .Xr sigaction 2 , .Xr vfork 2 , -.Xr wait 2 +.Xr wait 2 , +.Xr pthread_atfork 3 .Sh HISTORY The .Fn fork function appeared in .At v1 . +.Pp +The +.Fn _Fork +function was defined by Austin Group together with the removal +of a requirement that the +.Fn fork +implementation must be async-signal safe. +The +.Fn _Fork +function appeared in +.Fx 14.0 . From owner-dev-commits-src-main@freebsd.org Tue Aug 3 20:28:05 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08E8E650391; Tue, 3 Aug 2021 20:28:05 +0000 (UTC) (envelope-from bapt@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 4GfRJh6TPQz3rkb; Tue, 3 Aug 2021 20:28:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (nours.eu [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id AF119C1E0; Tue, 3 Aug 2021 20:28:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from dummy.faircode.eu (10.246.39.62.rev.sfr.net [62.39.246.10]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aniel.nours.eu (Postfix) with ESMTPSA id 96CD64D875; Tue, 3 Aug 2021 22:28:02 +0200 (CEST) Date: Tue, 3 Aug 2021 20:28:01 +0000 (UTC) From: Baptiste Daroussin To: "Rodney W. Grimes" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: <1acb127e-1d2c-4c9f-96e6-23bfbf9695ac@FreeBSD.org> In-Reply-To: <202108031732.173HWXr9049195@gndrsh.dnsmgr.net> References: <202108031732.173HWXr9049195@gndrsh.dnsmgr.net> Subject: Re: git: 184d64af1344 - main - locales: stop hardcoding the directories in the mtree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: <1acb127e-1d2c-4c9f-96e6-23bfbf9695ac@FreeBSD.org> X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2021 20:28:05 -0000 3 ao=C3=BBt 2021 19:32:44 Rodney W. Grimes : >> The branch main has been updated by bapt: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D184d64af1344d6f3c37049951= 0cede49320f4863 >> >> commit 184d64af1344d6f3c370499510cede49320f4863 >> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Baptiste Daroussin >> AuthorDate: 2021-08-03 12:25:00 +0000 >> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Baptiste Daroussin >> CommitDate: 2021-08-03 12:25:00 +0000 >> >> =C2=A0=C2=A0=C2=A0 locales: stop hardcoding the directories in the mtree >> =C2=A0=C2=A0=C2=A0 >> =C2=A0=C2=A0=C2=A0 The framework knows how to create directories and tag= them properly >> =C2=A0=C2=A0=C2=A0 for a the creation of a mtree, not need to hardcode a= ll the locales >> =C2=A0=C2=A0=C2=A0 entries in bsd.usr.mk >> =C2=A0=C2=A0=C2=A0 >> =C2=A0=C2=A0=C2=A0 This simplifies addition of new locales but also allo= w people building >> =C2=A0=C2=A0=C2=A0 with WITHOUT_LOCALES to end up with a directory full = of empty files > > The uses of /etc/mtree go beyond the simple directory creation, > please cause something to build a BSD.locale.dist file and install > it in /etc/mtree to replace the functionality removal you have > just performed. > > Thanks, > Rod > Please provide a valid use case not working anymore after this change and I= will consider. Note that this is not the only part of the tree where the same thing is don= e. Best, Bapt From owner-dev-commits-src-main@freebsd.org Wed Aug 4 02:11:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3930655335; Wed, 4 Aug 2021 02:11:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfZx25x9zz4jLq; Wed, 4 Aug 2021 02:11:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B42EE1E3B5; Wed, 4 Aug 2021 02:11:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1742BYLZ099561; Wed, 4 Aug 2021 02:11:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1742BYum099560; Wed, 4 Aug 2021 02:11:34 GMT (envelope-from git) Date: Wed, 4 Aug 2021 02:11:34 GMT Message-Id: <202108040211.1742BYum099560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e94f1a0a37fd - main - Revert "arm: remove fslsdma from GENERIC" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e94f1a0a37fdd3252201aaa5a94f46da7f8e740e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 02:11:35 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e94f1a0a37fdd3252201aaa5a94f46da7f8e740e commit e94f1a0a37fdd3252201aaa5a94f46da7f8e740e Author: Warner Losh AuthorDate: 2021-08-04 02:09:18 +0000 Commit: Warner Losh CommitDate: 2021-08-04 02:10:32 +0000 Revert "arm: remove fslsdma from GENERIC" The firmware was already in the tree when I did this commit, and I missed the message. The bug was obsolete. This reverts commit 9e3761d126c5c019d6c935e83989928eb1a0e76e. PR: 237466 Sponsored by: Netflix --- sys/arm/conf/GENERIC | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index 34876e285f8d..427f354d1f93 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -258,6 +258,7 @@ device ti_pruss device ti_mbox # DMA controller +device fslsdma device ti_sdma device a10_dmac device a31_dmac From owner-dev-commits-src-main@freebsd.org Wed Aug 4 10:12:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 021CF65B450; Wed, 4 Aug 2021 10:12:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gfnbk6Tvfz3NnZ; Wed, 4 Aug 2021 10:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6F1724E38; Wed, 4 Aug 2021 10:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174ACImq042954; Wed, 4 Aug 2021 10:12:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174ACIFh042953; Wed, 4 Aug 2021 10:12:18 GMT (envelope-from git) Date: Wed, 4 Aug 2021 10:12:18 GMT Message-Id: <202108041012.174ACIFh042953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 21d854658801 - main - sound: Add an example of basic sound application MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21d854658801f6ddb91de3a3c3384e90f5d920f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 10:12:19 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=21d854658801f6ddb91de3a3c3384e90f5d920f2 commit 21d854658801f6ddb91de3a3c3384e90f5d920f2 Author: Goran Mekić AuthorDate: 2021-08-04 10:04:54 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-04 10:11:54 +0000 sound: Add an example of basic sound application This is an example demonstrating the usage of the OSS-compatible APIs provided by the sound(4) subsystem. It reads frames from a dsp node and writes them to the same dsp node. MFC after: 2 weeks Reviewed by: hselasky, bcr Differential revision: https://reviews.freebsd.org/D30149 --- share/examples/Makefile | 7 ++ share/examples/sound/README | 66 +++++++++++ share/examples/sound/basic.c | 99 ++++++++++++++++ share/examples/sound/ossinit.h | 262 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 434 insertions(+) diff --git a/share/examples/Makefile b/share/examples/Makefile index f4273d2266f0..1d916f344b77 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -30,6 +30,7 @@ LDIRS= BSD_daemon \ printing \ ses \ scsi_target \ + sound \ sunrpc \ ypldap @@ -315,6 +316,12 @@ SE_SCSI_TARGET= \ scsi_target.8 \ scsi_cmds.c +SE_DIRS+= sound +SE_SOUND= \ + basic.c \ + ossinit.h \ + README + SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/README b/share/examples/sound/README new file mode 100644 index 000000000000..0188a26348c8 --- /dev/null +++ b/share/examples/sound/README @@ -0,0 +1,66 @@ +Briefly summarised, a general audio application will: +- open(2) +- ioctl(2) +- read(2) +- write(2) +- close(2) + +In this example, read/write will be called in a loop for a duration of +record/playback. Usually, /dev/dsp is the device you want to open, but it can +be any OSS compatible device, even user space one created with virtual_oss. For +configuring sample rate, bit depth and all other configuring of the device +ioctl is used. As devices can support multiple sample rates and formats, what +specific application should do in case there's an error issuing ioctl, as not +all errors are fatal, is upon the developer to decide. As a general guideline +Official OSS development howto should be used. FreeBSD OSS and virtual_oss are +different to a small degree. + +For more advanced OSS and real-time applications, developers need to handle +buffers more carefully. The size of the buffer in OSS is selected using fragment +size size_selector and the buffer size is 2^size_selector for values between 4 +and 16. The formula on the official site is: + +int frag = (max_fragments << 16) | (size_selector); +ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &frag); + +The max_fragments determines in how many fragments the buffer will be, hence if +the size_selector is 4, the requested size is 2^4 = 16 and for the +max_fragments of 2, the total buffer size will be + +(2 ^ size_selector) * max_fragments + +or in this case 32 bytes. Please note that size of buffer is in bytes not +samples. For example, 24bit sample will be represented with 3 bytes. If you're +porting audio app from Linux, you should be aware that 24 bit samples are +represented with 4 bytes (usually int). + +FreeBSD kernel will round up max_fragments and size of fragment/buffer, so the +last thing any OSS code should do is get info about buffer with audio_buf_info +and SNDCTL_DSP_GETOSPACE. That also means that not all values of max_fragments +are permitted. + +From kernel perspective, there are few points OSS developers should be aware of: +- There is a software facing buffer (bs) and a hardware driver buffer (b) +- The sizes can be seen with cat /dev/sndstat as [b:_/_/_] [bs:_/_/_] (needed: + sysctl hw.snd.verbose=2) +- OSS ioctl only concern software buffer fragments, not hardware + +For USB the block size is according to hw.usb.uaudio.buffer_ms sysctl, meaning +2ms at 48kHz gives 0.002 * 48000 = 96 samples per block, all multiples of this +work well. Block size for virtual_oss, if used, should be set accordingly. + +OSS driver insists on reading / writing a certain number of samples at a time, +one fragment full of samples. It is bound to do so in a fixed time frame, to +avoid under- and overruns in communication with the hardware. + +The idea of a total buffer size that holds max_fragments fragments is to give +some slack and allow application to be about max_fragments - 1 fragments late. +Let's call this the jitter tolerance. The jitter tolerance may be much less if +there is a slight mismatch between the period and the samples per fragment. + +Jitter tolerance gets better if we can make either the period or the samples +per fragment considerably smaller than the other. In our case that means we +divide the total buffer size into smaller fragments, keeping overall latency at +the same level. + +Official OSS development howto: http://manuals.opensound.com/developer/DSP.html diff --git a/share/examples/sound/basic.c b/share/examples/sound/basic.c new file mode 100644 index 000000000000..c903cbd8bf11 --- /dev/null +++ b/share/examples/sound/basic.c @@ -0,0 +1,99 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Goran Mekić + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "ossinit.h" + +int +main() +{ + config_t config = { + .device = "/dev/dsp", + .channels = -1, + .format = format, + .frag = -1, + .sample_rate = 48000, + .sample_size = sizeof(sample_t), + .buffer_info.fragments = -1, + .mmap = 0, + }; + + /* Initialize device */ + oss_init(&config); + + /* + * Allocate input and output buffers so that their size match + * frag_size + */ + int ret; + int bytes = config.buffer_info.bytes; + int8_t *ibuf = malloc(bytes); + int8_t *obuf = malloc(bytes); + sample_t *channels = malloc(bytes); + + printf( + "bytes: %d, fragments: %d, fragsize: %d, fragstotal: %d, samples: %d\n", + bytes, + config.buffer_info.fragments, + config.buffer_info.fragsize, + config.buffer_info.fragstotal, + config.sample_count + ); + + /* Minimal engine: read input and copy it to the output */ + for (;;) { + ret = read(config.fd, ibuf, bytes); + if (ret < bytes) { + fprintf( + stderr, + "Requested %d bytes, but read %d!\n", + bytes, + ret + ); + break; + } + oss_split(&config, (sample_t *)ibuf, channels); + /* All processing will happen here */ + oss_merge(&config, channels, (sample_t *)obuf); + ret = write(config.fd, obuf, bytes); + if (ret < bytes) { + fprintf( + stderr, + "Requested %d bytes, but wrote %d!\n", + bytes, + ret + ); + break; + } + } + + /* Cleanup */ + free(channels); + free(obuf); + free(ibuf); + close(config.fd); + return (0); +} diff --git a/share/examples/sound/ossinit.h b/share/examples/sound/ossinit.h new file mode 100644 index 000000000000..b5fbd3e99244 --- /dev/null +++ b/share/examples/sound/ossinit.h @@ -0,0 +1,262 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Goran Mekić + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include + + +#ifndef SAMPLE_SIZE +#define SAMPLE_SIZE 16 +#endif + +/* Format can be unsigned, in which case replace S with U */ +#if SAMPLE_SIZE == 32 +typedef int32_t sample_t; +int format = AFMT_S32_NE; /* Signed 32bit native endian format */ +#elif SAMPLE_SIZE == 16 +typedef int16_t sample_t; +int format = AFMT_S16_NE; /* Signed 16bit native endian format */ +#elif SAMPLE_SIZE == 8 +typedef int8_t sample_t; +int format = AFMT_S8_NE; /* Signed 8bit native endian format */ +#else +#error Unsupported sample format! +typedef int32_t sample_t; +int format = AFMT_S32_NE; /* Not a real value, just silencing + * compiler errors */ +#endif + + + +/* + * Minimal configuration for OSS + * For real world applications, this structure will probably contain many + * more fields + */ +typedef struct config { + char *device; + int channels; + int fd; + int format; + int frag; + int sample_count; + int sample_rate; + int sample_size; + int chsamples; + int mmap; + oss_audioinfo audio_info; + audio_buf_info buffer_info; +} config_t; + + +/* + * Error state is indicated by value=-1 in which case application exits + * with error + */ +static inline void +check_error(const int value, const char *message) +{ + if (value == -1) { + fprintf(stderr, "OSS error: %s %s\n", message, strerror(errno)); + exit(1); + } +} + + + +/* Calculate frag by giving it minimal size of buffer */ +static inline int +size2frag(int x) +{ + int frag = 0; + + while ((1 << frag) < x) { + ++frag; + } + return frag; +} + + +/* + * Split input buffer into channels. Input buffer is in interleaved format + * which means if we have 2 channels (L and R), this is what the buffer of + * 8 samples would contain: L,R,L,R,L,R,L,R. The result are two channels + * containing: L,L,L,L and R,R,R,R. + */ +void +oss_split(config_t *config, sample_t *input, sample_t *output) +{ + int channel; + int index; + + for (int i = 0; i < config->sample_count; ++i) { + channel = i % config->channels; + index = i / config->channels; + output[channel * index] = input[i]; + } +} + + +/* + * Convert channels into interleaved format and place it in output + * buffer + */ +void +oss_merge(config_t *config, sample_t *input, sample_t *output) +{ + for (int channel = 0; channel < config->channels; ++channel) { + for (int index = 0; index < config->chsamples; ++index) { + output[index * config->channels + channel] = input[channel * index]; + } + } +} + +void +oss_init(config_t *config) +{ + int error; + int tmp; + + /* Open the device for read and write */ + config->fd = open(config->device, O_RDWR); + check_error(config->fd, "open"); + + /* Get device information */ + config->audio_info.dev = -1; + error = ioctl(config->fd, SNDCTL_ENGINEINFO, &(config->audio_info)); + check_error(error, "SNDCTL_ENGINEINFO"); + printf("min_channels: %d\n", config->audio_info.min_channels); + printf("max_channels: %d\n", config->audio_info.max_channels); + printf("latency: %d\n", config->audio_info.latency); + printf("handle: %s\n", config->audio_info.handle); + if (config->audio_info.min_rate > config->sample_rate || config->sample_rate > config->audio_info.max_rate) { + fprintf(stderr, "%s doesn't support chosen ", config->device); + fprintf(stderr, "samplerate of %dHz!\n", config->sample_rate); + exit(1); + } + if (config->channels < 1) { + config->channels = config->audio_info.max_channels; + } + + /* + * If device is going to be used in mmap mode, disable all format + * conversions. Official OSS documentation states error code should not be + * checked. http://manuals.opensound.com/developer/mmap_test.c.html#LOC10 + */ + if (config->mmap) { + tmp = 0; + ioctl(config->fd, SNDCTL_DSP_COOKEDMODE, &tmp); + } + + /* + * Set number of channels. If number of channels is chosen to the value + * near the one wanted, save it in config + */ + tmp = config->channels; + error = ioctl(config->fd, SNDCTL_DSP_CHANNELS, &tmp); + check_error(error, "SNDCTL_DSP_CHANNELS"); + if (tmp != config->channels) { /* or check if tmp is close enough? */ + fprintf(stderr, "%s doesn't support chosen ", config->device); + fprintf(stderr, "channel count of %d", config->channels); + fprintf(stderr, ", set to %d!\n", tmp); + } + config->channels = tmp; + + /* Set format, or bit size: 8, 16, 24 or 32 bit sample */ + tmp = config->format; + error = ioctl(config->fd, SNDCTL_DSP_SETFMT, &tmp); + check_error(error, "SNDCTL_DSP_SETFMT"); + if (tmp != config->format) { + fprintf(stderr, "%s doesn't support chosen sample format!\n", config->device); + exit(1); + } + + /* Most common values for samplerate (in kHz): 44.1, 48, 88.2, 96 */ + tmp = config->sample_rate; + error = ioctl(config->fd, SNDCTL_DSP_SPEED, &tmp); + check_error(error, "SNDCTL_DSP_SPEED"); + + /* Get and check device capabilities */ + error = ioctl(config->fd, SNDCTL_DSP_GETCAPS, &(config->audio_info.caps)); + check_error(error, "SNDCTL_DSP_GETCAPS"); + if (!(config->audio_info.caps & PCM_CAP_DUPLEX)) { + fprintf(stderr, "Device doesn't support full duplex!\n"); + exit(1); + } + if (config->mmap) { + if (!(config->audio_info.caps & PCM_CAP_TRIGGER)) { + fprintf(stderr, "Device doesn't support triggering!\n"); + exit(1); + } + if (!(config->audio_info.caps & PCM_CAP_MMAP)) { + fprintf(stderr, "Device doesn't support mmap mode!\n"); + exit(1); + } + } + + /* + * If desired frag is smaller than minimum, based on number of channels + * and format (size in bits: 8, 16, 24, 32), set that as frag. Buffer size + * is 2^frag, but the real size of the buffer will be read when the + * configuration of the device is successfull + */ + int min_frag = size2frag(config->sample_size * config->channels); + + if (config->frag < min_frag) { + config->frag = min_frag; + } + + /* + * Allocate buffer in fragments. Total buffer will be split in number + * of fragments (2 by default) + */ + if (config->buffer_info.fragments < 0) { + config->buffer_info.fragments = 2; + } + tmp = ((config->buffer_info.fragments) << 16) | config->frag; + error = ioctl(config->fd, SNDCTL_DSP_SETFRAGMENT, &tmp); + check_error(error, "SNDCTL_DSP_SETFRAGMENT"); + + /* When all is set and ready to go, get the size of buffer */ + error = ioctl(config->fd, SNDCTL_DSP_GETOSPACE, &(config->buffer_info)); + check_error(error, "SNDCTL_DSP_GETOSPACE"); + if (config->buffer_info.bytes < 1) { + fprintf( + stderr, + "OSS buffer error: buffer size can not be %d\n", + config->buffer_info.bytes + ); + exit(1); + } + config->sample_count = config->buffer_info.bytes / config->sample_size; + config->chsamples = config->sample_count / config->channels; +} From owner-dev-commits-src-main@freebsd.org Wed Aug 4 13:44:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FA8065ECA0; Wed, 4 Aug 2021 13:44:34 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GftJd6PClz3vND; Wed, 4 Aug 2021 13:44:33 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 174DiVeu052683; Wed, 4 Aug 2021 06:44:31 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 174DiVr0052682; Wed, 4 Aug 2021 06:44:31 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202108041344.174DiVr0052682@gndrsh.dnsmgr.net> Subject: Re: git: 184d64af1344 - main - locales: stop hardcoding the directories in the mtree In-Reply-To: <1acb127e-1d2c-4c9f-96e6-23bfbf9695ac@FreeBSD.org> To: Baptiste Daroussin Date: Wed, 4 Aug 2021 06:44:31 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4GftJd6PClz3vND X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 13:44:34 -0000 > 3 ao?t 2021 19:32:44 Rodney W. Grimes : > > >> The branch main has been updated by bapt: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=184d64af1344d6f3c370499510cede49320f4863 > >> > >> commit 184d64af1344d6f3c370499510cede49320f4863 > >> Author:???? Baptiste Daroussin > >> AuthorDate: 2021-08-03 12:25:00 +0000 > >> Commit:???? Baptiste Daroussin > >> CommitDate: 2021-08-03 12:25:00 +0000 > >> > >> ??? locales: stop hardcoding the directories in the mtree > >> ??? > >> ??? The framework knows how to create directories and tag them properly > >> ??? for a the creation of a mtree, not need to hardcode all the locales > >> ??? entries in bsd.usr.mk > >> ??? > >> ??? This simplifies addition of new locales but also allow people building > >> ??? with WITHOUT_LOCALES to end up with a directory full of empty files > > > > The uses of /etc/mtree go beyond the simple directory creation, > > please cause something to build a BSD.locale.dist file and install > > it in /etc/mtree to replace the functionality removal you have > > just performed. > > > > Thanks, > > Rod > > > > Please provide a valid use case not working anymore after this change and I will consider. >From mtree(1): The mtree utility compares a file hierarchy against a specification, Since the shipped specification is now incomplete it can no longer be used to do validate the hiararchy of a system against RELEASED /etc/mtree files. > > Note that this is not the only part of the tree where the same thing is done. More regression does not make regression right. > Best, > Bapt -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-main@freebsd.org Wed Aug 4 14:29:51 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88DF865F50B for ; Wed, 4 Aug 2021 14:29:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (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 4GfvJv274bz4QsX for ; Wed, 4 Aug 2021 14:29:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x732.google.com with SMTP id t66so2964892qkb.0 for ; Wed, 04 Aug 2021 07:29:51 -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=rxzb+z2276c5kgOp0/4sIu5xq45BT+FHvbn/l9bvtsA=; b=wuGDY8hBogFxCjbn2/DiH5CyQrZhbqC38A97Vp1Avr3sD6i5P2boOlTw2vtGl0oHpt nhtyARG7LrvVirf7xhA75dwkmeie0CnSCgQHmCus2KxRowAoykwuCbQYjPa5SvvsHygh UH6fJQLhkAlC5iRqrmJ26ctsDmaeCqjKQr2EEfV6pV+/eCo/DttJzFnuCkaDPw2e0GSt c6rCFbRVoS9QLEIpZQsdGqe9wJ/8Row7GVEBFw3oAUVNmA+QyKEov+xnD6XnQkRwbU3V Vyhti7ySeK0V/95y+PBaMNHiyny8pSAv5if8P4smT405L/07z1OD7bU78iJnTcNfmvKB ibhQ== 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=rxzb+z2276c5kgOp0/4sIu5xq45BT+FHvbn/l9bvtsA=; b=cNDmsrTGF3d4oosyP3uagSB3vGNY2qrSptXvm1RCOdrWad7hqRTxynOu3PB6KxezRz nDauQiBz8QWguVr3pb/H84H9C1vaNFjB/1GlUOsPuRSVi2R57fyT+0X8fslNw/KihF3/ GlxZ1v1+8s6MkUo07+qD79CbreJumc46eWapK+GuIVGf79dOF2d8tNnzqAkROFdW8jZ+ e8YKn3lDtNmR7rwWzdg9fv1MvEAnr6ehMIq7aICWxUjGZ4PC1AImZXVPQjeXOCHOs+bx 6t3mfZnfMgbs+EDZvGUf1+NZcMeEvwAwI9zFPn3pbYd45tfNHKLtvbET6gU1ERHtO8kB dg0g== X-Gm-Message-State: AOAM530LZIIu44Mkr+S4NzypXQDMB2KxMSb/jt28EpH9BBD4ygt7v3Go Y3rpMDL6sIVMKQyTTcweIjPjovohfzw8Mr9GdaEMJA== X-Google-Smtp-Source: ABdhPJwvjObZ1tgEEjkaHfOeDiuydFrQeJvejnx1acp3XoogTDgn3l8XRtUEdxvgT91l6QO/hRJIhwfIsZb6DTI/EHI= X-Received: by 2002:a37:802:: with SMTP id 2mr26474653qki.89.1628087385371; Wed, 04 Aug 2021 07:29:45 -0700 (PDT) MIME-Version: 1.0 References: <1acb127e-1d2c-4c9f-96e6-23bfbf9695ac@FreeBSD.org> <202108041344.174DiVr0052682@gndrsh.dnsmgr.net> In-Reply-To: <202108041344.174DiVr0052682@gndrsh.dnsmgr.net> From: Warner Losh Date: Wed, 4 Aug 2021 08:29:34 -0600 Message-ID: Subject: Re: git: 184d64af1344 - main - locales: stop hardcoding the directories in the mtree To: "Rodney W. Grimes" Cc: Baptiste Daroussin , src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4GfvJv274bz4QsX X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 14:29:51 -0000 On Wed, Aug 4, 2021 at 7:44 AM Rodney W. Grimes wrote: > > 3 ao?t 2021 19:32:44 Rodney W. Grimes : > > > > >> The branch main has been updated by bapt: > > >> > > >> URL: > https://cgit.FreeBSD.org/src/commit/?id=184d64af1344d6f3c370499510cede49320f4863 > > >> > > >> commit 184d64af1344d6f3c370499510cede49320f4863 > > >> Author:???? Baptiste Daroussin > > >> AuthorDate: 2021-08-03 12:25:00 +0000 > > >> Commit:???? Baptiste Daroussin > > >> CommitDate: 2021-08-03 12:25:00 +0000 > > >> > > >> ??? locales: stop hardcoding the directories in the mtree > > >> ??? > > >> ??? The framework knows how to create directories and tag them > properly > > >> ??? for a the creation of a mtree, not need to hardcode all the > locales > > >> ??? entries in bsd.usr.mk > > >> ??? > > >> ??? This simplifies addition of new locales but also allow people > building > > >> ??? with WITHOUT_LOCALES to end up with a directory full of empty > files > > > > > > The uses of /etc/mtree go beyond the simple directory creation, > > > please cause something to build a BSD.locale.dist file and install > > > it in /etc/mtree to replace the functionality removal you have > > > just performed. > > > > > > Thanks, > > > Rod > > > > > > > Please provide a valid use case not working anymore after this change > and I will consider. > > From mtree(1): > The mtree utility compares a file hierarchy against a > specification, > > Since the shipped specification is now incomplete it can no longer be used > to do validate the hiararchy of a system against RELEASED /etc/mtree files. > install -d broke this at least a decade or more ago. Most people really don't care outside of things in /var getting created since validating directories is of such little functionality w/o also validating binaries and such. It's used in bsd.files.mk which is included by lots of things in the tree. > Note that this is not the only part of the tree where the same thing is > done. > > More regression does not make regression right. > The decision was made a long time ago to leave this feature behind, though you can still get it today if you do a NO_ROOT build because that creates a metafile that includes both directories and files for the system. pkg base uses that to generate its packages. NO_ROOT builds are better anyway, because it also lets you tag each file / directory on a per-package basis so you don't have them if you don't install a specific package. Warner > > Best, > > Bapt > -- > Rod Grimes > rgrimes@freebsd.org > From owner-dev-commits-src-main@freebsd.org Wed Aug 4 15:40:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABCAA65FCE4; Wed, 4 Aug 2021 15:40:30 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GfwtQ2K2Sz4Tf9; Wed, 4 Aug 2021 15:40:30 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 174FeQGL053048; Wed, 4 Aug 2021 08:40:26 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 174FeQme053047; Wed, 4 Aug 2021 08:40:26 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202108041540.174FeQme053047@gndrsh.dnsmgr.net> Subject: Re: git: 184d64af1344 - main - locales: stop hardcoding the directories in the mtree In-Reply-To: To: Warner Losh Date: Wed, 4 Aug 2021 08:40:26 -0700 (PDT) CC: "Rodney W. Grimes" , Baptiste Daroussin , src-committers , "" , dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4GfwtQ2K2Sz4Tf9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 15:40:30 -0000 [ Charset UTF-8 unsupported, converting... ] > On Wed, Aug 4, 2021 at 7:44 AM Rodney W. Grimes > wrote: > > > > 3 ao?t 2021 19:32:44 Rodney W. Grimes : > > > > > > >> The branch main has been updated by bapt: > > > >> > > > >> URL: > > https://cgit.FreeBSD.org/src/commit/?id=184d64af1344d6f3c370499510cede49320f4863 > > > >> > > > >> commit 184d64af1344d6f3c370499510cede49320f4863 > > > >> Author:???? Baptiste Daroussin > > > >> AuthorDate: 2021-08-03 12:25:00 +0000 > > > >> Commit:???? Baptiste Daroussin > > > >> CommitDate: 2021-08-03 12:25:00 +0000 > > > >> > > > >> ??? locales: stop hardcoding the directories in the mtree > > > >> ??? > > > >> ??? The framework knows how to create directories and tag them > > properly > > > >> ??? for a the creation of a mtree, not need to hardcode all the > > locales > > > >> ??? entries in bsd.usr.mk > > > >> ??? > > > >> ??? This simplifies addition of new locales but also allow people > > building > > > >> ??? with WITHOUT_LOCALES to end up with a directory full of empty > > files > > > > > > > > The uses of /etc/mtree go beyond the simple directory creation, > > > > please cause something to build a BSD.locale.dist file and install > > > > it in /etc/mtree to replace the functionality removal you have > > > > just performed. > > > > > > > > Thanks, > > > > Rod > > > > > > > > > > Please provide a valid use case not working anymore after this change > > and I will consider. > > > > From mtree(1): > > The mtree utility compares a file hierarchy against a > > specification, > > > > Since the shipped specification is now incomplete it can no longer be used > > to do validate the hiararchy of a system against RELEASED /etc/mtree files. > > > > install -d broke this at least a decade or more ago. install -d did not break this, use of install -d does not preclude maintaining mtree files. install -d is only used in a few places. > Most people really > don't > care outside of things in /var getting created since validating directories > is > of such little functionality w/o also validating binaries and such. It's > used > in bsd.files.mk which is included by lots of things in the tree. So we only catter to "some people" is what your saying, since "most people" dont care? > > > Note that this is not the only part of the tree where the same thing is > > done. > > > > More regression does not make regression right. > > > > The decision was made a long time ago to leave this feature behind, though > you can still get it today if you do a NO_ROOT build because that creates a > metafile that includes both directories and files for the system. pkg base > uses > that to generate its packages. NO_ROOT builds are better anyway, because > it also lets you tag each file / directory on a per-package basis so you > don't > have them if you don't install a specific package. This "feature" and mtree has NOT been left behind. Make hierarchy and the mtree files are still very much being used by the build and release process. And again, age of regression does not make regression correct. We are often "fixing" 20 year old bugs, should we stop fixing them cause they are "old"? More "death by a 1000 prickly sticks" cause developers dont use every feature that users do and some users like the features they have been using to continue to be usable. > Warner > > > Best, Bapt > > Rod Grimes > > rgrimes@freebsd.org -- Rod Grimes rgrimes@freebsd.org From owner-dev-commits-src-main@freebsd.org Wed Aug 4 17:16:54 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB9AD651C80; Wed, 4 Aug 2021 17:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gfz1f5kcwz4bjc; Wed, 4 Aug 2021 17:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8EAB2980; Wed, 4 Aug 2021 17:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174HGsJ4006971; Wed, 4 Aug 2021 17:16:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174HGsab006970; Wed, 4 Aug 2021 17:16:54 GMT (envelope-from git) Date: Wed, 4 Aug 2021 17:16:54 GMT Message-Id: <202108041716.174HGsab006970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0ef5eee9d941 - main - Add vn_lktype_write() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ef5eee9d94162ac3cefa0bd8aedf1bfa6f87192 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 17:16:54 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0ef5eee9d94162ac3cefa0bd8aedf1bfa6f87192 commit 0ef5eee9d94162ac3cefa0bd8aedf1bfa6f87192 Author: Konstantin Belousov AuthorDate: 2021-08-04 02:34:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-04 16:40:13 +0000 Add vn_lktype_write() and remove repetetive code that calculates vnode locking type for write. Reviewed by: khng, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31405 --- sys/cam/ctl/ctl_backend_block.c | 20 +++++--------------- sys/kern/vfs_syscalls.c | 10 ++-------- sys/kern/vfs_vnops.c | 34 ++++++++++++++-------------------- sys/sys/vnode.h | 1 + sys/vm/vm_pageout.c | 6 ++---- 5 files changed, 24 insertions(+), 47 deletions(-) diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index 4ffaf0912915..83ea6b43dac3 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -588,7 +588,7 @@ ctl_be_block_flush_file(struct ctl_be_block_lun *be_lun, { union ctl_io *io = beio->io; struct mount *mountpoint; - int error, lock_flags; + int error; DPRINTF("entered\n"); @@ -597,12 +597,8 @@ ctl_be_block_flush_file(struct ctl_be_block_lun *be_lun, (void) vn_start_write(be_lun->vn, &mountpoint, V_WAIT); - if (MNT_SHARED_WRITES(mountpoint) || - ((mountpoint == NULL) && MNT_SHARED_WRITES(be_lun->vn->v_mount))) - lock_flags = LK_SHARED; - else - lock_flags = LK_EXCLUSIVE; - vn_lock(be_lun->vn, lock_flags | LK_RETRY); + vn_lock(be_lun->vn, vn_lktype_write(mountpoint, be_lun->vn) | + LK_RETRY); error = VOP_FSYNC(be_lun->vn, beio->io_arg ? MNT_NOWAIT : MNT_WAIT, curthread); VOP_UNLOCK(be_lun->vn); @@ -722,16 +718,10 @@ ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun, } } else { struct mount *mountpoint; - int lock_flags; (void)vn_start_write(be_lun->vn, &mountpoint, V_WAIT); - - if (MNT_SHARED_WRITES(mountpoint) || ((mountpoint == NULL) - && MNT_SHARED_WRITES(be_lun->vn->v_mount))) - lock_flags = LK_SHARED; - else - lock_flags = LK_EXCLUSIVE; - vn_lock(be_lun->vn, lock_flags | LK_RETRY); + vn_lock(be_lun->vn, vn_lktype_write(mountpoint, + be_lun->vn) | LK_RETRY); /* * UFS pays attention to IO_DIRECT for writes. The write diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 82629a4f5947..5701932a0163 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -3517,7 +3517,7 @@ kern_fsync(struct thread *td, int fd, bool fullsync) struct vnode *vp; struct mount *mp; struct file *fp; - int error, lock_flags; + int error; AUDIT_ARG_FD(fd); error = getvnode(td, fd, &cap_fsync_rights, &fp); @@ -3532,13 +3532,7 @@ retry: error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error != 0) goto drop; - if (MNT_SHARED_WRITES(mp) || - ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) { - lock_flags = LK_SHARED; - } else { - lock_flags = LK_EXCLUSIVE; - } - vn_lock(vp, lock_flags | LK_RETRY); + vn_lock(vp, vn_lktype_write(mp, vp) | LK_RETRY); AUDIT_ARG_VNODE1(vp); if (vp->v_object != NULL) { VM_OBJECT_WLOCK(vp->v_object); diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index fc5118e8aa24..b7e53add5a35 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -653,11 +653,7 @@ vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset, (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto out; - if (MNT_SHARED_WRITES(mp) || - ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) - lock_flags = LK_SHARED; - else - lock_flags = LK_EXCLUSIVE; + lock_flags = vn_lktype_write(mp, vp); } else lock_flags = LK_SHARED; vn_lock(vp, lock_flags | LK_RETRY); @@ -1106,7 +1102,7 @@ vn_write(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct vnode *vp; struct mount *mp; off_t orig_offset; - int error, ioflag, lock_flags; + int error, ioflag; int advice; bool need_finished_write; @@ -1147,14 +1143,7 @@ vn_write(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, advice = get_advice(fp, uio); - if (MNT_SHARED_WRITES(mp) || - (mp == NULL && MNT_SHARED_WRITES(vp->v_mount))) { - lock_flags = LK_SHARED; - } else { - lock_flags = LK_EXCLUSIVE; - } - - vn_lock(vp, lock_flags | LK_RETRY); + vn_lock(vp, vn_lktype_write(mp, vp) | LK_RETRY); switch (advice) { case POSIX_FADV_NORMAL: case POSIX_FADV_SEQUENTIAL: @@ -3060,7 +3049,7 @@ vn_write_outvp(struct vnode *outvp, char *dat, off_t outoff, off_t xfer, { struct mount *mp; off_t dataoff, holeoff, xfer2; - int error, lckf; + int error; /* * Loop around doing writes of blksize until write has been completed. @@ -3099,11 +3088,7 @@ vn_write_outvp(struct vnode *outvp, char *dat, off_t outoff, off_t xfer, VOP_UNLOCK(outvp); } } else { - if (MNT_SHARED_WRITES(mp)) - lckf = LK_SHARED; - else - lckf = LK_EXCLUSIVE; - error = vn_lock(outvp, lckf); + error = vn_lock(outvp, vn_lktype_write(mp, outvp)); if (error == 0) { error = vn_rdwr(UIO_WRITE, outvp, dat, xfer2, outoff, UIO_SYSSPACE, IO_NODELOCKED, @@ -3532,3 +3517,12 @@ vn_lock_pair(struct vnode *vp1, bool vp1_locked, struct vnode *vp2, if (vp2 != NULL) ASSERT_VOP_ELOCKED(vp2, "vp2 ret"); } + +int +vn_lktype_write(struct mount *mp, struct vnode *vp) +{ + if (MNT_SHARED_WRITES(mp) || + (mp == NULL && MNT_SHARED_WRITES(vp->v_mount))) + return (LK_SHARED); + return (LK_EXCLUSIVE); +} diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 64fb00c5845e..1f2d74fdf5f1 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -1089,6 +1089,7 @@ int vn_chown(struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred, void vn_fsid(struct vnode *vp, struct vattr *va); int vn_dir_check_exec(struct vnode *vp, struct componentname *cnp); +int vn_lktype_write(struct mount *mp, struct vnode *vp); #define VOP_UNLOCK_FLAGS(vp, flags) ({ \ struct vnode *_vp = (vp); \ diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 216e76359631..9a0b295569e2 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -606,7 +606,7 @@ vm_pageout_clean(vm_page_t m, int *numpagedout) struct mount *mp; vm_object_t object; vm_pindex_t pindex; - int error, lockmode; + int error; object = m->object; VM_OBJECT_ASSERT_WLOCKED(object); @@ -640,9 +640,7 @@ vm_pageout_clean(vm_page_t m, int *numpagedout) vm_object_reference_locked(object); pindex = m->pindex; VM_OBJECT_WUNLOCK(object); - lockmode = MNT_SHARED_WRITES(vp->v_mount) ? - LK_SHARED : LK_EXCLUSIVE; - if (vget(vp, lockmode | LK_TIMELOCK)) { + if (vget(vp, vn_lktype_write(NULL, vp) | LK_TIMELOCK) != 0) { vp = NULL; error = EDEADLK; goto unlock_mp; From owner-dev-commits-src-main@freebsd.org Wed Aug 4 18:18:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E21F653305; Wed, 4 Aug 2021 18:18:07 +0000 (UTC) (envelope-from jhb@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 4Gg0NH2W9mz4gwY; Wed, 4 Aug 2021 18:18:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 5F6AA27660; Wed, 4 Aug 2021 18:18:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Marcin Wojtas , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202108031008.173A83HA096670@gitrepo.freebsd.org> From: John Baldwin Subject: Re: git: 5ad6d28cbe6b - main - enetc: Support building the driver as a loadable module. Message-ID: Date: Wed, 4 Aug 2021 11:18:02 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <202108031008.173A83HA096670@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 18:18:07 -0000 On 8/3/21 3:08 AM, Marcin Wojtas wrote: > The branch main has been updated by mw: > > URL: https://cgit.FreeBSD.org/src/commit/?id=5ad6d28cbe6b3ff85e49607a7e04cb68db3ed6df > > commit 5ad6d28cbe6b3ff85e49607a7e04cb68db3ed6df > Author: Kornel Duleba > AuthorDate: 2021-07-28 09:23:23 +0000 > Commit: Marcin Wojtas > CommitDate: 2021-08-03 10:07:49 +0000 > > enetc: Support building the driver as a loadable module. > > Function level reset has to be done in attach in order to put the > hardware in a known state before configuring it. > The order of DRIVER_MODULEs was changed to ensure that the miibus driver > is loaded when mii_attach is called. > > Obtained from: Semihalf > Sponsored by: Alstom Group > --- > sys/dev/enetc/if_enetc.c | 6 +++++- > sys/modules/Makefile | 2 ++ > sys/modules/enetc/Makefile | 8 ++++++++ > 3 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c > index 54cdc6ea9ad4..46327eb419bf 100644 > --- a/sys/dev/enetc/if_enetc.c > +++ b/sys/dev/enetc/if_enetc.c > @@ -158,8 +158,8 @@ static driver_t enetc_driver = { > }; > > static devclass_t enetc_devclass; > -DRIVER_MODULE(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL); > DRIVER_MODULE(miibus, enetc, miibus_driver, miibus_devclass, NULL, NULL); > +DRIVER_MODULE(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL); > MODULE_VERSION(enetc, 1); This is not the right way to fix this as the toolchain is free to reorder symbols. You should instead use 'DRIVER_MODULE_ORDERED(..., SI_ORDER_LAST)' for enetc so that the miibus driver is registered first. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Wed Aug 4 18:24:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8136653514; Wed, 4 Aug 2021 18:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg0Wg3KRGz4hmq; Wed, 4 Aug 2021 18:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B9123823; Wed, 4 Aug 2021 18:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174IOVqd001467; Wed, 4 Aug 2021 18:24:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174IOVtA001466; Wed, 4 Aug 2021 18:24:31 GMT (envelope-from git) Date: Wed, 4 Aug 2021 18:24:31 GMT Message-Id: <202108041824.174IOVtA001466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 4f35e8cba232 - main - hwpmc: disable uncore class on Sandy Bridge and newer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f35e8cba232d9256ab1399b8adfb761988e5eff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 18:24:31 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=4f35e8cba232d9256ab1399b8adfb761988e5eff commit 4f35e8cba232d9256ab1399b8adfb761988e5eff Author: Mitchell Horne AuthorDate: 2021-08-04 17:31:36 +0000 Commit: Mitchell Horne CommitDate: 2021-08-04 18:23:22 +0000 hwpmc: disable uncore class on Sandy Bridge and newer It was written for Nehalem and Westmere, with minor but incomplete updates for Sandy Bridge in 78d763a29b15. The uncore architecture changed significantly with this generation, bringing new layouts and locations for some MSRs. Misprogramming these MSRs in ucp_start_pmc() may panic the system, and this is trivially reproducible via pmcstat(8) on at least Broadwell and Haswell. Disable the class on these CPUs until it can be updated more completely and leave a TODO comment detailing some of the work required. Note that the nclasses value for Broadwell was already incorrect and doesn't need changing. The result is that any uncore events listed by pmcstat -L will no longer be allocatable, but this is already the case for newer generations of Intel CPUs. PR: 253687 Reported by: Zhenlei Huang Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31389 --- sys/dev/hwpmc/hwpmc_intel.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_intel.c b/sys/dev/hwpmc/hwpmc_intel.c index aec037b64938..02b8fd9431d1 100644 --- a/sys/dev/hwpmc/hwpmc_intel.c +++ b/sys/dev/hwpmc/hwpmc_intel.c @@ -149,7 +149,7 @@ pmc_intel_initialize(void) break; case 0x2A: /* Per Intel document 253669-039US 05/2011. */ cputype = PMC_CPU_INTEL_SANDYBRIDGE; - nclasses = 5; + nclasses = 3; break; case 0x2D: /* Per Intel document 253669-044US 08/2012. */ cputype = PMC_CPU_INTEL_SANDYBRIDGE_XEON; @@ -195,7 +195,7 @@ pmc_intel_initialize(void) case 0x3C: /* Per Intel document 325462-045US 01/2013. */ case 0x45: /* Per Intel document 325462-045US 09/2014. */ cputype = PMC_CPU_INTEL_HASWELL; - nclasses = 5; + nclasses = 3; break; case 0x37: case 0x4A: @@ -275,10 +275,27 @@ pmc_intel_initialize(void) * Intel Corei7 and Westmere processors. */ case PMC_CPU_INTEL_COREI7: - case PMC_CPU_INTEL_HASWELL: - case PMC_CPU_INTEL_SANDYBRIDGE: case PMC_CPU_INTEL_WESTMERE: +#ifdef notyet + /* + * TODO: re-enable uncore class on these processors. + * + * The uncore unit was reworked beginning with Sandy Bridge, including + * the MSRs required to program it. In particular, we need to: + * - Parse the MSR_UNC_CBO_CONFIG MSR for number of C-box units in the + * system + * - Support reading and writing to ARB and C-box units, depending on + * the requested event + * - Create some kind of mapping between C-box <--> CPU + * + * Also TODO: support other later changes to these interfaces, to + * enable the uncore class on generations newer than Broadwell. + * Skylake+ appears to use newer addresses for the uncore MSRs. + */ + case PMC_CPU_INTEL_HASWELL: case PMC_CPU_INTEL_BROADWELL: + case PMC_CPU_INTEL_SANDYBRIDGE: +#endif error = pmc_uncore_initialize(pmc_mdep, ncpus); break; default: @@ -329,11 +346,13 @@ pmc_intel_finalize(struct pmc_mdep *md) * Uncore. */ switch (md->pmd_cputype) { - case PMC_CPU_INTEL_BROADWELL: case PMC_CPU_INTEL_COREI7: + case PMC_CPU_INTEL_WESTMERE: +#ifdef notyet case PMC_CPU_INTEL_HASWELL: + case PMC_CPU_INTEL_BROADWELL: case PMC_CPU_INTEL_SANDYBRIDGE: - case PMC_CPU_INTEL_WESTMERE: +#endif pmc_uncore_finalize(md); break; default: From owner-dev-commits-src-main@freebsd.org Wed Aug 4 18:24:32 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3238652EA5; Wed, 4 Aug 2021 18:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg0Wh4LmLz4hhK; Wed, 4 Aug 2021 18:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E8D034DD; Wed, 4 Aug 2021 18:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174IOW70001491; Wed, 4 Aug 2021 18:24:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174IOW8R001490; Wed, 4 Aug 2021 18:24:32 GMT (envelope-from git) Date: Wed, 4 Aug 2021 18:24:32 GMT Message-Id: <202108041824.174IOW8R001490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 8399d923a569 - main - hwpmc_intel: assert for correct nclasses value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8399d923a5697b7c194dbd44c33018c94ec42c4e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 18:24:32 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8399d923a5697b7c194dbd44c33018c94ec42c4e commit 8399d923a5697b7c194dbd44c33018c94ec42c4e Author: Mitchell Horne AuthorDate: 2021-08-04 17:37:05 +0000 Commit: Mitchell Horne CommitDate: 2021-08-04 18:23:22 +0000 hwpmc_intel: assert for correct nclasses value This variable is set based on the exact CPU model detected. If this value is set too small, it could lead to a NULL-dereference from an improperly initialized pmc_rowindex_to_classdep array. Though it has been fixed, this was previously the case for Broadwell. Add two asserts to catch this in DEBUG kernels, as it represents a configuration error that may be hard to uncover otherwise. PR: 253687 Reported by: Zhenlei Huang Sponsored by: The FreeBSD Foundation --- sys/dev/hwpmc/hwpmc_intel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/hwpmc/hwpmc_intel.c b/sys/dev/hwpmc/hwpmc_intel.c index 02b8fd9431d1..6cc6ae3b50d6 100644 --- a/sys/dev/hwpmc/hwpmc_intel.c +++ b/sys/dev/hwpmc/hwpmc_intel.c @@ -255,6 +255,7 @@ pmc_intel_initialize(void) case PMC_CPU_INTEL_IVYBRIDGE_XEON: case PMC_CPU_INTEL_HASWELL: case PMC_CPU_INTEL_HASWELL_XEON: + MPASS(nclasses >= PMC_MDEP_CLASS_INDEX_IAF); error = pmc_core_initialize(pmc_mdep, ncpus, verov); break; @@ -296,6 +297,7 @@ pmc_intel_initialize(void) case PMC_CPU_INTEL_BROADWELL: case PMC_CPU_INTEL_SANDYBRIDGE: #endif + MPASS(nclasses >= PMC_MDEP_CLASS_INDEX_UCF); error = pmc_uncore_initialize(pmc_mdep, ncpus); break; default: From owner-dev-commits-src-main@freebsd.org Wed Aug 4 18:24:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF5F0653703; Wed, 4 Aug 2021 18:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg0Wj5JkFz4hn1; Wed, 4 Aug 2021 18:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C44C391D; Wed, 4 Aug 2021 18:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174IOXUI001515; Wed, 4 Aug 2021 18:24:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174IOXOi001514; Wed, 4 Aug 2021 18:24:33 GMT (envelope-from git) Date: Wed, 4 Aug 2021 18:24:33 GMT Message-Id: <202108041824.174IOXOi001514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: bcd2f41f7d22 - main - mk: format some option lists MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bcd2f41f7d222a942fe0a268614b46d3ec3af4c0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 18:24:33 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=bcd2f41f7d222a942fe0a268614b46d3ec3af4c0 commit bcd2f41f7d222a942fe0a268614b46d3ec3af4c0 Author: Mitchell Horne AuthorDate: 2021-08-04 18:17:34 +0000 Commit: Mitchell Horne CommitDate: 2021-08-04 18:23:22 +0000 mk: format some option lists Alphabetize and give each option its own line, ahead of making another change to these lists. This makes future diffs easier to read. Reviewed by: imp, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31399 --- Makefile.inc1 | 54 ++++++++++++++++++++++++--------- Makefile.libcompat | 11 +++++-- targets/pseudo/bootstrap-tools/Makefile | 23 ++++++++++---- 3 files changed, 65 insertions(+), 23 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index b6843177c10b..b61ed693af77 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -715,13 +715,25 @@ BSARGS= DESTDIR= \ BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ BWPHASE=${.TARGET:C,^_,,} \ SSP_CFLAGS= \ - MK_HTML=no NO_LINT=yes MK_MAN=no MK_MAN_UTILS=yes \ - -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS MK_WERROR=no MK_CTF=no \ - MK_ASAN=no MK_UBSAN=no \ - MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \ - MK_INCLUDES=yes + -DNO_CPU_CFLAGS \ + -DNO_LINT \ + -DNO_PIC \ + -DNO_SHARED \ + MK_ASAN=no \ + MK_CTF=no \ + MK_CLANG_EXTRAS=no \ + MK_CLANG_FORMAT=no \ + MK_CLANG_FULL=no \ + MK_HTML=no \ + MK_LLDB=no \ + MK_MAN=no \ + MK_PROFILE=no \ + MK_RETPOLINE=no \ + MK_TESTS=no \ + MK_UBSAN=no \ + MK_WERROR=no \ + MK_INCLUDES=yes \ + MK_MAN_UTILS=yes BMAKE= \ ${TIME_ENV} ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ @@ -738,11 +750,18 @@ TMAKE= \ BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ BWPHASE=${.TARGET:C,^_,,} \ SSP_CFLAGS= \ + -DNO_CPU_CFLAGS \ -DNO_LINT \ - -DNO_CPU_CFLAGS MK_WERROR=no MK_CTF=no \ - MK_ASAN=no MK_UBSAN=no \ - MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no + MK_ASAN=no \ + MK_CTF=no \ + MK_CLANG_EXTRAS=no \ + MK_CLANG_FORMAT=no \ + MK_CLANG_FULL=no \ + MK_LLDB=no \ + MK_RETPOLINE=no \ + MK_TESTS=no \ + MK_UBSAN=no \ + MK_WERROR=no # cross-tools stage # TOOLS_PREFIX set in BMAKE @@ -766,9 +785,16 @@ KTMAKE= ${TIME_ENV} \ MAKEOBJDIRPREFIX= \ BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ SSP_CFLAGS= \ - MK_HTML=no -DNO_LINT MK_MAN=no \ - -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS MK_RETPOLINE=no MK_WERROR=no MK_CTF=no + -DNO_CPU_CFLAGS \ + -DNO_LINT \ + -DNO_PIC \ + -DNO_SHARED \ + MK_CTF=no \ + MK_HTML=no \ + MK_MAN=no \ + MK_PROFILE=no \ + MK_RETPOLINE=no \ + MK_WERROR=no # world stage WMAKEENV= ${CROSSENV} \ diff --git a/Makefile.libcompat b/Makefile.libcompat index c2be63c29e73..88b1e3f0cf18 100644 --- a/Makefile.libcompat +++ b/Makefile.libcompat @@ -103,9 +103,14 @@ build${libcompat}: .PHONY OBJTOP=${LIBCOMPAT_OBJTOP} \ OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ - DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \ - MK_ASAN=no MK_UBSAN=no \ - MK_CTF=no MK_RETPOLINE=no MK_WERROR=no \ + DIRPRFX=${_dir}/ \ + -DNO_LINT \ + -DNO_CPU_CFLAGS \ + MK_ASAN=no \ + MK_CTF=no \ + MK_RETPOLINE=no \ + MK_UBSAN=no \ + MK_WERROR=no \ ${_t} .endfor .endfor diff --git a/targets/pseudo/bootstrap-tools/Makefile b/targets/pseudo/bootstrap-tools/Makefile index 0023f763af83..1a7f2bd15ad0 100644 --- a/targets/pseudo/bootstrap-tools/Makefile +++ b/targets/pseudo/bootstrap-tools/Makefile @@ -40,12 +40,23 @@ BSARGS= DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ BWPHASE=${.TARGET} \ SSP_CFLAGS= \ - MK_HTML=no NO_LINT=yes MK_MAN=no \ - -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS MK_WERROR=no MK_CTF=no \ - MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_TESTS=no \ - MK_INCLUDES=yes + -DNO_CPU_CFLAGS \ + -DNO_LINT \ + -DNO_PIC \ + -DNO_SHARED \ + MK_CTF=no \ + MK_CLANG_EXTRAS=no \ + MK_CLANG_FORMAT=no \ + MK_CLANG_FULL=no \ + MK_HTML=no \ + MK_LLDB=no \ + MK_MAN=no \ + MK_PROFILE=no \ + MK_RETPOLINE=no \ + MK_TESTS=no \ + MK_WERROR=no \ + MK_INCLUDES=yes \ + MK_MAN_UTILS=yes # We will handle building the toolchain and cross-compiler. BSARGS+= MK_CROSS_COMPILER=no MK_CLANG=no From owner-dev-commits-src-main@freebsd.org Wed Aug 4 18:24:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 377E46533CF; Wed, 4 Aug 2021 18:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg0Wk73x3z4hKh; Wed, 4 Aug 2021 18:24:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2F9D391E; Wed, 4 Aug 2021 18:24:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174IOYTk001541; Wed, 4 Aug 2021 18:24:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174IOYM8001540; Wed, 4 Aug 2021 18:24:34 GMT (envelope-from git) Date: Wed, 4 Aug 2021 18:24:34 GMT Message-Id: <202108041824.174IOYM8001540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 1b8db4b4e361 - main - arm: enable stack-smashing protection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b8db4b4e3614ef6334ce776dcdd46fe7f2c5a78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 18:24:35 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=1b8db4b4e3614ef6334ce776dcdd46fe7f2c5a78 commit 1b8db4b4e3614ef6334ce776dcdd46fe7f2c5a78 Author: Mitchell Horne AuthorDate: 2021-08-04 18:18:18 +0000 Commit: Mitchell Horne CommitDate: 2021-08-04 18:23:22 +0000 arm: enable stack-smashing protection With current generation clang/llvm it can pass all of our tests in libc/ssp. While here, remove the extra MACHINE_CPUARCH check for mips. SSP is included in BROKEN_OPTIONS for this architecture in src.opts.mk, which is enough to ensure normal builds won't set SSP_CFLAGS. Reviewed by: kevans, imp, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31400 --- share/mk/bsd.sys.mk | 5 ++--- sys/conf/kern.mk | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 6341800d5c70..031d49bbaca2 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -239,12 +239,11 @@ CFLAGS.clang+= -Qunused-arguments # but not yet. CXXFLAGS.clang+= -Wno-c++11-extensions -.if ${MK_SSP} != "no" && \ - ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" +.if ${MK_SSP} != "no" # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS?= -fstack-protector-strong CFLAGS+= ${SSP_CFLAGS} -.endif # SSP && !ARM && !MIPS +.endif # SSP # Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is # enabled. diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index f8ea372b1d93..56bddb35398b 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -213,8 +213,7 @@ CFLAGS+= -fwrapv # # GCC SSP support # -.if ${MK_SSP} != "no" && \ - ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" +.if ${MK_SSP} != "no" CFLAGS+= -fstack-protector .endif From owner-dev-commits-src-main@freebsd.org Wed Aug 4 18:24:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52EB6652EB9; Wed, 4 Aug 2021 18:24:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg0Wm2hhvz4hYn; Wed, 4 Aug 2021 18:24:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F07923A92; Wed, 4 Aug 2021 18:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174IOZp1001570; Wed, 4 Aug 2021 18:24:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174IOZj6001569; Wed, 4 Aug 2021 18:24:35 GMT (envelope-from git) Date: Wed, 4 Aug 2021 18:24:35 GMT Message-Id: <202108041824.174IOZj6001569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 61ed578ee666 - main - Prefer MK_SSP=no to SSP_CFLAGS= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61ed578ee66648eff206ee5622b66727bfb52e78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 18:24:37 -0000 The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=61ed578ee66648eff206ee5622b66727bfb52e78 commit 61ed578ee66648eff206ee5622b66727bfb52e78 Author: Mitchell Horne AuthorDate: 2021-08-04 18:20:50 +0000 Commit: Mitchell Horne CommitDate: 2021-08-04 18:23:22 +0000 Prefer MK_SSP=no to SSP_CFLAGS= It is more idiomatic. CFLAGS is only augmented with $SSP_CFLAGS when $MK_SSP != "no". Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31401 --- Makefile.inc1 | 8 ++++---- Makefile.libcompat | 3 ++- lib/csu/Makefile.inc | 3 +-- lib/libclang_rt/Makefile.inc | 2 +- stand/defs.mk | 2 -- targets/pseudo/bootstrap-tools/Makefile | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index b61ed693af77..be8ac02353e1 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -714,7 +714,6 @@ BSARGS= DESTDIR= \ MAKEOBJDIRPREFIX= \ BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ BWPHASE=${.TARGET:C,^_,,} \ - SSP_CFLAGS= \ -DNO_CPU_CFLAGS \ -DNO_LINT \ -DNO_PIC \ @@ -729,6 +728,7 @@ BSARGS= DESTDIR= \ MK_MAN=no \ MK_PROFILE=no \ MK_RETPOLINE=no \ + MK_SSP=no \ MK_TESTS=no \ MK_UBSAN=no \ MK_WERROR=no \ @@ -749,7 +749,6 @@ TMAKE= \ DESTDIR= \ BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ BWPHASE=${.TARGET:C,^_,,} \ - SSP_CFLAGS= \ -DNO_CPU_CFLAGS \ -DNO_LINT \ MK_ASAN=no \ @@ -759,6 +758,7 @@ TMAKE= \ MK_CLANG_FULL=no \ MK_LLDB=no \ MK_RETPOLINE=no \ + MK_SSP=no \ MK_TESTS=no \ MK_UBSAN=no \ MK_WERROR=no @@ -784,7 +784,6 @@ KTMAKE= ${TIME_ENV} \ OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ - SSP_CFLAGS= \ -DNO_CPU_CFLAGS \ -DNO_LINT \ -DNO_PIC \ @@ -793,6 +792,7 @@ KTMAKE= ${TIME_ENV} \ MK_HTML=no \ MK_MAN=no \ MK_PROFILE=no \ + MK_SSP=no \ MK_RETPOLINE=no \ MK_WERROR=no @@ -2768,7 +2768,6 @@ NXBMAKEARGS+= \ -DNO_SHARED \ -DNO_CPU_CFLAGS \ -DNO_PIC \ - SSP_CFLAGS= \ MK_CASPER=no \ MK_CLANG_EXTRAS=no \ MK_CLANG_FORMAT=no \ @@ -2784,6 +2783,7 @@ NXBMAKEARGS+= \ MK_PROFILE=no \ MK_RETPOLINE=no \ MK_SENDMAIL=no \ + MK_SSP=no \ MK_TESTS=no \ MK_WERROR=no \ MK_ZFS=no diff --git a/Makefile.libcompat b/Makefile.libcompat index 88b1e3f0cf18..b376ebaa65f4 100644 --- a/Makefile.libcompat +++ b/Makefile.libcompat @@ -99,7 +99,7 @@ build${libcompat}: .PHONY ${_+_}cd ${.CURDIR}/${_dir}; \ WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ - ${MAKE} SSP_CFLAGS= DESTDIR= \ + ${MAKE} DESTDIR= \ OBJTOP=${LIBCOMPAT_OBJTOP} \ OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ @@ -109,6 +109,7 @@ build${libcompat}: .PHONY MK_ASAN=no \ MK_CTF=no \ MK_RETPOLINE=no \ + MK_SSP=no \ MK_UBSAN=no \ MK_WERROR=no \ ${_t} diff --git a/lib/csu/Makefile.inc b/lib/csu/Makefile.inc index b089e1a947b1..31c1bcbd7278 100644 --- a/lib/csu/Makefile.inc +++ b/lib/csu/Makefile.inc @@ -1,13 +1,12 @@ # $FreeBSD$ -SSP_CFLAGS= - NO_WMISSING_VARIABLE_DECLARATIONS= # Can't instrument these files since that breaks non-sanitized programs. MK_ASAN:= no MK_UBSAN:= no .include +MK_SSP= no .if !defined(BUILDING_TESTS) diff --git a/lib/libclang_rt/Makefile.inc b/lib/libclang_rt/Makefile.inc index 19b8868b60e3..cb4ad189e18b 100644 --- a/lib/libclang_rt/Makefile.inc +++ b/lib/libclang_rt/Makefile.inc @@ -13,11 +13,11 @@ SHLIBDIR= ${LIBDIR} NO_PIC= MK_PROFILE= no MK_ASAN:= no +MK_SSP= no MK_UBSAN:= no WARNS?= 0 -SSP_CFLAGS= CFLAGS+= -DNDEBUG CFLAGS+= -DHAVE_RPC_XDR_H=0 CFLAGS+= -DSANITIZER_SUPPORTS_WEAK_HOOKS=0 diff --git a/stand/defs.mk b/stand/defs.mk index 02a03b92577e..1e22f7b7c693 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -135,8 +135,6 @@ LD_FLAGS+= -m elf_i386_fbsd AFLAGS+= --32 .endif -SSP_CFLAGS= - # Add in the no float / no SIMD stuff and announce we're freestanding # aarch64 and riscv don't have -msoft-float, but all others do. CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} diff --git a/targets/pseudo/bootstrap-tools/Makefile b/targets/pseudo/bootstrap-tools/Makefile index 1a7f2bd15ad0..3ac47053a388 100644 --- a/targets/pseudo/bootstrap-tools/Makefile +++ b/targets/pseudo/bootstrap-tools/Makefile @@ -39,7 +39,6 @@ BSARGS= DESTDIR= \ MAKEOBJDIRPREFIX= \ BOOTSTRAPPING=${OSRELDATE} \ BWPHASE=${.TARGET} \ - SSP_CFLAGS= \ -DNO_CPU_CFLAGS \ -DNO_LINT \ -DNO_PIC \ @@ -53,6 +52,7 @@ BSARGS= DESTDIR= \ MK_MAN=no \ MK_PROFILE=no \ MK_RETPOLINE=no \ + MK_SSP=no \ MK_TESTS=no \ MK_WERROR=no \ MK_INCLUDES=yes \ From owner-dev-commits-src-main@freebsd.org Wed Aug 4 18:55:33 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 569D8653B57; Wed, 4 Aug 2021 18:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg1CT1gkNz4lJ5; Wed, 4 Aug 2021 18:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2072C3D71; Wed, 4 Aug 2021 18:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174ItXj1041328; Wed, 4 Aug 2021 18:55:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174ItXap041327; Wed, 4 Aug 2021 18:55:33 GMT (envelope-from git) Date: Wed, 4 Aug 2021 18:55:33 GMT Message-Id: <202108041855.174ItXap041327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c51e4962a3cf - main - Document kern.log_wakeups_per_second. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c51e4962a3cf2959d1f1cb9ab74ceab448583169 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 18:55:33 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c51e4962a3cf2959d1f1cb9ab74ceab448583169 commit c51e4962a3cf2959d1f1cb9ab74ceab448583169 Author: John Baldwin AuthorDate: 2021-08-04 18:50:34 +0000 Commit: John Baldwin CommitDate: 2021-08-04 18:50:34 +0000 Document kern.log_wakeups_per_second. PR: 148680 MFC after: 2 weeks --- sys/kern/subr_log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index 9336611d6005..e69fb49b008f 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -98,10 +98,10 @@ static struct cv log_wakeup; struct mtx msgbuf_lock; MTX_SYSINIT(msgbuf_lock, &msgbuf_lock, "msgbuf lock", MTX_DEF); -/* Times per second to check for a pending syslog wakeup. */ static int log_wakeups_per_second = 5; SYSCTL_INT(_kern, OID_AUTO, log_wakeups_per_second, CTLFLAG_RW, - &log_wakeups_per_second, 0, ""); + &log_wakeups_per_second, 0, + "How often (times per second) to check for /dev/log waiters."); /*ARGSUSED*/ static int From owner-dev-commits-src-main@freebsd.org Wed Aug 4 19:02:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEB43654114; Wed, 4 Aug 2021 19:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg1M85RCZz4m3X; Wed, 4 Aug 2021 19:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A327D4490; Wed, 4 Aug 2021 19:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174J2CTb055076; Wed, 4 Aug 2021 19:02:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174J2Ci4055075; Wed, 4 Aug 2021 19:02:12 GMT (envelope-from git) Date: Wed, 4 Aug 2021 19:02:12 GMT Message-Id: <202108041902.174J2Ci4055075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 77013d11e648 - main - Cirrus-CI: add some timing info on pkg install failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77013d11e6483b970af25e13c9b892075742f7e5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 19:02:12 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=77013d11e6483b970af25e13c9b892075742f7e5 commit 77013d11e6483b970af25e13c9b892075742f7e5 Author: Ed Maste AuthorDate: 2021-06-02 17:08:29 +0000 Commit: Ed Maste CommitDate: 2021-08-04 19:02:00 +0000 Cirrus-CI: add some timing info on pkg install failure Sponsored by: The FreeBSD Foundation --- .cirrus-ci/pkg-install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.cirrus-ci/pkg-install.sh b/.cirrus-ci/pkg-install.sh index ef83e5284078..bcb781191023 100644 --- a/.cirrus-ci/pkg-install.sh +++ b/.cirrus-ci/pkg-install.sh @@ -1,10 +1,11 @@ #!/bin/sh set -e +start_time=$(date +%s) pkg install -y "$@" && exit 0 cat < Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E6C9654035; Wed, 4 Aug 2021 19:05:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg1Qr2j0cz4m4D; Wed, 4 Aug 2021 19:05:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44E3B422F; Wed, 4 Aug 2021 19:05:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174J5OvS055441; Wed, 4 Aug 2021 19:05:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174J5OiG055440; Wed, 4 Aug 2021 19:05:24 GMT (envelope-from git) Date: Wed, 4 Aug 2021 19:05:24 GMT Message-Id: <202108041905.174J5OiG055440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 62174eaf4605 - main - Install ipmi man page also on arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62174eaf460544c7645172cdde2c9204dcfd7321 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 19:05:24 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=62174eaf460544c7645172cdde2c9204dcfd7321 commit 62174eaf460544c7645172cdde2c9204dcfd7321 Author: Ed Maste AuthorDate: 2021-05-29 20:49:20 +0000 Commit: Ed Maste CommitDate: 2021-08-04 19:04:24 +0000 Install ipmi man page also on arm64 Fixes: 40d0971bbe5d ("arm64: enable build of the ipmi module") Sponsored by: The FreeBSD Foundation --- share/man/man4/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 71a0d37631c5..7177ca1c0b36 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -817,7 +817,6 @@ _if_vmx.4= if_vmx.4 _if_wpi.4= if_wpi.4 _igc.4= igc.4 _imcsmb.4= imcsmb.4 -_ipmi.4= ipmi.4 _io.4= io.4 _itwd.4= itwd.4 _nda.4= nda.4 @@ -887,6 +886,7 @@ _nvme.4= nvme.4 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "aarch64" +_ipmi.4= ipmi.4 _linux.4= linux.4 _ossl.4= ossl.4 .endif From owner-dev-commits-src-main@freebsd.org Wed Aug 4 20:10:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17FA565509D; Wed, 4 Aug 2021 20:10:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg2t30Dg9z4skM; Wed, 4 Aug 2021 20:10:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E49B94F9D; Wed, 4 Aug 2021 20:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174KAYue045197; Wed, 4 Aug 2021 20:10:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174KAYSb045196; Wed, 4 Aug 2021 20:10:34 GMT (envelope-from git) Date: Wed, 4 Aug 2021 20:10:34 GMT Message-Id: <202108042010.174KAYSb045196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: a0d701f61426 - main - vtfontcvt: minor style(9) fixes from clang-format MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0d701f6142686e853f96745a11bc9231dad97a9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 20:10:35 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a0d701f6142686e853f96745a11bc9231dad97a9 commit a0d701f6142686e853f96745a11bc9231dad97a9 Author: Ed Maste AuthorDate: 2021-05-13 00:17:35 +0000 Commit: Ed Maste CommitDate: 2021-08-04 19:08:21 +0000 vtfontcvt: minor style(9) fixes from clang-format Found during clang-format experiments (in D26340). Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30237 --- usr.bin/vtfontcvt/vtfontcvt.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/vtfontcvt/vtfontcvt.c b/usr.bin/vtfontcvt/vtfontcvt.c index fbfc0539b4d9..b7587f5881ec 100644 --- a/usr.bin/vtfontcvt/vtfontcvt.c +++ b/usr.bin/vtfontcvt/vtfontcvt.c @@ -31,21 +31,21 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include +#include #include #include -#include #include #include +#include +#include #include #include #include -#include #include #include -#include #define VFNT_MAXGLYPHS 131072 #define VFNT_MAXDIMENSION 128 @@ -300,11 +300,11 @@ check_whitelist(unsigned c) if (format == VT_C_SOURCE) { w = s_list; - n = sizeof (s_list) / sizeof (s_list[0]); + n = sizeof(s_list) / sizeof(s_list[0]); } if (format == VT_C_COMPRESSED) { w = c_list; - n = sizeof (c_list) / sizeof (c_list[0]); + n = sizeof(c_list) / sizeof(c_list[0]); } if (w == NULL) return (true); @@ -847,7 +847,7 @@ write_fnt_source(bool lz4, const char *filename) goto done; } if (fprintf(fp, "};\n\n") < 0) - goto done; + goto done; /* Write font maps. */ if (!TAILQ_EMPTY(&maps[VFNT_MAP_NORMAL])) { From owner-dev-commits-src-main@freebsd.org Wed Aug 4 20:10:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 553446550AD; Wed, 4 Aug 2021 20:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg2t41WGTz4sTR; Wed, 4 Aug 2021 20:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13220511B; Wed, 4 Aug 2021 20:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174KAZKj045221; Wed, 4 Aug 2021 20:10:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174KAZhG045220; Wed, 4 Aug 2021 20:10:35 GMT (envelope-from git) Date: Wed, 4 Aug 2021 20:10:35 GMT Message-Id: <202108042010.174KAZhG045220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: c910570e7573 - main - Use compressed debug in standalone userland debug files by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c910570e757305ba4a974b628bcd8fd4278908a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 20:10:36 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c910570e757305ba4a974b628bcd8fd4278908a7 commit c910570e757305ba4a974b628bcd8fd4278908a7 Author: Ed Maste AuthorDate: 2021-03-01 17:25:22 +0000 Commit: Ed Maste CommitDate: 2021-08-04 20:08:40 +0000 Use compressed debug in standalone userland debug files by default The compiler supports CFLAGS=-gz=zlib to compress .debug sections in object files, libraries, and binaries. Enable it to reduce disk usage for standalone debug files (and /usr/obj). Reviewed by: dim, kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29002 --- share/mk/bsd.compiler.mk | 2 +- share/mk/bsd.lib.mk | 5 +++++ share/mk/bsd.prog.mk | 4 ++++ share/mk/bsd.sys.mk | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index a52c3968fb09..681f6ffec14c 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -235,7 +235,7 @@ ${X_}COMPILER_FEATURES+= c++11 c++14 ${X_}COMPILER_FEATURES+= c++17 .endif .if ${${X_}COMPILER_TYPE} == "clang" -${X_}COMPILER_FEATURES+= retpoline init-all +${X_}COMPILER_FEATURES+= compressed-debug retpoline init-all .endif .if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 100000 || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 80100) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index aaac0b68d984..0c80dd63d5e8 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -113,8 +113,13 @@ CXXFLAGS+= -ftrivial-auto-var-init=pattern .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf*) +.if !${COMPILER_FEATURES:Mcompressed-debug} +CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} +CXXFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} +.else CFLAGS+= ${DEBUG_FILES_CFLAGS} CXXFLAGS+= ${DEBUG_FILES_CFLAGS} +.endif CTFFLAGS+= -g .endif diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 4f00be193874..437ccf373130 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -93,7 +93,11 @@ CFLAGS+=${CRUNCH_CFLAGS} .else .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf-*) +.if !${COMPILER_FEATURES:Mcompressed-debug} +CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*} +.else CFLAGS+= ${DEBUG_FILES_CFLAGS} +.endif CTFFLAGS+= -g .endif .endif diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 031d49bbaca2..a964cf6e596c 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -247,7 +247,7 @@ CFLAGS+= ${SSP_CFLAGS} # Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is # enabled. -DEBUG_FILES_CFLAGS?= -g +DEBUG_FILES_CFLAGS?= -g -gz=zlib # Allow user-specified additional warning flags, plus compiler and file # specific flag overrides, unless we've overridden this... From owner-dev-commits-src-main@freebsd.org Wed Aug 4 20:57:00 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12E9A655A48; Wed, 4 Aug 2021 20:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg3vc01Gnz3CgL; Wed, 4 Aug 2021 20:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCEF75C89; Wed, 4 Aug 2021 20:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174KuxDe002171; Wed, 4 Aug 2021 20:56:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174KuxjP002170; Wed, 4 Aug 2021 20:56:59 GMT (envelope-from git) Date: Wed, 4 Aug 2021 20:56:59 GMT Message-Id: <202108042056.174KuxjP002170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Phil Shafer Subject: git: cd2401cdd550 - main - add blank line between variables (testing git commit) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phil X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd2401cdd550e26dad098cdfb60d46a478b9ecb6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 20:57:00 -0000 The branch main has been updated by phil: URL: https://cgit.FreeBSD.org/src/commit/?id=cd2401cdd550e26dad098cdfb60d46a478b9ecb6 commit cd2401cdd550e26dad098cdfb60d46a478b9ecb6 Author: Phil Shafer AuthorDate: 2021-08-04 20:56:55 +0000 Commit: Phil Shafer CommitDate: 2021-08-04 20:56:55 +0000 add blank line between variables (testing git commit) --- lib/libxo/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libxo/Makefile b/lib/libxo/Makefile index 954e3d5ee4b6..96e91e3bf21a 100644 --- a/lib/libxo/Makefile +++ b/lib/libxo/Makefile @@ -3,6 +3,7 @@ .include HAS_TESTS= + SUBDIR.${MK_TESTS}+= tests SUBDIR = libxo .WAIT encoder From owner-dev-commits-src-main@freebsd.org Wed Aug 4 22:56:48 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35B4A656E5F; Wed, 4 Aug 2021 22:56:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gg6Yr0X4fz3LqL; Wed, 4 Aug 2021 22:56:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA16C72E7; Wed, 4 Aug 2021 22:56:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 174Mulrg062087; Wed, 4 Aug 2021 22:56:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 174Mulvd062086; Wed, 4 Aug 2021 22:56:47 GMT (envelope-from git) Date: Wed, 4 Aug 2021 22:56:47 GMT Message-Id: <202108042256.174Mulvd062086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: f3a3b0612169 - main - [lltable] Unify datapath feedback mechamism. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3a3b061216936b6233d1624dfdba03240d7c045 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 22:56:48 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=f3a3b061216936b6233d1624dfdba03240d7c045 commit f3a3b061216936b6233d1624dfdba03240d7c045 Author: Alexander V. Chernikov AuthorDate: 2021-08-02 22:39:00 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-08-04 22:52:43 +0000 [lltable] Unify datapath feedback mechamism. Use newly-create llentry_request_feedback(), llentry_mark_used() and llentry_get_hittime() to request datapatch usage check and fetch the results in the same fashion both in IPv4 and IPv6. While here, simplify llentry_provide_feedback() wrapper by eliminating 1 condition check. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31390 --- sys/net/if_ethersubr.c | 2 +- sys/net/if_infiniband.c | 2 +- sys/net/if_llatbl.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ sys/net/if_llatbl.h | 11 +++++++---- sys/netinet/if_ether.c | 25 +++++++------------------ sys/netinet/in.c | 15 +-------------- sys/netinet6/in6.c | 21 +-------------------- sys/netinet6/nd6.c | 32 ++++++++------------------------ 8 files changed, 72 insertions(+), 82 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 7eb46df8281a..718de9625044 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -315,7 +315,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, * the entry was used * by datapath. */ - llentry_mark_used(lle); + llentry_provide_feedback(lle); } if (lle != NULL) { phdr = lle->r_linkdata; diff --git a/sys/net/if_infiniband.c b/sys/net/if_infiniband.c index 3e7daeed4da3..528f20b7c98d 100644 --- a/sys/net/if_infiniband.c +++ b/sys/net/if_infiniband.c @@ -329,7 +329,7 @@ infiniband_output(struct ifnet *ifp, struct mbuf *m, * the entry was used * by datapath. */ - llentry_mark_used(lle); + llentry_provide_feedback(lle); } if (lle != NULL) { phdr = lle->r_linkdata; diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c index 7225869a07d0..70baf58c2778 100644 --- a/sys/net/if_llatbl.c +++ b/sys/net/if_llatbl.c @@ -386,6 +386,52 @@ lltable_calc_llheader(struct ifnet *ifp, int family, char *lladdr, return (error); } +/* + * Requests feedback from the datapath. + * First packet using @lle should result in + * setting r_skip_req back to 0 and updating + * lle_hittime to the current time_uptime. + */ +void +llentry_request_feedback(struct llentry *lle) +{ + LLE_REQ_LOCK(lle); + lle->r_skip_req = 1; + LLE_REQ_UNLOCK(lle); +} + +/* + * Updates the lle state to mark it has been used + * and record the time. + * Used by the llentry_provide_feedback() wrapper. + */ +void +llentry_mark_used(struct llentry *lle) +{ + LLE_REQ_LOCK(lle); + lle->r_skip_req = 0; + lle->lle_hittime = time_uptime; + LLE_REQ_UNLOCK(lle); +} + +/* + * Fetches the time when lle was used. + * Return 0 if the entry was not used, relevant time_uptime + * otherwise. + */ +time_t +llentry_get_hittime(struct llentry *lle) +{ + time_t lle_hittime = 0; + + LLE_REQ_LOCK(lle); + if ((lle->r_skip_req == 0) && (lle_hittime < lle->lle_hittime)) + lle_hittime = lle->lle_hittime; + LLE_REQ_UNLOCK(lle); + + return (lle_hittime); +} + /* * Update link-layer header for given @lle after * interface lladdr was changed. diff --git a/sys/net/if_llatbl.h b/sys/net/if_llatbl.h index 1081b7cdf2cd..488f8b006315 100644 --- a/sys/net/if_llatbl.h +++ b/sys/net/if_llatbl.h @@ -250,17 +250,20 @@ lla_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3addr) return (llt->llt_lookup(llt, flags, l3addr)); } +void llentry_request_feedback(struct llentry *lle); +void llentry_mark_used(struct llentry *lle); +time_t llentry_get_hittime(struct llentry *lle); + /* * Notify the LLE code that the entry was used by datapath. */ static __inline void -llentry_mark_used(struct llentry *lle) +llentry_provide_feedback(struct llentry *lle) { - if (lle->r_skip_req == 0) + if (__predict_true(lle->r_skip_req == 0)) return; - if ((lle->r_flags & RLLE_VALID) != 0) - lle->lle_tbl->llt_mark_used(lle); + llentry_mark_used(lle); } int lla_rt_output(struct rt_msghdr *, struct rt_addrinfo *); diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index ef50ec9ca964..3eb9d7210afb 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -207,7 +207,6 @@ arptimer(void *arg) { struct llentry *lle = (struct llentry *)arg; struct ifnet *ifp; - int r_skip_req; if (lle->la_flags & LLE_STATIC) { return; @@ -240,27 +239,17 @@ arptimer(void *arg) /* * Expiration time is approaching. - * Let's try to refresh entry if it is still - * in use. - * - * Set r_skip_req to get feedback from - * fast path. Change state and re-schedule - * ourselves. + * Request usage feedback from the datapath. + * Change state and re-schedule ourselves. */ - LLE_REQ_LOCK(lle); - lle->r_skip_req = 1; - LLE_REQ_UNLOCK(lle); + llentry_request_feedback(lle); lle->ln_state = ARP_LLINFO_VERIFY; callout_schedule(&lle->lle_timer, hz * V_arpt_rexmit); LLE_WUNLOCK(lle); CURVNET_RESTORE(); return; case ARP_LLINFO_VERIFY: - LLE_REQ_LOCK(lle); - r_skip_req = lle->r_skip_req; - LLE_REQ_UNLOCK(lle); - - if (r_skip_req == 0 && lle->la_preempt > 0) { + if (llentry_get_hittime(lle) > 0 && lle->la_preempt > 0) { /* Entry was used, issue refresh request */ struct epoch_tracker et; struct in_addr dst; @@ -532,7 +521,7 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int flags, struct mbuf *m, bcopy(lladdr, desten, ll_len); /* Notify LLE code that the entry was used by datapath */ - llentry_mark_used(la); + llentry_provide_feedback(la); if (pflags != NULL) *pflags = la->la_flags & (LLE_VALID|LLE_IFADDR); if (plle) { @@ -656,7 +645,7 @@ arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m, if (pflags != NULL) *pflags = LLE_VALID | (la->r_flags & RLLE_IFADDR); /* Notify the LLE handling code that the entry was used. */ - llentry_mark_used(la); + llentry_provide_feedback(la); if (plle) { LLE_ADDREF(la); *plle = la; @@ -1225,7 +1214,7 @@ arp_check_update_lle(struct arphdr *ah, struct in_addr isaddr, struct ifnet *ifp return; /* Clear fast path feedback request if set */ - la->r_skip_req = 0; + llentry_mark_used(la); } arp_mark_lle_reachable(la); diff --git a/sys/netinet/in.c b/sys/netinet/in.c index bcf071a81e0e..d1dd2b31b6ef 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1264,19 +1264,6 @@ in_lltable_destroy_lle_unlocked(epoch_context_t ctx) free(lle, M_LLTABLE); } -/* - * Called by the datapath to indicate that - * the entry was used. - */ -static void -in_lltable_mark_used(struct llentry *lle) -{ - - LLE_REQ_LOCK(lle); - lle->r_skip_req = 0; - LLE_REQ_UNLOCK(lle); -} - /* * Called by LLE_FREE_LOCKED when number of references * drops to zero. @@ -1681,7 +1668,7 @@ in_lltattach(struct ifnet *ifp) llt->llt_fill_sa_entry = in_lltable_fill_sa_entry; llt->llt_free_entry = in_lltable_free_entry; llt->llt_match_prefix = in_lltable_match_prefix; - llt->llt_mark_used = in_lltable_mark_used; + llt->llt_mark_used = llentry_mark_used; lltable_link(llt); return (llt); diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 02cb9df7da3a..d5b3452c0b06 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -2214,25 +2214,6 @@ in6_lltable_rtcheck(struct ifnet *ifp, return 0; } -/* - * Called by the datapath to indicate that the entry was used. - */ -static void -in6_lltable_mark_used(struct llentry *lle) -{ - - LLE_REQ_LOCK(lle); - lle->r_skip_req = 0; - - /* - * Set the hit time so the callback function - * can determine the remaining time before - * transiting to the DELAY state. - */ - lle->lle_hittime = time_uptime; - LLE_REQ_UNLOCK(lle); -} - static inline uint32_t in6_lltable_hash_dst(const struct in6_addr *dst, uint32_t hsize) { @@ -2469,7 +2450,7 @@ in6_lltattach(struct ifnet *ifp) llt->llt_fill_sa_entry = in6_lltable_fill_sa_entry; llt->llt_free_entry = in6_lltable_free_entry; llt->llt_match_prefix = in6_lltable_match_prefix; - llt->llt_mark_used = in6_lltable_mark_used; + llt->llt_mark_used = llentry_mark_used; lltable_link(llt); return (llt); diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 62f0ac733a23..60610462f4d7 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -617,7 +617,7 @@ nd6_llinfo_get_holdsrc(struct llentry *ln, struct in6_addr *src) static int nd6_is_stale(struct llentry *lle, long *pdelay, int *do_switch) { - int nd_delay, nd_gctimer, r_skip_req; + int nd_delay, nd_gctimer; time_t lle_hittime; long delay; @@ -625,17 +625,13 @@ nd6_is_stale(struct llentry *lle, long *pdelay, int *do_switch) nd_gctimer = V_nd6_gctimer; nd_delay = V_nd6_delay; - LLE_REQ_LOCK(lle); - r_skip_req = lle->r_skip_req; - lle_hittime = lle->lle_hittime; - LLE_REQ_UNLOCK(lle); + lle_hittime = llentry_get_hittime(lle); - if (r_skip_req > 0) { + if (lle_hittime == 0) { /* - * Nonzero r_skip_req value was set upon entering - * STALE state. Since value was not changed, no - * packets were passed using this lle. Ask for - * timer reschedule and keep STALE state. + * Datapath feedback has been requested upon entering + * STALE state. No packets has been passed using this lle. + * Ask for the timer reschedule and keep STALE state. */ delay = (long)(MIN(nd_gctimer, nd_delay)); delay *= hz; @@ -705,13 +701,7 @@ nd6_llinfo_setstate(struct llentry *lle, int newstate) break; case ND6_LLINFO_STALE: - /* - * Notify fast path that we want to know if any packet - * is transmitted by setting r_skip_req. - */ - LLE_REQ_LOCK(lle); - lle->r_skip_req = 1; - LLE_REQ_UNLOCK(lle); + llentry_request_feedback(lle); nd_delay = V_nd6_delay; nd_gctimer = V_nd6_gctimer; @@ -2254,13 +2244,7 @@ nd6_resolve(struct ifnet *ifp, int is_gw, struct mbuf *m, bcopy(ln->r_linkdata, desten, ln->r_hdrlen); if (pflags != NULL) *pflags = LLE_VALID | (ln->r_flags & RLLE_IFADDR); - /* Check if we have feedback request from nd6 timer */ - if (ln->r_skip_req != 0) { - LLE_REQ_LOCK(ln); - ln->r_skip_req = 0; /* Notify that entry was used */ - ln->lle_hittime = time_uptime; - LLE_REQ_UNLOCK(ln); - } + llentry_provide_feedback(ln); if (plle) { LLE_ADDREF(ln); *plle = ln; From owner-dev-commits-src-main@freebsd.org Thu Aug 5 08:55:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71BB465FBFA; Thu, 5 Aug 2021 08:55:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgMrc1Fl0z4kjY; Thu, 5 Aug 2021 08:55:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14C0617895; Thu, 5 Aug 2021 08:55:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1758tRgc064228; Thu, 5 Aug 2021 08:55:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1758tR09064227; Thu, 5 Aug 2021 08:55:27 GMT (envelope-from git) Date: Thu, 5 Aug 2021 08:55:27 GMT Message-Id: <202108050855.1758tR09064227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: dcfd60587102 - main - Add more arm64 external abort sources MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dcfd60587102b6854cda04a7c59c8de51ecf89b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 08:55:28 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=dcfd60587102b6854cda04a7c59c8de51ecf89b3 commit dcfd60587102b6854cda04a7c59c8de51ecf89b3 Author: Andrew Turner AuthorDate: 2021-08-03 13:20:54 +0000 Commit: Andrew Turner CommitDate: 2021-08-04 18:50:42 +0000 Add more arm64 external abort sources These will be used when we support the Arm Reliability, Availability, and Serviceability extension. Sponsored by: The FreeBSD Foundation --- sys/arm64/arm64/trap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 31bdf3e0287f..40bad51e8513 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -102,6 +102,15 @@ static abort_handler *abort_handlers[] = { [ISS_DATA_DFSC_PF_L3] = data_abort, [ISS_DATA_DFSC_ALIGN] = align_abort, [ISS_DATA_DFSC_EXT] = external_abort, + [ISS_DATA_DFSC_EXT_L0] = external_abort, + [ISS_DATA_DFSC_EXT_L1] = external_abort, + [ISS_DATA_DFSC_EXT_L2] = external_abort, + [ISS_DATA_DFSC_EXT_L3] = external_abort, + [ISS_DATA_DFSC_ECC] = external_abort, + [ISS_DATA_DFSC_ECC_L0] = external_abort, + [ISS_DATA_DFSC_ECC_L1] = external_abort, + [ISS_DATA_DFSC_ECC_L2] = external_abort, + [ISS_DATA_DFSC_ECC_L3] = external_abort, }; static __inline void From owner-dev-commits-src-main@freebsd.org Thu Aug 5 11:17:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24589661F14; Thu, 5 Aug 2021 11:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgR0R0Vtkz4vBn; Thu, 5 Aug 2021 11:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED92219073; Thu, 5 Aug 2021 11:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175BHQZn053582; Thu, 5 Aug 2021 11:17:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175BHQ9D053581; Thu, 5 Aug 2021 11:17:26 GMT (envelope-from git) Date: Thu, 5 Aug 2021 11:17:26 GMT Message-Id: <202108051117.175BHQ9D053581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 589951c76a3f - main - arm64: conf: std.broadcom: Add dwcotg and smsc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 589951c76a3ff5d3b1105af03d66e676c83dbffc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 11:17:27 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=589951c76a3ff5d3b1105af03d66e676c83dbffc commit 589951c76a3ff5d3b1105af03d66e676c83dbffc Author: Emmanuel Vadot AuthorDate: 2021-08-05 11:16:23 +0000 Commit: Emmanuel Vadot CommitDate: 2021-08-05 11:16:23 +0000 arm64: conf: std.broadcom: Add dwcotg and smsc Add the dwcotg and smsc usb to ethernet driver to std.broadcom. Those are used in RPI3 PR: 257593 --- sys/arm64/conf/std.broadcom | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/arm64/conf/std.broadcom b/sys/arm64/conf/std.broadcom index 8dfa8cec52d3..3332aaac0826 100644 --- a/sys/arm64/conf/std.broadcom +++ b/sys/arm64/conf/std.broadcom @@ -20,8 +20,12 @@ device pl011 # Ethernet NICs device genet # Broadcom on RPi4 +# USB support +device dwcotg + # USB ethernet support device muge +device smsc # MMC/SD/SDIO Card slot support device sdhci From owner-dev-commits-src-main@freebsd.org Thu Aug 5 12:36:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DE04663236; Thu, 5 Aug 2021 12:36:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgSlS3PC0z50wP; Thu, 5 Aug 2021 12:36:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 588AF19F5B; Thu, 5 Aug 2021 12:36:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175CaK8K059999; Thu, 5 Aug 2021 12:36:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175CaKst059998; Thu, 5 Aug 2021 12:36:20 GMT (envelope-from git) Date: Thu, 5 Aug 2021 12:36:20 GMT Message-Id: <202108051236.175CaKst059998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 89ed2ecb14ce - main - Disable compressed debug by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89ed2ecb14ceabc27883282cf96559a9e7d52717 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 12:36:20 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=89ed2ecb14ceabc27883282cf96559a9e7d52717 commit 89ed2ecb14ceabc27883282cf96559a9e7d52717 Author: Ed Maste AuthorDate: 2021-08-05 12:34:03 +0000 Commit: Ed Maste CommitDate: 2021-08-05 12:36:00 +0000 Disable compressed debug by default In c910570e7573 I enabled compressed debug sections, but it broke mips and powerpc. Disable it for now. Reported by: jenkins, manu Sponsored by: The FreeBSD Foundation --- share/mk/bsd.sys.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index a964cf6e596c..031d49bbaca2 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -247,7 +247,7 @@ CFLAGS+= ${SSP_CFLAGS} # Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is # enabled. -DEBUG_FILES_CFLAGS?= -g -gz=zlib +DEBUG_FILES_CFLAGS?= -g # Allow user-specified additional warning flags, plus compiler and file # specific flag overrides, unless we've overridden this... From owner-dev-commits-src-main@freebsd.org Thu Aug 5 13:11:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 715606636A2; Thu, 5 Aug 2021 13:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgTXF2ql6z545Y; Thu, 5 Aug 2021 13:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 497AF1AE33; Thu, 5 Aug 2021 13:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175DBfNl013544; Thu, 5 Aug 2021 13:11:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175DBfVF013543; Thu, 5 Aug 2021 13:11:41 GMT (envelope-from git) Date: Thu, 5 Aug 2021 13:11:41 GMT Message-Id: <202108051311.175DBfVF013543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 3f1f6b6ef7f6 - main - tcp, udp: improve input validation in handling bind() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f1f6b6ef7f6fea63583a4b6e917b3cc0f0d525e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 13:11:41 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3f1f6b6ef7f6fea63583a4b6e917b3cc0f0d525e commit 3f1f6b6ef7f6fea63583a4b6e917b3cc0f0d525e Author: Michael Tuexen AuthorDate: 2021-08-05 11:42:30 +0000 Commit: Michael Tuexen CommitDate: 2021-08-05 11:48:44 +0000 tcp, udp: improve input validation in handling bind() Reported by: syzbot+24fcfd8057e9bc339295@syzkaller.appspotmail.com Reported by: syzbot+6e90ceb5c89285b2655b@syzkaller.appspotmail.com Reviewed by: markj, rscheff MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D31422 --- sys/netinet/tcp_usrreq.c | 1 + sys/netinet/udp_usrreq.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index b1fc584f93b2..bcd7d18d9d62 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -326,6 +326,7 @@ tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td) * Preserve compatibility with old programs. */ if (nam->sa_family != AF_UNSPEC || + nam->sa_len < offsetof(struct sockaddr_in, sin_zero) || sinp->sin_addr.s_addr != INADDR_ANY) return (EAFNOSUPPORT); nam->sa_family = AF_INET; diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 76ed063391eb..46d687690713 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1635,6 +1635,7 @@ udp_bind(struct socket *so, struct sockaddr *nam, struct thread *td) * Preserve compatibility with old programs. */ if (nam->sa_family != AF_UNSPEC || + nam->sa_len < offsetof(struct sockaddr_in, sin_zero) || sinp->sin_addr.s_addr != INADDR_ANY) return (EAFNOSUPPORT); nam->sa_family = AF_INET; From owner-dev-commits-src-main@freebsd.org Thu Aug 5 14:22:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C54E1664987; Thu, 5 Aug 2021 14:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgW5b5Gjxz3BmC; Thu, 5 Aug 2021 14:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DCA91BA5C; Thu, 5 Aug 2021 14:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175EMBER006557; Thu, 5 Aug 2021 14:22:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175EMBpP006556; Thu, 5 Aug 2021 14:22:11 GMT (envelope-from git) Date: Thu, 5 Aug 2021 14:22:11 GMT Message-Id: <202108051422.175EMBpP006556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 98215005b747 - main - ktls: start a thread to keep the 16k ktls buffer zone populated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98215005b747fef67f44794ca64abd473b98bade Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 14:22:11 -0000 The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=98215005b747fef67f44794ca64abd473b98bade commit 98215005b747fef67f44794ca64abd473b98bade Author: Andrew Gallatin AuthorDate: 2021-08-05 14:15:09 +0000 Commit: Andrew Gallatin CommitDate: 2021-08-05 14:19:12 +0000 ktls: start a thread to keep the 16k ktls buffer zone populated Ktls recently received an optimization where we allocate 16k physically contiguous crypto destination buffers. This provides a large (more than 5%) reduction in CPU use in our workload. However, after several days of uptime, the performance benefit disappears because we have frequent allocation failures from the ktls buffer zone. It turns out that when load drops off, the ktls buffer zone is trimmed, and some 16k buffers are freed back to the OS. When load picks back up again, re-allocating those 16k buffers fails after some number of days of uptime because physical memory has become fragmented. This causes allocations to fail, because they are intentionally done without M_NORECLAIM, so as to avoid pausing the ktls crytpo work thread while the VM system defragments memory. To work around this, this change starts one thread per VM domain to allocate ktls buffers with M_NORECLAIM, as we don't care if this thread is paused while memory is defragged. The thread then frees the buffers back into the ktls buffer zone, thus allowing future allocations to succeed. Note that waking up the thread is intentionally racy, but neither of the races really matter. In the worst case, we could have either spurious wakeups or we could have to wait 1 second until the next rate-limited allocation failure to wake up the thread. This patch has been in use at Netflix on a handful of servers, and seems to fix the issue. Differential Revision: https://reviews.freebsd.org/D31260 Reviewed by: jhb, markj, (jtl, rrs, and dhw reviewed earlier version) Sponsored by: Netflix --- sys/kern/uipc_ktls.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 120 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 5f7dde325740..17b87195fc50 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include struct ktls_wq { struct mtx mtx; @@ -87,9 +88,17 @@ struct ktls_wq { int lastallocfail; } __aligned(CACHE_LINE_SIZE); +struct ktls_alloc_thread { + uint64_t wakeups; + uint64_t allocs; + struct thread *td; + int running; +}; + struct ktls_domain_info { int count; int cpu[MAXCPU]; + struct ktls_alloc_thread alloc_td; }; struct ktls_domain_info ktls_domains[MAXMEMDOM]; @@ -142,6 +151,11 @@ SYSCTL_BOOL(_kern_ipc_tls, OID_AUTO, sw_buffer_cache, CTLFLAG_RDTUN, &ktls_sw_buffer_cache, 1, "Enable caching of output buffers for SW encryption"); +static int ktls_max_alloc = 128; +SYSCTL_INT(_kern_ipc_tls, OID_AUTO, max_alloc, CTLFLAG_RWTUN, + &ktls_max_alloc, 128, + "Max number of 16k buffers to allocate in thread context"); + static COUNTER_U64_DEFINE_EARLY(ktls_tasks_active); SYSCTL_COUNTER_U64(_kern_ipc_tls, OID_AUTO, tasks_active, CTLFLAG_RD, &ktls_tasks_active, "Number of active tasks"); @@ -278,6 +292,7 @@ static void ktls_cleanup(struct ktls_session *tls); static void ktls_reset_send_tag(void *context, int pending); #endif static void ktls_work_thread(void *ctx); +static void ktls_alloc_thread(void *ctx); #if defined(INET) || defined(INET6) static u_int @@ -418,6 +433,32 @@ ktls_init(void *dummy __unused) ktls_number_threads++; } + /* + * Start an allocation thread per-domain to perform blocking allocations + * of 16k physically contiguous TLS crypto destination buffers. + */ + if (ktls_sw_buffer_cache) { + for (domain = 0; domain < vm_ndomains; domain++) { + if (VM_DOMAIN_EMPTY(domain)) + continue; + if (CPU_EMPTY(&cpuset_domain[domain])) + continue; + error = kproc_kthread_add(ktls_alloc_thread, + &ktls_domains[domain], &ktls_proc, + &ktls_domains[domain].alloc_td.td, + 0, 0, "KTLS", "alloc_%d", domain); + if (error) + panic("Can't add KTLS alloc thread %d error %d", + domain, error); + CPU_COPY(&cpuset_domain[domain], &mask); + error = cpuset_setthread(ktls_domains[domain].alloc_td.td->td_tid, + &mask); + if (error) + panic("Unable to bind KTLS alloc %d error %d", + domain, error); + } + } + /* * If we somehow have an empty domain, fall back to choosing * among all KTLS threads. @@ -1946,6 +1987,7 @@ static void * ktls_buffer_alloc(struct ktls_wq *wq, struct mbuf *m) { void *buf; + int domain, running; if (m->m_epg_npgs <= 2) return (NULL); @@ -1961,8 +2003,23 @@ ktls_buffer_alloc(struct ktls_wq *wq, struct mbuf *m) return (NULL); } buf = uma_zalloc(ktls_buffer_zone, M_NOWAIT | M_NORECLAIM); - if (buf == NULL) + if (buf == NULL) { + domain = PCPU_GET(domain); wq->lastallocfail = ticks; + + /* + * Note that this check is "racy", but the races are + * harmless, and are either a spurious wakeup if + * multiple threads fail allocations before the alloc + * thread wakes, or waiting an extra second in case we + * see an old value of running == true. + */ + if (!VM_DOMAIN_EMPTY(domain)) { + running = atomic_load_int(&ktls_domains[domain].alloc_td.running); + if (!running) + wakeup(&ktls_domains[domain].alloc_td); + } + } return (buf); } @@ -2154,6 +2211,68 @@ ktls_encrypt(struct ktls_wq *wq, struct mbuf *top) CURVNET_RESTORE(); } +static void +ktls_alloc_thread(void *ctx) +{ + struct ktls_domain_info *ktls_domain = ctx; + struct ktls_alloc_thread *sc = &ktls_domain->alloc_td; + void **buf; + struct sysctl_oid *oid; + char name[80]; + int i, nbufs; + + curthread->td_domain.dr_policy = + DOMAINSET_PREF(PCPU_GET(domain)); + snprintf(name, sizeof(name), "domain%d", PCPU_GET(domain)); + if (bootverbose) + printf("Starting KTLS alloc thread for domain %d\n", + PCPU_GET(domain)); + oid = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_kern_ipc_tls), OID_AUTO, + name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); + SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "allocs", + CTLFLAG_RD, &sc->allocs, 0, "buffers allocated"); + SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "wakeups", + CTLFLAG_RD, &sc->wakeups, 0, "thread wakeups"); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "running", + CTLFLAG_RD, &sc->running, 0, "thread running"); + + buf = NULL; + nbufs = 0; + for (;;) { + atomic_store_int(&sc->running, 0); + tsleep(sc, PZERO, "waiting for work", 0); + atomic_store_int(&sc->running, 1); + sc->wakeups++; + if (nbufs != ktls_max_alloc) { + free(buf, M_KTLS); + nbufs = atomic_load_int(&ktls_max_alloc); + buf = malloc(sizeof(void *) * nbufs, M_KTLS, + M_WAITOK | M_ZERO); + } + /* + * Below we allocate nbufs with different allocation + * flags than we use when allocating normally during + * encryption in the ktls worker thread. We specify + * M_NORECLAIM in the worker thread. However, we omit + * that flag here and add M_WAITOK so that the VM + * system is permitted to perform expensive work to + * defragment memory. We do this here, as it does not + * matter if this thread blocks. If we block a ktls + * worker thread, we risk developing backlogs of + * buffers to be encrypted, leading to surges of + * traffic and potential NIC output drops. + */ + for (i = 0; i < nbufs; i++) { + buf[i] = uma_zalloc(ktls_buffer_zone, M_WAITOK); + sc->allocs++; + } + for (i = 0; i < nbufs; i++) { + uma_zfree(ktls_buffer_zone, buf[i]); + buf[i] = NULL; + } + } +} + static void ktls_work_thread(void *ctx) { From owner-dev-commits-src-main@freebsd.org Thu Aug 5 15:23:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C4826650F7; Thu, 5 Aug 2021 15:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgXSQ2Sksz3GYr; Thu, 5 Aug 2021 15:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CB9C1CA98; Thu, 5 Aug 2021 15:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175FNYxa086149; Thu, 5 Aug 2021 15:23:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175FNYvD086148; Thu, 5 Aug 2021 15:23:34 GMT (envelope-from git) Date: Thu, 5 Aug 2021 15:23:34 GMT Message-Id: <202108051523.175FNYvD086148@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: de2e15295966 - main - Add vnode_pager_purge_range(9) KPI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de2e152959668756333db8a502a3d17a19dac393 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 15:23:34 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=de2e152959668756333db8a502a3d17a19dac393 commit de2e152959668756333db8a502a3d17a19dac393 Author: Ka Ho Ng AuthorDate: 2021-08-04 19:20:37 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-05 14:52:26 +0000 Add vnode_pager_purge_range(9) KPI This KPI is created in addition to the existing vnode_pager_setsize(9) KPI. The KPI is intended for file systems that are able to turn a range of file into sparse range, also known as hole-punching. Sponsored by: The FreeBSD Foundation Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D27194 --- share/man/man9/Makefile | 1 + share/man/man9/vnode_pager_purge_range.9 | 85 +++++++++++++++++++ sys/vm/vm_extern.h | 1 + sys/vm/vnode_pager.c | 140 +++++++++++++++++++++++-------- 4 files changed, 194 insertions(+), 33 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index a335f53b27f3..d0012301d889 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -409,6 +409,7 @@ MAN= accept_filter.9 \ vnet.9 \ vnode.9 \ vnode_pager_setsize.9 \ + vnode_pager_purge_range.9 \ VOP_ACCESS.9 \ VOP_ACLCHECK.9 \ VOP_ADVISE.9 \ diff --git a/share/man/man9/vnode_pager_purge_range.9 b/share/man/man9/vnode_pager_purge_range.9 new file mode 100644 index 000000000000..16a240c2a34b --- /dev/null +++ b/share/man/man9/vnode_pager_purge_range.9 @@ -0,0 +1,85 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2021 The FreeBSD Foundation +.\" +.\" This manual page was written by Ka Ho Ng under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd August 2, 2021 +.Dt VNODE_PAGER_PURGE_RANGE 9 +.Os +.Sh NAME +.Nm vnode_pager_purge_range +.Nd "invalidate the cached contents within the given byte range" +.Sh SYNOPSIS +.In sys/param.h +.In vm/vm.h +.In vm/vm_extern.h +.Ft void +.Fo vnode_pager_purge_range +.Fa "struct vnode *vp" +.Fa "vm_ooffset_t start" +.Fa "vm_ooffset_t end" +.Fc +.Sh DESCRIPTION +.Nm +invalidates the cached contents within the given byte range from the +specified vnode +.Fa vp . +The range to be purged is +.Eo [ +.Fa start , end +.Ec ) . +If the +.Fa end +parameter is the value zero, the affected range starts from +.Fa start +continues to the end of the object. +Pages within the specified range will be removed from the object's queue. +If +.Fa start +or +.Fa end +is not aligned to a page boundary, the invalidated part of the page is zeroed. +This function only cleans the resident pages in the affected region, it is up to +the callers to ensure reading the backing store gets back zeroes. +.Pp +In case the vnode +.Fa vp +does not have a VM object allocated, the effect of calling this function is a +no-op. +.Sh LOCKS +The vnode must be locked on entry and will still be locked on exit. +.Sh SEE ALSO +.Xr vnode 9 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 14 . +.Sh AUTHORS +This +manual page was written by +.An Ka Ho Ng Aq Mt khng@FreeBSD.org . diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index acdb361d3262..ed365bd41689 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -120,6 +120,7 @@ void vmspace_free(struct vmspace *); void vmspace_exitfree(struct proc *); void vmspace_switch_aio(struct vmspace *); void vnode_pager_setsize(struct vnode *, vm_ooffset_t); +void vnode_pager_purge_range(struct vnode *, vm_ooffset_t, vm_ooffset_t); int vslock(void *, size_t); void vsunlock(void *, size_t); struct sf_buf *vm_imgact_map_page(vm_object_t object, vm_ooffset_t offset); diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index d167fcc555fb..4330c17c2033 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -427,6 +427,53 @@ vnode_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, return TRUE; } +/* + * Internal routine clearing partial-page content + */ +static void +vnode_pager_subpage_purge(struct vm_page *m, int base, int end) +{ + int size; + + KASSERT(end > base && end <= PAGE_SIZE, + ("%s: start %d end %d", __func__, base, end)); + size = end - base; + + /* + * Clear out partial-page garbage in case + * the page has been mapped. + */ + pmap_zero_page_area(m, base, size); + + /* + * Update the valid bits to reflect the blocks + * that have been zeroed. Some of these valid + * bits may have already been set. + */ + vm_page_set_valid_range(m, base, size); + + /* + * Round up "base" to the next block boundary so + * that the dirty bit for a partially zeroed + * block is not cleared. + */ + base = roundup2(base, DEV_BSIZE); + end = rounddown2(end, DEV_BSIZE); + + if (end > base) { + /* + * Clear out partial-page dirty bits. + * + * note that we do not clear out the + * valid bits. This would prevent + * bogus_page replacement from working + * properly. + */ + vm_page_clear_dirty(m, base, end - base); + } + +} + /* * Lets the VM system know about a change in size for a file. * We adjust our own internal size and flush any cached pages in @@ -489,39 +536,9 @@ vnode_pager_setsize(struct vnode *vp, vm_ooffset_t nsize) m = vm_page_grab(object, OFF_TO_IDX(nsize), VM_ALLOC_NOCREAT); if (m == NULL) goto out; - if (!vm_page_none_valid(m)) { - int base = (int)nsize & PAGE_MASK; - int size = PAGE_SIZE - base; - - /* - * Clear out partial-page garbage in case - * the page has been mapped. - */ - pmap_zero_page_area(m, base, size); - - /* - * Update the valid bits to reflect the blocks that - * have been zeroed. Some of these valid bits may - * have already been set. - */ - vm_page_set_valid_range(m, base, size); - - /* - * Round "base" to the next block boundary so that the - * dirty bit for a partially zeroed block is not - * cleared. - */ - base = roundup2(base, DEV_BSIZE); - - /* - * Clear out partial-page dirty bits. - * - * note that we do not clear out the valid - * bits. This would prevent bogus_page - * replacement from working properly. - */ - vm_page_clear_dirty(m, base, PAGE_SIZE - base); - } + if (!vm_page_none_valid(m)) + vnode_pager_subpage_purge(m, (int)nsize & PAGE_MASK, + PAGE_SIZE); vm_page_xunbusy(m); } out: @@ -534,6 +551,63 @@ out: VM_OBJECT_WUNLOCK(object); } +/* + * Lets the VM system know about the purged range for a file. We toss away any + * cached pages in the associated object that are affected by the purge + * operation. Partial-page area not aligned to page boundaries will be zeroed + * and the dirty blocks in DEV_BSIZE unit within a page will not be flushed. + */ +void +vnode_pager_purge_range(struct vnode *vp, vm_ooffset_t start, vm_ooffset_t end) +{ + struct vm_page *m; + struct vm_object *object; + vm_pindex_t pi, pistart, piend; + bool same_page; + int base, pend; + + ASSERT_VOP_LOCKED(vp, "vnode_pager_purge_range"); + + object = vp->v_object; + pi = start + PAGE_MASK < start ? OBJ_MAX_SIZE : + OFF_TO_IDX(start + PAGE_MASK); + pistart = OFF_TO_IDX(start); + piend = end == 0 ? OBJ_MAX_SIZE : OFF_TO_IDX(end); + same_page = pistart == piend; + if ((end != 0 && end <= start) || object == NULL) + return; + + VM_OBJECT_WLOCK(object); + + if (pi < piend) + vm_object_page_remove(object, pi, piend, 0); + + if ((start & PAGE_MASK) != 0) { + base = (int)start & PAGE_MASK; + pend = same_page ? (int)end & PAGE_MASK : PAGE_SIZE; + m = vm_page_grab(object, pistart, VM_ALLOC_NOCREAT); + if (m != NULL) { + if (!vm_page_none_valid(m)) + vnode_pager_subpage_purge(m, base, pend); + vm_page_xunbusy(m); + } + if (same_page) + goto out; + } + if ((end & PAGE_MASK) != 0) { + base = same_page ? (int)start & PAGE_MASK : 0 ; + pend = (int)end & PAGE_MASK; + m = vm_page_grab(object, piend, VM_ALLOC_NOCREAT); + if (m != NULL) { + if (!vm_page_none_valid(m)) + vnode_pager_subpage_purge(m, base, pend); + vm_page_xunbusy(m); + } + } +out: + VM_OBJECT_WUNLOCK(object); +} + /* * calculate the linear (byte) disk address of specified virtual * file address From owner-dev-commits-src-main@freebsd.org Thu Aug 5 15:23:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9481766570A; Thu, 5 Aug 2021 15:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgXSR3hZfz3GhS; Thu, 5 Aug 2021 15:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 686901CB02; Thu, 5 Aug 2021 15:23:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175FNZ3Z086179; Thu, 5 Aug 2021 15:23:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175FNZHl086178; Thu, 5 Aug 2021 15:23:35 GMT (envelope-from git) Date: Thu, 5 Aug 2021 15:23:35 GMT Message-Id: <202108051523.175FNZHl086178@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: abbb57d5a647 - main - vfs: Introduce vn_bmap_seekhole_locked() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abbb57d5a647f91847a860bd25b4f109c3abb390 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 15:23:35 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=abbb57d5a647f91847a860bd25b4f109c3abb390 commit abbb57d5a647f91847a860bd25b4f109c3abb390 Author: Ka Ho Ng AuthorDate: 2021-08-04 19:20:59 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-05 14:52:26 +0000 vfs: Introduce vn_bmap_seekhole_locked() vn_bmap_seekhole_locked() is factored out version of vn_bmap_seekhole(). This variant requires shared vnode lock being held around the call. Sponsored by: The FreeBSD Foundation Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D31404 --- sys/kern/vfs_vnops.c | 36 +++++++++++++++++++++++++----------- sys/sys/vnode.h | 2 ++ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index b7e53add5a35..ccc468d71737 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -2425,7 +2425,8 @@ vn_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end) } int -vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) +vn_bmap_seekhole_locked(struct vnode *vp, u_long cmd, off_t *off, + struct ucred *cred) { struct vattr va; daddr_t bn, bnp; @@ -2434,21 +2435,20 @@ vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) int error; KASSERT(cmd == FIOSEEKHOLE || cmd == FIOSEEKDATA, - ("Wrong command %lu", cmd)); + ("%s: Wrong command %lu", __func__, cmd)); + ASSERT_VOP_LOCKED(vp, "vn_bmap_seekhole_locked"); - if (vn_lock(vp, LK_SHARED) != 0) - return (EBADF); if (vp->v_type != VREG) { error = ENOTTY; - goto unlock; + goto out; } error = VOP_GETATTR(vp, &va, cred); if (error != 0) - goto unlock; + goto out; noff = *off; if (noff >= va.va_size) { error = ENXIO; - goto unlock; + goto out; } bsize = vp->v_mount->mnt_stat.f_iosize; for (bn = noff / bsize; noff < va.va_size; bn++, noff += bsize - @@ -2456,14 +2456,14 @@ vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) error = VOP_BMAP(vp, bn, NULL, &bnp, NULL, NULL); if (error == EOPNOTSUPP) { error = ENOTTY; - goto unlock; + goto out; } if ((bnp == -1 && cmd == FIOSEEKHOLE) || (bnp != -1 && cmd == FIOSEEKDATA)) { noff = bn * bsize; if (noff < *off) noff = *off; - goto unlock; + goto out; } } if (noff > va.va_size) @@ -2471,13 +2471,27 @@ vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) /* noff == va.va_size. There is an implicit hole at the end of file. */ if (cmd == FIOSEEKDATA) error = ENXIO; -unlock: - VOP_UNLOCK(vp); +out: if (error == 0) *off = noff; return (error); } +int +vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred) +{ + int error; + + KASSERT(cmd == FIOSEEKHOLE || cmd == FIOSEEKDATA, + ("%s: Wrong command %lu", __func__, cmd)); + + if (vn_lock(vp, LK_SHARED) != 0) + return (EBADF); + error = vn_bmap_seekhole_locked(vp, cmd, off, cred); + VOP_UNLOCK(vp); + return (error); +} + int vn_seek(struct file *fp, off_t offset, int whence, struct thread *td) { diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 1f2d74fdf5f1..702fd6623e6a 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -731,6 +731,8 @@ void vunref(struct vnode *); void vn_printf(struct vnode *vp, const char *fmt, ...) __printflike(2,3); int vrecycle(struct vnode *vp); int vrecyclel(struct vnode *vp); +int vn_bmap_seekhole_locked(struct vnode *vp, u_long cmd, off_t *off, + struct ucred *cred); int vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred); int vn_close(struct vnode *vp, From owner-dev-commits-src-main@freebsd.org Thu Aug 5 15:23:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2EDE6656CF; Thu, 5 Aug 2021 15:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgXSS5FBQz3GcB; Thu, 5 Aug 2021 15:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C1CA1CB03; Thu, 5 Aug 2021 15:23:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175FNaar086203; Thu, 5 Aug 2021 15:23:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175FNaGp086202; Thu, 5 Aug 2021 15:23:36 GMT (envelope-from git) Date: Thu, 5 Aug 2021 15:23:36 GMT Message-Id: <202108051523.175FNaGp086202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 0dc332bff200 - main - Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0dc332bff200c940edc36c4715b629a2e1e9f9ae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 15:23:36 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=0dc332bff200c940edc36c4715b629a2e1e9f9ae commit 0dc332bff200c940edc36c4715b629a2e1e9f9ae Author: Ka Ho Ng AuthorDate: 2021-08-05 15:20:42 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-05 15:20:42 +0000 Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9). fspacectl(2) is a system call to provide space management support to userspace applications. VOP_DEALLOCATE(9) is a VOP call to perform the deallocation. vn_deallocate(9) is a public KPI for kmods' use. The purpose of proposing a new system call, a KPI and a VOP call is to allow bhyve or other hypervisor monitors to emulate the behavior of SCSI UNMAP/NVMe DEALLOCATE on a plain file. fspacectl(2) comprises of cmd and flags parameters to specify the space management operation to be performed. Currently cmd has to be SPACECTL_DEALLOC, and flags has to be 0. fo_fspacectl is added to fileops. VOP_DEALLOCATE(9) is added as a new VOP call. A trivial implementation of VOP_DEALLOCATE(9) is provided. Sponsored by: The FreeBSD Foundation Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28347 --- lib/libc/sys/Makefile.inc | 1 + lib/libc/sys/Symbol.map | 1 + lib/libc/sys/fspacectl.2 | 189 +++++++++++++++++++ lib/libc/sys/pathconf.2 | 3 + share/man/man9/Makefile | 2 + share/man/man9/VOP_DEALLOCATE.9 | 101 ++++++++++ share/man/man9/vn_deallocate.9 | 103 +++++++++++ sys/bsm/audit_kevents.h | 1 + sys/compat/freebsd32/freebsd32.h | 4 + sys/compat/freebsd32/freebsd32_misc.c | 34 ++++ sys/compat/freebsd32/syscalls.master | 5 + sys/kern/capabilities.conf | 5 + sys/kern/sys_generic.c | 70 +++++++ sys/kern/syscalls.master | 9 + sys/kern/vfs_default.c | 122 ++++++++++++ sys/kern/vfs_vnops.c | 110 +++++++++++ sys/kern/vnode_if.src | 11 ++ sys/security/audit/audit_bsm.c | 12 ++ sys/sys/fcntl.h | 20 ++ sys/sys/file.h | 15 ++ sys/sys/syscallsubr.h | 3 + sys/sys/unistd.h | 1 + sys/sys/vnode.h | 2 + tests/sys/file/Makefile | 1 + tests/sys/file/fspacectl_test.c | 338 ++++++++++++++++++++++++++++++++++ 25 files changed, 1163 insertions(+) diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index a1eb9567a380..29e914872a8d 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -190,6 +190,7 @@ MAN+= abort2.2 \ fhreadlink.2 \ flock.2 \ fork.2 \ + fspacectl.2 \ fsync.2 \ getdirentries.2 \ getdtablesize.2 \ diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map index 80bb2c236191..93fbc947a7e1 100644 --- a/lib/libc/sys/Symbol.map +++ b/lib/libc/sys/Symbol.map @@ -419,6 +419,7 @@ FBSD_1.6 { FBSD_1.7 { _Fork; + fspacectl; }; FBSDprivate_1.0 { diff --git a/lib/libc/sys/fspacectl.2 b/lib/libc/sys/fspacectl.2 new file mode 100644 index 000000000000..2f581d1c1fb8 --- /dev/null +++ b/lib/libc/sys/fspacectl.2 @@ -0,0 +1,189 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2021 The FreeBSD Foundation +.\" +.\" This manual page was written by Ka Ho Ng under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd August 4, 2021 +.Dt FSPACECTL 2 +.Os +.Sh NAME +.Nm fspacectl +.Nd space management in a file +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In fcntl.h +.Ft int +.Fo fspacectl +.Fa "int fd" +.Fa "int cmd" +.Fa "const struct spacectl_range *rqsr" +.Fa "int flags" +.Fa "struct spacectl_range *rmsr" +.Fc +.Sh DESCRIPTION +.Nm +is a system call performing space management over a file. +The +.Fa fd +argument specifies the file descriptor to be operated on by the +.Fa cmd +argument. +The +.Fa rqsr +argument points to a +.Fa spacectl_range +structure that contains the requested operation range. +The +.Fa flags +argument controls the behavior of the operation to take place. +If the +.Fa rmsr +argument is non-NULL, the +.Fa spacectl_range +structure it points to is updated to contain the unprocessed operation range +after the system call returns. +Both +.Fa rqsr +and +.Fa rmsr +arguments can point to the same structure. +.Pp +The +.Fa spacectl_range +structure is defined as: +.Bd -literal +struct spacectl_range { + off_t r_offset; + off_t r_len; +}; +.Ed +.Pp +The operation specified by the +.Fa cmd +argument may be one of: +.Bl -tag -width SPACECTL_DEALLOC +.It Dv SPACECTL_DEALLOC +Zero a region in the file specified by the +.Fa rqsr +argument. +The +.Va "rqsr->r_offset" +has to be a value greater than or equal to 0, and the +.Va "rqsr->r_len" +has to be a value greater than 0. +.Pp +If the file system supports hole-punching, +file system space deallocation may be performed in the given region. +.El +.Pp +The +.Fa flags +argument needs to be the value 0 currently. +.Sh RETURN VALUES +Upon successful completion, the value 0 is returned; +otherwise the value -1 is returned and +.Va errno +is set to indicate the error. +.Sh ERRORS +Possible failure conditions: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument is not a valid file descriptor. +.It Bq Er EBADF +The +.Fa fd +argument references a file that was opened without write permission. +.It Bq Er EINTR +A signal was caught during execution. +.It Bq Er EINVAL +The +.Fa cmd +argument is not valid. +.It Bq Er EINVAL +If the +.Fa cmd +argument is +.Dv SPACECTL_DEALLOC , +either the +.Fa "range->r_offset" +argument was less than zero, or the +.Fa "range->r_len" +argument was less than or equal to zero. +.It Bq Er EINVAL +An invalid or unsupported flag is included in +.Fa flags . +.It Bq Er EINVAL +A flag included in +.Fa flags +is not supported by the operation specified by the +.Fa cmd +argument. +.It Bq Er EFAULT +The +.Fa rqsr +or a non-NULL +.Fa rmsr +argument point outside the process' allocated address space. +.It Bq Er EIO +An I/O error occurred while reading from or writing to a file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. +.It Bq Er ENODEV +The +.Fa fd +argument does not refer to a file that supports +.Nm . +.It Bq Er ENOSPC +There is insufficient free space remaining on the file system storage +media. +.It Bq Er ENOTCAPABLE +The file descriptor +.Fa fd +has insufficient rights. +.It Bq Er ESPIPE +The +.Fa fd +argument is associated with a pipe or FIFO. +.El +.Sh SEE ALSO +.Xr creat 2 , +.Xr ftruncate 2 , +.Xr open 2 , +.Xr unlink 2 +.Sh HISTORY +The +.Nm +system call appeared in +.Fx 14.0 . +.Sh AUTHORS +.Nm +and this manual page were written by +.An Ka Ho Ng Aq Mt khng@FreeBSD.org +under sponsorship from the FreeBSD Foundation. diff --git a/lib/libc/sys/pathconf.2 b/lib/libc/sys/pathconf.2 index 62ec532705ef..c5a7ba1be3c5 100644 --- a/lib/libc/sys/pathconf.2 +++ b/lib/libc/sys/pathconf.2 @@ -166,6 +166,9 @@ specified file, otherwise 0. .It Li _PC_MIN_HOLE_SIZE If a file system supports the reporting of holes (see .Xr lseek 2 ) , +.It Li _PC_DEALLOC_PRESENT +If a file system supports hole-punching (see +.Xr fspacectl 2 ) , .Fn pathconf and .Fn fpathconf diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index d0012301d889..b2f1451a79d7 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -404,6 +404,7 @@ MAN= accept_filter.9 \ vm_page_wire.9 \ vm_set_page_size.9 \ vmem.9 \ + vn_deallocate.9 \ vn_fullpath.9 \ vn_isdisk.9 \ vnet.9 \ @@ -420,6 +421,7 @@ MAN= accept_filter.9 \ VOP_BWRITE.9 \ VOP_COPY_FILE_RANGE.9 \ VOP_CREATE.9 \ + VOP_DEALLOCATE.9 \ VOP_FSYNC.9 \ VOP_GETACL.9 \ VOP_GETEXTATTR.9 \ diff --git a/share/man/man9/VOP_DEALLOCATE.9 b/share/man/man9/VOP_DEALLOCATE.9 new file mode 100644 index 000000000000..1c7f80cfbc6c --- /dev/null +++ b/share/man/man9/VOP_DEALLOCATE.9 @@ -0,0 +1,101 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2021 The FreeBSD Foundation +.\" +.\" This manual page was written by Ka Ho Ng under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd May 11, 2021 +.Dt VOP_DEALLOCATE 9 +.Os +.Sh NAME +.Nm VOP_DEALLOCATE +.Nd zero and/or deallocate storage from a file +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fo VOP_DEALLOCATE +.Fa "struct vnode *vp" +.Fa "off_t *offset" +.Fa "off_t *len" +.Fa "int flags" +.Fa "struct ucred *cred" +.Fc +.Sh DESCRIPTION +This VOP call zeroes/deallocates storage for an offset range in a file. +It is used to implement the +.Xr fspacectl 2 +system call. +.Pp +Its arguments are: +.Bl -tag -width offset +.It Fa vp +The vnode of the file. +.It Fa offset +The start of the range to deallocate storage in the file. +.It Fa len +The length of the range to deallocate storage in the file. +.It Fa flags +The flags of this call. +This should be set to 0 for now. +.It Fa cred +The credentials of the caller. +.El +.Pp +.Fa *offset +and +.Fa *len +are updated to reflect the portion of the range that +still needs to be zeroed/deallocated on return. +Partial result is considered a successful operation. +.Sh LOCKS +The vnode should be locked on entry and will still be locked on exit. +.Sh RETURN VALUES +Zero is returned if the call is successful, otherwise an appropriate +error code is returned. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +Invalid +.Fa offset , len +or +.Fa flags +parameters are passed into this VOP call. +.It Bq Er ENODEV +The vnode type is not supported by this VOP call. +.It Bq Er ENOSPC +The file system is full. +.It Bq Er EPERM +An append-only flag is set on the file, but the caller is attempting to +zero before the current end of file. +.El +.Sh SEE ALSO +.Xr vnode 9 +.Sh AUTHORS +.Nm +and this manual page was written by +.An Ka Ho Ng Aq Mt khng@FreeBSD.org +under sponsorship from the FreeBSD Foundation. diff --git a/share/man/man9/vn_deallocate.9 b/share/man/man9/vn_deallocate.9 new file mode 100644 index 000000000000..415a8941ca68 --- /dev/null +++ b/share/man/man9/vn_deallocate.9 @@ -0,0 +1,103 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2021 The FreeBSD Foundation +.\" +.\" This manual page was written by Ka Ho Ng under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd Jul 30, 2021 +.Dt VN_DEALLOCATE 9 +.Os +.Sh NAME +.Nm vn_deallocate +.Nd zero and/or deallocate storage from a file +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.Ft int +.Fo vn_deallocate +.Fa "struct vnode *vp" +.Fa "off_t *offset" +.Fa "off_t *length" +.Fa "int flags" +.Fa "int ioflg" +.Fa "struct ucred *active_cred" +.Fa "struct ucred *file_cred" +.Fc +.Sh DESCRIPTION +The +.Fn vn_deallocate +function zeros and/or deallocates backing storage space from a file. +This function only works on vnodes with +.Dv VREG +type. +.Pp +The arguments are: +.Bl -tag -width active_cred +.It Fa vp +The vnode of the file. +.It Fa offset +The starting offset of the operation range. +.It Fa length +The length of the operation range. +This must be greater than 0. +.It Fa flags +The control flags of the operation. +This should be set to 0 for now. +.It Fa ioflg +The control flags of vnode locking. +.It Fa active_cred +The user credentials of the calling thread. +.It Fa file_cred +The credentials installed on the file description pointing to the vnode or NOCRED. +.El +.Pp +The +.Fn ioflg +argument may be one or more of the following flags: +.Bl -tag -width IO_RANGELOCKED +.It Dv IO_NODELOCKED +The vnode was locked before the call. +.It Dv IO_RANGELOCKED +Rangelock was owned around the call. +.It Dv IO_NOMACCHECK +Skip MAC checking in the call. +.El +.Pp +.Fa *offset +and +.Fa *length +are updated to reflect the unprocessed operation range of the call. +.Sh RETURN VALUES +Upon successful completion, the value 0 is returned; otherwise the +appropriate error is returned. +.Sh SEE ALSO +.Xr vnode 9 , +.Xr VOP_DEALLOCATE 9 +.Sh AUTHORS +.Nm +and this manual page was written by +.An Ka Ho Ng Aq Mt khng@FreeBSD.org +under sponsorship from the FreeBSD Foundation. diff --git a/sys/bsm/audit_kevents.h b/sys/bsm/audit_kevents.h index eeb928ecafdc..0da82de1fbcb 100644 --- a/sys/bsm/audit_kevents.h +++ b/sys/bsm/audit_kevents.h @@ -662,6 +662,7 @@ #define AUE_SPECIALFD 43266 /* FreeBSD-specific. */ #define AUE_AIO_WRITEV 43267 /* FreeBSD-specific. */ #define AUE_AIO_READV 43268 /* FreeBSD-specific. */ +#define AUE_FSPACECTL 43269 /* FreeBSD-specific. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h index 2e4f5155cbf4..8a14a42db813 100644 --- a/sys/compat/freebsd32/freebsd32.h +++ b/sys/compat/freebsd32/freebsd32.h @@ -435,5 +435,9 @@ struct ptrace_coredump32 { uint32_t pc_limit1, pc_limit2; }; +struct spacectl_range32 { + uint32_t r_offset1, r_offset2; + uint32_t r_len1, r_len2; +}; #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */ diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 736fd1123d53..c417a64d286a 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -3857,3 +3857,37 @@ freebsd32_ntp_adjtime(struct thread *td, struct freebsd32_ntp_adjtime_args *uap) } return (error); } + +int +freebsd32_fspacectl(struct thread *td, struct freebsd32_fspacectl_args *uap) +{ + struct spacectl_range rqsr, rmsr; + struct spacectl_range32 rqsr32, rmsr32; + int error, cerror; + + error = copyin(uap->rqsr, &rqsr32, sizeof(rqsr32)); + if (error != 0) + return (error); + rqsr.r_offset = PAIR32TO64(off_t, rqsr32.r_offset); + rqsr.r_len = PAIR32TO64(off_t, rqsr32.r_len); + + error = kern_fspacectl(td, uap->fd, uap->cmd, &rqsr, uap->flags, + &rmsr); + if (uap->rmsr != NULL) { +#if BYTE_ORDER == LITTLE_ENDIAN + rmsr32.r_offset1 = rmsr.r_offset; + rmsr32.r_offset2 = rmsr.r_offset >> 32; + rmsr32.r_len1 = rmsr.r_len; + rmsr32.r_len2 = rmsr.r_len >> 32; +#else + rmsr32.r_offset1 = rmsr.r_offset >> 32; + rmsr32.r_offset2 = rmsr.r_offset; + rmsr32.r_len1 = rmsr.r_len >> 32; + rmsr32.r_len2 = rmsr.r_len; +#endif + cerror = copyout(&rmsr32, uap->rmsr, sizeof(rmsr32)); + if (error == 0) + error = cerror; + } + return (error); +} diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index aac788bf3956..3e53de2dc966 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -1176,5 +1176,10 @@ struct aiocb32 *aiocbp); } 579 AUE_AIO_READV STD { int freebsd32_aio_readv( \ struct aiocb32 *aiocbp); } +580 AUE_FSPACECTL STD { int freebsd32_fspacectl(int fd, \ + int cmd, \ + const struct spacectl_range32 *rqsr, \ + int flags, \ + struct spacectl_range32 *rmsr); } ; vim: syntax=off diff --git a/sys/kern/capabilities.conf b/sys/kern/capabilities.conf index 602ec7088fc6..f53530eb7fa7 100644 --- a/sys/kern/capabilities.conf +++ b/sys/kern/capabilities.conf @@ -228,6 +228,11 @@ freebsd6_mmap freebsd6_pread freebsd6_pwrite +## +## Allow I/O-related file operations, subject to capability rights. +## +fspacectl + ## ## Allow querying file and file system state with fstat(2) and fstatfs(2), ## subject to capability rights. diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index f86d494400e2..e6b2cba27a04 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -861,6 +861,76 @@ kern_posix_fallocate(struct thread *td, int fd, off_t offset, off_t len) return (error); } +int +sys_fspacectl(struct thread *td, struct fspacectl_args *uap) +{ + struct spacectl_range rqsr, rmsr; + int error, cerror; + + error = copyin(uap->rqsr, &rqsr, sizeof(rqsr)); + if (error != 0) + return (error); + + error = kern_fspacectl(td, uap->fd, uap->cmd, &rqsr, uap->flags, + &rmsr); + if (uap->rmsr != NULL) { + cerror = copyout(&rmsr, uap->rmsr, sizeof(rmsr)); + if (error == 0) + error = cerror; + } + return (error); +} + +int +kern_fspacectl(struct thread *td, int fd, int cmd, + const struct spacectl_range *rqsr, int flags, struct spacectl_range *rmsrp) +{ + struct file *fp; + struct spacectl_range rmsr; + int error; + + AUDIT_ARG_FD(fd); + AUDIT_ARG_CMD(cmd); + AUDIT_ARG_FFLAGS(flags); + + if (rqsr == NULL) + return (EINVAL); + rmsr = *rqsr; + if (rmsrp != NULL) + *rmsrp = rmsr; + + if (cmd != SPACECTL_DEALLOC || + rqsr->r_offset < 0 || rqsr->r_len <= 0 || + rqsr->r_offset > OFF_MAX - rqsr->r_len || + (flags & ~SPACECTL_F_SUPPORTED) != 0) + return (EINVAL); + + error = fget_write(td, fd, &cap_pwrite_rights, &fp); + if (error != 0) + return (error); + AUDIT_ARG_FILE(td->td_proc, fp); + if ((fp->f_ops->fo_flags & DFLAG_SEEKABLE) == 0) { + error = ESPIPE; + goto out; + } + if ((fp->f_flag & FWRITE) == 0) { + error = EBADF; + goto out; + } + + error = fo_fspacectl(fp, cmd, &rmsr.r_offset, &rmsr.r_len, flags, + td->td_ucred, td); + /* fspacectl is not restarted after signals if the file is modified. */ + if (rmsr.r_len != rqsr->r_len && (error == ERESTART || + error == EINTR || error == EWOULDBLOCK)) + error = 0; + if (rmsrp != NULL) + *rmsrp = rmsr; +out: + fdrop(fp, td); + return (error); +} + int kern_specialfd(struct thread *td, int type, void *arg) { diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index af787908451a..11247aed8fd6 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -3250,6 +3250,15 @@ _Inout_ struct aiocb *aiocbp ); } +580 AUE_FSPACECTL STD { + int fspacectl( + int fd, + int cmd, + _In_ const struct spacectl_range *rqsr, + int flags, + _Out_opt_ struct spacectl_range *rmsr, + ); + } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 63bca7810847..c42d5a795935 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -93,6 +93,7 @@ static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); static int vop_stdread_pgcache(struct vop_read_pgcache_args *ap); static int vop_stdstat(struct vop_stat_args *ap); static int vop_stdvput_pair(struct vop_vput_pair_args *ap); +static int vop_stddeallocate(struct vop_deallocate_args *ap); /* * This vnode table stores what we want to do if the filesystem doesn't @@ -117,6 +118,7 @@ struct vop_vector default_vnodeops = { .vop_advlockasync = vop_stdadvlockasync, .vop_advlockpurge = vop_stdadvlockpurge, .vop_allocate = vop_stdallocate, + .vop_deallocate = vop_stddeallocate, .vop_bmap = vop_stdbmap, .vop_close = VOP_NULL, .vop_fsync = VOP_NULL, @@ -518,6 +520,7 @@ vop_stdpathconf(ap) case _PC_ACL_EXTENDED: case _PC_ACL_NFS4: case _PC_CAP_PRESENT: + case _PC_DEALLOC_PRESENT: case _PC_INF_PRESENT: case _PC_MAC_PRESENT: *ap->a_retval = 0; @@ -1069,6 +1072,125 @@ vop_stdallocate(struct vop_allocate_args *ap) return (error); } +static int +vp_zerofill(struct vnode *vp, struct vattr *vap, off_t *offsetp, off_t *lenp, + struct ucred *cred) +{ + int iosize; + int error = 0; + struct iovec aiov; + struct uio auio; + struct thread *td; + off_t offset, len; + + iosize = vap->va_blocksize; + td = curthread; + offset = *offsetp; + len = *lenp; + + if (iosize == 0) + iosize = BLKDEV_IOSIZE; + /* If va_blocksize is 512 bytes, iosize will be 4 kilobytes */ + iosize = min(iosize * 8, ZERO_REGION_SIZE); + + while (len > 0) { + int xfersize = iosize; + if (offset % iosize != 0) + xfersize -= offset % iosize; + if (xfersize > len) + xfersize = len; + + aiov.iov_base = __DECONST(void *, zero_region); + aiov.iov_len = xfersize; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = offset; + auio.uio_resid = xfersize; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_rw = UIO_WRITE; + auio.uio_td = td; + + error = VOP_WRITE(vp, &auio, 0, cred); + if (error != 0) { + len -= xfersize - auio.uio_resid; + offset += xfersize - auio.uio_resid; + break; + } + + len -= xfersize; + offset += xfersize; + } + + *offsetp = offset; + *lenp = len; + return (error); +} + +static int +vop_stddeallocate(struct vop_deallocate_args *ap) +{ + struct vnode *vp; + off_t offset, len; + struct ucred *cred; + int error; + struct vattr va; + off_t noff, xfersize, rem; + + vp = ap->a_vp; + offset = *ap->a_offset; + len = *ap->a_len; + cred = ap->a_cred; + + error = VOP_GETATTR(vp, &va, cred); + if (error) + return (error); + + len = omin(OFF_MAX - offset, *ap->a_len); + while (len > 0) { + noff = offset; + error = vn_bmap_seekhole_locked(vp, FIOSEEKDATA, &noff, cred); + if (error) { + if (error != ENXIO) + /* XXX: Is it okay to fallback further? */ + goto out; + + /* + * No more data region to be filled + */ + len = 0; + error = 0; + break; + } + KASSERT(noff >= offset, ("FIOSEEKDATA going backward")); + if (noff != offset) { + xfersize = omin(noff - offset, len); + len -= xfersize; + offset += xfersize; + if (len == 0) + break; + } + error = vn_bmap_seekhole_locked(vp, FIOSEEKHOLE, &noff, cred); + if (error) + goto out; + + /* Fill zeroes */ + xfersize = rem = omin(noff - offset, len); + error = vp_zerofill(vp, &va, &offset, &rem, cred); + if (error) { + len -= xfersize - rem; + goto out; + } + + len -= xfersize; + if (should_yield()) + break; + } +out: + *ap->a_offset = offset; + *ap->a_len = len; + return (error); +} + int vop_stdadvise(struct vop_advise_args *ap) { diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index ccc468d71737..c54f55a99036 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -106,6 +106,7 @@ static fo_kqfilter_t vn_kqfilter; static fo_close_t vn_closefile; static fo_mmap_t vn_mmap; static fo_fallocate_t vn_fallocate; +static fo_fspacectl_t vn_fspacectl; struct fileops vnops = { .fo_read = vn_io_fault, @@ -123,6 +124,7 @@ struct fileops vnops = { .fo_fill_kinfo = vn_fill_kinfo, .fo_mmap = vn_mmap, .fo_fallocate = vn_fallocate, + .fo_fspacectl = vn_fspacectl, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; @@ -3439,6 +3441,114 @@ vn_fallocate(struct file *fp, off_t offset, off_t len, struct thread *td) return (error); } +static int +vn_deallocate_impl(struct vnode *vp, off_t *offset, off_t *length, int flags, + int ioflg, struct ucred *active_cred, struct ucred *file_cred) +{ + struct mount *mp; + void *rl_cookie; + off_t off, len; + int error; +#ifdef AUDIT + bool audited_vnode1 = false; +#endif + + rl_cookie = NULL; + error = 0; + mp = NULL; + off = *offset; + len = *length; + + if ((ioflg & (IO_NODELOCKED|IO_RANGELOCKED)) == 0) + rl_cookie = vn_rangelock_wlock(vp, off, off + len); + while (len > 0 && error == 0) { + /* + * Try to deallocate the longest range in one pass. + * In case a pass takes too long to be executed, it returns + * partial result. The residue will be proceeded in the next + * pass. + */ + + if ((ioflg & IO_NODELOCKED) == 0) { + bwillwrite(); + if ((error = vn_start_write(vp, &mp, + V_WAIT | PCATCH)) != 0) + goto out; + vn_lock(vp, vn_lktype_write(mp, vp) | LK_RETRY); + } +#ifdef AUDIT + if (!audited_vnode1) { + AUDIT_ARG_VNODE1(vp); + audited_vnode1 = true; + } +#endif + +#ifdef MAC + if ((ioflg & IO_NOMACCHECK) == 0) + error = mac_vnode_check_write(active_cred, file_cred, + vp); +#endif + if (error == 0) + error = VOP_DEALLOCATE(vp, &off, &len, flags, + active_cred); + + if ((ioflg & IO_NODELOCKED) == 0) { + VOP_UNLOCK(vp); + if (mp != NULL) { + vn_finished_write(mp); + mp = NULL; + } + } + } +out: + if (rl_cookie != NULL) + vn_rangelock_unlock(vp, rl_cookie); + *offset = off; + *length = len; + return (error); +} + +int +vn_deallocate(struct vnode *vp, off_t *offset, off_t *length, int flags, + int ioflg, struct ucred *active_cred, struct ucred *file_cred) +{ + if (*offset < 0 || *length <= 0 || *length > OFF_MAX - *offset || + flags != 0) + return (EINVAL); + if (vp->v_type != VREG) + return (ENODEV); + + return (vn_deallocate_impl(vp, offset, length, flags, ioflg, + active_cred, file_cred)); +} + *** 562 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Thu Aug 5 15:23:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 398B2665855; Thu, 5 Aug 2021 15:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgXST6x1dz3GcG; Thu, 5 Aug 2021 15:23:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B477B1C8C5; Thu, 5 Aug 2021 15:23:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175FNb1c086227; Thu, 5 Aug 2021 15:23:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175FNbvY086226; Thu, 5 Aug 2021 15:23:37 GMT (envelope-from git) Date: Thu, 5 Aug 2021 15:23:37 GMT Message-Id: <202108051523.175FNbvY086226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: da9fe3529b3d - main - Regen after 0dc332bff200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da9fe3529b3ddc7a4edcbfe323dfbd280ac40f09 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 15:23:38 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=da9fe3529b3ddc7a4edcbfe323dfbd280ac40f09 commit da9fe3529b3ddc7a4edcbfe323dfbd280ac40f09 Author: Ka Ho Ng AuthorDate: 2021-08-04 19:34:42 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-05 15:22:02 +0000 Regen after 0dc332bff200 --- sys/compat/freebsd32/freebsd32_proto.h | 9 ++++++ sys/compat/freebsd32/freebsd32_syscall.h | 3 +- sys/compat/freebsd32/freebsd32_syscalls.c | 1 + sys/compat/freebsd32/freebsd32_sysent.c | 1 + sys/compat/freebsd32/freebsd32_systrace_args.c | 38 ++++++++++++++++++++++++++ sys/kern/init_sysent.c | 1 + sys/kern/syscalls.c | 1 + sys/kern/systrace_args.c | 38 ++++++++++++++++++++++++++ sys/sys/syscall.h | 3 +- sys/sys/syscall.mk | 3 +- sys/sys/sysproto.h | 9 ++++++ 11 files changed, 104 insertions(+), 3 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h index d7d4d4fec5ff..3a59abc99dcf 100644 --- a/sys/compat/freebsd32/freebsd32_proto.h +++ b/sys/compat/freebsd32/freebsd32_proto.h @@ -751,6 +751,13 @@ struct freebsd32_aio_writev_args { struct freebsd32_aio_readv_args { char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; }; +struct freebsd32_fspacectl_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; + char rqsr_l_[PADL_(const struct spacectl_range32 *)]; const struct spacectl_range32 * rqsr; char rqsr_r_[PADR_(const struct spacectl_range32 *)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char rmsr_l_[PADL_(struct spacectl_range32 *)]; struct spacectl_range32 * rmsr; char rmsr_r_[PADR_(struct spacectl_range32 *)]; +}; #if !defined(PAD64_REQUIRED) && !defined(__amd64__) #define PAD64_REQUIRED #endif @@ -893,6 +900,7 @@ int freebsd32_cpuset_setdomain(struct thread *, struct freebsd32_cpuset_setdomai int freebsd32___sysctlbyname(struct thread *, struct freebsd32___sysctlbyname_args *); int freebsd32_aio_writev(struct thread *, struct freebsd32_aio_writev_args *); int freebsd32_aio_readv(struct thread *, struct freebsd32_aio_readv_args *); +int freebsd32_fspacectl(struct thread *, struct freebsd32_fspacectl_args *); #ifdef COMPAT_43 @@ -1486,6 +1494,7 @@ int freebsd11_freebsd32_fstatat(struct thread *, struct freebsd11_freebsd32_fsta #define FREEBSD32_SYS_AUE_freebsd32___sysctlbyname AUE_SYSCTL #define FREEBSD32_SYS_AUE_freebsd32_aio_writev AUE_AIO_WRITEV #define FREEBSD32_SYS_AUE_freebsd32_aio_readv AUE_AIO_READV +#define FREEBSD32_SYS_AUE_freebsd32_fspacectl AUE_FSPACECTL #undef PAD_ #undef PADL_ diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h index c6ca12448ad2..7898b3a25c2e 100644 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -508,4 +508,5 @@ #define FREEBSD32_SYS___specialfd 577 #define FREEBSD32_SYS_freebsd32_aio_writev 578 #define FREEBSD32_SYS_freebsd32_aio_readv 579 -#define FREEBSD32_SYS_MAXSYSCALL 580 +#define FREEBSD32_SYS_freebsd32_fspacectl 580 +#define FREEBSD32_SYS_MAXSYSCALL 581 diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c index 4a79f2efdaa4..51b7dbc249d0 100644 --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -616,4 +616,5 @@ const char *freebsd32_syscallnames[] = { "__specialfd", /* 577 = __specialfd */ "freebsd32_aio_writev", /* 578 = freebsd32_aio_writev */ "freebsd32_aio_readv", /* 579 = freebsd32_aio_readv */ + "freebsd32_fspacectl", /* 580 = freebsd32_fspacectl */ }; diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index 98b43274e9d8..6e1ae033b765 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -669,4 +669,5 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(__specialfd_args), .sy_call = (sy_call_t *)sys___specialfd, .sy_auevent = AUE_SPECIALFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 577 = __specialfd */ { .sy_narg = AS(freebsd32_aio_writev_args), .sy_call = (sy_call_t *)freebsd32_aio_writev, .sy_auevent = AUE_AIO_WRITEV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 578 = freebsd32_aio_writev */ { .sy_narg = AS(freebsd32_aio_readv_args), .sy_call = (sy_call_t *)freebsd32_aio_readv, .sy_auevent = AUE_AIO_READV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 579 = freebsd32_aio_readv */ + { .sy_narg = AS(freebsd32_fspacectl_args), .sy_call = (sy_call_t *)freebsd32_fspacectl, .sy_auevent = AUE_FSPACECTL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 580 = freebsd32_fspacectl */ }; diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index 818a34e0cdad..7c970c358296 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -3407,6 +3407,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 1; break; } + /* freebsd32_fspacectl */ + case 580: { + struct freebsd32_fspacectl_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->cmd; /* int */ + uarg[2] = (intptr_t)p->rqsr; /* const struct spacectl_range32 * */ + iarg[3] = p->flags; /* int */ + uarg[4] = (intptr_t)p->rmsr; /* struct spacectl_range32 * */ + *n_args = 5; + break; + } default: *n_args = 0; break; @@ -9183,6 +9194,28 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* freebsd32_fspacectl */ + case 580: + switch (ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "userland const struct spacectl_range32 *"; + break; + case 3: + p = "int"; + break; + case 4: + p = "userland struct spacectl_range32 *"; + break; + default: + break; + }; + break; default: break; }; @@ -11102,6 +11135,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* freebsd32_fspacectl */ + case 580: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index bc5beb83cf3f..414b998420aa 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -635,4 +635,5 @@ struct sysent sysent[] = { { .sy_narg = AS(__specialfd_args), .sy_call = (sy_call_t *)sys___specialfd, .sy_auevent = AUE_SPECIALFD, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 577 = __specialfd */ { .sy_narg = AS(aio_writev_args), .sy_call = (sy_call_t *)sys_aio_writev, .sy_auevent = AUE_AIO_WRITEV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 578 = aio_writev */ { .sy_narg = AS(aio_readv_args), .sy_call = (sy_call_t *)sys_aio_readv, .sy_auevent = AUE_AIO_READV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 579 = aio_readv */ + { .sy_narg = AS(fspacectl_args), .sy_call = (sy_call_t *)sys_fspacectl, .sy_auevent = AUE_FSPACECTL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 580 = fspacectl */ }; diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index 190c82dd4e5e..4d5423a28bb8 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -586,4 +586,5 @@ const char *syscallnames[] = { "__specialfd", /* 577 = __specialfd */ "aio_writev", /* 578 = aio_writev */ "aio_readv", /* 579 = aio_readv */ + "fspacectl", /* 580 = fspacectl */ }; diff --git a/sys/kern/systrace_args.c b/sys/kern/systrace_args.c index 8f8274b1cdac..d924e49be355 100644 --- a/sys/kern/systrace_args.c +++ b/sys/kern/systrace_args.c @@ -3399,6 +3399,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 1; break; } + /* fspacectl */ + case 580: { + struct fspacectl_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->cmd; /* int */ + uarg[2] = (intptr_t)p->rqsr; /* const struct spacectl_range * */ + iarg[3] = p->flags; /* int */ + uarg[4] = (intptr_t)p->rmsr; /* struct spacectl_range * */ + *n_args = 5; + break; + } default: *n_args = 0; break; @@ -9088,6 +9099,28 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* fspacectl */ + case 580: + switch (ndx) { + case 0: + p = "int"; + break; + case 1: + p = "int"; + break; + case 2: + p = "userland const struct spacectl_range *"; + break; + case 3: + p = "int"; + break; + case 4: + p = "userland struct spacectl_range *"; + break; + default: + break; + }; + break; default: break; }; @@ -11034,6 +11067,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* fspacectl */ + case 580: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h index 950055c9559e..34c836f22ccc 100644 --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -517,4 +517,5 @@ #define SYS___specialfd 577 #define SYS_aio_writev 578 #define SYS_aio_readv 579 -#define SYS_MAXSYSCALL 580 +#define SYS_fspacectl 580 +#define SYS_MAXSYSCALL 581 diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk index e007d2c81e61..52cc8c9a7563 100644 --- a/sys/sys/syscall.mk +++ b/sys/sys/syscall.mk @@ -422,4 +422,5 @@ MIASM = \ rpctls_syscall.o \ __specialfd.o \ aio_writev.o \ - aio_readv.o + aio_readv.o \ + fspacectl.o diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h index f17b1951f559..cec3c1925e5d 100644 --- a/sys/sys/sysproto.h +++ b/sys/sys/sysproto.h @@ -1847,6 +1847,13 @@ struct aio_writev_args { struct aio_readv_args { char aiocbp_l_[PADL_(struct aiocb *)]; struct aiocb * aiocbp; char aiocbp_r_[PADR_(struct aiocb *)]; }; +struct fspacectl_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)]; + char rqsr_l_[PADL_(const struct spacectl_range *)]; const struct spacectl_range * rqsr; char rqsr_r_[PADR_(const struct spacectl_range *)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char rmsr_l_[PADL_(struct spacectl_range *)]; struct spacectl_range * rmsr; char rmsr_r_[PADR_(struct spacectl_range *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2241,6 +2248,7 @@ int sys_rpctls_syscall(struct thread *, struct rpctls_syscall_args *); int sys___specialfd(struct thread *, struct __specialfd_args *); int sys_aio_writev(struct thread *, struct aio_writev_args *); int sys_aio_readv(struct thread *, struct aio_readv_args *); +int sys_fspacectl(struct thread *, struct fspacectl_args *); #ifdef COMPAT_43 @@ -3185,6 +3193,7 @@ int freebsd12_closefrom(struct thread *, struct freebsd12_closefrom_args *); #define SYS_AUE___specialfd AUE_SPECIALFD #define SYS_AUE_aio_writev AUE_AIO_WRITEV #define SYS_AUE_aio_readv AUE_AIO_READV +#define SYS_AUE_fspacectl AUE_FSPACECTL #undef PAD_ #undef PADL_ From owner-dev-commits-src-main@freebsd.org Thu Aug 5 15:23:39 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7613366570F; Thu, 5 Aug 2021 15:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgXSW1wC2z3GhW; Thu, 5 Aug 2021 15:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5B681CA9A; Thu, 5 Aug 2021 15:23:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175FNcju086251; Thu, 5 Aug 2021 15:23:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175FNcUo086250; Thu, 5 Aug 2021 15:23:38 GMT (envelope-from git) Date: Thu, 5 Aug 2021 15:23:38 GMT Message-Id: <202108051523.175FNcUo086250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 245ec7651e42 - main - param.h: Bump __FreeBSD_version to 1400029 for commit 0dc332bff200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 245ec7651e4221043d1032fb3f82f335dc65fc7f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 15:23:39 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=245ec7651e4221043d1032fb3f82f335dc65fc7f commit 245ec7651e4221043d1032fb3f82f335dc65fc7f Author: Ka Ho Ng AuthorDate: 2021-08-04 18:35:57 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-05 15:22:07 +0000 param.h: Bump __FreeBSD_version to 1400029 for commit 0dc332bff200 Commit 0dc332bff200 changes fileops layout and adds VOP_DEALLOCATE VOP call. LinuxKPI kmods and file system modules need to be rebuilt at least. Sponsored by: The FreeBSD Foundation --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index de7607e6f90d..f842b344e9f9 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400028 +#define __FreeBSD_version 1400029 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-main@freebsd.org Thu Aug 5 15:50:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6242B665A26; Thu, 5 Aug 2021 15:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgY341qmcz3JHP; Thu, 5 Aug 2021 15:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26F721D093; Thu, 5 Aug 2021 15:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175Fo8eL018084; Thu, 5 Aug 2021 15:50:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175Fo8qv018081; Thu, 5 Aug 2021 15:50:08 GMT (envelope-from git) Date: Thu, 5 Aug 2021 15:50:08 GMT Message-Id: <202108051550.175Fo8qv018081@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d0bc4b466683 - main - x86_msr_op: extend the KPI to allow MSR read and single-CPU operations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0bc4b466683d17b84f9acafe4c3cc746f860dbf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 15:50:08 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d0bc4b466683d17b84f9acafe4c3cc746f860dbf commit d0bc4b466683d17b84f9acafe4c3cc746f860dbf Author: Konstantin Belousov AuthorDate: 2021-08-02 19:52:26 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-05 15:46:37 +0000 x86_msr_op: extend the KPI to allow MSR read and single-CPU operations Reivewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31386 --- sys/dev/hwpmc/hwpmc_core.c | 8 +++--- sys/x86/include/x86_var.h | 18 ++++++++++--- sys/x86/x86/cpu_machdep.c | 65 +++++++++++++++++++++++++++++++++++----------- 3 files changed, 69 insertions(+), 22 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c index b0773227fac7..afd587296e01 100644 --- a/sys/dev/hwpmc/hwpmc_core.c +++ b/sys/dev/hwpmc/hwpmc_core.c @@ -261,8 +261,8 @@ iaf_allocate_pmc(int cpu, int ri, struct pmc *pm, if ((cpu_stdext_feature3 & CPUID_STDEXT3_TSXFA) != 0 && !pmc_tsx_force_abort_set) { pmc_tsx_force_abort_set = true; - x86_msr_op(MSR_TSX_FORCE_ABORT, MSR_OP_RENDEZVOUS | - MSR_OP_WRITE, 1); + x86_msr_op(MSR_TSX_FORCE_ABORT, MSR_OP_RENDEZVOUS_ALL | + MSR_OP_WRITE, 1, NULL); } flags = 0; @@ -403,8 +403,8 @@ iaf_release_pmc(int cpu, int ri, struct pmc *pmc) MPASS(pmc_alloc_refs > 0); if (pmc_alloc_refs-- == 1 && pmc_tsx_force_abort_set) { pmc_tsx_force_abort_set = false; - x86_msr_op(MSR_TSX_FORCE_ABORT, MSR_OP_RENDEZVOUS | - MSR_OP_WRITE, 0); + x86_msr_op(MSR_TSX_FORCE_ABORT, MSR_OP_RENDEZVOUS_ALL | + MSR_OP_WRITE, 0, NULL); } return (0); diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index 983c353327fd..0fdff68638cf 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -154,12 +154,24 @@ int user_dbreg_trap(register_t dr6); int minidumpsys(struct dumperinfo *); struct pcb *get_pcb_td(struct thread *td); +/* + * MSR ops for x86_msr_op() + */ #define MSR_OP_ANDNOT 0x00000001 #define MSR_OP_OR 0x00000002 #define MSR_OP_WRITE 0x00000003 +#define MSR_OP_READ 0x00000004 + +/* + * Where and which execution mode + */ #define MSR_OP_LOCAL 0x10000000 -#define MSR_OP_SCHED 0x20000000 -#define MSR_OP_RENDEZVOUS 0x30000000 -void x86_msr_op(u_int msr, u_int op, uint64_t arg1); +#define MSR_OP_SCHED_ALL 0x20000000 +#define MSR_OP_SCHED_ONE 0x30000000 +#define MSR_OP_RENDEZVOUS_ALL 0x40000000 +#define MSR_OP_RENDEZVOUS_ONE 0x50000000 +#define MSR_OP_CPUID(id) ((id) << 8) + +void x86_msr_op(u_int msr, u_int op, uint64_t arg1, uint64_t *res); #endif diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c index eb94285ad606..bfc1a697cde0 100644 --- a/sys/x86/x86/cpu_machdep.c +++ b/sys/x86/x86/cpu_machdep.c @@ -119,6 +119,7 @@ struct msr_op_arg { u_int msr; int op; uint64_t arg1; + uint64_t *res; }; static void @@ -142,33 +143,41 @@ x86_msr_op_one(void *argp) case MSR_OP_WRITE: wrmsr(a->msr, a->arg1); break; + case MSR_OP_READ: + v = rdmsr(a->msr); + *a->res = v; + break; } } #define MSR_OP_EXMODE_MASK 0xf0000000 #define MSR_OP_OP_MASK 0x000000ff +#define MSR_OP_GET_CPUID(x) (((x) & ~MSR_OP_EXMODE_MASK) >> 8) void -x86_msr_op(u_int msr, u_int op, uint64_t arg1) +x86_msr_op(u_int msr, u_int op, uint64_t arg1, uint64_t *res) { struct thread *td; struct msr_op_arg a; + cpuset_t set; u_int exmode; - int bound_cpu, i, is_bound; + int bound_cpu, cpu, i, is_bound; a.op = op & MSR_OP_OP_MASK; MPASS(a.op == MSR_OP_ANDNOT || a.op == MSR_OP_OR || - a.op == MSR_OP_WRITE); + a.op == MSR_OP_WRITE || a.op == MSR_OP_READ); exmode = op & MSR_OP_EXMODE_MASK; - MPASS(exmode == MSR_OP_LOCAL || exmode == MSR_OP_SCHED || - exmode == MSR_OP_RENDEZVOUS); + MPASS(exmode == MSR_OP_LOCAL || exmode == MSR_OP_SCHED_ALL || + exmode == MSR_OP_SCHED_ONE || exmode == MSR_OP_RENDEZVOUS_ALL || + exmode == MSR_OP_RENDEZVOUS_ONE); a.msr = msr; a.arg1 = arg1; + a.res = res; switch (exmode) { case MSR_OP_LOCAL: x86_msr_op_one(&a); break; - case MSR_OP_SCHED: + case MSR_OP_SCHED_ALL: td = curthread; thread_lock(td); is_bound = sched_is_bound(td); @@ -183,8 +192,32 @@ x86_msr_op(u_int msr, u_int op, uint64_t arg1) sched_unbind(td); thread_unlock(td); break; - case MSR_OP_RENDEZVOUS: - smp_rendezvous(NULL, x86_msr_op_one, NULL, &a); + case MSR_OP_SCHED_ONE: + td = curthread; + cpu = MSR_OP_GET_CPUID(op); + thread_lock(td); + is_bound = sched_is_bound(td); + bound_cpu = td->td_oncpu; + if (!is_bound || bound_cpu != cpu) + sched_bind(td, cpu); + x86_msr_op_one(&a); + if (is_bound) { + if (bound_cpu != cpu) + sched_bind(td, bound_cpu); + } else { + sched_unbind(td); + } + thread_unlock(td); + break; + case MSR_OP_RENDEZVOUS_ALL: + smp_rendezvous(smp_no_rendezvous_barrier, x86_msr_op_one, + smp_no_rendezvous_barrier, &a); + break; + case MSR_OP_RENDEZVOUS_ONE: + cpu = MSR_OP_GET_CPUID(op); + CPU_SETOF(cpu, &set); + smp_rendezvous_cpus(set, smp_no_rendezvous_barrier, + x86_msr_op_one, smp_no_rendezvous_barrier, &a); break; } } @@ -872,9 +905,9 @@ hw_ibrs_recalculate(bool for_all_cpus) { if ((cpu_ia32_arch_caps & IA32_ARCH_CAP_IBRS_ALL) != 0) { x86_msr_op(MSR_IA32_SPEC_CTRL, (for_all_cpus ? - MSR_OP_RENDEZVOUS : MSR_OP_LOCAL) | + MSR_OP_RENDEZVOUS_ALL : MSR_OP_LOCAL) | (hw_ibrs_disable != 0 ? MSR_OP_ANDNOT : MSR_OP_OR), - IA32_SPEC_CTRL_IBRS); + IA32_SPEC_CTRL_IBRS, NULL); hw_ibrs_active = hw_ibrs_disable == 0; hw_ibrs_ibpb_active = 0; } else { @@ -930,7 +963,8 @@ hw_ssb_set(bool enable, bool for_all_cpus) hw_ssb_active = enable; x86_msr_op(MSR_IA32_SPEC_CTRL, (enable ? MSR_OP_OR : MSR_OP_ANDNOT) | - (for_all_cpus ? MSR_OP_SCHED : MSR_OP_LOCAL), IA32_SPEC_CTRL_SSBD); + (for_all_cpus ? MSR_OP_SCHED_ALL : MSR_OP_LOCAL), + IA32_SPEC_CTRL_SSBD, NULL); } void @@ -1221,8 +1255,9 @@ taa_set(bool enable, bool all) x86_msr_op(MSR_IA32_TSX_CTRL, (enable ? MSR_OP_OR : MSR_OP_ANDNOT) | - (all ? MSR_OP_RENDEZVOUS : MSR_OP_LOCAL), - IA32_TSX_CTRL_RTM_DISABLE | IA32_TSX_CTRL_TSX_CPUID_CLEAR); + (all ? MSR_OP_RENDEZVOUS_ALL : MSR_OP_LOCAL), + IA32_TSX_CTRL_RTM_DISABLE | IA32_TSX_CTRL_TSX_CPUID_CLEAR, + NULL); } void @@ -1386,8 +1421,8 @@ x86_rngds_mitg_recalculate(bool all_cpus) return; x86_msr_op(MSR_IA32_MCU_OPT_CTRL, (x86_rngds_mitg_enable ? MSR_OP_OR : MSR_OP_ANDNOT) | - (all_cpus ? MSR_OP_RENDEZVOUS : MSR_OP_LOCAL), - IA32_RNGDS_MITG_DIS); + (all_cpus ? MSR_OP_RENDEZVOUS_ALL : MSR_OP_LOCAL), + IA32_RNGDS_MITG_DIS, NULL); } static int From owner-dev-commits-src-main@freebsd.org Thu Aug 5 15:50:09 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A96666600C; Thu, 5 Aug 2021 15:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgY352QNWz3JFB; Thu, 5 Aug 2021 15:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BCBE1CCEC; Thu, 5 Aug 2021 15:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175Fo9U5018300; Thu, 5 Aug 2021 15:50:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175Fo9GA018298; Thu, 5 Aug 2021 15:50:09 GMT (envelope-from git) Date: Thu, 5 Aug 2021 15:50:09 GMT Message-Id: <202108051550.175Fo9GA018298@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4cc6fe1e5b73 - main - coretemp: use x86_msr_op for thermal MSR access MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4cc6fe1e5b73ce540882753d918bc8208849e9e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 15:50:09 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4cc6fe1e5b73ce540882753d918bc8208849e9e9 commit 4cc6fe1e5b73ce540882753d918bc8208849e9e9 Author: Konstantin Belousov AuthorDate: 2021-08-02 19:53:08 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-05 15:47:07 +0000 coretemp: use x86_msr_op for thermal MSR access Reviewed by: markj Discussed with: mav Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31386 --- sys/dev/coretemp/coretemp.c | 57 +++++++++++++-------------------------------- 1 file changed, 16 insertions(+), 41 deletions(-) diff --git a/sys/dev/coretemp/coretemp.c b/sys/dev/coretemp/coretemp.c index 53a2434254f6..bdc71b284ac7 100644 --- a/sys/dev/coretemp/coretemp.c +++ b/sys/dev/coretemp/coretemp.c @@ -315,56 +315,31 @@ struct coretemp_args { uint64_t val; }; -static void -coretemp_rdmsr(void *arg) -{ - struct coretemp_args *args = arg; - - args->val = rdmsr(args->msr); -} - -static void -coretemp_wrmsr(void *arg) -{ - struct coretemp_args *args = arg; - - wrmsr(args->msr, args->val); -} - +/* + * The digital temperature reading is located at bit 16 + * of MSR_THERM_STATUS. + * + * There is a bit on that MSR that indicates whether the + * temperature is valid or not. + * + * The temperature is computed by subtracting the temperature + * reading by Tj(max). + */ static uint64_t coretemp_get_thermal_msr(int cpu) { - struct coretemp_args args; - cpuset_t cpus; + uint64_t res; - /* - * The digital temperature reading is located at bit 16 - * of MSR_THERM_STATUS. - * - * There is a bit on that MSR that indicates whether the - * temperature is valid or not. - * - * The temperature is computed by subtracting the temperature - * reading by Tj(max). - */ - args.msr = MSR_THERM_STATUS; - CPU_SETOF(cpu, &cpus); - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, coretemp_rdmsr, - smp_no_rendezvous_barrier, &args); - return (args.val); + x86_msr_op(MSR_THERM_STATUS, MSR_OP_RENDEZVOUS_ONE | MSR_OP_READ | + MSR_OP_CPUID(cpu), 0, &res); + return (res); } static void coretemp_clear_thermal_msr(int cpu) { - struct coretemp_args args; - cpuset_t cpus; - - args.msr = MSR_THERM_STATUS; - args.val = 0; - CPU_SETOF(cpu, &cpus); - smp_rendezvous_cpus(cpus, smp_no_rendezvous_barrier, coretemp_wrmsr, - smp_no_rendezvous_barrier, &args); + x86_msr_op(MSR_THERM_STATUS, MSR_OP_RENDEZVOUS_ONE | MSR_OP_WRITE | + MSR_OP_CPUID(cpu), 0, NULL); } static int From owner-dev-commits-src-main@freebsd.org Thu Aug 5 16:00:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7201B665FE3; Thu, 5 Aug 2021 16:00:17 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (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 4GgYGn2cwVz3KvS; Thu, 5 Aug 2021 16:00:17 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f174.google.com with SMTP id k3so5632553ilu.2; Thu, 05 Aug 2021 09:00:17 -0700 (PDT) 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=lRuXnnximghH+2nht3beOfR/L1VEF+U6w+vRGnIzBqM=; b=qahyFhqqncGcgFpxwmICg8p4vFnaV/VG+2G1cTCX+rm0d2mVP4O00rs4bJwu/r21eY A9wqxb3jwOgn80V7K8/28Ul8hDU3c8zUpAsEnjZ9o9GnShJsX9wWRYdBJPIfqhztxh2S zUd65nSl9lRcG1mVcnDhs8H9WhQENXWblO7J97bLuyKEA526p2AxbBp9lKbGCLoNS588 9K9M222D5lepoGfximnYBMjmyFbvEIV6Yk20U40kYq35gBt1VeeX193V+BnLELnfyioh 8jmCmrXfavhJ9xgtoxmBubZSUmcb4c4Uvjaw2WzUKTzoxCjr4xSD2PJRmnG1lZQcLHdI yZkA== X-Gm-Message-State: AOAM530/5bIezyCfrJThFhttH6utFf3RTUtafBfNg5ds83jHV4Io6e+s ugf+CAudjbaVU2Zo/+cXWM3TNx6Muz+qV3CuezcX2ek0S9Q= X-Google-Smtp-Source: ABdhPJxh7tkoc4fG4mgM6mop4RlHTHCgYJRPegiaNdEEszZG5Q6Y2qDs3vnjLK8x9YMISiruiQ1k/Pu0IY+IloYs7Fs= X-Received: by 2002:a92:cacd:: with SMTP id m13mr370800ilq.256.1628179210959; Thu, 05 Aug 2021 09:00:10 -0700 (PDT) MIME-Version: 1.0 References: <202108051422.175EMBpP006556@gitrepo.freebsd.org> In-Reply-To: <202108051422.175EMBpP006556@gitrepo.freebsd.org> From: Ed Maste Date: Thu, 5 Aug 2021 11:59:53 -0400 Message-ID: Subject: Re: git: 98215005b747 - main - ktls: start a thread to keep the 16k ktls buffer zone populated To: Andrew Gallatin Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4GgYGn2cwVz3KvS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 16:00:17 -0000 On Thu, 5 Aug 2021 at 10:22, Andrew Gallatin wrote: > > The branch main has been updated by gallatin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=98215005b747fef67f44794ca64abd473b98bade > > commit 98215005b747fef67f44794ca64abd473b98bade > Author: Andrew Gallatin > AuthorDate: 2021-08-05 14:15:09 +0000 > Commit: Andrew Gallatin > CommitDate: 2021-08-05 14:19:12 +0000 > > ktls: start a thread to keep the 16k ktls buffer zone populated My Cirrus-CI boot smoke test is now failing with: Starting KTLS alloc thread for domain 0 panic: sleeping without a lock cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0000b20ae0 vpanic() at vpanic+0x187/frame 0xfffffe0000b20b40 panic() at panic+0x43/frame 0xfffffe0000b20ba0 _sleep() at _sleep+0x484/frame 0xfffffe0000b20c40 ktls_alloc_thread() at ktls_alloc_thread+0x1c4/frame 0xfffffe0000b20cf0 fork_exit() at fork_exit+0x80/frame 0xfffffe0000b20d30 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000b20d30 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- KDB: enter: panic [ thread pid 2 tid 100027 ] Stopped at kdb_enter+0x37: movq $0,0x127877e(%rip) db> qemu-system-x86_64: terminating on signal 15 from pid 32579 (timeout) Did not boot successfully, see /tmp/ci-qemu-test-boot.log From owner-dev-commits-src-main@freebsd.org Thu Aug 5 16:52:21 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 801EF6669BA; Thu, 5 Aug 2021 16:52:21 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgZQs2rjLz3NqF; Thu, 5 Aug 2021 16:52:21 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.1.2] (pool-74-110-137-7.rcmdva.fios.verizon.net [74.110.137.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 4DFF12700137; Thu, 5 Aug 2021 12:52:15 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 4DFF12700137 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1628182335; bh=Ksg4Hdvv9K4OMkSjrReb686FZ2ippIK4LIHBjpjwwEY=; h=Subject:To:From:Date:From; b=EwGDRwIyvH2Awm1edHGwfrmkQBQSLTLd0CgC1lJxx1Z5VILWLjWnalXNpAR5wEsou 1I7l9YHrmaU3qsFyoGyOJ+sVTuSvoVTOJu0k323GmmhO9Xw5s+LY3+mTzYC4BGorCp rjFStkt8/UxfyhLlccodzzA04pX1eV37rTKeeLfcadSlgnwKXwPJqDuQWSQdZesD8I ShjLezPl0spJNNWrQzfatDYcXH01NJY3QylBnV+3Dc7QsDkmuHYmlC35KtPoLsFvyv LoQizmUJMmUH1QaIHJKe9I8lhWvahhHnn3G79a9LgVvK6N3UaE61AsJywHSHNGU7pC 3YmtD1Zn6zI1A== Subject: Re: git: 98215005b747 - main - ktls: start a thread to keep the 16k ktls buffer zone populated To: Ed Maste , Andrew Gallatin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202108051422.175EMBpP006556@gitrepo.freebsd.org> From: Andrew Gallatin Message-ID: Date: Thu, 5 Aug 2021 12:52:14 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4GgZQs2rjLz3NqF X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 16:52:21 -0000 On 8/5/21 11:59 AM, Ed Maste wrote: > On Thu, 5 Aug 2021 at 10:22, Andrew Gallatin wrote: >> >> The branch main has been updated by gallatin: >> >> URL: https://urldefense.com/v3/__https://cgit.FreeBSD.org/src/commit/?id=98215005b747fef67f44794ca64abd473b98bade__;!!OToaGQ!6H22s_lcYmkhuynvYHpkyGHe143j9dOq8CYazaDqtTi9kyapeu9DMyf0Tvo0tDDCVw$ >> >> commit 98215005b747fef67f44794ca64abd473b98bade >> Author: Andrew Gallatin >> AuthorDate: 2021-08-05 14:15:09 +0000 >> Commit: Andrew Gallatin >> CommitDate: 2021-08-05 14:19:12 +0000 >> >> ktls: start a thread to keep the 16k ktls buffer zone populated > > My Cirrus-CI boot smoke test is now failing with: > > Starting KTLS alloc thread for domain 0 > panic: sleeping without a lock > cpuid = 0 > time = 1 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0000b20ae0 > vpanic() at vpanic+0x187/frame 0xfffffe0000b20b40 > panic() at panic+0x43/frame 0xfffffe0000b20ba0 > _sleep() at _sleep+0x484/frame 0xfffffe0000b20c40 > ktls_alloc_thread() at ktls_alloc_thread+0x1c4/frame 0xfffffe0000b20cf0 > fork_exit() at fork_exit+0x80/frame 0xfffffe0000b20d30 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000b20d30 > --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > KDB: enter: panic > [ thread pid 2 tid 100027 ] > Stopped at kdb_enter+0x37: movq $0,0x127877e(%rip) > db> qemu-system-x86_64: terminating on signal 15 from pid 32579 (timeout) > Did not boot successfully, see /tmp/ci-qemu-test-boot.log > I'd thought that I'd tested this with INVARIANTS, but I guess I was wrong. The assert is failing because I'm sleeping forever (sbt == 0). I don't understand the point of the assert, but I've reproduced the panic and am testing a workaround. Drew From owner-dev-commits-src-main@freebsd.org Thu Aug 5 17:10:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C86066740D; Thu, 5 Aug 2021 17:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgZqj3bwkz3Pny; Thu, 5 Aug 2021 17:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D4FE1E18E; Thu, 5 Aug 2021 17:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175HAPLI031062; Thu, 5 Aug 2021 17:10:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175HAP1D031061; Thu, 5 Aug 2021 17:10:25 GMT (envelope-from git) Date: Thu, 5 Aug 2021 17:10:25 GMT Message-Id: <202108051710.175HAP1D031061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 2694c869ff9f - main - ktls: fix a panic with INVARIANTS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2694c869ff9ff60fd8e3d4d7936b7dc61763c18a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 17:10:25 -0000 The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=2694c869ff9ff60fd8e3d4d7936b7dc61763c18a commit 2694c869ff9ff60fd8e3d4d7936b7dc61763c18a Author: Andrew Gallatin AuthorDate: 2021-08-05 17:05:00 +0000 Commit: Andrew Gallatin CommitDate: 2021-08-05 17:09:06 +0000 ktls: fix a panic with INVARIANTS 98215005b747fef67f44794ca64abd473b98bade introduced a new thread that uses tsleep(..0) to sleep forever. This hit an assert due to sleeping with a 0 timeout. So spell "forever" using SBT_MAX instead, which does not trigger the assert. Pointy hat to: gallatin Pointed out by: emaste Sponsored by: Netflix --- sys/kern/uipc_ktls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 17b87195fc50..47815c266667 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -2240,7 +2240,7 @@ ktls_alloc_thread(void *ctx) nbufs = 0; for (;;) { atomic_store_int(&sc->running, 0); - tsleep(sc, PZERO, "waiting for work", 0); + tsleep_sbt(sc, PZERO, "waiting for work", SBT_MAX, SBT_1S, 0); atomic_store_int(&sc->running, 1); sc->wakeups++; if (nbufs != ktls_max_alloc) { From owner-dev-commits-src-main@freebsd.org Thu Aug 5 17:33:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A073F667AD9; Thu, 5 Aug 2021 17:33:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 4GgbLT3mPRz3Qsq; Thu, 5 Aug 2021 17:33:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f41.google.com with SMTP id z7so7699871iog.13; Thu, 05 Aug 2021 10:33:37 -0700 (PDT) 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=Za93dnmiNmSJp0S3SSxmyUWTgEw9qCT6Q2GwrpsQOmA=; b=CUftiGI6vY231NEUXWaw7SCP55Bo5GJu7OyADMlKbxG9Zj57A4PUiY228MNlzPPPoJ SHf3eZCuKHzChHIVcvoCMp+7cDt6MQbKnSpQMZRb1i6EXkyBVPYw7f0ePRcRNqNefKsO pYiz67lXaiQJs8/+6fBqkxDbOpvy8wIOrVxU9j/ehrWAHEJFZzH19h2mLv7f6xsawLO+ J9TUMjiSO2MeJlVaLnjluu9HREnzbw9esE8U8bZaMJCNSs8nokAGiZrPyHvix9G2sw7D 7YQC3YC5ygkGTdxXtEoCSTDYP72G5uKYvDwtE1nIw4zH9g0oZWr19liIVGRCX+Fdgu/1 +mhg== X-Gm-Message-State: AOAM533rJtk4M4DNCWOP8UiXjNIOIvrVPQvvCQiPhu3HWyeN4h/8tkcW QDL0PVnSbUNKk5seZoPJYik20tT9Kkl3HK/FtCeqK4em X-Google-Smtp-Source: ABdhPJwtZD7Ozxt3847b4GWBsTy4tRdALlbLYC3VhjYHHVxfvy1XVeD/FE+Nj7vRR+ldTP2sYc/A6Sq8ONe7tuIb5js= X-Received: by 2002:a5d:9655:: with SMTP id d21mr312398ios.111.1628184810303; Thu, 05 Aug 2021 10:33:30 -0700 (PDT) MIME-Version: 1.0 References: <202108051710.175HAP1D031061@gitrepo.freebsd.org> In-Reply-To: <202108051710.175HAP1D031061@gitrepo.freebsd.org> From: Ed Maste Date: Thu, 5 Aug 2021 13:33:12 -0400 Message-ID: Subject: Re: git: 2694c869ff9f - main - ktls: fix a panic with INVARIANTS To: Andrew Gallatin Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4GgbLT3mPRz3Qsq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 17:33:37 -0000 On Thu, 5 Aug 2021 at 13:10, Andrew Gallatin wrote: > > The branch main has been updated by gallatin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2694c869ff9ff60fd8e3d4d7936b7dc61763c18a > > commit 2694c869ff9ff60fd8e3d4d7936b7dc61763c18a > Author: Andrew Gallatin > AuthorDate: 2021-08-05 17:05:00 +0000 > Commit: Andrew Gallatin > CommitDate: 2021-08-05 17:09:06 +0000 > > ktls: fix a panic with INVARIANTS Thanks for the quick fix. From owner-dev-commits-src-main@freebsd.org Thu Aug 5 17:41:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 422906677CA for ; Thu, 5 Aug 2021 17:41:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2p.ore.mailhop.org (outbound2p.ore.mailhop.org [54.187.218.212]) (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 4GgbX56Z45z3RLQ for ; Thu, 5 Aug 2021 17:41:57 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1628185311; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=dCziVoFTMSWKLoe06vSNsSXvvEB6RPRGu5/n90bMfpGKIDss1tub8+PFybLSnFycF4U0slte7rPB3 BuDCLYrHbk1ITFgMXiq28Pgg12hBxo0e6EzD9FnnwW89ZEo9aRH13BPBaHL1hhjsqmfCboCBEEOmke SJvdLY+PW5plLxXGcxdv5QFkz931HYTl59vG18YFn/p1Z5KfNrBCpBZBdfGCFa0fFq0TD2w6oNBQ5n jqrDZ7ypSTG734hySndWMBnOmrPUn3HW77hniMW/g+3avsnwHOu/JsDI6SVpBF9dFpBboNCePCwDM2 0/5ITt/X3SM1uqftjprwyrjcF/m2XdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=8xad6Q1P38YW/K6tdXzN+cLrcAf+M8sm5hlFeoJKZXo=; b=D7fkIHzxGgjFqJs1Pzmpcc959b8rTjVW/pzyyJOaVpoKO4rG8QxGdX4pgM/bDRFnBe94c0ILnE/JF fXZ2PXgbsx+Lh2BrqYg9fkLJS6OhRmfjfLPN2JjmMcnCYrLxtCtyOlrgyp5cD3sweGUXx7pVmYCRKz qE1rPwAixKxBPXwvRmCvk6sUQU09gkiCtNy0ThJluR/Nc9mIh7oBRL8uJq8Vnk4QwHYULk7BvlDxQg e5/pSu3sByYMAgzYPd7sjXUczDgm6OrJ2Xn5hRamZyDXcF4ZbsyXJLvTSnNWNoT8vYrr6JYH3DX9F0 yGIHGVOmJXoRVx/voqia1kT9jDYIK/A== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=8xad6Q1P38YW/K6tdXzN+cLrcAf+M8sm5hlFeoJKZXo=; b=D89lPYv9jHyedehI8iEhXvM12q5Z6NkLpcWkcucqsyolYHxbDMvDNaDTzeIVeLrUT/2ZFHz2bQuV0 D1V8S6tNehZbcwNx2j99o2f56Kn05t39zt4s3SeDwCxWFGHKbE7YazvyRrFu7WePyLfwzkwSN12R5R NAxiYs0++bFRz9iFsHGA93gFE5Zi5dOFTj+xO/xgXKSEOYeFM3v0bhnPrAauBlZv1Bv5HX9WuQ1RWK i5F6X4GFFv6SJuEf3bv2MzoOzB6C7oiLfIpASnoawGk6NSxfT/AhQFAVcXnK+bOiOmCQa8M/acT01N Vljr7WzDgNS3p1GxQu+ew+eTFniqN7Q== X-Originating-IP: 67.177.211.60 X-MHO-RoutePath: aGlwcGll X-MHO-User: 692b7e57-f614-11eb-a658-89389772cfc7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 692b7e57-f614-11eb-a658-89389772cfc7; Thu, 05 Aug 2021 17:41:49 +0000 (UTC) Received: from [172.22.42.84] (rev2.hippie.lan [172.22.42.84]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 175HfmhW085229; Thu, 5 Aug 2021 11:41:48 -0600 (MDT) (envelope-from ian@freebsd.org) X-Authentication-Warning: paranoia.hippie.lan: Host rev2.hippie.lan [172.22.42.84] claimed to be [172.22.42.84] Message-ID: <1013cb35c9a2c3cc55b4f3bd10d14b1540c9462f.camel@freebsd.org> Subject: Re: git: 2694c869ff9f - main - ktls: fix a panic with INVARIANTS From: Ian Lepore To: Andrew Gallatin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Date: Thu, 05 Aug 2021 11:41:48 -0600 In-Reply-To: <202108051710.175HAP1D031061@gitrepo.freebsd.org> References: <202108051710.175HAP1D031061@gitrepo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.3 FreeBSD GNOME Team MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4GgbX56Z45z3RLQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 17:41:58 -0000 On Thu, 2021-08-05 at 17:10 +0000, Andrew Gallatin wrote: > The branch main has been updated by gallatin: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=2694c869ff9ff60fd8e3d4d7936b7dc61763c18a > > commit 2694c869ff9ff60fd8e3d4d7936b7dc61763c18a > Author:     Andrew Gallatin > AuthorDate: 2021-08-05 17:05:00 +0000 > Commit:     Andrew Gallatin > CommitDate: 2021-08-05 17:09:06 +0000 > >     ktls: fix a panic with INVARIANTS >     >     98215005b747fef67f44794ca64abd473b98bade introduced a new >     thread that uses tsleep(..0) to sleep forever.  This hit >     an assert due to sleeping with a 0 timeout. >     >     So spell "forever" using SBT_MAX instead, which does not >     trigger the assert. >     >     Pointy hat to: gallatin >     Pointed out by: emaste >     Sponsored by: Netflix > --- >  sys/kern/uipc_ktls.c | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c > index 17b87195fc50..47815c266667 100644 > --- a/sys/kern/uipc_ktls.c > +++ b/sys/kern/uipc_ktls.c > @@ -2240,7 +2240,7 @@ ktls_alloc_thread(void *ctx) >         nbufs = 0; >         for (;;) { >                 atomic_store_int(&sc->running, 0); > -               tsleep(sc, PZERO, "waiting for work", 0); > +               tsleep_sbt(sc, PZERO, "waiting for work", SBT_MAX, > SBT_1S, 0); >                 atomic_store_int(&sc->running, 1); >                 sc->wakeups++; >                 if (nbufs != ktls_max_alloc) { Finding a different way to spell "forever" is not a valid way to fix a problem where you're being warned that it is not safe to sleep forever. The assert was warning you that the code was vulnerable to hanging forever due to a missed wakeup. The code is still vulnerable to that, but now the problem is hidden and will be very difficult to find (more so because the wait message also violates the convention of using a short name that can be displayed by tools such as ps(1) and SIGINFO, where the wait-channel display is currently likely to show as "waitin"). I haven't looked at the code outside of the few lines shown in the commit diff, but based on the names involved, I suspect the right fix is to protect sc->running with a mutex and use msleep() instead of trying to roll-your-own with atomics. That would certainly be true if the wakeup code is some form of "if (!sc->running) wakeup(sc);" -- Ian From owner-dev-commits-src-main@freebsd.org Thu Aug 5 17:46:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE06C667C8A; Thu, 5 Aug 2021 17:46:26 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgbdG3SK9z3hgp; Thu, 5 Aug 2021 17:46:26 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.1.2] (pool-74-110-137-7.rcmdva.fios.verizon.net [74.110.137.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id D66062700137; Thu, 5 Aug 2021 13:46:25 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu D66062700137 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1628185586; bh=y7n+r9JdomK31h/wi2srOGwsiANpX5UxKlJG5qUgR3s=; h=Subject:To:From:Date:From; b=J0tR06V5iro1Zgb2Xu3UKLMD30uf2wG+F8CRuZgPmpDGhfIFAOFSEfgySYiJwdzRR b+h4bx8UlNhhenY7vfdAVQFUYG84uoRB8SArnIOMlCsSkgz2bEX2taOBrwWqtVd9yG k6s5LPdV1aOtLMhPz2fdPv/SkHb4TVXW7+hjK2dbxVO5q5J6Yy9S9Hs9MssVb7f/ug /Nwec8LZpf+uLmbdA2s53AOvhGf/KOzGYkQmZutJGQMNKZUiIElocYmv31xD7YXO7N +okq8UNFfNiKrL7MVw4arDc/isvMzf0wnxpJ+jClRU6hxmO9e5OIBnATuVwfIZbGeo AiH35x0rn6vsg== Subject: Re: git: 2694c869ff9f - main - ktls: fix a panic with INVARIANTS To: Ian Lepore , Andrew Gallatin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202108051710.175HAP1D031061@gitrepo.freebsd.org> <1013cb35c9a2c3cc55b4f3bd10d14b1540c9462f.camel@freebsd.org> From: Andrew Gallatin Message-ID: <69995f5d-9228-f956-aef5-d3cd4a4caa3d@cs.duke.edu> Date: Thu, 5 Aug 2021 13:46:25 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <1013cb35c9a2c3cc55b4f3bd10d14b1540c9462f.camel@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4GgbdG3SK9z3hgp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 17:46:26 -0000 On 8/5/21 1:41 PM, Ian Lepore wrote:       if (nbufs != ktls_max_alloc) { > > Finding a different way to spell "forever" is not a valid way to fix a > problem where you're being warned that it is not safe to sleep forever. > > The assert was warning you that the code was vulnerable to hanging > forever due to a missed wakeup. The code is still vulnerable to that, > but now the problem is hidden and will be very difficult to find (more > so because the wait message also violates the convention of using a > short name that can be displayed by tools such as ps(1) and SIGINFO, > where the wait-channel display is currently likely to show as > "waitin"). > > I haven't looked at the code outside of the few lines shown in the > commit diff, but based on the names involved, I suspect the right fix > is to protect sc->running with a mutex and use msleep() instead of > trying to roll-your-own with atomics. That would certainly be true if > the wakeup code is some form of "if (!sc->running) wakeup(sc);" > > -- Ian > The code is a case where a missing wakeup does not matter. The thread is woken up by an allocation failure, which are themselves rate-limited to one attempt per second (since failures are expensive, and there is a less expensive fallback). So the worst thing that can happen is that we wait at most an extra second. Adding a mutex adds nothing except unneeded complexity. Drew From owner-dev-commits-src-main@freebsd.org Thu Aug 5 18:37:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B20866848D; Thu, 5 Aug 2021 18:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgcmP10RRz3mNR; Thu, 5 Aug 2021 18:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A97E1F3B5; Thu, 5 Aug 2021 18:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175Ibe52043875; Thu, 5 Aug 2021 18:37:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175IbeLh043874; Thu, 5 Aug 2021 18:37:40 GMT (envelope-from git) Date: Thu, 5 Aug 2021 18:37:40 GMT Message-Id: <202108051837.175IbeLh043874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ceri Davies Subject: git: 383dbdb2ebff - main - fork.2: correct minor typo in manpage. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ceri X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 383dbdb2ebffabf8c0efadd8928f8ef3e45ab9e5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 18:37:41 -0000 The branch main has been updated by ceri (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=383dbdb2ebffabf8c0efadd8928f8ef3e45ab9e5 commit 383dbdb2ebffabf8c0efadd8928f8ef3e45ab9e5 Author: Ceri Davies AuthorDate: 2021-08-05 18:36:33 +0000 Commit: Ceri Davies CommitDate: 2021-08-05 18:36:33 +0000 fork.2: correct minor typo in manpage. --- lib/libc/sys/fork.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2 index bf934d166b03..d841b0bc38e1 100644 --- a/lib/libc/sys/fork.2 +++ b/lib/libc/sys/fork.2 @@ -150,7 +150,7 @@ Upon successful completion, and .Fn _Fork return a value -of 0 to the child process and returns the process ID of the child +of 0 to the child process and return the process ID of the child process to the parent process. Otherwise, a value of -1 is returned to the parent process, no child process is created, and the global From owner-dev-commits-src-main@freebsd.org Thu Aug 5 18:49:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77D696688B3; Thu, 5 Aug 2021 18:49:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 4Ggd1z2VcBz3nGK; Thu, 5 Aug 2021 18:49:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6DC8A2602DE; Thu, 5 Aug 2021 20:49:20 +0200 (CEST) Subject: Re: git: 2694c869ff9f - main - ktls: fix a panic with INVARIANTS To: Andrew Gallatin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202108051710.175HAP1D031061@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Thu, 5 Aug 2021 20:49:10 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <202108051710.175HAP1D031061@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Ggd1z2VcBz3nGK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 18:49:27 -0000 On 8/5/21 7:10 PM, Andrew Gallatin wrote: > + tsleep_sbt(sc, PZERO, "waiting for work", SBT_MAX, SBT_1S, 0); Hi, This basically puts a useless callout into the timer subsystem forever. I think if you don't care about this tsleep being accurate, then lock Giant and use sbt = 0. In between, I think that assert in question should be updated. --HPS From owner-dev-commits-src-main@freebsd.org Thu Aug 5 18:52:34 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3640F668B15; Thu, 5 Aug 2021 18:52:34 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 4Ggd5Y1J7Qz3nqb; Thu, 5 Aug 2021 18:52:33 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 086422602DE; Thu, 5 Aug 2021 20:52:31 +0200 (CEST) Subject: Re: git: 2694c869ff9f - main - ktls: fix a panic with INVARIANTS From: Hans Petter Selasky To: Andrew Gallatin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202108051710.175HAP1D031061@gitrepo.freebsd.org> Message-ID: Date: Thu, 5 Aug 2021 20:52:22 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 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-Rspamd-Queue-Id: 4Ggd5Y1J7Qz3nqb X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-1.61 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; DMARC_NA(0.00)[selasky.org]; NEURAL_SPAM_SHORT(0.69)[0.685]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 18:52:34 -0000 On 8/5/21 8:49 PM, Hans Petter Selasky wrote: > On 8/5/21 7:10 PM, Andrew Gallatin wrote: >> +        tsleep_sbt(sc, PZERO, "waiting for work", SBT_MAX, SBT_1S, 0); > > Hi, > > This basically puts a useless callout into the timer subsystem forever. > I think if you don't care about this tsleep being accurate, then lock > Giant and use sbt = 0. > > In between, I think that assert in question should be updated. > > --HPS Or update the code: if (sbt != 0) sleepq_set_timeout_sbt(ident, sbt, pr, flags); Should maybe be: if (sbt > 0 && sbt < SBT_MAX) sleepq_set_timeout_sbt(ident, sbt, pr, flags); --HPS From owner-dev-commits-src-main@freebsd.org Thu Aug 5 19:20:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D0B7668ADF; Thu, 5 Aug 2021 19:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ggdjb1xW9z3tsK; Thu, 5 Aug 2021 19:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AEE21F47C; Thu, 5 Aug 2021 19:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175JKJOi004727; Thu, 5 Aug 2021 19:20:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175JKJi8004720; Thu, 5 Aug 2021 19:20:19 GMT (envelope-from git) Date: Thu, 5 Aug 2021 19:20:19 GMT Message-Id: <202108051920.175JKJi8004720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 87322a907545 - main - iscsi: Remove icl_soft-only fields from struct icl_conn. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 87322a907545fa76fbaf7949f80e85b1377a53ad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 19:20:19 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=87322a907545fa76fbaf7949f80e85b1377a53ad commit 87322a907545fa76fbaf7949f80e85b1377a53ad Author: John Baldwin AuthorDate: 2021-08-05 19:05:30 +0000 Commit: John Baldwin CommitDate: 2021-08-05 19:05:30 +0000 iscsi: Remove icl_soft-only fields from struct icl_conn. Create a struct icl_soft_conn which extends struct icl_conn and move fields only used by icl_soft from struct icl_conn to struct icl_soft_conn. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31414 --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 11 -- sys/dev/iscsi/icl.h | 20 +--- sys/dev/iscsi/icl_soft.c | 218 ++++++++++++++++++++++---------------- 3 files changed, 128 insertions(+), 121 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 7d8ebd1e040f..d5b13fb5c3ea 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -569,10 +569,6 @@ icl_cxgbei_new_conn(const char *name, struct mtx *lock) ic = &icc->ic; ic->ic_lock = lock; - /* XXXNP: review. Most of these icl_conn fields aren't really used */ - STAILQ_INIT(&ic->ic_to_send); - cv_init(&ic->ic_send_cv, "icl_cxgbei_tx"); - cv_init(&ic->ic_receive_cv, "icl_cxgbei_rx"); #ifdef DIAGNOSTIC refcount_init(&ic->ic_outstanding_pdus, 0); #endif @@ -594,9 +590,6 @@ icl_cxgbei_conn_free(struct icl_conn *ic) CTR2(KTR_CXGBE, "%s: icc %p", __func__, icc); - cv_destroy(&ic->ic_send_cv); - cv_destroy(&ic->ic_receive_cv); - mtx_destroy(&icc->cmp_lock); hashdestroy(icc->cmp_table, M_CXGBEI, icc->cmp_hash_mask); kobj_delete((struct kobj *)icc, M_CXGBE); @@ -864,10 +857,6 @@ icl_cxgbei_conn_close(struct icl_conn *ic) } ic->ic_disconnecting = true; - /* These are unused in this driver right now. */ - MPASS(STAILQ_EMPTY(&ic->ic_to_send)); - MPASS(ic->ic_receive_pdu == NULL); - #ifdef DIAGNOSTIC KASSERT(ic->ic_outstanding_pdus == 0, ("destroying session with %d outstanding PDUs", diff --git a/sys/dev/iscsi/icl.h b/sys/dev/iscsi/icl.h index 94600c0edad1..adcd580f299b 100644 --- a/sys/dev/iscsi/icl.h +++ b/sys/dev/iscsi/icl.h @@ -82,13 +82,6 @@ struct icl_pdu { void *ip_prv1; }; -#define ICL_CONN_STATE_INVALID 0 -#define ICL_CONN_STATE_BHS 1 -#define ICL_CONN_STATE_AHS 2 -#define ICL_CONN_STATE_HEADER_DIGEST 3 -#define ICL_CONN_STATE_DATA 4 -#define ICL_CONN_STATE_DATA_DIGEST 5 - #define ICL_NOCOPY (1 << 30) struct icl_conn { @@ -98,20 +91,11 @@ struct icl_conn { #ifdef DIAGNOSTIC volatile u_int ic_outstanding_pdus; #endif - STAILQ_HEAD(, icl_pdu) ic_to_send; - bool ic_check_send_space; - size_t ic_receive_len; - int ic_receive_state; - struct icl_pdu *ic_receive_pdu; - struct cv ic_send_cv; - struct cv ic_receive_cv; - bool ic_header_crc32c; - bool ic_data_crc32c; - bool ic_send_running; - bool ic_receive_running; uint32_t ic_max_recv_data_segment_length; uint32_t ic_max_send_data_segment_length; size_t ic_maxtags; + bool ic_header_crc32c; + bool ic_data_crc32c; bool ic_disconnecting; bool ic_iser; bool ic_unmapped; diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index 001c595af7ec..95c4c87dd6f3 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -63,6 +63,27 @@ __FBSDID("$FreeBSD$"); #include #include +#define ICL_CONN_STATE_BHS 1 +#define ICL_CONN_STATE_AHS 2 +#define ICL_CONN_STATE_HEADER_DIGEST 3 +#define ICL_CONN_STATE_DATA 4 +#define ICL_CONN_STATE_DATA_DIGEST 5 + +struct icl_soft_conn { + struct icl_conn ic; + + /* soft specific stuff goes here. */ + STAILQ_HEAD(, icl_pdu) to_send; + struct cv send_cv; + struct cv receive_cv; + struct icl_pdu *receive_pdu; + size_t receive_len; + int receive_state; + bool receive_running; + bool check_send_space; + bool send_running; +}; + struct icl_soft_pdu { struct icl_pdu ip; @@ -150,7 +171,7 @@ static kobj_method_t icl_soft_methods[] = { { 0, 0 } }; -DEFINE_CLASS(icl_soft, icl_soft_methods, sizeof(struct icl_conn)); +DEFINE_CLASS(icl_soft, icl_soft_methods, sizeof(struct icl_soft_conn)); static void icl_conn_fail(struct icl_conn *ic) @@ -441,14 +462,14 @@ static int icl_pdu_receive_data_segment(struct icl_pdu *request, struct mbuf **r, size_t *rs, bool *more_neededp) { - struct icl_conn *ic; + struct icl_soft_conn *isc; size_t len, padding = 0; struct mbuf *m; - ic = request->ip_conn; + isc = (struct icl_soft_conn *)request->ip_conn; *more_neededp = false; - ic->ic_receive_len = 0; + isc->receive_len = 0; len = icl_pdu_data_segment_length(request); if (len == 0) @@ -497,8 +518,7 @@ icl_pdu_receive_data_segment(struct icl_pdu *request, struct mbuf **r, ICL_DEBUG("len 0"); if (*more_neededp) - ic->ic_receive_len = - icl_pdu_data_segment_receive_len(request); + isc->receive_len = icl_pdu_data_segment_receive_len(request); return (0); } @@ -537,16 +557,17 @@ icl_pdu_check_data_digest(struct icl_pdu *request, struct mbuf **r, size_t *rs) * "part" of PDU at a time; call it repeatedly until it returns non-NULL. */ static struct icl_pdu * -icl_conn_receive_pdu(struct icl_conn *ic, struct mbuf **r, size_t *rs) +icl_conn_receive_pdu(struct icl_soft_conn *isc, struct mbuf **r, size_t *rs) { + struct icl_conn *ic = &isc->ic; struct icl_pdu *request; size_t len; int error = 0; bool more_needed; - if (ic->ic_receive_state == ICL_CONN_STATE_BHS) { - KASSERT(ic->ic_receive_pdu == NULL, - ("ic->ic_receive_pdu != NULL")); + if (isc->receive_state == ICL_CONN_STATE_BHS) { + KASSERT(isc->receive_pdu == NULL, + ("isc->receive_pdu != NULL")); request = icl_soft_conn_new_pdu(ic, M_NOWAIT); if (request == NULL) { ICL_DEBUG("failed to allocate PDU; " @@ -554,14 +575,14 @@ icl_conn_receive_pdu(struct icl_conn *ic, struct mbuf **r, size_t *rs) icl_conn_fail(ic); return (NULL); } - ic->ic_receive_pdu = request; + isc->receive_pdu = request; } else { - KASSERT(ic->ic_receive_pdu != NULL, - ("ic->ic_receive_pdu == NULL")); - request = ic->ic_receive_pdu; + KASSERT(isc->receive_pdu != NULL, + ("isc->receive_pdu == NULL")); + request = isc->receive_pdu; } - switch (ic->ic_receive_state) { + switch (isc->receive_state) { case ICL_CONN_STATE_BHS: //ICL_DEBUG("receiving BHS"); icl_soft_receive_buf(r, rs, request->ip_bhs, @@ -581,18 +602,18 @@ icl_conn_receive_pdu(struct icl_conn *ic, struct mbuf **r, size_t *rs) break; } - ic->ic_receive_state = ICL_CONN_STATE_AHS; - ic->ic_receive_len = icl_pdu_ahs_length(request); + isc->receive_state = ICL_CONN_STATE_AHS; + isc->receive_len = icl_pdu_ahs_length(request); break; case ICL_CONN_STATE_AHS: //ICL_DEBUG("receiving AHS"); icl_pdu_receive_ahs(request, r, rs); - ic->ic_receive_state = ICL_CONN_STATE_HEADER_DIGEST; + isc->receive_state = ICL_CONN_STATE_HEADER_DIGEST; if (ic->ic_header_crc32c == false) - ic->ic_receive_len = 0; + isc->receive_len = 0; else - ic->ic_receive_len = ISCSI_HEADER_DIGEST_SIZE; + isc->receive_len = ISCSI_HEADER_DIGEST_SIZE; break; case ICL_CONN_STATE_HEADER_DIGEST: @@ -604,9 +625,8 @@ icl_conn_receive_pdu(struct icl_conn *ic, struct mbuf **r, size_t *rs) break; } - ic->ic_receive_state = ICL_CONN_STATE_DATA; - ic->ic_receive_len = - icl_pdu_data_segment_receive_len(request); + isc->receive_state = ICL_CONN_STATE_DATA; + isc->receive_len = icl_pdu_data_segment_receive_len(request); break; case ICL_CONN_STATE_DATA: @@ -622,11 +642,11 @@ icl_conn_receive_pdu(struct icl_conn *ic, struct mbuf **r, size_t *rs) if (more_needed) break; - ic->ic_receive_state = ICL_CONN_STATE_DATA_DIGEST; + isc->receive_state = ICL_CONN_STATE_DATA_DIGEST; if (request->ip_data_len == 0 || ic->ic_data_crc32c == false) - ic->ic_receive_len = 0; + isc->receive_len = 0; else - ic->ic_receive_len = ISCSI_DATA_DIGEST_SIZE; + isc->receive_len = ISCSI_DATA_DIGEST_SIZE; break; case ICL_CONN_STATE_DATA_DIGEST: @@ -642,18 +662,18 @@ icl_conn_receive_pdu(struct icl_conn *ic, struct mbuf **r, size_t *rs) * We've received complete PDU; reset the receive state machine * and return the PDU. */ - ic->ic_receive_state = ICL_CONN_STATE_BHS; - ic->ic_receive_len = sizeof(struct iscsi_bhs); - ic->ic_receive_pdu = NULL; + isc->receive_state = ICL_CONN_STATE_BHS; + isc->receive_len = sizeof(struct iscsi_bhs); + isc->receive_pdu = NULL; return (request); default: - panic("invalid ic_receive_state %d\n", ic->ic_receive_state); + panic("invalid receive_state %d\n", isc->receive_state); } if (error != 0) { /* - * Don't free the PDU; it's pointed to by ic->ic_receive_pdu + * Don't free the PDU; it's pointed to by isc->receive_pdu * and will get freed in icl_soft_conn_close(). */ icl_conn_fail(ic); @@ -663,8 +683,9 @@ icl_conn_receive_pdu(struct icl_conn *ic, struct mbuf **r, size_t *rs) } static void -icl_conn_receive_pdus(struct icl_conn *ic, struct mbuf **r, size_t *rs) +icl_conn_receive_pdus(struct icl_soft_conn *isc, struct mbuf **r, size_t *rs) { + struct icl_conn *ic = &isc->ic; struct icl_pdu *response; for (;;) { @@ -675,15 +696,15 @@ icl_conn_receive_pdus(struct icl_conn *ic, struct mbuf **r, size_t *rs) * Loop until we have a complete PDU or there is not enough * data in the socket buffer. */ - if (*rs < ic->ic_receive_len) { + if (*rs < isc->receive_len) { #if 0 ICL_DEBUG("not enough data; have %zd, need %zd", - *rs, ic->ic_receive_len); + *rs, isc->receive_len); #endif return; } - response = icl_conn_receive_pdu(ic, r, rs); + response = icl_conn_receive_pdu(isc, r, rs); if (response == NULL) continue; @@ -703,14 +724,14 @@ icl_conn_receive_pdus(struct icl_conn *ic, struct mbuf **r, size_t *rs) static void icl_receive_thread(void *arg) { - struct icl_conn *ic; + struct icl_soft_conn *isc = arg; + struct icl_conn *ic = &isc->ic; size_t available, read = 0; struct socket *so; struct mbuf *m, *r = NULL; struct uio uio; int error, flags; - ic = arg; so = ic->ic_socket; for (;;) { @@ -727,9 +748,9 @@ icl_receive_thread(void *arg) * is enough data received to read the PDU. */ available = sbavail(&so->so_rcv); - if (read + available < ic->ic_receive_len) { - so->so_rcv.sb_lowat = ic->ic_receive_len - read; - cv_wait(&ic->ic_receive_cv, SOCKBUF_MTX(&so->so_rcv)); + if (read + available < isc->receive_len) { + so->so_rcv.sb_lowat = isc->receive_len - read; + cv_wait(&isc->receive_cv, SOCKBUF_MTX(&so->so_rcv)); so->so_rcv.sb_lowat = so->so_rcv.sb_hiwat + 1; available = sbavail(&so->so_rcv); } @@ -764,15 +785,15 @@ icl_receive_thread(void *arg) r = m; read += available; - icl_conn_receive_pdus(ic, &r, &read); + icl_conn_receive_pdus(isc, &r, &read); } if (r) m_freem(r); ICL_CONN_LOCK(ic); - ic->ic_receive_running = false; - cv_signal(&ic->ic_send_cv); + isc->receive_running = false; + cv_signal(&isc->send_cv); ICL_CONN_UNLOCK(ic); kthread_exit(); } @@ -780,13 +801,13 @@ icl_receive_thread(void *arg) static int icl_soupcall_receive(struct socket *so, void *arg, int waitflag) { - struct icl_conn *ic; + struct icl_soft_conn *isc; if (!soreadable(so)) return (SU_OK); - ic = arg; - cv_signal(&ic->ic_receive_cv); + isc = arg; + cv_signal(&isc->receive_cv); return (SU_OK); } @@ -846,8 +867,9 @@ icl_pdu_finalize(struct icl_pdu *request) } static void -icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) +icl_conn_send_pdus(struct icl_soft_conn *isc, struct icl_pdu_stailq *queue) { + struct icl_conn *ic = &isc->ic; struct icl_pdu *request, *request2; struct mbuf *m; struct socket *so; @@ -866,7 +888,7 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) * of error. */ available = sbspace(&so->so_snd); - ic->ic_check_send_space = false; + isc->check_send_space = false; /* * Notify the socket upcall that we don't need wakeups @@ -961,10 +983,12 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) static void icl_send_thread(void *arg) { + struct icl_soft_conn *isc; struct icl_conn *ic; struct icl_pdu_stailq queue; - ic = arg; + isc = arg; + ic = &isc->ic; STAILQ_INIT(&queue); @@ -976,18 +1000,18 @@ icl_send_thread(void *arg) * This way the icl_conn_send_pdus() can go through * all the queued PDUs without holding any locks. */ - if (STAILQ_EMPTY(&queue) || ic->ic_check_send_space) - STAILQ_CONCAT(&queue, &ic->ic_to_send); + if (STAILQ_EMPTY(&queue) || isc->check_send_space) + STAILQ_CONCAT(&queue, &isc->to_send); ICL_CONN_UNLOCK(ic); - icl_conn_send_pdus(ic, &queue); + icl_conn_send_pdus(isc, &queue); ICL_CONN_LOCK(ic); /* * The icl_soupcall_send() was called since the last * call to sbspace(); go around; */ - if (ic->ic_check_send_space) + if (isc->check_send_space) continue; /* @@ -995,7 +1019,7 @@ icl_send_thread(void *arg) * in the main one; go around. */ if (STAILQ_EMPTY(&queue) && - !STAILQ_EMPTY(&ic->ic_to_send)) + !STAILQ_EMPTY(&isc->to_send)) continue; /* @@ -1011,17 +1035,17 @@ icl_send_thread(void *arg) break; } - cv_wait(&ic->ic_send_cv, ic->ic_lock); + cv_wait(&isc->send_cv, ic->ic_lock); } /* * We're exiting; move PDUs back to the main queue, so they can * get freed properly. At this point ordering doesn't matter. */ - STAILQ_CONCAT(&ic->ic_to_send, &queue); + STAILQ_CONCAT(&isc->to_send, &queue); - ic->ic_send_running = false; - cv_signal(&ic->ic_send_cv); + isc->send_running = false; + cv_signal(&isc->send_cv); ICL_CONN_UNLOCK(ic); kthread_exit(); } @@ -1029,18 +1053,20 @@ icl_send_thread(void *arg) static int icl_soupcall_send(struct socket *so, void *arg, int waitflag) { + struct icl_soft_conn *isc; struct icl_conn *ic; if (!sowriteable(so)) return (SU_OK); - ic = arg; + isc = arg; + ic = &isc->ic; ICL_CONN_LOCK(ic); - ic->ic_check_send_space = true; + isc->check_send_space = true; ICL_CONN_UNLOCK(ic); - cv_signal(&ic->ic_send_cv); + cv_signal(&isc->send_cv); return (SU_OK); } @@ -1112,6 +1138,7 @@ static void icl_soft_conn_pdu_queue_cb(struct icl_conn *ic, struct icl_pdu *ip, icl_pdu_cb cb) { + struct icl_soft_conn *isc = (struct icl_soft_conn *)ic; struct icl_soft_pdu *isp = (struct icl_soft_pdu *)ip; ICL_CONN_LOCK_ASSERT(ic); @@ -1124,8 +1151,8 @@ icl_soft_conn_pdu_queue_cb(struct icl_conn *ic, struct icl_pdu *ip, return; } - if (!STAILQ_EMPTY(&ic->ic_to_send)) { - STAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); + if (!STAILQ_EMPTY(&isc->to_send)) { + STAILQ_INSERT_TAIL(&isc->to_send, ip, ip_next); /* * If the queue is not empty, someone else had already * signaled the send thread; no need to do that again, @@ -1134,23 +1161,27 @@ icl_soft_conn_pdu_queue_cb(struct icl_conn *ic, struct icl_pdu *ip, return; } - STAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); - cv_signal(&ic->ic_send_cv); + STAILQ_INSERT_TAIL(&isc->to_send, ip, ip_next); + cv_signal(&isc->send_cv); } static struct icl_conn * icl_soft_new_conn(const char *name, struct mtx *lock) { + struct icl_soft_conn *isc; struct icl_conn *ic; refcount_acquire(&icl_ncons); - ic = (struct icl_conn *)kobj_create(&icl_soft_class, M_ICL_SOFT, M_WAITOK | M_ZERO); + isc = (struct icl_soft_conn *)kobj_create(&icl_soft_class, M_ICL_SOFT, + M_WAITOK | M_ZERO); + + STAILQ_INIT(&isc->to_send); + cv_init(&isc->send_cv, "icl_tx"); + cv_init(&isc->receive_cv, "icl_rx"); - STAILQ_INIT(&ic->ic_to_send); + ic = &isc->ic; ic->ic_lock = lock; - cv_init(&ic->ic_send_cv, "icl_tx"); - cv_init(&ic->ic_receive_cv, "icl_rx"); #ifdef DIAGNOSTIC refcount_init(&ic->ic_outstanding_pdus, 0); #endif @@ -1164,21 +1195,23 @@ icl_soft_new_conn(const char *name, struct mtx *lock) void icl_soft_conn_free(struct icl_conn *ic) { + struct icl_soft_conn *isc = (struct icl_soft_conn *)ic; #ifdef DIAGNOSTIC KASSERT(ic->ic_outstanding_pdus == 0, ("destroying session with %d outstanding PDUs", ic->ic_outstanding_pdus)); #endif - cv_destroy(&ic->ic_send_cv); - cv_destroy(&ic->ic_receive_cv); - kobj_delete((struct kobj *)ic, M_ICL_SOFT); + cv_destroy(&isc->send_cv); + cv_destroy(&isc->receive_cv); + kobj_delete((struct kobj *)isc, M_ICL_SOFT); refcount_release(&icl_ncons); } static int icl_conn_start(struct icl_conn *ic) { + struct icl_soft_conn *isc = (struct icl_soft_conn *)ic; size_t minspace; struct sockopt opt; int error, one = 1; @@ -1193,8 +1226,8 @@ icl_conn_start(struct icl_conn *ic) return (EINVAL); } - ic->ic_receive_state = ICL_CONN_STATE_BHS; - ic->ic_receive_len = sizeof(struct iscsi_bhs); + isc->receive_state = ICL_CONN_STATE_BHS; + isc->receive_len = sizeof(struct iscsi_bhs); ic->ic_disconnecting = false; ICL_CONN_UNLOCK(ic); @@ -1251,25 +1284,25 @@ icl_conn_start(struct icl_conn *ic) * and free space to send outgoing ones. */ SOCKBUF_LOCK(&ic->ic_socket->so_snd); - soupcall_set(ic->ic_socket, SO_SND, icl_soupcall_send, ic); + soupcall_set(ic->ic_socket, SO_SND, icl_soupcall_send, isc); SOCKBUF_UNLOCK(&ic->ic_socket->so_snd); SOCKBUF_LOCK(&ic->ic_socket->so_rcv); - soupcall_set(ic->ic_socket, SO_RCV, icl_soupcall_receive, ic); + soupcall_set(ic->ic_socket, SO_RCV, icl_soupcall_receive, isc); SOCKBUF_UNLOCK(&ic->ic_socket->so_rcv); /* * Start threads. */ ICL_CONN_LOCK(ic); - ic->ic_send_running = ic->ic_receive_running = true; + isc->send_running = isc->receive_running = true; ICL_CONN_UNLOCK(ic); error = kthread_add(icl_send_thread, ic, NULL, NULL, 0, 0, "%stx", ic->ic_name); if (error != 0) { ICL_WARN("kthread_add(9) failed with error %d", error); ICL_CONN_LOCK(ic); - ic->ic_send_running = ic->ic_receive_running = false; - cv_signal(&ic->ic_send_cv); + isc->send_running = isc->receive_running = false; + cv_signal(&isc->send_cv); ICL_CONN_UNLOCK(ic); icl_soft_conn_close(ic); return (error); @@ -1279,8 +1312,8 @@ icl_conn_start(struct icl_conn *ic) if (error != 0) { ICL_WARN("kthread_add(9) failed with error %d", error); ICL_CONN_LOCK(ic); - ic->ic_receive_running = false; - cv_signal(&ic->ic_send_cv); + isc->receive_running = false; + cv_signal(&isc->send_cv); ICL_CONN_UNLOCK(ic); icl_soft_conn_close(ic); return (error); @@ -1355,6 +1388,7 @@ icl_soft_conn_handoff(struct icl_conn *ic, int fd) void icl_soft_conn_close(struct icl_conn *ic) { + struct icl_soft_conn *isc = (struct icl_soft_conn *)ic; struct icl_pdu *pdu; struct socket *so; @@ -1371,10 +1405,10 @@ icl_soft_conn_close(struct icl_conn *ic) if (so) SOCKBUF_UNLOCK(&so->so_rcv); } - while (ic->ic_receive_running || ic->ic_send_running) { - cv_signal(&ic->ic_receive_cv); - cv_signal(&ic->ic_send_cv); - cv_wait(&ic->ic_send_cv, ic->ic_lock); + while (isc->receive_running || isc->send_running) { + cv_signal(&isc->receive_cv); + cv_signal(&isc->send_cv); + cv_wait(&isc->send_cv, ic->ic_lock); } /* Some other thread could close the connection same time. */ @@ -1400,22 +1434,22 @@ icl_soft_conn_close(struct icl_conn *ic) soclose(so); ICL_CONN_LOCK(ic); - if (ic->ic_receive_pdu != NULL) { + if (isc->receive_pdu != NULL) { //ICL_DEBUG("freeing partially received PDU"); - icl_soft_conn_pdu_free(ic, ic->ic_receive_pdu); - ic->ic_receive_pdu = NULL; + icl_soft_conn_pdu_free(ic, isc->receive_pdu); + isc->receive_pdu = NULL; } /* * Remove any outstanding PDUs from the send queue. */ - while (!STAILQ_EMPTY(&ic->ic_to_send)) { - pdu = STAILQ_FIRST(&ic->ic_to_send); - STAILQ_REMOVE_HEAD(&ic->ic_to_send, ip_next); + while (!STAILQ_EMPTY(&isc->to_send)) { + pdu = STAILQ_FIRST(&isc->to_send); + STAILQ_REMOVE_HEAD(&isc->to_send, ip_next); icl_soft_pdu_done(pdu, ENOTCONN); } - KASSERT(STAILQ_EMPTY(&ic->ic_to_send), + KASSERT(STAILQ_EMPTY(&isc->to_send), ("destroying session with non-empty send queue")); ICL_CONN_UNLOCK(ic); } From owner-dev-commits-src-main@freebsd.org Thu Aug 5 20:45:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78BC666A30A; Thu, 5 Aug 2021 20:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gggbz2lRdz4VV2; Thu, 5 Aug 2021 20:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4629420F1D; Thu, 5 Aug 2021 20:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175KjZa8018668; Thu, 5 Aug 2021 20:45:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175KjZFG018667; Thu, 5 Aug 2021 20:45:35 GMT (envelope-from git) Date: Thu, 5 Aug 2021 20:45:35 GMT Message-Id: <202108052045.175KjZFG018667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 8482aa77481a - main - Use lltable calculated header when sending lle holdchain after successful lle resolution. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8482aa77481a1576df7a19dbeaccb91243fbb2a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 20:45:35 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=8482aa77481a1576df7a19dbeaccb91243fbb2a3 commit 8482aa77481a1576df7a19dbeaccb91243fbb2a3 Author: Alexander V. Chernikov AuthorDate: 2021-08-02 23:16:48 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-08-05 20:44:36 +0000 Use lltable calculated header when sending lle holdchain after successful lle resolution. Subscribers: imp, ae, bz Differential Revision: https://reviews.freebsd.org/D31391 --- sys/netinet/if_ether.c | 55 ++++++++++++++++++++++++++++++++++++++------------ sys/netinet6/nd6.c | 30 +++++++++++++++++---------- sys/netinet6/nd6.h | 6 ++---- sys/netinet6/nd6_nbr.c | 9 +++------ 4 files changed, 66 insertions(+), 34 deletions(-) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 3eb9d7210afb..2f92d623feeb 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1145,6 +1145,44 @@ drop: } #endif +static struct mbuf * +arp_grab_holdchain(struct llentry *la) +{ + struct mbuf *chain; + + LLE_WLOCK_ASSERT(la); + + chain = la->la_hold; + la->la_hold = NULL; + la->la_numheld = 0; + + return (chain); +} + +static void +arp_flush_holdchain(struct ifnet *ifp, struct llentry *la, struct mbuf *chain) +{ + struct mbuf *m_hold, *m_hold_next; + struct sockaddr_in sin; + + NET_EPOCH_ASSERT(); + + struct route ro = { + .ro_prepend = la->r_linkdata, + .ro_plen = la->r_hdrlen, + }; + + lltable_fill_sa_entry(la, (struct sockaddr *)&sin); + + for (m_hold = chain; m_hold != NULL; m_hold = m_hold_next) { + m_hold_next = m_hold->m_nextpkt; + m_hold->m_nextpkt = NULL; + /* Avoid confusing lower layers. */ + m_clrprotoflags(m_hold); + (*ifp->if_output)(ifp, m_hold, (struct sockaddr *)&sin, &ro); + } +} + /* * Checks received arp data against existing @la. * Updates lle state/performs notification if necessary. @@ -1153,8 +1191,6 @@ static void arp_check_update_lle(struct arphdr *ah, struct in_addr isaddr, struct ifnet *ifp, int bridged, struct llentry *la) { - struct sockaddr sa; - struct mbuf *m_hold, *m_hold_next; uint8_t linkhdr[LLE_MAX_LINKHDR]; size_t linkhdrsize; int lladdr_off; @@ -1227,18 +1263,11 @@ arp_check_update_lle(struct arphdr *ah, struct in_addr isaddr, struct ifnet *ifp * output routine. */ if (la->la_hold != NULL) { - m_hold = la->la_hold; - la->la_hold = NULL; - la->la_numheld = 0; - lltable_fill_sa_entry(la, &sa); + struct mbuf *chain; + + chain = arp_grab_holdchain(la); LLE_WUNLOCK(la); - for (; m_hold != NULL; m_hold = m_hold_next) { - m_hold_next = m_hold->m_nextpkt; - m_hold->m_nextpkt = NULL; - /* Avoid confusing lower layers. */ - m_clrprotoflags(m_hold); - (*ifp->if_output)(ifp, m_hold, &sa, NULL); - } + arp_flush_holdchain(ifp, la, chain); } else LLE_WUNLOCK(la); } diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 60610462f4d7..437fdb5d4e52 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1923,7 +1923,6 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, int llchange; int flags; uint16_t router = 0; - struct sockaddr_in6 sin6; struct mbuf *chain = NULL; u_char linkhdr[LLE_MAX_LINKHDR]; size_t linkhdrsize; @@ -2044,7 +2043,7 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED); if (ln->la_hold != NULL) - nd6_grab_holdchain(ln, &chain, &sin6); + chain = nd6_grab_holdchain(ln); } /* Calculates new router status */ @@ -2062,7 +2061,7 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, LLE_RUNLOCK(ln); if (chain != NULL) - nd6_flush_holdchain(ifp, chain, &sin6); + nd6_flush_holdchain(ifp, ln, chain); /* * When the link-layer address of a router changes, select the @@ -2119,16 +2118,15 @@ nd6_slowtimo(void *arg) CURVNET_RESTORE(); } -void -nd6_grab_holdchain(struct llentry *ln, struct mbuf **chain, - struct sockaddr_in6 *sin6) +struct mbuf * +nd6_grab_holdchain(struct llentry *ln) { + struct mbuf *chain; LLE_WLOCK_ASSERT(ln); - *chain = ln->la_hold; + chain = ln->la_hold; ln->la_hold = NULL; - lltable_fill_sa_entry(ln, (struct sockaddr *)sin6); if (ln->ln_state == ND6_LLINFO_STALE) { /* @@ -2142,6 +2140,8 @@ nd6_grab_holdchain(struct llentry *ln, struct mbuf **chain, */ nd6_llinfo_setstate(ln, ND6_LLINFO_DELAY); } + + return (chain); } int @@ -2435,19 +2435,27 @@ nd6_resolve_addr(struct ifnet *ifp, int flags, const struct sockaddr *dst, } int -nd6_flush_holdchain(struct ifnet *ifp, struct mbuf *chain, - struct sockaddr_in6 *dst) +nd6_flush_holdchain(struct ifnet *ifp, struct llentry *lle, struct mbuf *chain) { struct mbuf *m, *m_head; + struct sockaddr_in6 dst6; int error = 0; + NET_EPOCH_ASSERT(); + + struct route_in6 ro = { + .ro_prepend = lle->r_linkdata, + .ro_plen = lle->r_hdrlen, + }; + + lltable_fill_sa_entry(lle, (struct sockaddr *)&dst6); m_head = chain; while (m_head) { m = m_head; m_head = m_head->m_nextpkt; m->m_nextpkt = NULL; - error = nd6_output_ifp(ifp, ifp, m, dst, NULL); + error = nd6_output_ifp(ifp, ifp, m, &dst6, (struct route *)&ro); } /* diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index a64c786efcc8..ee53acce840a 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -376,10 +376,8 @@ int nd6_resolve(struct ifnet *, int, struct mbuf *, int nd6_ioctl(u_long, caddr_t, struct ifnet *); void nd6_cache_lladdr(struct ifnet *, struct in6_addr *, char *, int, int, int); -void nd6_grab_holdchain(struct llentry *, struct mbuf **, - struct sockaddr_in6 *); -int nd6_flush_holdchain(struct ifnet *, struct mbuf *, - struct sockaddr_in6 *); +struct mbuf *nd6_grab_holdchain(struct llentry *); +int nd6_flush_holdchain(struct ifnet *, struct llentry *, struct mbuf *); int nd6_add_ifa_lle(struct in6_ifaddr *); void nd6_rem_ifa_lle(struct in6_ifaddr *, int); int nd6_output_ifp(struct ifnet *, struct ifnet *, struct mbuf *, diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 42e901bdd2a4..0f18a38c37a1 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -623,7 +623,6 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) struct mbuf *chain; struct nd_neighbor_advert *nd_na; struct in6_addr daddr6, taddr6; - struct sockaddr_in6 sin6; union nd_opts ndopts; u_char linkhdr[LLE_MAX_LINKHDR]; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; @@ -899,16 +898,14 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) * rt->rt_flags &= ~RTF_REJECT; */ ln->la_asked = 0; - if (ln->la_hold != NULL) { - memset(&sin6, 0, sizeof(sin6)); - nd6_grab_holdchain(ln, &chain, &sin6); - } + if (ln->la_hold != NULL) + chain = nd6_grab_holdchain(ln); freeit: if (ln != NULL) LLE_WUNLOCK(ln); if (chain != NULL) - nd6_flush_holdchain(ifp, chain, &sin6); + nd6_flush_holdchain(ifp, ln, chain); if (checklink) pfxlist_onlink_check(); From owner-dev-commits-src-main@freebsd.org Thu Aug 5 22:51:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB41D66BCC0; Thu, 5 Aug 2021 22:51:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgkPn4rLgz4crB; Thu, 5 Aug 2021 22:51:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E7FD22274; Thu, 5 Aug 2021 22:51:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175MpvGd090850; Thu, 5 Aug 2021 22:51:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175MpvX7090849; Thu, 5 Aug 2021 22:51:57 GMT (envelope-from git) Date: Thu, 5 Aug 2021 22:51:57 GMT Message-Id: <202108052251.175MpvX7090849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 1b97a054f3ac - main - tsleep: Add a PNOLOCK flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b97a054f3acaf13a5c8361b7b80e10ad16257b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 22:51:57 -0000 The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=1b97a054f3acaf13a5c8361b7b80e10ad16257b9 commit 1b97a054f3acaf13a5c8361b7b80e10ad16257b9 Author: Andrew Gallatin AuthorDate: 2021-08-05 21:16:30 +0000 Commit: Andrew Gallatin CommitDate: 2021-08-05 21:16:30 +0000 tsleep: Add a PNOLOCK flag Add a PNOLOCK flag so that, in the race circumstance where wakeup races are externally mitigated, tsleep() can be called with a sleep time of 0 without triggering an an assertion. Reviewed by: jhb Sponsored by: Netflix --- sys/kern/kern_synch.c | 3 ++- sys/sys/param.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 793c5309a30b..7bf5193fb7b1 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -148,7 +148,8 @@ _sleep(const void *ident, struct lock_object *lock, int priority, #endif WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, lock, "Sleeping on \"%s\"", wmesg); - KASSERT(sbt != 0 || mtx_owned(&Giant) || lock != NULL, + KASSERT(sbt != 0 || mtx_owned(&Giant) || lock != NULL || + (priority & PNOLOCK) != 0, ("sleeping without a lock")); KASSERT(ident != NULL, ("_sleep: NULL ident")); KASSERT(TD_IS_RUNNING(td), ("_sleep: curthread not running")); diff --git a/sys/sys/param.h b/sys/sys/param.h index f842b344e9f9..8864063e3d9b 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -246,7 +246,8 @@ #define PRIMASK 0x0ff #define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ #define PDROP 0x200 /* OR'd with pri to stop re-entry of interlock mutex */ -#define PRILASTFLAG 0x200 /* Last flag defined above */ +#define PNOLOCK 0x400 /* OR'd with pri to allow sleeping w/o a lock */ +#define PRILASTFLAG 0x400 /* Last flag defined above */ #define NZERO 0 /* default "nice" */ From owner-dev-commits-src-main@freebsd.org Thu Aug 5 22:51:58 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E153D66C29D; Thu, 5 Aug 2021 22:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgkPp5ygDz4cmC; Thu, 5 Aug 2021 22:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2C662285A; Thu, 5 Aug 2021 22:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175MpwDJ090874; Thu, 5 Aug 2021 22:51:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175MpwTC090873; Thu, 5 Aug 2021 22:51:58 GMT (envelope-from git) Date: Thu, 5 Aug 2021 22:51:58 GMT Message-Id: <202108052251.175MpwTC090873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 09066b98663d - main - ktls: Use the new PNOLOCK flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09066b98663d92f4d129bab25105805adf0abaf7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 22:51:59 -0000 The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=09066b98663d92f4d129bab25105805adf0abaf7 commit 09066b98663d92f4d129bab25105805adf0abaf7 Author: Andrew Gallatin AuthorDate: 2021-08-05 21:19:12 +0000 Commit: Andrew Gallatin CommitDate: 2021-08-05 21:19:12 +0000 ktls: Use the new PNOLOCK flag Use the new PNOLOCK flag to tsleep() to indicate that we are managing potential races, and don't need to sleep with a lock, or have a backstop timeout. Reviewed by: jhb Sponsored by: Netflix --- sys/kern/uipc_ktls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 47815c266667..1cc1f2e8b8c4 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -2240,7 +2240,7 @@ ktls_alloc_thread(void *ctx) nbufs = 0; for (;;) { atomic_store_int(&sc->running, 0); - tsleep_sbt(sc, PZERO, "waiting for work", SBT_MAX, SBT_1S, 0); + tsleep(sc, PZERO | PNOLOCK, "-", 0); atomic_store_int(&sc->running, 1); sc->wakeups++; if (nbufs != ktls_max_alloc) { From owner-dev-commits-src-main@freebsd.org Thu Aug 5 23:25:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41B2566C904; Thu, 5 Aug 2021 23:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ggl8f0xvvz4fkV; Thu, 5 Aug 2021 23:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04CBB2313B; Thu, 5 Aug 2021 23:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 175NPbqh035137; Thu, 5 Aug 2021 23:25:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175NPbZG035136; Thu, 5 Aug 2021 23:25:37 GMT (envelope-from git) Date: Thu, 5 Aug 2021 23:25:37 GMT Message-Id: <202108052325.175NPbZG035136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 739de953ecc1 - main - ktls: Move KERN_TLS ifdef to tcp_var.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 739de953ecc13afa930e2f55b7ee2a04e41e3519 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 23:25:38 -0000 The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=739de953ecc13afa930e2f55b7ee2a04e41e3519 commit 739de953ecc13afa930e2f55b7ee2a04e41e3519 Author: Andrew Gallatin AuthorDate: 2021-08-05 23:17:35 +0000 Commit: Andrew Gallatin CommitDate: 2021-08-05 23:17:35 +0000 ktls: Move KERN_TLS ifdef to tcp_var.h This allows us to remove stubs in ktls.h and allows us to sort the function prototypes. Reviewed by: jhb Sponsored by: Netflix --- sys/netinet/tcp_var.h | 6 +++--- sys/sys/ktls.h | 14 +++----------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 8cfd2c5417c2..64e954cf4ad5 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1144,8 +1144,6 @@ static inline void tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, uint8_t is_tlp, int hw_tls) { - uint64_t rexmit_percent; - if (is_tlp) { tp->t_sndtlppack++; tp->t_sndtlpbyte += len; @@ -1156,11 +1154,13 @@ tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, else tp->t_sndbytes += len; +#ifdef KERN_TLS if (hw_tls && is_rxt) { - rexmit_percent = (1000ULL * tp->t_snd_rxt_bytes) / (10ULL * (tp->t_snd_rxt_bytes + tp->t_sndbytes)); + uint64_t rexmit_percent = (1000ULL * tp->t_snd_rxt_bytes) / (10ULL * (tp->t_snd_rxt_bytes + tp->t_sndbytes)); if (rexmit_percent > ktls_ifnet_max_rexmit_pct) ktls_disable_ifnet(tp); } +#endif } #endif /* _KERNEL */ diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index a4156eb10395..437e36f965ea 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -197,7 +197,10 @@ struct ktls_session { bool disable_ifnet_pending; } __aligned(CACHE_LINE_SIZE); +extern unsigned int ktls_ifnet_max_rexmit_pct; + void ktls_check_rx(struct sockbuf *sb); +void ktls_disable_ifnet(void *arg); int ktls_enable_rx(struct socket *so, struct tls_enable *en); int ktls_enable_tx(struct socket *so, struct tls_enable *en); void ktls_destroy(struct ktls_session *tls); @@ -233,16 +236,5 @@ ktls_free(struct ktls_session *tls) ktls_destroy(tls); } -#ifdef KERN_TLS -extern unsigned int ktls_ifnet_max_rexmit_pct; -void ktls_disable_ifnet(void *arg); -#else -#define ktls_ifnet_max_rexmit_pct 1 -static inline void -ktls_disable_ifnet(void *arg __unused) -{ -} -#endif - #endif /* !_KERNEL */ #endif /* !_SYS_KTLS_H_ */ From owner-dev-commits-src-main@freebsd.org Thu Aug 5 23:58:45 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0393C66CCDB for ; Thu, 5 Aug 2021 23:58:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2p.ore.mailhop.org (outbound2p.ore.mailhop.org [54.187.218.212]) (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 4Ggltr3wm0z4hbk for ; Thu, 5 Aug 2021 23:58:44 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1628207923; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=gVrKL5P7eAIc0KHV8DYCfRTQ8xU2AEy1AhvoxHrhycYTz1c3m38v9tXSu0ChJyV0jA3CZJ1FajY7x v8LyQPubIuHGrRyKUJ0szUclnrau6jhPo6pAyOP31BSc9JGzh/kjIJqabuFQy1ruzMtuJBxrBYUGwe t/1VBhCH97XTC6M3ZuUFzNz0At6UnGwDoGabHgjzclu+5F/Dw0L+psnC41m352V6oh/1dM2li1UCMr ai6yJ6Xk9zao30n+f28RqFVdObYwlPnRNIfJ9w1PoeDNNr4Eb9x2dXmr7Qx9kxJ6ljbrxRIY382x5K MxSxeVFClW4W2Az9k5B3aRYhG1THCsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=l09YutvCLUy5HpLP3zWJgoK6psR+4zFElran31sxWt0=; b=hOPDBPx7poEjDdRTOhaYdcQDw4E0e+RtN3lR94LCZMh9zRwwDkfzOlIp6tLfHZP1pyTI+yOv5381/ +0bzoqCdNylN4ZFv7/OLBUBHlDaolPsIb3vzgVxPGTiByHWfNtsqpSlnfGjc1fbensa99Ecukgo2US KWtCXqkYraSVaJIYCp75XZbIQ0Ujn0xNjDYpY+XqlsHg6BbxB4a0Ii6eHruY56/W1uwTehS3WIwGWE 75TiSY2QAN/+gq/INYmCOiaQNo/1pvYaTO4+c/SsKUyOAE2ZETqp0whPR6ZECAMpNp0Jgii2bag48j GBdBPREWpXgA2fH9wheKx9a+YJkGyJQ== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=l09YutvCLUy5HpLP3zWJgoK6psR+4zFElran31sxWt0=; b=AzEevA0J5IkyLcsSHR9kRNrjpBSmzldVospuJifhA2TCacylD3zOosybYlod+b5Nj2cVmf1K+wnOw 46kQ5yehLWjT5GIcEgVfUTnwSwD1acLWJGO46vZJ162BKtnhx+JXba16i53guocHe8XaMo5Ivw/4Nq r9CZQbiLdDlcPDQwft//hPX89VBJzFuLAxJcXdVh/6DX5RHIPuPOsa/tCHSaukbMlV00qh4t4Nvt/u Xc5QihzggXYn3e7BMn2MCBF/Rp4jPlrEc8Sxfw5TB6LHZXqyMVBJoYxZpPkLAqBG+5Y5cj22rhckn/ MrR4+FpDDA5mF5vrm6GZIYCKUjmSR3A== X-Originating-IP: 67.177.211.60 X-MHO-RoutePath: aGlwcGll X-MHO-User: 0f529c41-f649-11eb-a658-89389772cfc7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 0f529c41-f649-11eb-a658-89389772cfc7; Thu, 05 Aug 2021 23:58:42 +0000 (UTC) Received: from [172.22.42.84] (rev2.hippie.lan [172.22.42.84]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 175Nwf0q086315; Thu, 5 Aug 2021 17:58:41 -0600 (MDT) (envelope-from ian@freebsd.org) X-Authentication-Warning: paranoia.hippie.lan: Host rev2.hippie.lan [172.22.42.84] claimed to be [172.22.42.84] Message-ID: Subject: Re: git: 09066b98663d - main - ktls: Use the new PNOLOCK flag From: Ian Lepore To: Andrew Gallatin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Date: Thu, 05 Aug 2021 17:58:41 -0600 In-Reply-To: <202108052251.175MpwTC090873@gitrepo.freebsd.org> References: <202108052251.175MpwTC090873@gitrepo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.3 FreeBSD GNOME Team MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Ggltr3wm0z4hbk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 23:58:45 -0000 On Thu, 2021-08-05 at 22:51 +0000, Andrew Gallatin wrote: > The branch main has been updated by gallatin: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=09066b98663d92f4d129bab25105805adf0abaf7 > > commit 09066b98663d92f4d129bab25105805adf0abaf7 > Author:     Andrew Gallatin > AuthorDate: 2021-08-05 21:19:12 +0000 > Commit:     Andrew Gallatin > CommitDate: 2021-08-05 21:19:12 +0000 > >     ktls: Use the new PNOLOCK flag >     >     Use the new PNOLOCK flag to tsleep() to indicate that >     we are managing potential races, and don't need to >     sleep with a lock, or have a backstop timeout. >     >     Reviewed by: jhb >     Sponsored by: Netflix > --- >  sys/kern/uipc_ktls.c | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c > index 47815c266667..1cc1f2e8b8c4 100644 > --- a/sys/kern/uipc_ktls.c > +++ b/sys/kern/uipc_ktls.c > @@ -2240,7 +2240,7 @@ ktls_alloc_thread(void *ctx) >         nbufs = 0; >         for (;;) { >                 atomic_store_int(&sc->running, 0); > -               tsleep_sbt(sc, PZERO, "waiting for work", SBT_MAX, > SBT_1S, 0); > +               tsleep(sc, PZERO | PNOLOCK, "-",  0); >                 atomic_store_int(&sc->running, 1); >                 sc->wakeups++; >                 if (nbufs != ktls_max_alloc) { I especially like this solution, it documents explicitly what you're doing and why. (Earlier I was considering mumbling something about "there should be a comment to say a sleep-forever is known safe here".) -- Ian From owner-dev-commits-src-main@freebsd.org Fri Aug 6 03:31:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 007D366F7A5; Fri, 6 Aug 2021 03:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ggrch6JLCz4vRY; Fri, 6 Aug 2021 03:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C086E263E0; Fri, 6 Aug 2021 03:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1763VmQ0066876; Fri, 6 Aug 2021 03:31:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1763Vmp2066875; Fri, 6 Aug 2021 03:31:48 GMT (envelope-from git) Date: Fri, 6 Aug 2021 03:31:48 GMT Message-Id: <202108060331.1763Vmp2066875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 645b46d379a0 - main - pkgbase: fix locale packages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 645b46d379a028b7a7b2c5a54ecfc1ab5a0b8936 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 03:31:49 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=645b46d379a028b7a7b2c5a54ecfc1ab5a0b8936 commit 645b46d379a028b7a7b2c5a54ecfc1ab5a0b8936 Author: Kyle Evans AuthorDate: 2021-08-05 18:37:18 +0000 Commit: Kyle Evans CommitDate: 2021-08-06 03:31:40 +0000 pkgbase: fix locale packages Most places spelled it -locales, but numericdef spelled it as -locale in just this one place. Pluralize it. Reviewed by: emaste, manu Fixes: 0fa5403d493b ("pkgbase: move locales into their own package") Differential Revision: https://reviews.freebsd.org/D31428 --- share/numericdef/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/numericdef/Makefile b/share/numericdef/Makefile index 90e2551570b5..12cc7dc68ab1 100644 --- a/share/numericdef/Makefile +++ b/share/numericdef/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -PACKAGE= locale +PACKAGE= locales LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_NUMERIC .SUFFIXES: .src .out From owner-dev-commits-src-main@freebsd.org Fri Aug 6 03:31:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 161E066F3FC; Fri, 6 Aug 2021 03:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ggrcj73Fyz4vgJ; Fri, 6 Aug 2021 03:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D87DD26656; Fri, 6 Aug 2021 03:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1763VnwS066900; Fri, 6 Aug 2021 03:31:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1763VncT066899; Fri, 6 Aug 2021 03:31:49 GMT (envelope-from git) Date: Fri, 6 Aug 2021 03:31:49 GMT Message-Id: <202108060331.1763VncT066899@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: b3e87f133454 - main - ctypedef: fix installation of C.UTF-8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3e87f1334547b15596a98c030c3d99278685aa5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 03:31:50 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b3e87f1334547b15596a98c030c3d99278685aa5 commit b3e87f1334547b15596a98c030c3d99278685aa5 Author: Kyle Evans AuthorDate: 2021-08-05 18:39:36 +0000 Commit: Kyle Evans CommitDate: 2021-08-06 03:31:40 +0000 ctypedef: fix installation of C.UTF-8 The appropriate directory and name were assigned to the FILESDIR grouping, but not the ALWAYS grouping where C.UTF-8 is actually assigned. Add the appropriate bits for ALWAYSDIR, and remove an obsolete *PACKAGE= assignment since C.UTF-8 is explicitly not included in FILES. Prior to this change, C.UTF-8 was being installed as /usr/share/C.UTF-8.LC_CTYPE. Reviewed by: manu Fixes: 0fa5403d493b ("pkgbase: move locales into their own package") Differential Revision: https://reviews.freebsd.org/D31429 --- ObsoleteFiles.inc | 3 +++ share/ctypedef/Makefile | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index d23562072214..99db0e591090 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -40,6 +40,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20210805: C.UTF-8 installed to the wrong location +OLD_FILES+=usr/share/C.UTF-8.LC_CTYPE + # 20210619: new clang import which bumps version from 12.0.0 to 12.0.1. OLD_FILES+=usr/lib/clang/12.0.0/include/cuda_wrappers/algorithm OLD_FILES+=usr/lib/clang/12.0.0/include/cuda_wrappers/complex diff --git a/share/ctypedef/Makefile b/share/ctypedef/Makefile index 912b4e6f4757..a717e94db5e6 100644 --- a/share/ctypedef/Makefile +++ b/share/ctypedef/Makefile @@ -5,6 +5,7 @@ FILESGROUPS= FILES ALWAYS ALWAYSPACKAGE= runtime LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_CTYPE +ALWAYSNAME= LC_CTYPE .SUFFIXES: .src .LC_CTYPE MAPLOC= ${.CURDIR}/../../tools/tools/locale/etc/final-maps @@ -231,7 +232,7 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.LC_CTYPE= ${LOCALEDIR}/${f} .endfor -FILESDIR_C.UTF-8.LC_CTYPEPACKAGE= runtime +ALWAYSDIR_C.UTF-8.LC_CTYPE= ${LOCALEDIR}/C.UTF-8 SYMPAIRS+= zh_CN.eucCN.src zh_CN.GB18030.src SYMPAIRS+= zh_CN.eucCN.src zh_CN.GB2312.src From owner-dev-commits-src-main@freebsd.org Fri Aug 6 09:09:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6203665229E; Fri, 6 Aug 2021 09:09:55 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 4Gh06q1d8Wz3n28; Fri, 6 Aug 2021 09:09:55 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 198FF260206; Fri, 6 Aug 2021 11:09:54 +0200 (CEST) Subject: Re: git: 09066b98663d - main - ktls: Use the new PNOLOCK flag To: Ian Lepore , Andrew Gallatin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202108052251.175MpwTC090873@gitrepo.freebsd.org> From: Hans Petter Selasky Message-ID: <18ed8e5f-d042-478b-e18c-dd0de7affcae@selasky.org> Date: Fri, 6 Aug 2021 11:09:43 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Gh06q1d8Wz3n28 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 09:09:55 -0000 On 8/6/21 1:58 AM, Ian Lepore wrote: > I especially like this solution, it documents explicitly what you're > doing and why. (Earlier I was considering mumbling something about > "there should be a comment to say a sleep-forever is known safe here".) Hi, MPSAFE is the word to use, like with other things related to GIANT? PNOLOCK -> PMPSAFE ?? --HPS From owner-dev-commits-src-main@freebsd.org Fri Aug 6 09:30:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AA796524F7; Fri, 6 Aug 2021 09:30:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gh0ZP75dqz3pBZ; Fri, 6 Aug 2021 09:30:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB94328FC; Fri, 6 Aug 2021 09:30:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1769ULR1044067; Fri, 6 Aug 2021 09:30:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1769UL5I044061; Fri, 6 Aug 2021 09:30:21 GMT (envelope-from git) Date: Fri, 6 Aug 2021 09:30:21 GMT Message-Id: <202108060930.1769UL5I044061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 132fca633593 - main - sound(4): Fix typos. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 132fca6335939b308f230d4942ba15ba2b56ceb7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 09:30:22 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=132fca6335939b308f230d4942ba15ba2b56ceb7 commit 132fca6335939b308f230d4942ba15ba2b56ceb7 Author: Hans Petter Selasky AuthorDate: 2021-07-28 11:25:01 +0000 Commit: Hans Petter Selasky CommitDate: 2021-08-06 09:28:43 +0000 sound(4): Fix typos. Submitted by: Christos Margiolis Differential Revision: https://reviews.freebsd.org/D31320 MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/sound/pcm/sound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 299e4937f8e4..e03529f00b78 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -1020,7 +1020,7 @@ pcm_sysinit(device_t dev) { struct snddev_info *d = device_get_softc(dev); - /* XXX: an user should be able to set this with a control tool, the + /* XXX: a user should be able to set this with a control tool, the sysadmin then needs min+max sysctls for this */ SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -1133,7 +1133,7 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec) sysctl_ctx_init(&d->rec_sysctl_ctx); d->rec_sysctl_tree = SYSCTL_ADD_NODE(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rec", - CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "record channels node"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "recording channels node"); if (numplay > 0 || numrec > 0) d->flags |= SD_F_AUTOVCHAN; From owner-dev-commits-src-main@freebsd.org Fri Aug 6 09:30:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48C55652AD1; Fri, 6 Aug 2021 09:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gh0ZR16SNz3pHl; Fri, 6 Aug 2021 09:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D6C32BFA; Fri, 6 Aug 2021 09:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1769UMij044204; Fri, 6 Aug 2021 09:30:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1769UMaO044203; Fri, 6 Aug 2021 09:30:22 GMT (envelope-from git) Date: Fri, 6 Aug 2021 09:30:22 GMT Message-Id: <202108060930.1769UMaO044203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: ed2196e5df0c - main - sound(4): Implement playback and recording mode sysctl(8). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed2196e5df0c8b5b81563d2fffdcb32bb7ebe966 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 09:30:23 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ed2196e5df0c8b5b81563d2fffdcb32bb7ebe966 commit ed2196e5df0c8b5b81563d2fffdcb32bb7ebe966 Author: Hans Petter Selasky AuthorDate: 2021-07-28 11:22:52 +0000 Commit: Hans Petter Selasky CommitDate: 2021-08-06 09:28:44 +0000 sound(4): Implement playback and recording mode sysctl(8). The dev.pcm..mode sysctl(8) gives information if a sound device supports hardware mixing, playback or recording. Submitted by: Christos Margiolis Differential Revision: https://reviews.freebsd.org/D31320 MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/sound/pcm/sound.c | 23 +++++++++++++++++++++++ sys/dev/sound/pcm/sound.h | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index e03529f00b78..663ec84f93b6 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -1015,10 +1015,28 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, clone_gc, "global clone garbage collector"); #endif +static u_int8_t +pcm_mode_init(struct snddev_info *d) +{ + u_int8_t mode = 0; + + if (d->playcount > 0) + mode |= PCM_MODE_PLAY; + if (d->reccount > 0) + mode |= PCM_MODE_REC; + if (d->mixer_dev != NULL) + mode |= PCM_MODE_MIXER; + + return (mode); +} + static void pcm_sysinit(device_t dev) { struct snddev_info *d = device_get_softc(dev); + u_int8_t mode; + + mode = pcm_mode_init(d); /* XXX: a user should be able to set this with a control tool, the sysadmin then needs min+max sysctls for this */ @@ -1030,6 +1048,11 @@ pcm_sysinit(device_t dev) "bitperfect", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, d, sizeof(d), sysctl_dev_pcm_bitperfect, "I", "bit-perfect playback/recording (0=disable, 1=enable)"); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "mode", CTLFLAG_RD, NULL, mode, + "mode (1=mixer, 2=play, 4=rec. The values are OR'ed if more than one" + "mode is supported)"); #ifdef SND_DEBUG SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 7b4a4d3a46ca..7c664524211a 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -412,6 +412,10 @@ struct snddev_info { void sound_oss_sysinfo(oss_sysinfo *); int sound_oss_card_info(oss_card_info *); +#define PCM_MODE_MIXER 0x01 +#define PCM_MODE_PLAY 0x02 +#define PCM_MODE_REC 0x04 + #define PCM_LOCKOWNED(d) mtx_owned((d)->lock) #define PCM_LOCK(d) mtx_lock((d)->lock) #define PCM_UNLOCK(d) mtx_unlock((d)->lock) From owner-dev-commits-src-main@freebsd.org Fri Aug 6 09:30:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 856A9652ADA; Fri, 6 Aug 2021 09:30:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gh0ZS1s1vz3pW7; Fri, 6 Aug 2021 09:30:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 265B53223; Fri, 6 Aug 2021 09:30:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1769UOxD044228; Fri, 6 Aug 2021 09:30:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1769UOLC044227; Fri, 6 Aug 2021 09:30:24 GMT (envelope-from git) Date: Fri, 6 Aug 2021 09:30:24 GMT Message-Id: <202108060930.1769UOLC044227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: bb5cd80e8b42 - main - Update the TCP LRO code to handle both encrypted and un-encrypted traffic. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb5cd80e8b42b31a2229077a7e93ffd3585eeb78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 09:30:24 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=bb5cd80e8b42b31a2229077a7e93ffd3585eeb78 commit bb5cd80e8b42b31a2229077a7e93ffd3585eeb78 Author: Hans Petter Selasky AuthorDate: 2021-08-02 09:53:12 +0000 Commit: Hans Petter Selasky CommitDate: 2021-08-06 09:28:44 +0000 Update the TCP LRO code to handle both encrypted and un-encrypted traffic. Encrypted and un-encrypted traffic needs to be coalesced separately. Split the 16-bit lro_type field in the address information into two 8-bit fields, and then use the last 8-bit field for flags, which among other indicate if the received mbuf is encrypted or un-encrypted. Differential Revision: https://reviews.freebsd.org/D31377 Reviewed by: gallatin MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/netinet/tcp_lro.c | 5 ++++- sys/netinet/tcp_lro.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index f0a996f685c3..cb548d457bb3 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -394,6 +394,9 @@ tcp_lro_parser(struct mbuf *m, struct lro_parser *po, struct lro_parser *pi, boo po->data.vlan_id = htons(m->m_pkthdr.ether_vtag) & htons(EVL_VLID_MASK); } + /* Store decrypted flag, if any. */ + if (__predict_false(m->m_flags & M_DECRYPTED)) + po->data.lro_flags |= LRO_FLAG_DECRYPTED; } switch (po->data.lro_type) { @@ -1583,7 +1586,7 @@ do_bpf_strip_and_compress(struct inpcb *inp, struct lro_ctrl *lc, uint32_t *ts_ptr; int32_t n_mbuf; bool other_opts, can_compress; - uint16_t lro_type; + uint8_t lro_type; uint16_t iptos; int tcp_hdr_offset; int idx; diff --git a/sys/netinet/tcp_lro.h b/sys/netinet/tcp_lro.h index 75ab78c7fc6f..3eefd4f0537c 100644 --- a/sys/netinet/tcp_lro.h +++ b/sys/netinet/tcp_lro.h @@ -67,12 +67,14 @@ struct inpcb; union lro_address { u_long raw[1]; struct { - uint16_t lro_type; /* internal */ + uint8_t lro_type; /* internal */ #define LRO_TYPE_NONE 0 #define LRO_TYPE_IPV4_TCP 1 #define LRO_TYPE_IPV6_TCP 2 #define LRO_TYPE_IPV4_UDP 3 #define LRO_TYPE_IPV6_UDP 4 + uint8_t lro_flags; +#define LRO_FLAG_DECRYPTED 1 uint16_t vlan_id; /* VLAN identifier */ uint16_t s_port; /* source TCP/UDP port */ uint16_t d_port; /* destination TCP/UDP port */ From owner-dev-commits-src-main@freebsd.org Fri Aug 6 10:00:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0082652BCB; Fri, 6 Aug 2021 10:00:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gh1Fd5b5Xz3sq2; Fri, 6 Aug 2021 10:00:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7E7B3464; Fri, 6 Aug 2021 10:00:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176A0raH085618; Fri, 6 Aug 2021 10:00:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176A0r7R085617; Fri, 6 Aug 2021 10:00:53 GMT (envelope-from git) Date: Fri, 6 Aug 2021 10:00:53 GMT Message-Id: <202108061000.176A0r7R085617@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: d477a7feed17 - main - Fix panic in IPv6 multicast code. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d477a7feed177d0ad5c12bc6e2cce804d427ed38 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 10:00:53 -0000 The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=d477a7feed177d0ad5c12bc6e2cce804d427ed38 commit d477a7feed177d0ad5c12bc6e2cce804d427ed38 Author: Andrey V. Elsukov AuthorDate: 2021-08-05 08:51:46 +0000 Commit: Andrey V. Elsukov CommitDate: 2021-08-06 09:57:59 +0000 Fix panic in IPv6 multicast code. Add check that ifp supports IPv6 multicasts in in6_getmulti. This fixes panic when user application tries to join into multicast group on an interface that doesn't support IPv6 multicasts, like IFT_PFLOG interfaces. PR: 257302 Reviewed by: melifaro MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31420 --- sys/netinet6/in6_mcast.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c index 0744a1178fc7..7326befc6d01 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -374,9 +374,18 @@ in6_getmulti(struct ifnet *ifp, const struct in6_addr *group, IN6_MULTI_LIST_LOCK(); IF_ADDR_WLOCK(ifp); NET_EPOCH_ENTER(et); - inm = in6m_lookup_locked(ifp, group); + /* + * Does ifp support IPv6 multicasts? + */ + if (ifp->if_afdata[AF_INET6] == NULL) + error = ENODEV; + else + inm = in6m_lookup_locked(ifp, group); NET_EPOCH_EXIT(et); + if (error != 0) + goto out_locked; + if (inm != NULL) { /* * If we already joined this group, just bump the From owner-dev-commits-src-main@freebsd.org Fri Aug 6 12:38:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B6F065526D; Fri, 6 Aug 2021 12:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gh4ky2vsjz4YDP; Fri, 6 Aug 2021 12:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4845058EE; Fri, 6 Aug 2021 12:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176Cc2nL092202; Fri, 6 Aug 2021 12:38:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176Cc2D2092201; Fri, 6 Aug 2021 12:38:02 GMT (envelope-from git) Date: Fri, 6 Aug 2021 12:38:02 GMT Message-Id: <202108061238.176Cc2D2092201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: e06b8f112803 - main - pkgbase: Add nfsiod to the FreeBSD-nfs package MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e06b8f11280397d7fdaa27d8d6f8eec9e4c707b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 12:38:02 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=e06b8f11280397d7fdaa27d8d6f8eec9e4c707b3 commit e06b8f11280397d7fdaa27d8d6f8eec9e4c707b3 Author: Emmanuel Vadot AuthorDate: 2021-08-05 16:17:34 +0000 Commit: Emmanuel Vadot CommitDate: 2021-08-06 12:37:35 +0000 pkgbase: Add nfsiod to the FreeBSD-nfs package Missed in 081fb644925f --- sbin/nfsiod/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/nfsiod/Makefile b/sbin/nfsiod/Makefile index 47cd290ec78e..912dd19e25cb 100644 --- a/sbin/nfsiod/Makefile +++ b/sbin/nfsiod/Makefile @@ -4,4 +4,6 @@ PROG= nfsiod MAN= nfsiod.8 +PACKAGE= nfs + .include From owner-dev-commits-src-main@freebsd.org Fri Aug 6 12:38:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A310965526E; Fri, 6 Aug 2021 12:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gh4kz3qNrz4YDQ; Fri, 6 Aug 2021 12:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60DA55BC9; Fri, 6 Aug 2021 12:38:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176Cc3Wv092226; Fri, 6 Aug 2021 12:38:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176Cc30B092225; Fri, 6 Aug 2021 12:38:03 GMT (envelope-from git) Date: Fri, 6 Aug 2021 12:38:03 GMT Message-Id: <202108061238.176Cc30B092225@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 86c71e97d19f - main - pkgbase: locales: Also tag the files dir MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86c71e97d19f8b82b8ab79a56b20998ada7ee868 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 12:38:03 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=86c71e97d19f8b82b8ab79a56b20998ada7ee868 commit 86c71e97d19f8b82b8ab79a56b20998ada7ee868 Author: Emmanuel Vadot AuthorDate: 2021-08-06 12:36:06 +0000 Commit: Emmanuel Vadot CommitDate: 2021-08-06 12:37:45 +0000 pkgbase: locales: Also tag the files dir Otherwise bsd.dirs.mk will create the directory with the default package (utilities) and we end up with a bunch of empty dirs managed by this package while it shouldn't be the case. --- share/colldef/Makefile | 3 +++ share/colldef_unicode/Makefile | 2 ++ share/ctypedef/Makefile | 1 + share/monetdef/Makefile | 1 + share/monetdef_unicode/Makefile | 1 + share/msgdef/Makefile | 1 + share/msgdef_unicode/Makefile | 1 + share/numericdef/Makefile | 1 + share/numericdef_unicode/Makefile | 1 + share/timedef/Makefile | 1 + 10 files changed, 13 insertions(+) diff --git a/share/colldef/Makefile b/share/colldef/Makefile index f7e24446342d..5d94c6e77736 100644 --- a/share/colldef/Makefile +++ b/share/colldef/Makefile @@ -136,6 +136,7 @@ CLEANFILES= ${FILES} .for f t in ${SAME} DIRS+= LOCALEDIR_$t +LOCALEDIR_${t}PACKAGE= locales LOCALEDIR_$t= ${LOCALEDIR}/$t SYMLINKS+= ../$f/${FILESNAME} \ ${LOCALEDIR}/$t/${FILESNAME} @@ -143,11 +144,13 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.LC_COLLATE= ${LOCALEDIR}/${f} +FILESDIR_${f}.LC_COLLATEPACKAGE= locales .endfor .for f t in ${LOCALES_MAPPED} FILES+= $t.LC_COLLATE FILESDIR_$t.LC_COLLATE= ${LOCALEDIR}/$t +FILESDIR_${t}.LC_COLLATEPACKAGE= locales $t.LC_COLLATE: ${.CURDIR}/$f.src localedef ${LOCALEDEF_ENDIAN} -D -U -i ${.ALLSRC} \ -V ${CLDR_VERSION} \ diff --git a/share/colldef_unicode/Makefile b/share/colldef_unicode/Makefile index f76a7a94805c..0c1b0488b86d 100644 --- a/share/colldef_unicode/Makefile +++ b/share/colldef_unicode/Makefile @@ -115,11 +115,13 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.LC_COLLATE= ${LOCALEDIR}/${f} +FILESDIR_${f}.LC_COLLATEPACKAGE= locales .endfor .for f t in ${LOCALES_MAPPED} FILES+= $t.LC_COLLATE FILESDIR_$t.LC_COLLATE= ${LOCALEDIR}/$t +FILESDIR_$t.LC_COLLATEPACKAGE= locales $t.LC_COLLATE: ${.CURDIR}/$f.src localedef ${LOCALEDEF_ENDIAN} -D -U -i ${.ALLSRC} \ -V ${CLDR_VERSION} \ diff --git a/share/ctypedef/Makefile b/share/ctypedef/Makefile index a717e94db5e6..798576f7ad08 100644 --- a/share/ctypedef/Makefile +++ b/share/ctypedef/Makefile @@ -231,6 +231,7 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.LC_CTYPE= ${LOCALEDIR}/${f} +FILESDIR_${f}.LC_CTYPEPACKAGE= locales .endfor ALWAYSDIR_C.UTF-8.LC_CTYPE= ${LOCALEDIR}/C.UTF-8 diff --git a/share/monetdef/Makefile b/share/monetdef/Makefile index dd1732bd87c6..4e62cbf4b5e3 100644 --- a/share/monetdef/Makefile +++ b/share/monetdef/Makefile @@ -140,6 +140,7 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.out= ${LOCALEDIR}/${f} +FILESDIR_${f}.outPACKAGE= locales .endfor .include diff --git a/share/monetdef_unicode/Makefile b/share/monetdef_unicode/Makefile index 2ab442ad51b4..4e4d9a6c1a40 100644 --- a/share/monetdef_unicode/Makefile +++ b/share/monetdef_unicode/Makefile @@ -107,6 +107,7 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.out= ${LOCALEDIR}/${f} +FILESDIR_${f}.outPACKAGE= locales .endfor .include diff --git a/share/msgdef/Makefile b/share/msgdef/Makefile index 4cc6a45b46c6..f77f9c0758e0 100644 --- a/share/msgdef/Makefile +++ b/share/msgdef/Makefile @@ -133,6 +133,7 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.out= ${LOCALEDIR}/${f} +FILESDIR_${f}.outPACKAGE= locales .endfor .include diff --git a/share/msgdef_unicode/Makefile b/share/msgdef_unicode/Makefile index 608ba8860afb..78f581608218 100644 --- a/share/msgdef_unicode/Makefile +++ b/share/msgdef_unicode/Makefile @@ -107,6 +107,7 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.out= ${LOCALEDIR}/${f} +FILESDIR_${f}.outPACKAGE= locales .endfor .include diff --git a/share/numericdef/Makefile b/share/numericdef/Makefile index 12cc7dc68ab1..2890978237b3 100644 --- a/share/numericdef/Makefile +++ b/share/numericdef/Makefile @@ -136,6 +136,7 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.out= ${LOCALEDIR}/${f} +FILESDIR_${f}.outPACKAGE= locales .endfor .include diff --git a/share/numericdef_unicode/Makefile b/share/numericdef_unicode/Makefile index 6b7af4799efe..e8c72ac5f6bc 100644 --- a/share/numericdef_unicode/Makefile +++ b/share/numericdef_unicode/Makefile @@ -107,6 +107,7 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.out= ${LOCALEDIR}/${f} +FILESDIR_${f}.outPACKAGE= locales .endfor .include diff --git a/share/timedef/Makefile b/share/timedef/Makefile index c33461ff36bd..af0cd2ea378f 100644 --- a/share/timedef/Makefile +++ b/share/timedef/Makefile @@ -219,6 +219,7 @@ SYMLINKS+= ../$f/${FILESNAME} \ .for f in ${LOCALES} FILESDIR_${f}.out= ${LOCALEDIR}/${f} +FILESDIR_${f}.outPACKAGE= locales .endfor .include From owner-dev-commits-src-main@freebsd.org Fri Aug 6 13:21:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60537656725; Fri, 6 Aug 2021 13:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gh5jN2BhCz4bcH; Fri, 6 Aug 2021 13:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33A2C64EA; Fri, 6 Aug 2021 13:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176DLiUa059482; Fri, 6 Aug 2021 13:21:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176DLihO059481; Fri, 6 Aug 2021 13:21:44 GMT (envelope-from git) Date: Fri, 6 Aug 2021 13:21:44 GMT Message-Id: <202108061321.176DLihO059481@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: b542c9e42ba4 - main - modules: felix: Add needed dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b542c9e42ba404b12facf2a51b4c2504bb14eab9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 13:21:44 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=b542c9e42ba404b12facf2a51b4c2504bb14eab9 commit b542c9e42ba404b12facf2a51b4c2504bb14eab9 Author: Emmanuel Vadot AuthorDate: 2021-08-06 13:20:06 +0000 Commit: Emmanuel Vadot CommitDate: 2021-08-06 13:21:31 +0000 modules: felix: Add needed dependencies Modules should list all needed _if dependencies in their makefile otherwise if one compiles a kernel that didn't compile those files the module won't build. Fixes: 451bcf1b3601 --- sys/modules/felix/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/felix/Makefile b/sys/modules/felix/Makefile index cfe36a58c3dc..47747ffaa11e 100644 --- a/sys/modules/felix/Makefile +++ b/sys/modules/felix/Makefile @@ -29,6 +29,6 @@ .PATH: ${SRCTOP}/sys/dev/etherswitch/felix KMOD = felix -SRCS = felix.c +SRCS = felix.c etherswitch_if.c etherswitch_if.h .include From owner-dev-commits-src-main@freebsd.org Fri Aug 6 13:35:47 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 356AB656B5C; Fri, 6 Aug 2021 13:35:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gh61b0zwrz4bkC; Fri, 6 Aug 2021 13:35:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A11B6B36; Fri, 6 Aug 2021 13:35:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176DZkQo073844; Fri, 6 Aug 2021 13:35:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176DZkKr073843; Fri, 6 Aug 2021 13:35:46 GMT (envelope-from git) Date: Fri, 6 Aug 2021 13:35:46 GMT Message-Id: <202108061335.176DZkKr073843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jung-uk Kim Subject: git: 362fef2f4a99 - main - bsd.cpu.mk: add support for x86-64-v[234] levels as CPUTYPE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 362fef2f4a9954c0f5eeecbe512cc5abbdc44263 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 13:35:47 -0000 The branch main has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=362fef2f4a9954c0f5eeecbe512cc5abbdc44263 commit 362fef2f4a9954c0f5eeecbe512cc5abbdc44263 Author: Greg V AuthorDate: 2021-08-06 13:33:37 +0000 Commit: Jung-uk Kim CommitDate: 2021-08-06 13:33:37 +0000 bsd.cpu.mk: add support for x86-64-v[234] levels as CPUTYPE These are supported in LLVM 12 and GCC 11: https://github.com/llvm/llvm-project/commit/012dd42e027e https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=324bec558e95584e8c1997575ae9d75978af59f1 Differential Revision: https://reviews.freebsd.org/D29150 --- share/mk/bsd.cpu.mk | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 81a1f0f0dd32..f269bb110ed7 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -194,16 +194,19 @@ MACHINE_CPU = k5 i586 ${CPUTYPE} == "cooperlake" || ${CPUTYPE} == "cascadelake" || \ ${CPUTYPE} == "icelake-server" || ${CPUTYPE} == "icelake-client" || \ ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \ - ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" + ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" || \ + ${CPUTYPE} == "x86-64-v4" MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "alderlake" || ${CPUTYPE} == "skylake" || \ - ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell" + ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell" || \ + ${CPUTYPE} == "x86-64-v3" MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "tremont" || ${CPUTYPE} == "goldmont-plus" || \ ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \ - ${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont" + ${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont" || \ + ${CPUTYPE} == "x86-64-v2" MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "penryn" MACHINE_CPU = sse41 ssse3 sse3 sse2 sse i686 mmx i586 @@ -212,7 +215,7 @@ MACHINE_CPU = ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "yonah" || ${CPUTYPE} == "prescott" MACHINE_CPU = sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || \ - ${CPUTYPE} == "pentium-m" + ${CPUTYPE} == "pentium-m" || ${CPUTYPE} == "x86-64" MACHINE_CPU = sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m" MACHINE_CPU = sse i686 mmx i586 @@ -262,16 +265,19 @@ MACHINE_CPU = k8 3dnow ${CPUTYPE} == "cooperlake" || ${CPUTYPE} == "cascadelake" || \ ${CPUTYPE} == "icelake-server" || ${CPUTYPE} == "icelake-client" || \ ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \ - ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" + ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" || \ + ${CPUTYPE} == "x86-64-v4" MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "alderlake" || ${CPUTYPE} == "skylake" || \ - ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell" + ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell" || \ + ${CPUTYPE} == "x86-64-v3" MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "tremont" || ${CPUTYPE} == "goldmont-plus" || \ ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \ - ${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont" + ${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont" || \ + ${CPUTYPE} == "x86-64-v2" MACHINE_CPU = sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "penryn" MACHINE_CPU = sse41 ssse3 sse3 From owner-dev-commits-src-main@freebsd.org Fri Aug 6 15:00:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10DE2657DED; Fri, 6 Aug 2021 15:00:41 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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 (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gh7vX5gcnz4k92; Fri, 6 Aug 2021 15:00:40 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 176F0dQM016686 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 6 Aug 2021 08:00:39 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 176F0dwM016685; Fri, 6 Aug 2021 08:00:39 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 6 Aug 2021 08:00:39 -0700 From: Gleb Smirnoff To: Lutz Donnerhacke Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 25392fac9488 - main - libalias: Fix splay comparsion bug Message-ID: References: <202107022232.162MWUIY049889@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202107022232.162MWUIY049889@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4Gh7vX5gcnz4k92 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 15:00:41 -0000 Lutz, Wouldn't declaring 'i' to u_short fix the root of the problem? On Fri, Jul 02, 2021 at 10:32:30PM +0000, Lutz Donnerhacke wrote: L> The branch main has been updated by donner: L> L> URL: https://cgit.FreeBSD.org/src/commit/?id=25392fac9488bcae5c451500df2e2945430484a6 L> L> commit 25392fac9488bcae5c451500df2e2945430484a6 L> Author: Lutz Donnerhacke L> AuthorDate: 2021-07-02 21:41:25 +0000 L> Commit: Lutz Donnerhacke L> CommitDate: 2021-07-02 22:31:53 +0000 L> L> libalias: Fix splay comparsion bug L> L> Comparing elements in a tree requires transitiviy. If a < b and b < c L> then a must be smaller than c. This way the tree elements are always L> pairwise comparable. L> L> Tristate comparsion functions returning values lower, equal, or L> greater than zero, are usually implemented by a simple subtraction of L> the operands. If the size of the operands are equal to the size of L> the result, integer modular arithmetics kick in and violates the L> transitivity. L> L> Example: L> Working on byte with 0, 120, and 240. Now computing the differences: L> 120 - 0 = 120 L> 240 - 120 = 120 L> 240 - 0 = -16 L> L> MFC after: 3 days L> sys/netinet/libalias/alias_db.h | 13 +++++++------ L> 1 file changed, 7 insertions(+), 6 deletions(-) L> L> diff --git a/sys/netinet/libalias/alias_db.h b/sys/netinet/libalias/alias_db.h L> index ec0b69c01f82..971ca305c1a6 100644 L> --- a/sys/netinet/libalias/alias_db.h L> +++ b/sys/netinet/libalias/alias_db.h L> @@ -351,10 +351,10 @@ static inline int L> cmp_out(struct alias_link *a, struct alias_link *b) { L> int i = a->src_port - b->src_port; L> if (i != 0) return (i); L> - i = a->src_addr.s_addr - b->src_addr.s_addr; L> - if (i != 0) return (i); L> - i = a->dst_addr.s_addr - b->dst_addr.s_addr; L> - if (i != 0) return (i); L> + if (a->src_addr.s_addr > b->src_addr.s_addr) return (1); L> + if (a->src_addr.s_addr < b->src_addr.s_addr) return (-1); L> + if (a->dst_addr.s_addr > b->dst_addr.s_addr) return (1); L> + if (a->dst_addr.s_addr < b->dst_addr.s_addr) return (-1); L> i = a->dst_port - b->dst_port; L> if (i != 0) return (i); L> i = a->link_type - b->link_type; L> @@ -368,8 +368,9 @@ cmp_in(struct group_in *a, struct group_in *b) { L> if (i != 0) return (i); L> i = a->link_type - b->link_type; L> if (i != 0) return (i); L> - i = a->alias_addr.s_addr - b->alias_addr.s_addr; L> - return (i); L> + if (a->alias_addr.s_addr > b->alias_addr.s_addr) return (1); L> + if (a->alias_addr.s_addr < b->alias_addr.s_addr) return (-1); L> + return (0); L> } L> SPLAY_PROTOTYPE(splay_in, group_in, in, cmp_in); L> -- Gleb Smirnoff From owner-dev-commits-src-main@freebsd.org Fri Aug 6 15:08:55 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5C0A65848E; Fri, 6 Aug 2021 15:08:55 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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 (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gh8533f74z4kg6; Fri, 6 Aug 2021 15:08:55 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 176F8seC016705 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 6 Aug 2021 08:08:54 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 176F8qm1016704; Fri, 6 Aug 2021 08:08:52 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 6 Aug 2021 08:08:52 -0700 From: Gleb Smirnoff To: Lutz Donnerhacke Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 2f4d91f9cb22 - main - libalias: Rewrite HISTORY Message-ID: References: <202107041549.164Fn2Ga030801@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202107041549.164Fn2Ga030801@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4Gh8533f74z4kg6 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 15:08:55 -0000 Lutz, I think something should go between these two entries: Version 3.2: July, 2000 (Erik Salander, erik@whistle.com and Version 3.3: May 2021 (donner) At least porting to kernel by me and modularization by Paolo Pisati. These are substantial changes. On Sun, Jul 04, 2021 at 03:49:02PM +0000, Lutz Donnerhacke wrote: L> The branch main has been updated by donner: L> L> URL: https://cgit.FreeBSD.org/src/commit/?id=2f4d91f9cb22fc65eb65407e8118b433a5d71976 L> L> commit 2f4d91f9cb22fc65eb65407e8118b433a5d71976 L> Author: Lutz Donnerhacke L> AuthorDate: 2021-07-04 15:46:47 +0000 L> Commit: Lutz Donnerhacke L> CommitDate: 2021-07-04 15:46:47 +0000 L> L> libalias: Rewrite HISTORY L> L> Fix the history entry (wrong year) and add the missing recent work. L> MFC together with the other patches. L> L> MFC after: 2 days L> --- L> sys/netinet/libalias/HISTORY | 5 +++-- L> 1 file changed, 3 insertions(+), 2 deletions(-) L> L> diff --git a/sys/netinet/libalias/HISTORY b/sys/netinet/libalias/HISTORY L> index 04427be17b39..87d5b6f8ed76 100644 L> --- a/sys/netinet/libalias/HISTORY L> +++ b/sys/netinet/libalias/HISTORY L> @@ -144,6 +144,7 @@ Version 3.2: July, 2000 (Erik Salander, erik@whistle.com and L> Junichi Satoh, junichi@junichi.org) L> - Added support for streaming media (RTSP and PNA) aliasing. L> L> -Version 3.3: May 2020 (donner) L> +Version 3.3: May 2021 (donner) L> - Dropped LibAliasCheckNewLink L> - - Refactor the database handling, perfomance improvements. L> + - Refactor the database handling L> + - Switch to more effienct SPLAY trees L> _______________________________________________ L> dev-commits-src-all@freebsd.org mailing list L> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all L> To unsubscribe, send any mail to "dev-commits-src-all-unsubscribe@freebsd.org" -- Gleb Smirnoff From owner-dev-commits-src-main@freebsd.org Fri Aug 6 16:39:11 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBBD76593B9; Fri, 6 Aug 2021 16:39:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhB5C4mSTz4qrK; Fri, 6 Aug 2021 16:39:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D47611069; Fri, 6 Aug 2021 16:39:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176GdBqk016073; Fri, 6 Aug 2021 16:39:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176GdBca016072; Fri, 6 Aug 2021 16:39:11 GMT (envelope-from git) Date: Fri, 6 Aug 2021 16:39:11 GMT Message-Id: <202108061639.176GdBca016072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Fernando Apestegu=C3=ADa?= Subject: git: e6379a2c9546 - main - man: Install more man pages unconditionally MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6379a2c954698be466f5b4481a924b3a0074cb4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 16:39:11 -0000 The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e6379a2c954698be466f5b4481a924b3a0074cb4 commit e6379a2c954698be466f5b4481a924b3a0074cb4 Author: Fernando ApesteguĂ­a AuthorDate: 2021-08-06 16:33:31 +0000 Commit: Fernando ApesteguĂ­a CommitDate: 2021-08-06 16:34:07 +0000 man: Install more man pages unconditionally Add more manual pages which were not spotted previously in 0a0f7486413c Ideally to be MFH'ed with: 8539518055d0 - Remove manpages from OLD_FILES 8b487b8292e4 - Fix bsd.subdir.mk-related issues after 0a0f7486413c f6043a672135 - ObsoleteFiles.inc: Remove manpages from OLD_FILES 0a0f7486413c - man: Build manpages for all architectures There is at least one pending issue when building with -DNO_ROOT. Reported by: ceri@ MFH: 4 weeks Discussed with: wosch Differential Revision: https://reviews.freebsd.org/D31018 --- share/man/man5/Makefile | 4 ++-- share/man/man8/Makefile | 4 ++-- share/man/man9/Makefile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile index 2083993b0795..e1b765346689 100644 --- a/share/man/man5/Makefile +++ b/share/man/man5/Makefile @@ -107,8 +107,8 @@ MAN+= pf.conf.5 \ pf.os.5 .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +# This makes more sense for amd64 and i386 but +# we decide to install all manpages in all architectures _boot.config.5= boot.config.5 -.endif .include diff --git a/share/man/man8/Makefile b/share/man/man8/Makefile index 1e61c79d12b9..1257f3ab97bf 100644 --- a/share/man/man8/Makefile +++ b/share/man/man8/Makefile @@ -35,10 +35,10 @@ MLINKS+=yp.8 NIS.8 \ yp.8 YP.8 .endif -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" +# This makes more sense for aarch 64 and amd64 +# we decide to install all manpages in all architectures _uefi.8= uefi.8 MLINKS+=uefi.8 efi.8 -.endif .include diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index b2f1451a79d7..d6650a2538f7 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -2398,7 +2398,8 @@ MLINKS+=zone.9 uma.9 \ zone.9 uma_zone_set_warning.9 \ zone.9 uma_zsecond_create.9 -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +# This makes more sense for amd64 and i386 but +# we decide to install all manpages in all architectures _superio.9= superio.9 MLINKS+=superio.9 superio_devid.9 \ superio.9 superio_dev_disable.9 \ @@ -2415,6 +2416,5 @@ MLINKS+=superio.9 superio_devid.9 \ superio.9 superio_revid.9 \ superio.9 superio_vendor.9 \ superio.9 superio_write.9 -.endif .include From owner-dev-commits-src-main@freebsd.org Fri Aug 6 16:44:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB503659341; Fri, 6 Aug 2021 16:44:16 +0000 (UTC) (envelope-from rob.fx907@gmail.com) Received: from mail-oo1-xc34.google.com (mail-oo1-xc34.google.com [IPv6:2607:f8b0:4864:20::c34]) (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 4GhBC43x18z4rHZ; Fri, 6 Aug 2021 16:44:16 +0000 (UTC) (envelope-from rob.fx907@gmail.com) Received: by mail-oo1-xc34.google.com with SMTP id h7-20020a4ab4470000b0290263c143bcb2so2377172ooo.7; Fri, 06 Aug 2021 09:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=a1LpHOj0V8F38XedG2+nRaYu+IPrFzA/ki2CiRwtUN8=; b=OyMp6MJ4GMwCKtnpJ5cBlehbTPtYxpcfV8n8PlVu6yVzy8CxclOn5rDmADJNHZnoDu O9SLnKKeG8n7twANUNjMhTWBFM/s2xQaojDVcWjN/mbqByMQ+to/VpUhfHMcvLBj/Pys bZmNeM7ppfz38sLZcgT0lIeWwSdXYGutCmjEYNvVWDayzzXvxT/8f5eyoJ/Z47oR9HDG FjaNjL0bW/F/2iaYWarQJXmE6sTXPoC3tzqNEOhi2M9jPMqUyku9PQ//A5IztFKfChfl mQDyoM3gx0lZgM9Jaa3l+OLMVARwJZ+gZjgjNrX/hIbJKMvKDHWx55G/19goUfvVPBEa 2kpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=a1LpHOj0V8F38XedG2+nRaYu+IPrFzA/ki2CiRwtUN8=; b=CGCo5HeeD4jE7CaPZKK5y6XCk0AKNf8SW9e/zRH6xKrBuYMwlHMIMPf6ABssCDH1w9 5nw8qq1WpndIW2nOG8TltGQaiNWxLhPcMCLKbwLEmcPd0emy0J3kS0KGzOc0AMSBtv5T 0SZ+ysld1FpvaRyeBDEpGr9S4o0FP1nppG3fARd9u/ZoDF7YEFl2NW3v61K5MDOwfR9A tuC2ExS5XDHY1WGuhZIrQpSTPm8v8Xjkada9jETPPTtx20X0y3TC506tQg5q/oRBdUCm WHmBfjoJ8EX8kPw+W9WCwm0ElpcPlV0+GFOoAf88Us9LQazfdHF/hZPbN6Kx7vsyWvke ZWww== X-Gm-Message-State: AOAM531vuHCdeGuTWCjDVj9hN2+TjkPnMGxYDldXiMYOL0fTVQ2h8FLx bOm4YIql4Q+nkjT/feZjOatSWCO7UktUO+VTwakskuiFACc= X-Google-Smtp-Source: ABdhPJzEKp6GCKI6Ga+dSn6XV5K06jMwiVUwGPmekGUJJJSi4faP/9Cc5jRamMxGGITykw0PAJgoDwjJZwPJtZnituw= X-Received: by 2002:a4a:b04c:: with SMTP id g12mr7303668oon.3.1628268250600; Fri, 06 Aug 2021 09:44:10 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:704d:0:0:0:0:0 with HTTP; Fri, 6 Aug 2021 09:44:10 -0700 (PDT) In-Reply-To: References: <202107022232.162MWUIY049889@gitrepo.freebsd.org> From: Rob Wing Date: Fri, 6 Aug 2021 08:44:10 -0800 Message-ID: Subject: Re: git: 25392fac9488 - main - libalias: Fix splay comparsion bug To: Gleb Smirnoff Cc: Lutz Donnerhacke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" X-Rspamd-Queue-Id: 4GhBC43x18z4rHZ 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)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 16:44:16 -0000 Hey Gleb, as a heads up (in case you missed it)...about a week ago Lutz mentioned he=E2=80=99d be AFK for three weeks. On Friday, August 6, 2021, Gleb Smirnoff wrote: > Lutz, > > Wouldn't declaring 'i' to u_short fix the root of the problem? > > On Fri, Jul 02, 2021 at 10:32:30PM +0000, Lutz Donnerhacke wrote: > L> The branch main has been updated by donner: > L> > L> URL: https://cgit.FreeBSD.org/src/commit/?id=3D > 25392fac9488bcae5c451500df2e2945430484a6 > L> > L> commit 25392fac9488bcae5c451500df2e2945430484a6 > L> Author: Lutz Donnerhacke > L> AuthorDate: 2021-07-02 21:41:25 +0000 > L> Commit: Lutz Donnerhacke > L> CommitDate: 2021-07-02 22:31:53 +0000 > L> > L> libalias: Fix splay comparsion bug > L> > L> Comparing elements in a tree requires transitiviy. If a < b and b > < c > L> then a must be smaller than c. This way the tree elements are > always > L> pairwise comparable. > L> > L> Tristate comparsion functions returning values lower, equal, or > L> greater than zero, are usually implemented by a simple subtraction > of > L> the operands. If the size of the operands are equal to the size o= f > L> the result, integer modular arithmetics kick in and violates the > L> transitivity. > L> > L> Example: > L> Working on byte with 0, 120, and 240. Now computing the difference= s: > L> 120 - 0 =3D 120 > L> 240 - 120 =3D 120 > L> 240 - 0 =3D -16 > L> > L> MFC after: 3 days > L> sys/netinet/libalias/alias_db.h | 13 +++++++------ > L> 1 file changed, 7 insertions(+), 6 deletions(-) > L> > L> diff --git a/sys/netinet/libalias/alias_db.h > b/sys/netinet/libalias/alias_db.h > L> index ec0b69c01f82..971ca305c1a6 100644 > L> --- a/sys/netinet/libalias/alias_db.h > L> +++ b/sys/netinet/libalias/alias_db.h > L> @@ -351,10 +351,10 @@ static inline int > L> cmp_out(struct alias_link *a, struct alias_link *b) { > L> int i =3D a->src_port - b->src_port; > L> if (i !=3D 0) return (i); > L> - i =3D a->src_addr.s_addr - b->src_addr.s_addr; > L> - if (i !=3D 0) return (i); > L> - i =3D a->dst_addr.s_addr - b->dst_addr.s_addr; > L> - if (i !=3D 0) return (i); > L> + if (a->src_addr.s_addr > b->src_addr.s_addr) return (1); > L> + if (a->src_addr.s_addr < b->src_addr.s_addr) return (-1); > L> + if (a->dst_addr.s_addr > b->dst_addr.s_addr) return (1); > L> + if (a->dst_addr.s_addr < b->dst_addr.s_addr) return (-1); > L> i =3D a->dst_port - b->dst_port; > L> if (i !=3D 0) return (i); > L> i =3D a->link_type - b->link_type; > L> @@ -368,8 +368,9 @@ cmp_in(struct group_in *a, struct group_in *b) { > L> if (i !=3D 0) return (i); > L> i =3D a->link_type - b->link_type; > L> if (i !=3D 0) return (i); > L> - i =3D a->alias_addr.s_addr - b->alias_addr.s_addr; > L> - return (i); > L> + if (a->alias_addr.s_addr > b->alias_addr.s_addr) return (1); > L> + if (a->alias_addr.s_addr < b->alias_addr.s_addr) return (-1); > L> + return (0); > L> } > L> SPLAY_PROTOTYPE(splay_in, group_in, in, cmp_in); > L> > > -- > Gleb Smirnoff > From owner-dev-commits-src-main@freebsd.org Fri Aug 6 16:53:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43BD2659B3D; Fri, 6 Aug 2021 16:53:22 +0000 (UTC) (envelope-from jhb@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 4GhBPZ1Hwkz4rdt; Fri, 6 Aug 2021 16:53:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 7339EEEE5; Fri, 6 Aug 2021 16:53:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 09066b98663d - main - ktls: Use the new PNOLOCK flag To: Hans Petter Selasky , Ian Lepore , Andrew Gallatin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202108052251.175MpwTC090873@gitrepo.freebsd.org> <18ed8e5f-d042-478b-e18c-dd0de7affcae@selasky.org> From: John Baldwin Message-ID: <0805925c-dc48-c55c-2682-abffb672459c@FreeBSD.org> Date: Fri, 6 Aug 2021 09:53:14 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <18ed8e5f-d042-478b-e18c-dd0de7affcae@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 16:53:22 -0000 On 8/6/21 2:09 AM, Hans Petter Selasky wrote: > On 8/6/21 1:58 AM, Ian Lepore wrote: >> I especially like this solution, it documents explicitly what you're >> doing and why. (Earlier I was considering mumbling something about >> "there should be a comment to say a sleep-forever is known safe here".) > > Hi, > > MPSAFE is the word to use, like with other things related to GIANT? > > PNOLOCK -> PMPSAFE ?? No, I suggested PNOLOCK explicitly to mean "I'm purposefully sleeping without any lock at all". Normally MPSAFE has been used to mean "this has had other locking added so that it no longer needs Giant". I'd actually generally like to axe MPSAFE from our tree and invert flags to have things opt-in to Giant instead. This is already in place for sysctls (and for 14 we can probably axe the SYSCTL_MPSAFE flag). INTR_MPSAFE is probably one I'd like to flip next to an INTR_GIANT (though probably for 14 both flags would have to live as the sysctl flags did for 13). CALLOUT_MPSAFE -> CALLOUT_GIANT is perhaps another candidate. It'd be nice to get all these done in 14-current. I'm not super optimistic we can fully eradicate Giant in 14, but at least we can start better isolating it in terms of most code not having to declare "I don't need it" anymore. -- John Baldwin From owner-dev-commits-src-main@freebsd.org Fri Aug 6 18:51:51 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAC6C65C432; Fri, 6 Aug 2021 18:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhF2H6Nd0z3Gp6; Fri, 6 Aug 2021 18:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3C9A12E51; Fri, 6 Aug 2021 18:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176Ipp8l099112; Fri, 6 Aug 2021 18:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176IppLt099111; Fri, 6 Aug 2021 18:51:51 GMT (envelope-from git) Date: Fri, 6 Aug 2021 18:51:51 GMT Message-Id: <202108061851.176IppLt099111@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 34e7e4b6a059 - main - Add ElfW() macro for compatibility with Linux MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 34e7e4b6a059eee5e4e3e34de5b9d5f0d6e589f9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 18:51:52 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=34e7e4b6a059eee5e4e3e34de5b9d5f0d6e589f9 commit 34e7e4b6a059eee5e4e3e34de5b9d5f0d6e589f9 Author: Dimitry Andric AuthorDate: 2021-08-05 18:57:22 +0000 Commit: Dimitry Andric CommitDate: 2021-08-06 18:50:32 +0000 Add ElfW() macro for compatibility with Linux Some Linux software using ELF headers assumes the existence of an ElfW(type) macro, which concatenates 'Elf', the default ELF word size, and the given type. This is identical to our __ElfN(x) macro in . Add the macro for compatibility, with a comment that we prefer the __ElfN() macro for FreeBSD. Reviewed by: emaste, kib Differential Revision: https://reviews.freebsd.org/D31427 MFC after: 1 week --- sys/sys/elf_generic.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/sys/elf_generic.h b/sys/sys/elf_generic.h index 301ee52cf7a1..dcd44fe93b14 100644 --- a/sys/sys/elf_generic.h +++ b/sys/sys/elf_generic.h @@ -57,6 +57,9 @@ #define __ELFN(x) __CONCAT(__CONCAT(__CONCAT(ELF,__ELF_WORD_SIZE),_),x) #define __ElfType(x) typedef __ElfN(x) __CONCAT(Elf_,x) +/* Define ElfW for compatibility with Linux, prefer __ElfN() in FreeBSD code */ +#define ElfW(x) __ElfN(x) + __ElfType(Addr); __ElfType(Half); __ElfType(Off); From owner-dev-commits-src-main@freebsd.org Fri Aug 6 19:28:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E21865DB39; Fri, 6 Aug 2021 19:28:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhFrJ6Swqz3JLD; Fri, 6 Aug 2021 19:28:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1FBC13712; Fri, 6 Aug 2021 19:28:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176JSGGi043353; Fri, 6 Aug 2021 19:28:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176JSG42043352; Fri, 6 Aug 2021 19:28:16 GMT (envelope-from git) Date: Fri, 6 Aug 2021 19:28:16 GMT Message-Id: <202108061928.176JSG42043352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 40b9f924b189 - main - pkg: allow multiple add arguments again MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40b9f924b189ce8fa871db600b4abc99b03c6a65 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 19:28:17 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=40b9f924b189ce8fa871db600b4abc99b03c6a65 commit 40b9f924b189ce8fa871db600b4abc99b03c6a65 Author: Kyle Evans AuthorDate: 2021-02-18 03:41:53 +0000 Commit: Kyle Evans CommitDate: 2021-08-06 19:25:07 +0000 pkg: allow multiple add arguments again While pkg(7) add only handles a single 'add' argument, pkg-add(8) fully handles multiple arguments. Stop rejecting it, just turn off local-bootstrap mode and proceed to remote bootstrap if we need it. While we're here, check if the first argument to pkg add is even a pkg package. If it's not, also do remote bootstrap instead. Future work could improve this altogether by picking out a pkg package out of many and local bootstrap then pass the rest through to the newly installed pkg. Reviewed by: bapt, manu (earlier version) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28766 --- usr.sbin/pkg/pkg.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 8193dc79a430..1196c78e5cc9 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -1056,6 +1056,40 @@ cleanup: return (ret); } +#define PKG_NAME "pkg" +#define PKG_DEVEL_NAME PKG_NAME "-devel" +#define PKG_PKG PKG_NAME "." + +static bool +pkg_is_pkg_pkg(const char *pkg) +{ + char *vstart; + size_t namelen; + + /* + * Chop off the final "-" (version delimiter) and check the name that + * precedes it. If we didn't have a version delimiter, it must be the + * pkg.$archive short form but we'll check it anyways. pkg-devel short + * form will look like a pkg archive with 'devel' version, but that's + * OK. We otherwise assumed that non-pkg packages will always have a + * version component. + */ + vstart = strrchr(pkg, '-'); + if (vstart == NULL) { + return (strlen(pkg) > sizeof(PKG_PKG) - 1 && + strncmp(pkg, PKG_PKG, sizeof(PKG_PKG) - 1) == 0); + } + + namelen = vstart - pkg; + if (namelen == sizeof(PKG_NAME) - 1 && + strncmp(pkg, PKG_NAME, sizeof(PKG_NAME) - 1) == 0) + return (true); + if (namelen == sizeof(PKG_DEVEL_NAME) - 1 && + strncmp(pkg, PKG_DEVEL_NAME, sizeof(PKG_DEVEL_NAME) - 1) == 0) + return (true); + return (false); +} + int main(int argc, char *argv[]) { @@ -1159,13 +1193,25 @@ main(int argc, char *argv[]) fprintf(stderr, args_bootstrap_message); exit(EXIT_FAILURE); } - // For add, we accept exactly one further argument else if (add_pkg && pkgarg != NULL) { - fprintf(stderr, args_add_message); - exit(EXIT_FAILURE); + /* + * Additional arguments also means it's not a + * local bootstrap request. + */ + add_pkg = false; } else if (add_pkg) { - pkgarg = argv[optind-1]; + /* + * If it's not a request for pkg or pkg-devel, + * then we must assume they were trying to + * install some other local package and we + * should try to bootstrap from the repo. + */ + if (!pkg_is_pkg_pkg(argv[optind-1])) { + add_pkg = false; + } else { + pkgarg = argv[optind-1]; + } } break; default: From owner-dev-commits-src-main@freebsd.org Fri Aug 6 19:28:18 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1239F65DAA4; Fri, 6 Aug 2021 19:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhFrK723lz3JFf; Fri, 6 Aug 2021 19:28:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DACC0136BB; Fri, 6 Aug 2021 19:28:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176JSHE3043377; Fri, 6 Aug 2021 19:28:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176JSHqY043376; Fri, 6 Aug 2021 19:28:17 GMT (envelope-from git) Date: Fri, 6 Aug 2021 19:28:17 GMT Message-Id: <202108061928.176JSHqY043376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: d35164539b14 - main - pkg: use specific CONFSNAME_${file} for FreeBSD.conf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d35164539b14a6d14fb587e58a0c7a1668d7643a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 19:28:18 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d35164539b14a6d14fb587e58a0c7a1668d7643a commit d35164539b14a6d14fb587e58a0c7a1668d7643a Author: Kyle Evans AuthorDate: 2021-02-18 04:10:46 +0000 Commit: Kyle Evans CommitDate: 2021-08-06 19:25:45 +0000 pkg: use specific CONFSNAME_${file} for FreeBSD.conf Setting CONFSNAME directly is a little more complicated for downstream consumers, as any additional CONFS that are added here will inherit the group name by default. This is perhaps arguably a design flaw in CONFS because inheriting NAME will never give a good result when additional files are added, but this is a low-effort change. While we're here, pull FreeBSD.conf.${branch} out into a PKGCONF variable so one can just drop a new repo config in entirely with a new naming scheme. CONFSNAME gets set based on chopping anything off after ".conf", so that, e.g.: - FooBSD.conf => FooBSD.conf - FooBSD.conf.internal => FooBSD.conf Reviewed by: bapt, manu Differential Revision: https://reviews.freebsd.org/D28767 --- usr.sbin/pkg/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg/Makefile b/usr.sbin/pkg/Makefile index a71f0b2acb86..dd3db00885b1 100644 --- a/usr.sbin/pkg/Makefile +++ b/usr.sbin/pkg/Makefile @@ -15,8 +15,9 @@ PKGCONFBRANCH?= latest . endif . endif .endif -CONFS= FreeBSD.conf.${PKGCONFBRANCH} -CONFSNAME= FreeBSD.conf +PKGCONF?= FreeBSD.conf.${PKGCONFBRANCH} +CONFS= ${PKGCONF} +CONFSNAME_${PKGCONF}= ${PKGCONF:C/\.conf.+$/.conf/} CONFSDIR= /etc/pkg CONFSMODE= 644 PROG= pkg From owner-dev-commits-src-main@freebsd.org Fri Aug 6 21:29:07 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D391465F2A5; Fri, 6 Aug 2021 21:29:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhJWl5PGsz3R0P; Fri, 6 Aug 2021 21:29:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A180615197; Fri, 6 Aug 2021 21:29:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176LT7BR003033; Fri, 6 Aug 2021 21:29:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176LT773003032; Fri, 6 Aug 2021 21:29:07 GMT (envelope-from git) Date: Fri, 6 Aug 2021 21:29:07 GMT Message-Id: <202108062129.176LT773003032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: f0594f52f6fd - main - iSCSI: Add support for segmentation offload for hardware offloads. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0594f52f6fdabecee134dd5700bf936283959ad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 21:29:07 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f0594f52f6fdabecee134dd5700bf936283959ad commit f0594f52f6fdabecee134dd5700bf936283959ad Author: John Baldwin AuthorDate: 2021-08-06 21:03:00 +0000 Commit: John Baldwin CommitDate: 2021-08-06 21:03:00 +0000 iSCSI: Add support for segmentation offload for hardware offloads. Similar to TSO, iSCSI segmentation offload permits the upper layers to submit a "large" virtual PDU which is split up into multiple segments (PDUs) on the wire. Similar to how the TCP/IP headers are used as templates for TSO, the BHS at the start of a large PDU is used as a template to construct the specific BHS at the start of each PDU. In particular, the DataSN is incremented for each subsequent PDU, and the 'F' flag is only set on the last PDU. struct icl_conn has a new 'ic_hw_isomax' field which defaults to 0, but can be set to the largest virtual PDU a backend supports. If this value is non-zero, the iSCSI target and initiator use this size instead of 'ic_max_send_data_segment_length' to determine the maximum size for SCSI Data-In and SCSI Data-Out PDUs. Note that since PDUs can be constructed from multiple buffers before being dispatched, the target and initiator must wait for the PDU to be fully constructed before determining the number of DataSN values were consumed (and thus updating the per-transfer DataSN value used for the start of the next PDU). The target generates large PDUs for SCSI Data-In PDUs in cfiscsi_datamove_in(). The initiator generates large PDUs for SCSI Data-Out PDUs generated in response to an R2T. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31222 --- sys/cam/ctl/ctl_frontend_iscsi.c | 29 +++++++++++++++++------------ sys/dev/iscsi/icl.h | 1 + sys/dev/iscsi/iscsi.c | 15 +++++++++++---- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index b3cd8ab79d76..b8fafcea69ed 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -2447,6 +2447,7 @@ cfiscsi_datamove_in(union ctl_io *io) struct iscsi_bhs_data_in *bhsdi; struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; size_t len, expected_len, sg_len, buffer_offset; + size_t max_send_data_segment_length; const char *sg_addr; icl_pdu_cb cb; int ctl_sg_count, error, i; @@ -2504,6 +2505,11 @@ cfiscsi_datamove_in(union ctl_io *io) sg_len = 0; response = NULL; bhsdi = NULL; + if (cs->cs_conn->ic_hw_isomax != 0) + max_send_data_segment_length = cs->cs_conn->ic_hw_isomax; + else + max_send_data_segment_length = + cs->cs_conn->ic_max_send_data_segment_length; for (;;) { if (response == NULL) { response = cfiscsi_pdu_new_response(request, M_NOWAIT); @@ -2520,7 +2526,7 @@ cfiscsi_datamove_in(union ctl_io *io) bhsdi->bhsdi_initiator_task_tag = bhssc->bhssc_initiator_task_tag; bhsdi->bhsdi_target_transfer_tag = 0xffffffff; - bhsdi->bhsdi_datasn = htonl(PRIV_EXPDATASN(io)++); + bhsdi->bhsdi_datasn = htonl(PRIV_EXPDATASN(io)); bhsdi->bhsdi_buffer_offset = htonl(buffer_offset); } @@ -2536,15 +2542,11 @@ cfiscsi_datamove_in(union ctl_io *io) /* * Truncate to maximum data segment length. */ - KASSERT(response->ip_data_len < - cs->cs_conn->ic_max_send_data_segment_length, - ("ip_data_len %zd >= max_send_data_segment_length %d", - response->ip_data_len, - cs->cs_conn->ic_max_send_data_segment_length)); - if (response->ip_data_len + len > - cs->cs_conn->ic_max_send_data_segment_length) { - len = cs->cs_conn->ic_max_send_data_segment_length - - response->ip_data_len; + KASSERT(response->ip_data_len < max_send_data_segment_length, + ("ip_data_len %zd >= max_send_data_segment_length %zd", + response->ip_data_len, max_send_data_segment_length)); + if (response->ip_data_len + len > max_send_data_segment_length) { + len = max_send_data_segment_length - response->ip_data_len; KASSERT(len <= sg_len, ("len %zd > sg_len %zd", len, sg_len)); } @@ -2603,8 +2605,7 @@ cfiscsi_datamove_in(union ctl_io *io) i++; } - if (response->ip_data_len == - cs->cs_conn->ic_max_send_data_segment_length) { + if (response->ip_data_len == max_send_data_segment_length) { /* * Can't stuff more data into the current PDU; * queue it. Note that's not enough to check @@ -2619,6 +2620,8 @@ cfiscsi_datamove_in(union ctl_io *io) buffer_offset -= response->ip_data_len; break; } + PRIV_EXPDATASN(io) += howmany(response->ip_data_len, + cs->cs_conn->ic_max_send_data_segment_length); if (cb != NULL) { response->ip_prv0 = io->scsiio.kern_data_ref; response->ip_prv1 = io->scsiio.kern_data_arg; @@ -2654,6 +2657,8 @@ cfiscsi_datamove_in(union ctl_io *io) } } KASSERT(response->ip_data_len > 0, ("sending empty Data-In")); + PRIV_EXPDATASN(io) += howmany(response->ip_data_len, + cs->cs_conn->ic_max_send_data_segment_length); if (cb != NULL) { response->ip_prv0 = io->scsiio.kern_data_ref; response->ip_prv1 = io->scsiio.kern_data_arg; diff --git a/sys/dev/iscsi/icl.h b/sys/dev/iscsi/icl.h index adcd580f299b..bd12569a8957 100644 --- a/sys/dev/iscsi/icl.h +++ b/sys/dev/iscsi/icl.h @@ -93,6 +93,7 @@ struct icl_conn { #endif uint32_t ic_max_recv_data_segment_length; uint32_t ic_max_send_data_segment_length; + size_t ic_hw_isomax; size_t ic_maxtags; bool ic_header_crc32c; bool ic_data_crc32c; diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index 9a1b539e539b..60b3e3766da7 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -1154,7 +1154,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) struct iscsi_bhs_data_out *bhsdo; struct iscsi_outstanding *io; struct ccb_scsiio *csio; - size_t off, len, total_len; + size_t off, len, max_send_data_segment_length, total_len; int error; uint32_t datasn = 0; @@ -1203,11 +1203,16 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) //ISCSI_SESSION_DEBUG(is, "r2t; off %zd, len %zd", off, total_len); + if (is->is_conn->ic_hw_isomax != 0) + max_send_data_segment_length = is->is_conn->ic_hw_isomax; + else + max_send_data_segment_length = + is->is_conn->ic_max_send_data_segment_length; for (;;) { len = total_len; - if (len > is->is_conn->ic_max_send_data_segment_length) - len = is->is_conn->ic_max_send_data_segment_length; + if (len > max_send_data_segment_length) + len = max_send_data_segment_length; if (off + len > csio->dxfer_len) { ISCSI_SESSION_WARN(is, "target requested invalid " @@ -1232,7 +1237,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) bhsr2t->bhsr2t_initiator_task_tag; bhsdo->bhsdo_target_transfer_tag = bhsr2t->bhsr2t_target_transfer_tag; - bhsdo->bhsdo_datasn = htonl(datasn++); + bhsdo->bhsdo_datasn = htonl(datasn); bhsdo->bhsdo_buffer_offset = htonl(off); error = icl_pdu_append_data(request, csio->data_ptr + off, len, M_NOWAIT); @@ -1245,6 +1250,8 @@ iscsi_pdu_handle_r2t(struct icl_pdu *response) return; } + datasn += howmany(len, + is->is_conn->ic_max_send_data_segment_length); off += len; total_len -= len; From owner-dev-commits-src-main@freebsd.org Fri Aug 6 21:29:08 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7EE665F0C3; Fri, 6 Aug 2021 21:29:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhJWm5mwwz3h1D; Fri, 6 Aug 2021 21:29:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF24914E45; Fri, 6 Aug 2021 21:29:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176LT8Rl003057; Fri, 6 Aug 2021 21:29:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176LT8JL003056; Fri, 6 Aug 2021 21:29:08 GMT (envelope-from git) Date: Fri, 6 Aug 2021 21:29:08 GMT Message-Id: <202108062129.176LT8JL003056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 5b27e4b27caa - main - cxgbei: Support for ISO (iSCSI segmentation offload). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b27e4b27caae840bd79ccc5cb7811a0c9acc656 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 21:29:08 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5b27e4b27caae840bd79ccc5cb7811a0c9acc656 commit 5b27e4b27caae840bd79ccc5cb7811a0c9acc656 Author: John Baldwin AuthorDate: 2021-08-06 21:21:37 +0000 Commit: John Baldwin CommitDate: 2021-08-06 21:21:37 +0000 cxgbei: Support for ISO (iSCSI segmentation offload). ISO can be disabled before establishing a connection by setting dev.tNnex.N.toe.iso to 0. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31223 --- sys/dev/cxgbe/adapter.h | 1 + sys/dev/cxgbe/cxgbei/cxgbei.h | 2 + sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 62 +++++++++++-- sys/dev/cxgbe/offload.h | 1 + sys/dev/cxgbe/t4_main.c | 5 ++ sys/dev/cxgbe/t4_sge.c | 5 ++ sys/dev/cxgbe/tom/t4_cpl_io.c | 184 ++++++++++++++++++++++++++++---------- sys/dev/cxgbe/tom/t4_tom.h | 52 +++++++++++ 8 files changed, 254 insertions(+), 58 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 3eb39ef5e987..14bc6cd9c36a 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -739,6 +739,7 @@ struct sge_ofld_txq { struct sge_wrq wrq; counter_u64_t tx_iscsi_pdus; counter_u64_t tx_iscsi_octets; + counter_u64_t tx_iscsi_iso_wrs; counter_u64_t tx_toe_tls_records; counter_u64_t tx_toe_tls_octets; } __aligned(CACHE_LINE_SIZE); diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.h b/sys/dev/cxgbe/cxgbei/cxgbei.h index 45d3398d545c..433f15b743fe 100644 --- a/sys/dev/cxgbe/cxgbei/cxgbei.h +++ b/sys/dev/cxgbe/cxgbei/cxgbei.h @@ -134,6 +134,8 @@ struct cxgbei_data { struct sysctl_ctx_list ctx; /* from uld_activate to deactivate */ }; +#define CXGBEI_MAX_ISO_PAYLOAD 65535 + /* cxgbei.c */ u_int cxgbei_select_worker_thread(struct icl_cxgbei_conn *); diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index d5b13fb5c3ea..a57d26ae21b8 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -335,13 +335,14 @@ finalize_pdu(struct icl_cxgbei_conn *icc, struct icl_cxgbei_pdu *icp) uint8_t ulp_submode, padding; struct mbuf *m, *last; struct iscsi_bhs *bhs; + int data_len; /* * Fix up the data segment mbuf first. */ m = ip->ip_data_mbuf; ulp_submode = icc->ulp_submode; - if (m) { + if (m != NULL) { last = m_last(m); /* @@ -349,7 +350,8 @@ finalize_pdu(struct icl_cxgbei_conn *icc, struct icl_cxgbei_pdu *icp) * necessary. There will definitely be room in the mbuf. */ padding = roundup2(ip->ip_data_len, 4) - ip->ip_data_len; - if (padding) { + if (padding != 0) { + MPASS(padding <= M_TRAILINGSPACE(last)); bzero(mtod(last, uint8_t *) + last->m_len, padding); last->m_len += padding; } @@ -367,9 +369,41 @@ finalize_pdu(struct icl_cxgbei_conn *icc, struct icl_cxgbei_pdu *icp) MPASS(m->m_len == sizeof(struct iscsi_bhs)); bhs = ip->ip_bhs; - bhs->bhs_data_segment_len[2] = ip->ip_data_len; - bhs->bhs_data_segment_len[1] = ip->ip_data_len >> 8; - bhs->bhs_data_segment_len[0] = ip->ip_data_len >> 16; + data_len = ip->ip_data_len; + if (data_len > icc->ic.ic_max_send_data_segment_length) { + struct iscsi_bhs_data_in *bhsdi; + int flags; + + KASSERT(padding == 0, ("%s: ISO with padding %d for icp %p", + __func__, padding, icp)); + switch (bhs->bhs_opcode) { + case ISCSI_BHS_OPCODE_SCSI_DATA_OUT: + flags = 1; + break; + case ISCSI_BHS_OPCODE_SCSI_DATA_IN: + flags = 2; + break; + default: + panic("invalid opcode %#x for ISO", bhs->bhs_opcode); + } + data_len = icc->ic.ic_max_send_data_segment_length; + bhsdi = (struct iscsi_bhs_data_in *)bhs; + if (bhsdi->bhsdi_flags & BHSDI_FLAGS_F) { + /* + * Firmware will set F on the final PDU in the + * burst. + */ + flags |= CXGBE_ISO_F; + bhsdi->bhsdi_flags &= ~BHSDI_FLAGS_F; + } + set_mbuf_iscsi_iso(m, true); + set_mbuf_iscsi_iso_flags(m, flags); + set_mbuf_iscsi_iso_mss(m, data_len); + } + + bhs->bhs_data_segment_len[2] = data_len; + bhs->bhs_data_segment_len[1] = data_len >> 8; + bhs->bhs_data_segment_len[0] = data_len >> 16; /* * Extract mbuf chain from PDU. @@ -477,7 +511,8 @@ icl_cxgbei_conn_pdu_append_data(struct icl_conn *ic, struct icl_pdu *ip, } MPASS(len == 0); } - MPASS(ip->ip_data_len <= ic->ic_max_send_data_segment_length); + MPASS(ip->ip_data_len <= max(ic->ic_max_send_data_segment_length, + ic->ic_hw_isomax)); return (0); } @@ -748,7 +783,7 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) struct tcpcb *tp; struct toepcb *toep; cap_rights_t rights; - int error; + int error, max_iso_pdus; MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); ICL_CONN_LOCK_ASSERT_NOT(ic); @@ -815,12 +850,21 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) icc->ulp_submode |= ULP_CRC_HEADER; if (ic->ic_data_crc32c) icc->ulp_submode |= ULP_CRC_DATA; + + if (icc->sc->tt.iso && chip_id(icc->sc) >= CHELSIO_T5) { + max_iso_pdus = CXGBEI_MAX_ISO_PAYLOAD / + ci->max_tx_pdu_len; + ic->ic_hw_isomax = max_iso_pdus * + ic->ic_max_send_data_segment_length; + } else + max_iso_pdus = 1; + so->so_options |= SO_NO_DDP; toep->params.ulp_mode = ULP_MODE_ISCSI; toep->ulpcb = icc; - send_iscsi_flowc_wr(icc->sc, toep, roundup(ci->max_tx_pdu_len, - tp->t_maxseg)); + send_iscsi_flowc_wr(icc->sc, toep, + roundup(max_iso_pdus * ci->max_tx_pdu_len, tp->t_maxseg)); set_ulp_mode_iscsi(icc->sc, toep, icc->ulp_submode); error = 0; } diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h index 7efbd5f81f34..6607d0c173e7 100644 --- a/sys/dev/cxgbe/offload.h +++ b/sys/dev/cxgbe/offload.h @@ -233,6 +233,7 @@ struct tom_tunables { int cop_managed_offloading; int autorcvbuf_inc; int update_hc_on_pmtu_change; + int iso; }; /* iWARP driver tunables */ diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 67500b0c44b9..9865bd7048ae 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -7590,6 +7590,10 @@ t4_sysctls(struct adapter *sc) &sc->tt.update_hc_on_pmtu_change, 0, "Update hostcache entry if the PMTU changes"); + sc->tt.iso = 1; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "iso", CTLFLAG_RW, + &sc->tt.iso, 0, "Enable iSCSI segmentation offload"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "timer_tick", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_tp_tick, "A", "TP timer tick (us)"); @@ -11896,6 +11900,7 @@ clear_stats(struct adapter *sc, u_int port_id) ofld_txq->wrq.tx_wrs_copied = 0; counter_u64_zero(ofld_txq->tx_iscsi_pdus); counter_u64_zero(ofld_txq->tx_iscsi_octets); + counter_u64_zero(ofld_txq->tx_iscsi_iso_wrs); counter_u64_zero(ofld_txq->tx_toe_tls_records); counter_u64_zero(ofld_txq->tx_toe_tls_octets); } diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 1d0e334896be..5093c84516bc 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -4787,6 +4787,7 @@ alloc_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq, int idx) ofld_txq->tx_iscsi_pdus = counter_u64_alloc(M_WAITOK); ofld_txq->tx_iscsi_octets = counter_u64_alloc(M_WAITOK); + ofld_txq->tx_iscsi_iso_wrs = counter_u64_alloc(M_WAITOK); ofld_txq->tx_toe_tls_records = counter_u64_alloc(M_WAITOK); ofld_txq->tx_toe_tls_octets = counter_u64_alloc(M_WAITOK); add_ofld_txq_sysctls(&vi->ctx, oid, ofld_txq); @@ -4824,6 +4825,7 @@ free_ofld_txq(struct vi_info *vi, struct sge_ofld_txq *ofld_txq) MPASS(!(eq->flags & EQ_HW_ALLOCATED)); counter_u64_free(ofld_txq->tx_iscsi_pdus); counter_u64_free(ofld_txq->tx_iscsi_octets); + counter_u64_free(ofld_txq->tx_iscsi_iso_wrs); counter_u64_free(ofld_txq->tx_toe_tls_records); counter_u64_free(ofld_txq->tx_toe_tls_octets); free_wrq(sc, &ofld_txq->wrq); @@ -4848,6 +4850,9 @@ add_ofld_txq_sysctls(struct sysctl_ctx_list *ctx, struct sysctl_oid *oid, SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_iscsi_octets", CTLFLAG_RD, &ofld_txq->tx_iscsi_octets, "# of payload octets in transmitted iSCSI PDUs"); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_iscsi_iso_wrs", + CTLFLAG_RD, &ofld_txq->tx_iscsi_iso_wrs, + "# of iSCSI segmentation offload work requests"); SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "tx_toe_tls_records", CTLFLAG_RD, &ofld_txq->tx_toe_tls_records, "# of TOE TLS records transmitted"); diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index a75f93ded5f6..9013f03ddaa3 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -67,6 +67,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "common/common.h" #include "common/t4_msg.h" #include "common/t4_regs.h" @@ -516,38 +518,44 @@ t4_close_conn(struct adapter *sc, struct toepcb *toep) #define MAX_OFLD_TX_CREDITS (SGE_MAX_WR_LEN / 16) #define MIN_OFLD_TX_CREDITS (howmany(sizeof(struct fw_ofld_tx_data_wr) + 1, 16)) +#define MIN_ISO_TX_CREDITS (howmany(sizeof(struct cpl_tx_data_iso), 16)) +#define MIN_TX_CREDITS(iso) \ + (MIN_OFLD_TX_CREDITS + ((iso) ? MIN_ISO_TX_CREDITS : 0)) /* Maximum amount of immediate data we could stuff in a WR */ static inline int -max_imm_payload(int tx_credits) +max_imm_payload(int tx_credits, int iso) { + const int iso_cpl_size = iso ? sizeof(struct cpl_tx_data_iso) : 0; const int n = 1; /* Use no more than one desc for imm. data WR */ KASSERT(tx_credits >= 0 && tx_credits <= MAX_OFLD_TX_CREDITS, ("%s: %d credits", __func__, tx_credits)); - if (tx_credits < MIN_OFLD_TX_CREDITS) + if (tx_credits < MIN_TX_CREDITS(iso)) return (0); if (tx_credits >= (n * EQ_ESIZE) / 16) - return ((n * EQ_ESIZE) - sizeof(struct fw_ofld_tx_data_wr)); + return ((n * EQ_ESIZE) - sizeof(struct fw_ofld_tx_data_wr) - + iso_cpl_size); else - return (tx_credits * 16 - sizeof(struct fw_ofld_tx_data_wr)); + return (tx_credits * 16 - sizeof(struct fw_ofld_tx_data_wr) - + iso_cpl_size); } /* Maximum number of SGL entries we could stuff in a WR */ static inline int -max_dsgl_nsegs(int tx_credits) +max_dsgl_nsegs(int tx_credits, int iso) { int nseg = 1; /* ulptx_sgl has room for 1, rest ulp_tx_sge_pair */ - int sge_pair_credits = tx_credits - MIN_OFLD_TX_CREDITS; + int sge_pair_credits = tx_credits - MIN_TX_CREDITS(iso); KASSERT(tx_credits >= 0 && tx_credits <= MAX_OFLD_TX_CREDITS, ("%s: %d credits", __func__, tx_credits)); - if (tx_credits < MIN_OFLD_TX_CREDITS) + if (tx_credits < MIN_TX_CREDITS(iso)) return (0); nseg += 2 * (sge_pair_credits * 16 / 24); @@ -558,12 +566,13 @@ max_dsgl_nsegs(int tx_credits) } static inline void -write_tx_wr(void *dst, struct toepcb *toep, unsigned int immdlen, - unsigned int plen, uint8_t credits, int shove, int ulp_submode) +write_tx_wr(void *dst, struct toepcb *toep, int fw_wr_opcode, + unsigned int immdlen, unsigned int plen, uint8_t credits, int shove, + int ulp_submode) { struct fw_ofld_tx_data_wr *txwr = dst; - txwr->op_to_immdlen = htobe32(V_WR_OP(FW_OFLD_TX_DATA_WR) | + txwr->op_to_immdlen = htobe32(V_WR_OP(fw_wr_opcode) | V_FW_WR_IMMDLEN(immdlen)); txwr->flowid_len16 = htobe32(V_FW_WR_FLOWID(toep->tid) | V_FW_WR_LEN16(credits)); @@ -707,8 +716,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) txsd = &toep->txsd[toep->txsd_pidx]; do { tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS); - max_imm = max_imm_payload(tx_credits); - max_nsegs = max_dsgl_nsegs(tx_credits); + max_imm = max_imm_payload(tx_credits, 0); + max_nsegs = max_dsgl_nsegs(tx_credits, 0); SOCKBUF_LOCK(sb); sowwakeup = drop; @@ -832,7 +841,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) } txwr = wrtod(wr); credits = howmany(wr->wr_len, 16); - write_tx_wr(txwr, toep, plen, plen, credits, shove, 0); + write_tx_wr(txwr, toep, FW_OFLD_TX_DATA_WR, plen, plen, + credits, shove, 0); m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); nsegs = 0; } else { @@ -851,7 +861,8 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) } txwr = wrtod(wr); credits = howmany(wr_len, 16); - write_tx_wr(txwr, toep, 0, plen, credits, shove, 0); + write_tx_wr(txwr, toep, FW_OFLD_TX_DATA_WR, 0, plen, + credits, shove, 0); write_tx_sgl(txwr + 1, sndptr, m, nsegs, max_nsegs_1mbuf); if (wr_len & 0xf) { @@ -927,18 +938,71 @@ rqdrop_locked(struct mbufq *q, int plen) } } +/* + * Not a bit in the TCB, but is a bit in the ulp_submode field of the + * CPL_TX_DATA flags field in FW_ISCSI_TX_DATA_WR. + */ +#define ULP_ISO G_TX_ULP_SUBMODE(F_FW_ISCSI_TX_DATA_WR_ULPSUBMODE_ISO) + +static void +write_tx_data_iso(void *dst, u_int ulp_submode, uint8_t flags, uint16_t mss, + int len, int npdu) +{ + struct cpl_tx_data_iso *cpl; + unsigned int burst_size; + unsigned int last; + + /* + * The firmware will set the 'F' bit on the last PDU when + * either condition is true: + * + * - this large PDU is marked as the "last" slice + * + * - the amount of data payload bytes equals the burst_size + * + * The strategy used here is to always set the burst_size + * artificially high (len includes the size of the template + * BHS) and only set the "last" flag if the original PDU had + * 'F' set. + */ + burst_size = len; + last = !!(flags & CXGBE_ISO_F); + + cpl = (struct cpl_tx_data_iso *)dst; + cpl->op_to_scsi = htonl(V_CPL_TX_DATA_ISO_OP(CPL_TX_DATA_ISO) | + V_CPL_TX_DATA_ISO_FIRST(1) | V_CPL_TX_DATA_ISO_LAST(last) | + V_CPL_TX_DATA_ISO_CPLHDRLEN(0) | + V_CPL_TX_DATA_ISO_HDRCRC(!!(ulp_submode & ULP_CRC_HEADER)) | + V_CPL_TX_DATA_ISO_PLDCRC(!!(ulp_submode & ULP_CRC_DATA)) | + V_CPL_TX_DATA_ISO_IMMEDIATE(0) | + V_CPL_TX_DATA_ISO_SCSI(CXGBE_ISO_TYPE(flags))); + + cpl->ahs_len = 0; + cpl->mpdu = htons(DIV_ROUND_UP(mss, 4)); + cpl->burst_size = htonl(DIV_ROUND_UP(burst_size, 4)); + cpl->len = htonl(len); + cpl->reserved2_seglen_offset = htonl(0); + cpl->datasn_offset = htonl(0); + cpl->buffer_offset = htonl(0); + cpl->reserved3 = 0; +} + static struct wrqe * write_iscsi_mbuf_wr(struct toepcb *toep, struct mbuf *sndptr) { struct mbuf *m; struct fw_ofld_tx_data_wr *txwr; + struct cpl_tx_data_iso *cpl_iso; + void *p; struct wrqe *wr; u_int plen, nsegs, credits, max_imm, max_nsegs, max_nsegs_1mbuf; - u_int adjusted_plen, ulp_submode; + u_int adjusted_plen, imm_data, ulp_submode; struct inpcb *inp = toep->inp; struct tcpcb *tp = intotcpcb(inp); - int tx_credits, shove; + int tx_credits, shove, npdu, wr_len; + uint16_t iso_mss; static const u_int ulp_extra_len[] = {0, 4, 4, 8}; + bool iso; M_ASSERTPKTHDR(sndptr); @@ -958,8 +1022,10 @@ write_iscsi_mbuf_wr(struct toepcb *toep, struct mbuf *sndptr) return (wr); } - max_imm = max_imm_payload(tx_credits); - max_nsegs = max_dsgl_nsegs(tx_credits); + iso = mbuf_iscsi_iso(sndptr); + max_imm = max_imm_payload(tx_credits, iso); + max_nsegs = max_dsgl_nsegs(tx_credits, iso); + iso_mss = mbuf_iscsi_iso_mss(sndptr); plen = 0; nsegs = 0; @@ -993,8 +1059,6 @@ write_iscsi_mbuf_wr(struct toepcb *toep, struct mbuf *sndptr) MPASS(sndptr->m_pkthdr.len == plen); shove = !(tp->t_flags & TF_MORETOCOME); - ulp_submode = mbuf_ulp_submode(sndptr); - MPASS(ulp_submode < nitems(ulp_extra_len)); /* * plen doesn't include header and data digests, which are @@ -1002,51 +1066,73 @@ write_iscsi_mbuf_wr(struct toepcb *toep, struct mbuf *sndptr) * they do occupy TCP sequence space and need to be accounted * for. */ - adjusted_plen = plen + ulp_extra_len[ulp_submode]; + ulp_submode = mbuf_ulp_submode(sndptr); + MPASS(ulp_submode < nitems(ulp_extra_len)); + npdu = iso ? howmany(plen - ISCSI_BHS_SIZE, iso_mss) : 1; + adjusted_plen = plen + ulp_extra_len[ulp_submode] * npdu; + if (iso) + adjusted_plen += ISCSI_BHS_SIZE * (npdu - 1); + wr_len = sizeof(*txwr); + if (iso) + wr_len += sizeof(struct cpl_tx_data_iso); if (plen <= max_imm) { - /* Immediate data tx */ - - wr = alloc_wrqe(roundup2(sizeof(*txwr) + plen, 16), - &toep->ofld_txq->wrq); - if (wr == NULL) { - /* XXX: how will we recover from this? */ - return (NULL); - } - txwr = wrtod(wr); - credits = howmany(wr->wr_len, 16); - write_tx_wr(txwr, toep, plen, adjusted_plen, credits, - shove, ulp_submode); - m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); + imm_data = plen; + wr_len += plen; nsegs = 0; } else { - int wr_len; - /* DSGL tx */ - wr_len = sizeof(*txwr) + sizeof(struct ulptx_sgl) + + imm_data = 0; + wr_len += sizeof(struct ulptx_sgl) + ((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; - wr = alloc_wrqe(roundup2(wr_len, 16), - &toep->ofld_txq->wrq); - if (wr == NULL) { - /* XXX: how will we recover from this? */ - return (NULL); - } - txwr = wrtod(wr); - credits = howmany(wr_len, 16); - write_tx_wr(txwr, toep, 0, adjusted_plen, credits, - shove, ulp_submode); - write_tx_sgl(txwr + 1, sndptr, m, nsegs, max_nsegs_1mbuf); + } + + wr = alloc_wrqe(roundup2(wr_len, 16), &toep->ofld_txq->wrq); + if (wr == NULL) { + /* XXX: how will we recover from this? */ + return (NULL); + } + txwr = wrtod(wr); + credits = howmany(wr->wr_len, 16); + + if (iso) { + write_tx_wr(txwr, toep, FW_ISCSI_TX_DATA_WR, + imm_data + sizeof(struct cpl_tx_data_iso), + adjusted_plen, credits, shove, ulp_submode | ULP_ISO); + cpl_iso = (struct cpl_tx_data_iso *)(txwr + 1); + MPASS(plen == sndptr->m_pkthdr.len); + write_tx_data_iso(cpl_iso, ulp_submode, + mbuf_iscsi_iso_flags(sndptr), iso_mss, plen, npdu); + p = cpl_iso + 1; + } else { + write_tx_wr(txwr, toep, FW_OFLD_TX_DATA_WR, imm_data, + adjusted_plen, credits, shove, ulp_submode); + p = txwr + 1; + } + + if (imm_data != 0) { + m_copydata(sndptr, 0, plen, p); + } else { + write_tx_sgl(p, sndptr, m, nsegs, max_nsegs_1mbuf); if (wr_len & 0xf) { uint64_t *pad = (uint64_t *)((uintptr_t)txwr + wr_len); *pad = 0; } } + KASSERT(toep->tx_credits >= credits, + ("%s: not enough credits: credits %u " + "toep->tx_credits %u tx_credits %u nsegs %u " + "max_nsegs %u iso %d", __func__, credits, + toep->tx_credits, tx_credits, nsegs, max_nsegs, iso)); + tp->snd_nxt += adjusted_plen; tp->snd_max += adjusted_plen; - counter_u64_add(toep->ofld_txq->tx_iscsi_pdus, 1); + counter_u64_add(toep->ofld_txq->tx_iscsi_pdus, npdu); counter_u64_add(toep->ofld_txq->tx_iscsi_octets, plen); + if (iso) + counter_u64_add(toep->ofld_txq->tx_iscsi_iso_wrs, 1); return (wr); } diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index 5dd04ff548e5..10d9cfe87960 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -362,6 +362,58 @@ mbuf_ulp_submode(struct mbuf *m) return (m->m_pkthdr.PH_per.eight[0]); } +static inline void +set_mbuf_iscsi_iso(struct mbuf *m, bool iso) +{ + + M_ASSERTPKTHDR(m); + m->m_pkthdr.PH_per.eight[1] = iso; +} + +static inline bool +mbuf_iscsi_iso(struct mbuf *m) +{ + + M_ASSERTPKTHDR(m); + return (m->m_pkthdr.PH_per.eight[1]); +} + +/* Flags for iSCSI segmentation offload. */ +#define CXGBE_ISO_TYPE(flags) ((flags) & 0x3) +#define CXGBE_ISO_F 0x4 + +static inline void +set_mbuf_iscsi_iso_flags(struct mbuf *m, uint8_t flags) +{ + + M_ASSERTPKTHDR(m); + m->m_pkthdr.PH_per.eight[2] = flags; +} + +static inline uint8_t +mbuf_iscsi_iso_flags(struct mbuf *m) +{ + + M_ASSERTPKTHDR(m); + return (m->m_pkthdr.PH_per.eight[2]); +} + +static inline void +set_mbuf_iscsi_iso_mss(struct mbuf *m, uint16_t mss) +{ + + M_ASSERTPKTHDR(m); + m->m_pkthdr.PH_per.sixteen[2] = mss; +} + +static inline uint16_t +mbuf_iscsi_iso_mss(struct mbuf *m) +{ + + M_ASSERTPKTHDR(m); + return (m->m_pkthdr.PH_per.sixteen[2]); +} + /* t4_tom.c */ struct toepcb *alloc_toepcb(struct vi_info *, int); int init_toepcb(struct vi_info *, struct toepcb *); From owner-dev-commits-src-main@freebsd.org Fri Aug 6 23:10:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20C2B660787; Fri, 6 Aug 2021 23:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhLmf09B0z3mGl; Fri, 6 Aug 2021 23:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E224716520; Fri, 6 Aug 2021 23:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 176NAPWq043871; Fri, 6 Aug 2021 23:10:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 176NAPf2043870; Fri, 6 Aug 2021 23:10:25 GMT (envelope-from git) Date: Fri, 6 Aug 2021 23:10:25 GMT Message-Id: <202108062310.176NAPf2043870@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: fd0ffba3b4c9 - main - Fix pathconf.2 documentation error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd0ffba3b4c9edfc79590f98729dfa34abba6100 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 23:10:26 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=fd0ffba3b4c9edfc79590f98729dfa34abba6100 commit fd0ffba3b4c9edfc79590f98729dfa34abba6100 Author: Ka Ho Ng AuthorDate: 2021-08-06 23:09:57 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-06 23:09:57 +0000 Fix pathconf.2 documentation error _PC_MIN_HOLE_SIZE and _PC_DEALLOC_PRESENT were mixed somehow before this fix. Sponsored by: The FreeBSD Foundation Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D31436 --- lib/libc/sys/pathconf.2 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/pathconf.2 b/lib/libc/sys/pathconf.2 index c5a7ba1be3c5..5586e460185b 100644 --- a/lib/libc/sys/pathconf.2 +++ b/lib/libc/sys/pathconf.2 @@ -28,7 +28,7 @@ .\" @(#)pathconf.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd August 6, 2021 .Dt PATHCONF 2 .Os .Sh NAME @@ -166,9 +166,6 @@ specified file, otherwise 0. .It Li _PC_MIN_HOLE_SIZE If a file system supports the reporting of holes (see .Xr lseek 2 ) , -.It Li _PC_DEALLOC_PRESENT -If a file system supports hole-punching (see -.Xr fspacectl 2 ) , .Fn pathconf and .Fn fpathconf @@ -177,6 +174,10 @@ bytes. The offsets of holes returned will be aligned to this same value. A special value of 1 is returned if the file system does not specify the minimum hole size but still reports holes. +.It Li _PC_DEALLOC_PRESENT +Return 1 if a file system supports hole-punching (see +.Xr fspacectl 2 ) , +otherwise 0. .El .Sh RETURN VALUES If the call to From owner-dev-commits-src-main@freebsd.org Sat Aug 7 01:44:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E89DD662918; Sat, 7 Aug 2021 01:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhQBJ60Lqz4QqD; Sat, 7 Aug 2021 01:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5E3018836; Sat, 7 Aug 2021 01:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1771iO3s048633; Sat, 7 Aug 2021 01:44:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1771iOwi048632; Sat, 7 Aug 2021 01:44:24 GMT (envelope-from git) Date: Sat, 7 Aug 2021 01:44:24 GMT Message-Id: <202108070144.1771iOwi048632@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: c18c74a87c15 - main - namei: Add cn_flags bits for OPENREAD and OPENWRITE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c18c74a87c15f5f8774df7e2f8fa0fe72422203d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 01:44:25 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c18c74a87c15f5f8774df7e2f8fa0fe72422203d commit c18c74a87c15f5f8774df7e2f8fa0fe72422203d Author: Rick Macklem AuthorDate: 2021-08-07 01:41:11 +0000 Commit: Rick Macklem CommitDate: 2021-08-07 01:41:11 +0000 namei: Add cn_flags bits for OPENREAD and OPENWRITE VOP_LOOKUP() is called with cn_flags bits ISLASTCN and ISOPEN to indicate that the lookup is for the last component of a pathname when doing open. If the cn_flags also indicates if the open is for Reading, Writing or Both, the NFSv4 client can do an NFSv4 Open operation in the same compound RPC as Lookup, often avoiding the additional Open RPC now done when VOP_OPEN() is called. This patch defines two new cn_flags bits called OPENREAD and OPENWRITE and sets these in open2nameif() based on FREAD, FWRITE flag bits. This will allow a subsequent patch to the NFSv4 client to do the Open operation in the same RPC as Lookup. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D31431 --- sys/kern/vfs_vnops.c | 4 ++++ sys/sys/namei.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index c54f55a99036..832ade5d800e 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -205,6 +205,10 @@ open2nameif(int fmode, u_int vn_open_flags) res |= RBENEATH; if ((fmode & O_EMPTY_PATH) != 0) res |= EMPTYPATH; + if ((fmode & FREAD) != 0) + res |= OPENREAD; + if ((fmode & FWRITE) != 0) + res |= OPENWRITE; if ((vn_open_flags & VN_OPEN_NOAUDIT) == 0) res |= AUDITVNODE1; if ((vn_open_flags & VN_OPEN_NOCAPCHECK) != 0) diff --git a/sys/sys/namei.h b/sys/sys/namei.h index 9e0a82ea1659..3f6e59289f0a 100644 --- a/sys/sys/namei.h +++ b/sys/sys/namei.h @@ -183,8 +183,8 @@ int cache_fplookup(struct nameidata *ndp, enum cache_fpl_status *status, #define AUDITVNODE1 0x00040000 /* audit the looked up vnode information */ #define AUDITVNODE2 0x00080000 /* audit the looked up vnode information */ #define NOCAPCHECK 0x00100000 /* do not perform capability checks */ -/* UNUSED 0x00200000 */ -/* UNUSED 0x00400000 */ +#define OPENREAD 0x00200000 /* open for reading */ +#define OPENWRITE 0x00400000 /* open for writing */ /* UNUSED 0x00800000 */ #define HASBUF 0x01000000 /* has allocated pathname buffer */ #define NOEXECCHECK 0x02000000 /* do not perform exec check on dir */ From owner-dev-commits-src-main@freebsd.org Sat Aug 7 09:11:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4B7B667E83; Sat, 7 Aug 2021 09:11:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ghc5z6BNVz4tcw; Sat, 7 Aug 2021 09:11:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDE421E4FE; Sat, 7 Aug 2021 09:11:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1779BJs5045409; Sat, 7 Aug 2021 09:11:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1779BJki045408; Sat, 7 Aug 2021 09:11:19 GMT (envelope-from git) Date: Sat, 7 Aug 2021 09:11:19 GMT Message-Id: <202108070911.1779BJki045408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 3676512b60d6 - main - bhyve: Use fspacectl(2) for BOP_DELETE on regular file images MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3676512b60d65ff68fb807ede2fa6e89af18c490 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 09:11:20 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=3676512b60d65ff68fb807ede2fa6e89af18c490 commit 3676512b60d65ff68fb807ede2fa6e89af18c490 Author: Ka Ho Ng AuthorDate: 2021-08-07 09:10:30 +0000 Commit: Ka Ho Ng CommitDate: 2021-08-07 09:10:30 +0000 bhyve: Use fspacectl(2) for BOP_DELETE on regular file images bhyve can also make use of fspacectl(2) to implement BOP_DELETE with hole-punching. Since it is not desirable to do zero-filling for large DEALLOCATE/UNMAP range, candelete is not set if pathconf(2) indicates that the underlying file system does not support native VOP_DEALLOCATE(9). Sponsored by: The FreeBSD Foundation Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D28880 --- usr.sbin/bhyve/block_if.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/block_if.c b/usr.sbin/bhyve/block_if.c index 98c0f9f5f38b..9d7371bec50f 100644 --- a/usr.sbin/bhyve/block_if.c +++ b/usr.sbin/bhyve/block_if.c @@ -239,6 +239,7 @@ blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be, uint8_t *buf) off_t arg[2]; ssize_t clen, len, off, boff, voff; int i, err; + struct spacectl_range range; br = be->be_req; if (br->br_iovcnt <= 1) @@ -336,8 +337,20 @@ blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be, uint8_t *buf) err = errno; else br->br_resid = 0; - } else - err = EOPNOTSUPP; + } else { + range.r_offset = br->br_offset; + range.r_len = br->br_resid; + + while (range.r_len > 0) { + if (fspacectl(bc->bc_fd, SPACECTL_DEALLOC, + &range, 0, &range) != 0) { + err = errno; + break; + } + } + if (err == 0) + br->br_resid = 0; + } break; default: err = EINVAL; @@ -566,8 +579,11 @@ blockif_open(nvlist_t *nvl, const char *ident) candelete = arg.value.i; if (ioctl(fd, DIOCGPROVIDERNAME, name) == 0) geom = 1; - } else + } else { psectsz = sbuf.st_blksize; + /* Avoid fallback implementation */ + candelete = fpathconf(fd, _PC_DEALLOC_PRESENT) == 1; + } #ifndef WITHOUT_CAPSICUM if (caph_ioctls_limit(fd, cmds, nitems(cmds)) == -1) From owner-dev-commits-src-main@freebsd.org Sat Aug 7 10:05:50 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AFAC668885; Sat, 7 Aug 2021 10:05:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhdJt0pG0z3D3y; Sat, 7 Aug 2021 10:05:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3DE51F1F2; Sat, 7 Aug 2021 10:05:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177A5np4017084; Sat, 7 Aug 2021 10:05:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177A5nrD017083; Sat, 7 Aug 2021 10:05:49 GMT (envelope-from git) Date: Sat, 7 Aug 2021 10:05:49 GMT Message-Id: <202108071005.177A5nrD017083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 0b79b007ebfc - main - [lltable] Restructure nd6 code. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b79b007ebfc250a8a7b928df268ada6f1c988c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 10:05:50 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=0b79b007ebfc250a8a7b928df268ada6f1c988c4 commit 0b79b007ebfc250a8a7b928df268ada6f1c988c4 Author: Alexander V. Chernikov AuthorDate: 2021-08-06 08:27:22 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-08-07 09:59:11 +0000 [lltable] Restructure nd6 code. Factor out lltable locking logic from lltable_try_set_entry_addr() into a separate lltable_acquire_wlock(), so the latter can be used in other parts of the code w/o duplication. Create nd6_try_set_entry_addr() to avoid code duplication in nd6.c and nd6_nbr.c. Move lle creation logic from nd6_resolve_slow() into a separate nd6_get_llentry() to simplify the former. These changes serve as a pre-requisite for implementing RFC8950 (IPv4 prefixes with IPv6 nexthops). Differential Revision: https://reviews.freebsd.org/D31432 MFC after: 2 weeks --- sys/net/if_llatbl.c | 40 +++++++++++------ sys/net/if_llatbl.h | 2 + sys/netinet6/nd6.c | 114 ++++++++++++++++++++++++++++++++----------------- sys/netinet6/nd6.h | 1 + sys/netinet6/nd6_nbr.c | 11 +---- 5 files changed, 105 insertions(+), 63 deletions(-) diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c index 70baf58c2778..c656974c80ee 100644 --- a/sys/net/if_llatbl.c +++ b/sys/net/if_llatbl.c @@ -318,22 +318,18 @@ lltable_set_entry_addr(struct ifnet *ifp, struct llentry *lle, } /* - * Tries to update @lle link-level address. - * Since update requires AFDATA WLOCK, function - * drops @lle lock, acquires AFDATA lock and then acquires - * @lle lock to maintain lock order. + * Acquires lltable write lock. * - * Returns 1 on success. + * Returns true on success, with both lltable and lle lock held. + * On failure, false is returned and lle wlock is still held. */ -int -lltable_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle, - const char *linkhdr, size_t linkhdrsize, int lladdr_off) +bool +lltable_acquire_wlock(struct ifnet *ifp, struct llentry *lle) { + NET_EPOCH_ASSERT(); /* Perform real LLE update */ /* use afdata WLOCK to update fields */ - LLE_WLOCK_ASSERT(lle); - LLE_ADDREF(lle); LLE_WUNLOCK(lle); IF_AFDATA_WLOCK(ifp); LLE_WLOCK(lle); @@ -344,17 +340,33 @@ lltable_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle, */ if ((lle->la_flags & LLE_DELETED) != 0) { IF_AFDATA_WUNLOCK(ifp); - LLE_FREE_LOCKED(lle); - return (0); + return (false); } + return (true); +} + +/* + * Tries to update @lle link-level address. + * Since update requires AFDATA WLOCK, function + * drops @lle lock, acquires AFDATA lock and then acquires + * @lle lock to maintain lock order. + * + * Returns 1 on success. + */ +int +lltable_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle, + const char *linkhdr, size_t linkhdrsize, int lladdr_off) +{ + + if (!lltable_acquire_wlock(ifp, lle)) + return (0); + /* Update data */ lltable_set_entry_addr(ifp, lle, linkhdr, linkhdrsize, lladdr_off); IF_AFDATA_WUNLOCK(ifp); - LLE_REMREF(lle); - return (1); } diff --git a/sys/net/if_llatbl.h b/sys/net/if_llatbl.h index 488f8b006315..ffbaa7a946bb 100644 --- a/sys/net/if_llatbl.h +++ b/sys/net/if_llatbl.h @@ -238,6 +238,8 @@ void lltable_fill_sa_entry(const struct llentry *lle, struct sockaddr *sa); struct ifnet *lltable_get_ifp(const struct lltable *llt); int lltable_get_af(const struct lltable *llt); +bool lltable_acquire_wlock(struct ifnet *ifp, struct llentry *lle); + int lltable_foreach_lle(struct lltable *llt, llt_foreach_cb_t *f, void *farg); /* diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 437fdb5d4e52..5166186f56dc 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1382,6 +1382,35 @@ nd6_is_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp) return (rc); } +/* + * Tries to update @lle address/prepend data with new @lladdr. + * + * Returns true on success. + * In any case, @lle is returned wlocked. + */ +bool +nd6_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle, char *lladdr) +{ + u_char linkhdr[LLE_MAX_LINKHDR]; + size_t linkhdrsize; + int lladdr_off; + + LLE_WLOCK_ASSERT(lle); + + linkhdrsize = sizeof(linkhdr); + if (lltable_calc_llheader(ifp, AF_INET6, lladdr, + linkhdr, &linkhdrsize, &lladdr_off) != 0) { + return (false); + } + + if (!lltable_acquire_wlock(ifp, lle)) + return (false); + lltable_set_entry_addr(ifp, lle, linkhdr, linkhdrsize, lladdr_off); + IF_AFDATA_WUNLOCK(ifp); + + return (true); +} + /* * Free an nd6 llinfo entry. * Since the function would cause significant changes in the kernel, DO NOT @@ -2027,14 +2056,9 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, * Record source link-layer address * XXX is it dependent to ifp->if_type? */ - linkhdrsize = sizeof(linkhdr); - if (lltable_calc_llheader(ifp, AF_INET6, lladdr, - linkhdr, &linkhdrsize, &lladdr_off) != 0) - return; - - if (lltable_try_set_entry_addr(ifp, ln, linkhdr, linkhdrsize, - lladdr_off) == 0) { + if (!nd6_try_set_entry_addr(ifp, ln, lladdr)) { /* Entry was deleted */ + LLE_WUNLOCK(ln); return; } @@ -2257,6 +2281,39 @@ nd6_resolve(struct ifnet *ifp, int is_gw, struct mbuf *m, return (nd6_resolve_slow(ifp, 0, m, dst6, desten, pflags, plle)); } +/* + * Finds or creates a new llentry for @addr. + * Returns wlocked llentry or NULL. + */ +static __noinline struct llentry * +nd6_get_llentry(struct ifnet *ifp, const struct in6_addr *addr) +{ + struct llentry *lle, *lle_tmp; + + lle = nd6_alloc(addr, 0, ifp); + if (lle == NULL) { + char ip6buf[INET6_ADDRSTRLEN]; + log(LOG_DEBUG, + "nd6_get_llentry: can't allocate llinfo for %s " + "(ln=%p)\n", + ip6_sprintf(ip6buf, addr), lle); + return (NULL); + } + + IF_AFDATA_WLOCK(ifp); + LLE_WLOCK(lle); + /* Prefer any existing entry over newly-created one */ + lle_tmp = nd6_lookup(addr, LLE_EXCLUSIVE, ifp); + if (lle_tmp == NULL) + lltable_link_entry(LLTABLE6(ifp), lle); + IF_AFDATA_WUNLOCK(ifp); + if (lle_tmp != NULL) { + lltable_free_entry(LLTABLE6(ifp), lle); + return (lle_tmp); + } else + return (lle); +} + /* * Do L2 address resolution for @sa_dst address. Stores found * address in @desten buffer. Copy of lle ln_flags can be also @@ -2273,7 +2330,7 @@ nd6_resolve_slow(struct ifnet *ifp, int flags, struct mbuf *m, const struct sockaddr_in6 *dst, u_char *desten, uint32_t *pflags, struct llentry **plle) { - struct llentry *lle = NULL, *lle_tmp; + struct llentry *lle = NULL; struct in6_addr *psrc, src; int send_ns, ll_len; char *lladdr; @@ -2286,39 +2343,16 @@ nd6_resolve_slow(struct ifnet *ifp, int flags, struct mbuf *m, * At this point, the destination of the packet must be a unicast * or an anycast address(i.e. not a multicast). */ - if (lle == NULL) { - lle = nd6_lookup(&dst->sin6_addr, LLE_EXCLUSIVE, ifp); - if ((lle == NULL) && nd6_is_addr_neighbor(dst, ifp)) { - /* - * Since nd6_is_addr_neighbor() internally calls nd6_lookup(), - * the condition below is not very efficient. But we believe - * it is tolerable, because this should be a rare case. - */ - lle = nd6_alloc(&dst->sin6_addr, 0, ifp); - if (lle == NULL) { - char ip6buf[INET6_ADDRSTRLEN]; - log(LOG_DEBUG, - "nd6_output: can't allocate llinfo for %s " - "(ln=%p)\n", - ip6_sprintf(ip6buf, &dst->sin6_addr), lle); - m_freem(m); - return (ENOBUFS); - } + lle = nd6_lookup(&dst->sin6_addr, LLE_EXCLUSIVE, ifp); + if ((lle == NULL) && nd6_is_addr_neighbor(dst, ifp)) { + /* + * Since nd6_is_addr_neighbor() internally calls nd6_lookup(), + * the condition below is not very efficient. But we believe + * it is tolerable, because this should be a rare case. + */ + lle = nd6_get_llentry(ifp, &dst->sin6_addr); + } - IF_AFDATA_WLOCK(ifp); - LLE_WLOCK(lle); - /* Prefer any existing entry over newly-created one */ - lle_tmp = nd6_lookup(&dst->sin6_addr, LLE_EXCLUSIVE, ifp); - if (lle_tmp == NULL) - lltable_link_entry(LLTABLE6(ifp), lle); - IF_AFDATA_WUNLOCK(ifp); - if (lle_tmp != NULL) { - lltable_free_entry(LLTABLE6(ifp), lle); - lle = lle_tmp; - lle_tmp = NULL; - } - } - } if (lle == NULL) { m_freem(m); return (ENOBUFS); diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index ee53acce840a..fe0f2b22cc48 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -376,6 +376,7 @@ int nd6_resolve(struct ifnet *, int, struct mbuf *, int nd6_ioctl(u_long, caddr_t, struct ifnet *); void nd6_cache_lladdr(struct ifnet *, struct in6_addr *, char *, int, int, int); +bool nd6_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle, char *lladdr); struct mbuf *nd6_grab_holdchain(struct llentry *); int nd6_flush_holdchain(struct ifnet *, struct llentry *, struct mbuf *); int nd6_add_ifa_lle(struct in6_ifaddr *); diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 0f18a38c37a1..974c454e93a5 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -770,16 +770,9 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) /* * Record link-layer address, and update the state. */ - linkhdrsize = sizeof(linkhdr); - if (lltable_calc_llheader(ifp, AF_INET6, lladdr, - linkhdr, &linkhdrsize, &lladdr_off) != 0) - return; - - if (lltable_try_set_entry_addr(ifp, ln, linkhdr, linkhdrsize, - lladdr_off) == 0) { - ln = NULL; + if (!nd6_try_set_entry_addr(ifp, ln, lladdr)) goto freeit; - } + EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED); if (is_solicited) nd6_llinfo_setstate(ln, ND6_LLINFO_REACHABLE); From owner-dev-commits-src-main@freebsd.org Sat Aug 7 11:06:29 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15F9E669388; Sat, 7 Aug 2021 11:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ghffr714Kz3Gvg; Sat, 7 Aug 2021 11:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D89E720305; Sat, 7 Aug 2021 11:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177B6SHk096765; Sat, 7 Aug 2021 11:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177B6SW0096764; Sat, 7 Aug 2021 11:06:28 GMT (envelope-from git) Date: Sat, 7 Aug 2021 11:06:28 GMT Message-Id: <202108071106.177B6SW0096764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: b30e7cb7fa9c - main - cache: add OPENREAD and OPENWRITE to fast path lookup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b30e7cb7fa9c521bda8fa7eeeb95205543827539 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 11:06:29 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b30e7cb7fa9c521bda8fa7eeeb95205543827539 commit b30e7cb7fa9c521bda8fa7eeeb95205543827539 Author: Mateusz Guzik AuthorDate: 2021-08-07 11:02:38 +0000 Commit: Mateusz Guzik CommitDate: 2021-08-07 11:02:38 +0000 cache: add OPENREAD and OPENWRITE to fast path lookup --- sys/kern/vfs_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 09f926d0cd31..199da865e39c 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4175,7 +4175,8 @@ cache_fpl_terminated(struct cache_fpl *fpl) #define CACHE_FPL_SUPPORTED_CN_FLAGS \ (NC_NOMAKEENTRY | NC_KEEPPOSENTRY | LOCKLEAF | LOCKPARENT | WANTPARENT | \ FAILIFEXISTS | FOLLOW | LOCKSHARED | SAVENAME | SAVESTART | WILLBEDIR | \ - ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK) + ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2 | NOCAPCHECK | OPENREAD | \ + OPENWRITE) #define CACHE_FPL_INTERNAL_CN_FLAGS \ (ISDOTDOT | MAKEENTRY | ISLASTCN) From owner-dev-commits-src-main@freebsd.org Sat Aug 7 11:14:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80351669760; Sat, 7 Aug 2021 11:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ghfrd2yNxz3HVQ; Sat, 7 Aug 2021 11:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4965F20258; Sat, 7 Aug 2021 11:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177BEvvJ010866; Sat, 7 Aug 2021 11:14:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177BEvP1010865; Sat, 7 Aug 2021 11:14:57 GMT (envelope-from git) Date: Sat, 7 Aug 2021 11:14:57 GMT Message-Id: <202108071114.177BEvP1010865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: d69d07569ee2 - main - Apply upstream lld fix for compressed input sections on BE targets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d69d07569ee2404705ff4c4abb45dc0b884eeb35 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 11:14:57 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d69d07569ee2404705ff4c4abb45dc0b884eeb35 commit d69d07569ee2404705ff4c4abb45dc0b884eeb35 Author: Dimitry Andric AuthorDate: 2021-08-07 11:14:11 +0000 Commit: Dimitry Andric CommitDate: 2021-08-07 11:14:11 +0000 Apply upstream lld fix for compressed input sections on BE targets Merge commit c6ebc651b6fa from llvm git (by Simon Atanasyan): [LLD] Support compressed input sections on big-endian targets This patch enables compressed input sections on big-endian targets by checking the target endianness and selecting an appropriate `Chdr` structure. Fixes PR51369 Differential Revision: https://reviews.llvm.org/D107635 Reported by: emaste MFC after: 3 days --- contrib/llvm-project/lld/ELF/InputSection.cpp | 47 ++++++++++++--------------- contrib/llvm-project/lld/ELF/InputSection.h | 1 + 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/contrib/llvm-project/lld/ELF/InputSection.cpp b/contrib/llvm-project/lld/ELF/InputSection.cpp index 6f16fc7abc48..f9cad7f975a7 100644 --- a/contrib/llvm-project/lld/ELF/InputSection.cpp +++ b/contrib/llvm-project/lld/ELF/InputSection.cpp @@ -88,7 +88,22 @@ InputSectionBase::InputSectionBase(InputFile *file, uint64_t flags, if (!zlib::isAvailable()) error(toString(file) + ": contains a compressed section, " + "but zlib is not available"); - parseCompressedHeader(); + switch (config->ekind) { + case ELF32LEKind: + parseCompressedHeader(); + break; + case ELF32BEKind: + parseCompressedHeader(); + break; + case ELF64LEKind: + parseCompressedHeader(); + break; + case ELF64BEKind: + parseCompressedHeader(); + break; + default: + llvm_unreachable("unknown ELFT"); + } } } @@ -210,10 +225,7 @@ OutputSection *SectionBase::getOutputSection() { // When a section is compressed, `rawData` consists with a header followed // by zlib-compressed data. This function parses a header to initialize // `uncompressedSize` member and remove the header from `rawData`. -void InputSectionBase::parseCompressedHeader() { - using Chdr64 = typename ELF64LE::Chdr; - using Chdr32 = typename ELF32LE::Chdr; - +template void InputSectionBase::parseCompressedHeader() { // Old-style header if (name.startswith(".zdebug")) { if (!toStringRef(rawData).startswith("ZLIB")) { @@ -239,32 +251,13 @@ void InputSectionBase::parseCompressedHeader() { assert(flags & SHF_COMPRESSED); flags &= ~(uint64_t)SHF_COMPRESSED; - // New-style 64-bit header - if (config->is64) { - if (rawData.size() < sizeof(Chdr64)) { - error(toString(this) + ": corrupted compressed section"); - return; - } - - auto *hdr = reinterpret_cast(rawData.data()); - if (hdr->ch_type != ELFCOMPRESS_ZLIB) { - error(toString(this) + ": unsupported compression type"); - return; - } - - uncompressedSize = hdr->ch_size; - alignment = std::max(hdr->ch_addralign, 1); - rawData = rawData.slice(sizeof(*hdr)); - return; - } - - // New-style 32-bit header - if (rawData.size() < sizeof(Chdr32)) { + // New-style header + if (rawData.size() < sizeof(typename ELFT::Chdr)) { error(toString(this) + ": corrupted compressed section"); return; } - auto *hdr = reinterpret_cast(rawData.data()); + auto *hdr = reinterpret_cast(rawData.data()); if (hdr->ch_type != ELFCOMPRESS_ZLIB) { error(toString(this) + ": unsupported compression type"); return; diff --git a/contrib/llvm-project/lld/ELF/InputSection.h b/contrib/llvm-project/lld/ELF/InputSection.h index 5b91c1c90bd2..c914d0b42155 100644 --- a/contrib/llvm-project/lld/ELF/InputSection.h +++ b/contrib/llvm-project/lld/ELF/InputSection.h @@ -238,6 +238,7 @@ public: } protected: + template void parseCompressedHeader(); void uncompress() const; From owner-dev-commits-src-main@freebsd.org Sat Aug 7 12:57:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5068866B272; Sat, 7 Aug 2021 12:57:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ghj6v1TXlz3Pvs; Sat, 7 Aug 2021 12:57:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16847218B7; Sat, 7 Aug 2021 12:57:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177CvQTg042847; Sat, 7 Aug 2021 12:57:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177CvQZp042846; Sat, 7 Aug 2021 12:57:26 GMT (envelope-from git) Date: Sat, 7 Aug 2021 12:57:26 GMT Message-Id: <202108071257.177CvQZp042846@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: b732091a761a - main - sctp: improve input validation of mapped addresses in send() Reported by: syzbot+35528f275f2eea6317cc@syzkaller.appspotmail.com Reported by: syzbot+ac29916d5f16d241553d@syzkaller.appspotmail.com MFC after: 3 days MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b732091a761a04c7a04229f28642d27dc48485d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 12:57:27 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=b732091a761a04c7a04229f28642d27dc48485d8 commit b732091a761a04c7a04229f28642d27dc48485d8 Author: Michael Tuexen AuthorDate: 2021-08-07 12:50:40 +0000 Commit: Michael Tuexen CommitDate: 2021-08-07 12:50:40 +0000 sctp: improve input validation of mapped addresses in send() Reported by: syzbot+35528f275f2eea6317cc@syzkaller.appspotmail.com Reported by: syzbot+ac29916d5f16d241553d@syzkaller.appspotmail.com MFC after: 3 days --- sys/netinet/sctp_output.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index e34534e80fa3..5e9aff7bfba9 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -12434,9 +12434,13 @@ sctp_sosend(struct socket *so, } addr_to_use = addr; #if defined(INET) && defined(INET6) - if ((addr) && (addr->sa_family == AF_INET6)) { + if ((addr != NULL) && (addr->sa_family == AF_INET6)) { struct sockaddr_in6 *sin6; + if (addr->sa_len != sizeof(struct sockaddr_in6)) { + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL); + return (EINVAL); + } sin6 = (struct sockaddr_in6 *)addr; if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { in6_sin6_2_sin(&sin, sin6); From owner-dev-commits-src-main@freebsd.org Sat Aug 7 13:13:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7F0766B5B0; Sat, 7 Aug 2021 13:13:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhjTd5yPdz3QhY; Sat, 7 Aug 2021 13:13:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4AB921CD4; Sat, 7 Aug 2021 13:13:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177DDfdF069976; Sat, 7 Aug 2021 13:13:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177DDf8O069975; Sat, 7 Aug 2021 13:13:41 GMT (envelope-from git) Date: Sat, 7 Aug 2021 13:13:41 GMT Message-Id: <202108071313.177DDf8O069975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 112899c6afc5 - main - sctp: improve input validation of mapped addresses in sctp_connectx() MFC after: 3 days MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 112899c6afc5d174445b6ab4738b8eb4de19d835 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 13:13:42 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=112899c6afc5d174445b6ab4738b8eb4de19d835 commit 112899c6afc5d174445b6ab4738b8eb4de19d835 Author: Michael Tuexen AuthorDate: 2021-08-07 13:12:09 +0000 Commit: Michael Tuexen CommitDate: 2021-08-07 13:12:09 +0000 sctp: improve input validation of mapped addresses in sctp_connectx() MFC after: 3 days --- sys/netinet/sctputil.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index ad4409f666df..f331fb70ded5 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -6716,15 +6716,15 @@ sctp_connectx_helper_find(struct sctp_inpcb *inp, struct sockaddr *addr, { struct sockaddr_in6 *sin6; + incr = (unsigned int)sizeof(struct sockaddr_in6); + if (sa->sa_len != incr) { + return (EINVAL); + } sin6 = (struct sockaddr_in6 *)sa; if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { /* Must be non-mapped for connectx */ return (EINVAL); } - incr = (unsigned int)sizeof(struct sockaddr_in6); - if (sa->sa_len != incr) { - return (EINVAL); - } (*num_v6) += 1; break; } From owner-dev-commits-src-main@freebsd.org Sat Aug 7 15:30:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12B5066CDA9; Sat, 7 Aug 2021 15:30:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhmWP6mHbz3pQy; Sat, 7 Aug 2021 15:30:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDF4E23899; Sat, 7 Aug 2021 15:30:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177FUPSM051338; Sat, 7 Aug 2021 15:30:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177FUPab051337; Sat, 7 Aug 2021 15:30:25 GMT (envelope-from git) Date: Sat, 7 Aug 2021 15:30:25 GMT Message-Id: <202108071530.177FUPab051337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 784692c74019 - main - sctp: improve handling of IPv4 addresses on IPV6 sockets Reported by: syzbot+08fe66e4bfc2777cba95@syzkaller.appspotmail.com MFC after: 3 days MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 784692c74019fa69b5298fb1693a97f107c56b4b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 15:30:26 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=784692c74019fa69b5298fb1693a97f107c56b4b commit 784692c74019fa69b5298fb1693a97f107c56b4b Author: Michael Tuexen AuthorDate: 2021-08-07 15:27:56 +0000 Commit: Michael Tuexen CommitDate: 2021-08-07 15:27:56 +0000 sctp: improve handling of IPv4 addresses on IPV6 sockets Reported by: syzbot+08fe66e4bfc2777cba95@syzkaller.appspotmail.com MFC after: 3 days --- sys/netinet6/sctp6_usrreq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index 6f5d639e6367..fcbb566b53d3 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -771,7 +771,8 @@ sctp6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, return (EINVAL); } } - if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + if ((addr->sa_family == AF_INET6) && + IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { struct sockaddr_in sin; /* convert v4-mapped into v4 addr and send */ @@ -909,7 +910,8 @@ sctp6_connect(struct socket *so, struct sockaddr *addr, struct thread *p) return (EINVAL); } } - if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + if ((addr->sa_family == AF_INET6) && + IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { /* convert v4-mapped into v4 addr */ in6_sin6_2_sin(&store.sin, sin6); addr = &store.sa; From owner-dev-commits-src-main@freebsd.org Sat Aug 7 17:15:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF56F66E623; Sat, 7 Aug 2021 17:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ghpr55kN4z4VJ2; Sat, 7 Aug 2021 17:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC98324F66; Sat, 7 Aug 2021 17:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177HF1ZY089758; Sat, 7 Aug 2021 17:15:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177HF1u5089757; Sat, 7 Aug 2021 17:15:01 GMT (envelope-from git) Date: Sat, 7 Aug 2021 17:15:01 GMT Message-Id: <202108071715.177HF1u5089757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: cd38d9cf26db - main - Follow-up to d69d07569ee2 by bumping lld local version MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd38d9cf26db9264f709c52469f0f4e9684d62bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 17:15:01 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=cd38d9cf26db9264f709c52469f0f4e9684d62bb commit cd38d9cf26db9264f709c52469f0f4e9684d62bb Author: Dimitry Andric AuthorDate: 2021-08-07 17:14:31 +0000 Commit: Dimitry Andric CommitDate: 2021-08-07 17:14:31 +0000 Follow-up to d69d07569ee2 by bumping lld local version This makes it easier to detect that lld's support for compressed input sections on BE targets is fixed. MFC after: 3 days X-MFC-With: d69d07569ee2 --- lib/clang/include/VCSVersion.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/clang/include/VCSVersion.inc b/lib/clang/include/VCSVersion.inc index cb7736e7d7de..8c1798de59ee 100644 --- a/lib/clang/include/VCSVersion.inc +++ b/lib/clang/include/VCSVersion.inc @@ -7,7 +7,7 @@ #define CLANG_REPOSITORY "git@github.com:llvm/llvm-project.git" // - -#define LLD_REVISION "llvmorg-12.0.1-0-gfed41342a82f-1400001" +#define LLD_REVISION "llvmorg-12.0.1-0-gfed41342a82f-1400002" #define LLD_REPOSITORY "FreeBSD" #define LLDB_REVISION "llvmorg-12.0.1-0-gfed41342a82f" From owner-dev-commits-src-main@freebsd.org Sat Aug 7 17:33:15 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C00066EBC6; Sat, 7 Aug 2021 17:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhqF66rS4z4WGL; Sat, 7 Aug 2021 17:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C37B5253BB; Sat, 7 Aug 2021 17:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177HXE1I015922; Sat, 7 Aug 2021 17:33:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177HXEEt015921; Sat, 7 Aug 2021 17:33:14 GMT (envelope-from git) Date: Sat, 7 Aug 2021 17:33:14 GMT Message-Id: <202108071733.177HXEEt015921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d178b1f878ae - main - Parse named nodes from IORT ACPI on arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d178b1f878ae5b1b4e574bcf34d21b60855bf5a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 17:33:15 -0000 The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d178b1f878ae5b1b4e574bcf34d21b60855bf5a0 commit d178b1f878ae5b1b4e574bcf34d21b60855bf5a0 Author: Dmitry Salychev AuthorDate: 2021-08-07 17:17:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-08-07 17:30:38 +0000 Parse named nodes from IORT ACPI on arm64 Add the ability to map named components from IORT to their SMMU or ITS node in order to setup interrupts. It is now possible to find a node by its name (substring) and resource ID similar to PCI nodes. This is needed by work on a driver for NXP's Second Generation Data Path Acceleration Architecture (DPAA2). Reviewed by: andrew MFC after: 2 weeks Differential Revision:: https://reviews.freebsd.org/D31267 --- sys/arm64/acpica/acpi_iort.c | 138 ++++++++++++++++++++++++++++++++++++++----- sys/dev/acpica/acpivar.h | 4 ++ 2 files changed, 126 insertions(+), 16 deletions(-) diff --git a/sys/arm64/acpica/acpi_iort.c b/sys/arm64/acpica/acpi_iort.c index ec5cf799b333..e35531731251 100644 --- a/sys/arm64/acpica/acpi_iort.c +++ b/sys/arm64/acpica/acpi_iort.c @@ -77,6 +77,14 @@ struct iort_its_entry { int pxm; }; +struct iort_named_component +{ + UINT32 NodeFlags; + UINT64 MemoryProperties; + UINT8 MemoryAddressLimit; + char DeviceName[32]; /* Path of namespace object */ +}; + /* * IORT node. Each node has some device specific data depending on the * type of the node. The node can also have a set of mappings, OR in @@ -91,9 +99,10 @@ struct iort_node { u_int usecount; /* for bookkeeping */ u_int revision; /* node revision */ union { - ACPI_IORT_ROOT_COMPLEX pci_rc; /* PCI root complex */ - ACPI_IORT_SMMU smmu; - ACPI_IORT_SMMU_V3 smmu_v3; + ACPI_IORT_ROOT_COMPLEX pci_rc; /* PCI root complex */ + ACPI_IORT_SMMU smmu; + ACPI_IORT_SMMU_V3 smmu_v3; + struct iort_named_component named_comp; } data; union { struct iort_map_entry *mappings; /* node mappings */ @@ -105,6 +114,7 @@ struct iort_node { static TAILQ_HEAD(, iort_node) pci_nodes = TAILQ_HEAD_INITIALIZER(pci_nodes); static TAILQ_HEAD(, iort_node) smmu_nodes = TAILQ_HEAD_INITIALIZER(smmu_nodes); static TAILQ_HEAD(, iort_node) its_groups = TAILQ_HEAD_INITIALIZER(its_groups); +static TAILQ_HEAD(, iort_node) named_nodes = TAILQ_HEAD_INITIALIZER(named_nodes); static int iort_entry_get_id_mapping_index(struct iort_node *node) @@ -166,6 +176,29 @@ iort_entry_lookup(struct iort_node *node, u_int id, u_int *outid) return (entry->out_node); } +/* + * Perform an additional lookup in case of SMMU node and ITS outtype. + */ +static struct iort_node * +iort_smmu_trymap(struct iort_node *node, u_int outtype, u_int *outid) +{ + /* Original node can be not found. */ + if (!node) + return (NULL); + + /* Node can be SMMU or ITS. If SMMU, we need another lookup. */ + if (outtype == ACPI_IORT_NODE_ITS_GROUP && + (node->type == ACPI_IORT_NODE_SMMU_V3 || + node->type == ACPI_IORT_NODE_SMMU)) { + node = iort_entry_lookup(node, *outid, outid); + if (node == NULL) + return (NULL); + } + + KASSERT(node->type == outtype, ("mapping fail")); + return (node); +} + /* * Map a PCI RID to a SMMU node or an ITS node, based on outtype. */ @@ -184,21 +217,35 @@ iort_pci_rc_map(u_int seg, u_int rid, u_int outtype, u_int *outid) break; } - /* Could not find a PCI RC node with segment and device ID. */ - if (out_node == NULL) - return (NULL); + out_node = iort_smmu_trymap(out_node, outtype, &nxtid); + if (out_node) + *outid = nxtid; - /* Node can be SMMU or ITS. If SMMU, we need another lookup. */ - if (outtype == ACPI_IORT_NODE_ITS_GROUP && - (out_node->type == ACPI_IORT_NODE_SMMU_V3 || - out_node->type == ACPI_IORT_NODE_SMMU)) { - out_node = iort_entry_lookup(out_node, nxtid, &nxtid); - if (out_node == NULL) - return (NULL); + return (out_node); +} + +/* + * Map a named component node to a SMMU node or an ITS node, based on outtype. + */ +static struct iort_node * +iort_named_comp_map(const char *devname, u_int rid, u_int outtype, u_int *outid) +{ + struct iort_node *node, *out_node; + u_int nxtid; + + out_node = NULL; + TAILQ_FOREACH(node, &named_nodes, next) { + if (strstr(node->data.named_comp.DeviceName, devname) == NULL) + continue; + out_node = iort_entry_lookup(node, rid, &nxtid); + if (out_node != NULL) + break; } - KASSERT(out_node->type == outtype, ("mapping fail")); - *outid = nxtid; + out_node = iort_smmu_trymap(out_node, outtype, &nxtid); + if (out_node) + *outid = nxtid; + return (out_node); } @@ -279,6 +326,7 @@ iort_add_nodes(ACPI_IORT_NODE *node_entry, u_int node_offset) ACPI_IORT_ROOT_COMPLEX *pci_rc; ACPI_IORT_SMMU *smmu; ACPI_IORT_SMMU_V3 *smmu_v3; + ACPI_IORT_NAMED_COMPONENT *named_comp; struct iort_node *node; node = malloc(sizeof(*node), M_DEVBUF, M_WAITOK | M_ZERO); @@ -310,6 +358,19 @@ iort_add_nodes(ACPI_IORT_NODE *node_entry, u_int node_offset) iort_copy_its(node, node_entry); TAILQ_INSERT_TAIL(&its_groups, node, next); break; + case ACPI_IORT_NODE_NAMED_COMPONENT: + named_comp = (ACPI_IORT_NAMED_COMPONENT *)node_entry->NodeData; + memcpy(&node->data.named_comp, named_comp, sizeof(*named_comp)); + + /* Copy name of the node separately. */ + strncpy(node->data.named_comp.DeviceName, + named_comp->DeviceName, + sizeof(node->data.named_comp.DeviceName)); + node->data.named_comp.DeviceName[31] = 0; + + iort_copy_data(node, node_entry); + TAILQ_INSERT_TAIL(&named_nodes, node, next); + break; default: printf("ACPI: IORT: Dropping unhandled type %u\n", node_entry->Type); @@ -368,7 +429,9 @@ iort_post_process_mappings(void) TAILQ_FOREACH(node, &smmu_nodes, next) for (i = 0; i < node->nentries; i++) iort_resolve_node(&node->entries.mappings[i], FALSE); - /* TODO: named nodes */ + TAILQ_FOREACH(node, &named_nodes, next) + for (i = 0; i < node->nentries; i++) + iort_resolve_node(&node->entries.mappings[i], TRUE); } /* @@ -587,3 +650,46 @@ acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, u_int *xref, u_int *sid) return (0); } + +/* + * Finds mapping for a named node given name and resource ID and returns the + * XREF for MSI interrupt setup and the device ID to use for the interrupt setup. + */ +int +acpi_iort_map_named_msi(const char *devname, u_int rid, u_int *xref, + u_int *devid) +{ + struct iort_node *node; + + node = iort_named_comp_map(devname, rid, ACPI_IORT_NODE_ITS_GROUP, + devid); + if (node == NULL) + return (ENOENT); + + /* This should be an ITS node */ + KASSERT(node->type == ACPI_IORT_NODE_ITS_GROUP, ("bad group")); + + /* Return first node, we don't handle more than that now. */ + *xref = node->entries.its[0].xref; + return (0); +} + +int +acpi_iort_map_named_smmuv3(const char *devname, u_int rid, u_int *xref, + u_int *devid) +{ + ACPI_IORT_SMMU_V3 *smmu; + struct iort_node *node; + + node = iort_named_comp_map(devname, rid, ACPI_IORT_NODE_SMMU_V3, devid); + if (node == NULL) + return (ENOENT); + + /* This should be an SMMU node. */ + KASSERT(node->type == ACPI_IORT_NODE_SMMU_V3, ("bad node")); + + smmu = (ACPI_IORT_SMMU_V3 *)&node->data.smmu_v3; + *xref = smmu->BaseAddress; + + return (0); +} diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 980a004e2c35..1f64b479d414 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -578,6 +578,10 @@ int acpi_get_domain(device_t dev, device_t child, int *domain); int acpi_iort_map_pci_msi(u_int seg, u_int rid, u_int *xref, u_int *devid); int acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, u_int *xref, u_int *devid); int acpi_iort_its_lookup(u_int its_id, u_int *xref, int *pxm); +int acpi_iort_map_named_msi(const char *devname, u_int rid, u_int *xref, + u_int *devid); +int acpi_iort_map_named_smmuv3(const char *devname, u_int rid, u_int *xref, + u_int *devid); #endif #endif /* _KERNEL */ #endif /* !_ACPIVAR_H_ */ From owner-dev-commits-src-main@freebsd.org Sat Aug 7 18:28:17 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55CD166F49E; Sat, 7 Aug 2021 18:28:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhrSd1hCQz4ZPh; Sat, 7 Aug 2021 18:28:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22199260E9; Sat, 7 Aug 2021 18:28:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177ISHvC082400; Sat, 7 Aug 2021 18:28:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177ISHWN082399; Sat, 7 Aug 2021 18:28:17 GMT (envelope-from git) Date: Sat, 7 Aug 2021 18:28:17 GMT Message-Id: <202108071828.177ISHWN082399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 12b115ec57cb - main - fu540_prci: Rename to sifive_prci and use ocd_data for FU540 specificity MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12b115ec57cbe5e18a6511d9c98225551263d4ac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 18:28:17 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=12b115ec57cbe5e18a6511d9c98225551263d4ac commit 12b115ec57cbe5e18a6511d9c98225551263d4ac Author: Jessica Clarke AuthorDate: 2021-08-07 18:27:27 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 18:27:27 +0000 fu540_prci: Rename to sifive_prci and use ocd_data for FU540 specificity The FU740 has a very similar controller and will reuse most of the driver. This also drops the dependency on the device-tree include for the binding indices; the header doesn't namespace its contents (and nor does the FU740 one) so using both would require seperate translation units which would be unnecessarily complicated just to avoid defining local copies of the small number of constants. Whilst here, add the missing l to gemgxlclk's name and drop the prci_ prefix from tlclk's name as we don't prefix any of the others and it's entirely unnecessary. Reviewed by: kp, mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31021 --- sys/riscv/sifive/files.sifive | 2 +- sys/riscv/sifive/{fu540_prci.c => sifive_prci.c} | 85 +++++++++++++++--------- 2 files changed, 56 insertions(+), 31 deletions(-) diff --git a/sys/riscv/sifive/files.sifive b/sys/riscv/sifive/files.sifive index e0ab09b38502..5426f703c27c 100644 --- a/sys/riscv/sifive/files.sifive +++ b/sys/riscv/sifive/files.sifive @@ -1,6 +1,6 @@ # $FreeBSD$ riscv/sifive/fe310_aon.c optional fe310aon -riscv/sifive/fu540_prci.c standard riscv/sifive/fu540_spi.c optional fu540spi spibus +riscv/sifive/sifive_prci.c standard riscv/sifive/sifive_uart.c standard diff --git a/sys/riscv/sifive/fu540_prci.c b/sys/riscv/sifive/sifive_prci.c similarity index 81% rename from sys/riscv/sifive/fu540_prci.c rename to sys/riscv/sifive/sifive_prci.c index 133cdba26d10..7c0939c77251 100644 --- a/sys/riscv/sifive/fu540_prci.c +++ b/sys/riscv/sifive/sifive_prci.c @@ -3,6 +3,7 @@ * * Copyright (c) 2019 Axiado Corporation * All rights reserved. + * Copyright (c) 2021 Jessica Clarke * * This software was developed in part by Kristof Provost under contract for * Axiado Corporation. @@ -51,15 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - -static struct ofw_compat_data compat_data[] = { - { "sifive,aloeprci0", 1 }, - { "sifive,ux00prci0", 1 }, - { "sifive,fu540-c000-prci", 1 }, - { NULL, 0 }, -}; - static struct resource_spec prci_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, RESOURCE_SPEC_END @@ -86,10 +78,6 @@ struct prci_clk_pll_sc { #define PRCI_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED); #define PRCI_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED); -#define PRCI_COREPLL_CFG0 0x4 -#define PRCI_DDRPLL_CFG0 0xC -#define PRCI_GEMGXLPLL_CFG0 0x1C - #define PRCI_PLL_DIVR_MASK 0x3f #define PRCI_PLL_DIVR_SHIFT 0 #define PRCI_PLL_DIVF_MASK 0x7fc0 @@ -113,17 +101,36 @@ struct prci_pll_def { .reg = (_base), \ } -/* PLL Clocks */ -struct prci_pll_def pll_clks[] = { - PLL(PRCI_CLK_COREPLL, "coreclk", PRCI_COREPLL_CFG0), - PLL(PRCI_CLK_DDRPLL, "ddrclk", PRCI_DDRPLL_CFG0), - PLL(PRCI_CLK_GEMGXLPLL, "gemgxclk", PRCI_GEMGXLPLL_CFG0), +#define PLL_END PLL(0, NULL, 0) + +struct prci_config { + struct prci_pll_def *pll_clks; + struct clk_fixed_def *tlclk_def; +}; + +/* FU540 clock numbers */ +#define FU540_PRCI_CORECLK 0 +#define FU540_PRCI_DDRCLK 1 +#define FU540_PRCI_GEMGXLCLK 2 +#define FU540_PRCI_TLCLK 3 + +/* FU540 registers */ +#define FU540_PRCI_COREPLL_CFG0 0x4 +#define FU540_PRCI_DDRPLL_CFG0 0xC +#define FU540_PRCI_GEMGXLPLL_CFG0 0x1C + +/* FU540 PLL clocks */ +static struct prci_pll_def fu540_pll_clks[] = { + PLL(FU540_PRCI_CORECLK, "coreclk", FU540_PRCI_COREPLL_CFG0), + PLL(FU540_PRCI_DDRCLK, "ddrclk", FU540_PRCI_DDRPLL_CFG0), + PLL(FU540_PRCI_GEMGXLCLK, "gemgxlclk", FU540_PRCI_GEMGXLPLL_CFG0), + PLL_END }; -/* Fixed divisor clock TLCLK. */ -struct clk_fixed_def tlclk_def = { - .clkdef.id = PRCI_CLK_TLCLK, - .clkdef.name = "prci_tlclk", +/* FU540 fixed divisor clock TLCLK. */ +static struct clk_fixed_def fu540_tlclk_def = { + .clkdef.id = FU540_PRCI_TLCLK, + .clkdef.name = "tlclk", .clkdef.parent_names = (const char *[]){"coreclk"}, .clkdef.parent_cnt = 1, .clkdef.flags = CLK_NODE_STATIC_STRINGS, @@ -131,6 +138,19 @@ struct clk_fixed_def tlclk_def = { .div = 2, }; +/* FU540 config */ +struct prci_config fu540_prci_config = { + .pll_clks = fu540_pll_clks, + .tlclk_def = &fu540_tlclk_def, +}; + +static struct ofw_compat_data compat_data[] = { + { "sifive,aloeprci0", (uintptr_t)&fu540_prci_config }, + { "sifive,ux00prci0", (uintptr_t)&fu540_prci_config }, + { "sifive,fu540-c000-prci", (uintptr_t)&fu540_prci_config }, + { NULL, 0 }, +}; + static int prci_clk_pll_init(struct clknode *clk, device_t dev) { @@ -199,7 +219,7 @@ prci_probe(device_t dev) if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); - device_set_desc(dev, "SiFive FU540 Power Reset Clocking Interrupt"); + device_set_desc(dev, "SiFive Power Reset Clocking Interrupt"); return (BUS_PROBE_DEFAULT); } @@ -231,10 +251,15 @@ prci_attach(device_t dev) clk_t clk_parent; phandle_t node; int i, ncells, error; + struct prci_config *cfg; + struct prci_pll_def *pll_clk; sc = device_get_softc(dev); sc->dev = dev; + cfg = (struct prci_config *)ofw_bus_search_compatible(dev, + compat_data)->ocd_data; + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); error = bus_alloc_resources(dev, prci_spec, &sc->res); @@ -277,10 +302,10 @@ prci_attach(device_t dev) } /* We can't free a clkdom, so from now on we cannot fail. */ - for (i = 0; i < nitems(pll_clks); i++) { - clkdef.id = pll_clks[i].id; - clkdef.name = pll_clks[i].name; - prci_pll_register(sc, &clkdef, pll_clks[i].reg); + for (pll_clk = cfg->pll_clks; pll_clk->name; pll_clk++) { + clkdef.id = pll_clk->id; + clkdef.name = pll_clk->name; + prci_pll_register(sc, &clkdef, pll_clk->reg); } /* @@ -291,7 +316,7 @@ prci_attach(device_t dev) * will be registered automatically by the fixed_clk driver, and the * version we register here will be an unreferenced duplicate. */ - clknode_fixed_register(sc->clkdom, &tlclk_def); + clknode_fixed_register(sc->clkdom, cfg->tlclk_def); error = clkdom_finit(sc->clkdom); if (error) @@ -316,12 +341,12 @@ static device_method_t prci_methods[] = { }; static driver_t prci_driver = { - "fu540prci", + "sifive_prci", prci_methods, sizeof(struct prci_softc) }; static devclass_t prci_devclass; -EARLY_DRIVER_MODULE(fu540prci, simplebus, prci_driver, prci_devclass, 0, 0, +EARLY_DRIVER_MODULE(sifive_prci, simplebus, prci_driver, prci_devclass, 0, 0, BUS_PASS_BUS); From owner-dev-commits-src-main@freebsd.org Sat Aug 7 18:28:18 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71B7E66F325; Sat, 7 Aug 2021 18:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhrSf2T31z4Zk7; Sat, 7 Aug 2021 18:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B72225F8B; Sat, 7 Aug 2021 18:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177ISI1Q082424; Sat, 7 Aug 2021 18:28:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177ISI8s082423; Sat, 7 Aug 2021 18:28:18 GMT (envelope-from git) Date: Sat, 7 Aug 2021 18:28:18 GMT Message-Id: <202108071828.177ISI8s082423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 589d8a78a57b - main - sifive_prci: Add support for the FU740 PRCI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 589d8a78a57b3ca1327bec3311281a38e4e49952 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 18:28:18 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=589d8a78a57b3ca1327bec3311281a38e4e49952 commit 589d8a78a57b3ca1327bec3311281a38e4e49952 Author: Jessica Clarke AuthorDate: 2021-08-07 18:27:28 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 18:27:28 +0000 sifive_prci: Add support for the FU740 PRCI Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31022 --- sys/riscv/sifive/sifive_prci.c | 292 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 291 insertions(+), 1 deletion(-) diff --git a/sys/riscv/sifive/sifive_prci.c b/sys/riscv/sifive/sifive_prci.c index 7c0939c77251..21b9cd568f32 100644 --- a/sys/riscv/sifive/sifive_prci.c +++ b/sys/riscv/sifive/sifive_prci.c @@ -47,11 +47,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include "clkdev_if.h" + static struct resource_spec prci_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, RESOURCE_SPEC_END @@ -73,6 +76,12 @@ struct prci_clk_pll_sc { uint32_t reg; }; +struct prci_clk_div_sc { + struct prci_softc *parent_sc; + uint32_t reg; + uint32_t bias; +}; + #define PRCI_LOCK(sc) mtx_lock(&(sc)->mtx) #define PRCI_UNLOCK(sc) mtx_unlock(&(sc)->mtx) #define PRCI_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED); @@ -87,6 +96,8 @@ struct prci_clk_pll_sc { #define PRCI_READ(_sc, _reg) \ bus_space_read_4((_sc)->bst, (_sc)->bsh, (_reg)) +#define PRCI_WRITE(_sc, _reg, _val) \ + bus_space_write_4((_sc)->bst, (_sc)->bsh, (_reg), (_val)) struct prci_pll_def { uint32_t id; @@ -103,8 +114,46 @@ struct prci_pll_def { #define PLL_END PLL(0, NULL, 0) +struct prci_div_def { + uint32_t id; + const char *name; + const char *parent_name; + uint32_t reg; + uint32_t bias; +}; + +#define DIV(_id, _name, _parent_name, _base, _bias) \ +{ \ + .id = (_id), \ + .name = (_name), \ + .parent_name = (_parent_name), \ + .reg = (_base), \ + .bias = (_bias), \ +} + +#define DIV_END DIV(0, NULL, NULL, 0, 0) + +struct prci_gate_def { + uint32_t id; + const char *name; + const char *parent_name; + uint32_t reg; +}; + +#define GATE(_id, _name, _parent_name, _base) \ +{ \ + .id = (_id), \ + .name = (_name), \ + .parent_name = (_parent_name), \ + .reg = (_base), \ +} + +#define GATE_END GATE(0, NULL, NULL, 0) + struct prci_config { struct prci_pll_def *pll_clks; + struct prci_div_def *div_clks; + struct prci_gate_def *gate_clks; struct clk_fixed_def *tlclk_def; }; @@ -144,10 +193,74 @@ struct prci_config fu540_prci_config = { .tlclk_def = &fu540_tlclk_def, }; +/* FU740 clock numbers */ +#define FU740_PRCI_CORECLK 0 +#define FU740_PRCI_DDRCLK 1 +#define FU740_PRCI_GEMGXLCLK 2 +#define FU740_PRCI_DVFSCORECLK 3 +#define FU740_PRCI_HFPCLK 4 +#define FU740_PRCI_CLTXCLK 5 +#define FU740_PRCI_TLCLK 6 +#define FU740_PRCI_PCLK 7 +#define FU740_PRCI_PCIEAUXCLK 8 + +/* FU740 registers */ +#define FU740_PRCI_COREPLL_CFG0 0x4 +#define FU740_PRCI_DDRPLL_CFG0 0xC +#define FU740_PRCI_PCIEAUX_GATE 0x14 +#define FU740_PRCI_GEMGXLPLL_CFG0 0x1C +#define FU740_PRCI_DVFSCOREPLL_CFG0 0x38 +#define FU740_PRCI_HFPCLKPLL_CFG0 0x50 +#define FU740_PRCI_CLTXPLL_CFG0 0x30 +#define FU740_PRCI_HFPCLK_DIV 0x5C + +/* FU740 PLL clocks */ +static struct prci_pll_def fu740_pll_clks[] = { + PLL(FU740_PRCI_CORECLK, "coreclk", FU740_PRCI_COREPLL_CFG0), + PLL(FU740_PRCI_DDRCLK, "ddrclk", FU740_PRCI_DDRPLL_CFG0), + PLL(FU740_PRCI_GEMGXLCLK, "gemgxlclk", FU740_PRCI_GEMGXLPLL_CFG0), + PLL(FU740_PRCI_DVFSCORECLK, "dvfscoreclk", FU740_PRCI_DVFSCOREPLL_CFG0), + PLL(FU740_PRCI_HFPCLK, "hfpclk", FU740_PRCI_HFPCLKPLL_CFG0), + PLL(FU740_PRCI_CLTXCLK, "cltxclk", FU740_PRCI_CLTXPLL_CFG0), + PLL_END +}; + +/* FU740 divisor clocks */ +static struct prci_div_def fu740_div_clks[] = { + DIV(FU740_PRCI_PCLK, "pclk", "hfpclk", FU740_PRCI_HFPCLK_DIV, 2), + DIV_END +}; + +/* FU740 gated clocks */ +static struct prci_gate_def fu740_gate_clks[] = { + GATE(FU740_PRCI_PCIEAUXCLK, "pcieauxclk", "hfclk", FU740_PRCI_PCIEAUX_GATE), + GATE_END +}; + +/* FU740 fixed divisor clock TLCLK. */ +static struct clk_fixed_def fu740_tlclk_def = { + .clkdef.id = FU740_PRCI_TLCLK, + .clkdef.name = "tlclk", + .clkdef.parent_names = (const char *[]){"coreclk"}, + .clkdef.parent_cnt = 1, + .clkdef.flags = CLK_NODE_STATIC_STRINGS, + .mult = 1, + .div = 2, +}; + +/* FU740 config */ +struct prci_config fu740_prci_config = { + .pll_clks = fu740_pll_clks, + .div_clks = fu740_div_clks, + .gate_clks = fu740_gate_clks, + .tlclk_def = &fu740_tlclk_def, +}; + static struct ofw_compat_data compat_data[] = { { "sifive,aloeprci0", (uintptr_t)&fu540_prci_config }, { "sifive,ux00prci0", (uintptr_t)&fu540_prci_config }, { "sifive,fu540-c000-prci", (uintptr_t)&fu540_prci_config }, + { "sifive,fu740-c000-prci", (uintptr_t)&fu740_prci_config }, { NULL, 0 }, }; @@ -209,6 +322,60 @@ DEFINE_CLASS_1(prci_clk_pll_clknode, prci_clk_pll_clknode_class, prci_clk_pll_clknode_methods, sizeof(struct prci_clk_pll_sc), clknode_class); +static int +prci_clk_div_init(struct clknode *clk, device_t dev) +{ + + clknode_init_parent_idx(clk, 0); + + return (0); +} + +static int +prci_clk_div_recalc(struct clknode *clk, uint64_t *freq) +{ + struct prci_clk_div_sc *sc; + struct clknode *parent_clk; + uint32_t div; + uint64_t refclk; + int err; + + KASSERT(freq != NULL, ("freq cannot be NULL")); + + sc = clknode_get_softc(clk); + + PRCI_LOCK(sc->parent_sc); + + /* Get refclock frequency. */ + parent_clk = clknode_get_parent(clk); + err = clknode_get_freq(parent_clk, &refclk); + if (err) { + device_printf(sc->parent_sc->dev, + "Failed to get refclk frequency\n"); + PRCI_UNLOCK(sc->parent_sc); + return (err); + } + + /* Calculate the divisor output */ + div = PRCI_READ(sc->parent_sc, sc->reg); + + *freq = refclk / (div + sc->bias); + + PRCI_UNLOCK(sc->parent_sc); + + return (0); +} + +static clknode_method_t prci_clk_div_clknode_methods[] = { + CLKNODEMETHOD(clknode_init, prci_clk_div_init), + CLKNODEMETHOD(clknode_recalc_freq, prci_clk_div_recalc), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(prci_clk_div_clknode, prci_clk_div_clknode_class, + prci_clk_div_clknode_methods, sizeof(struct prci_clk_div_sc), + clknode_class); + static int prci_probe(device_t dev) { @@ -243,16 +410,39 @@ prci_pll_register(struct prci_softc *parent_sc, struct clknode_init_def *clkdef, clknode_register(parent_sc->clkdom, clk); } +static void +prci_div_register(struct prci_softc *parent_sc, struct clknode_init_def *clkdef, + uint32_t reg, uint32_t bias) +{ + struct clknode *clk; + struct prci_clk_div_sc *sc; + + clk = clknode_create(parent_sc->clkdom, &prci_clk_div_clknode_class, + clkdef); + if (clk == NULL) + panic("Failed to create clknode"); + + sc = clknode_get_softc(clk); + sc->parent_sc = parent_sc; + sc->reg = reg; + sc->bias = bias; + + clknode_register(parent_sc->clkdom, clk); +} + static int prci_attach(device_t dev) { - struct clknode_init_def clkdef; + struct clknode_init_def clkdef, clkdef_div; + struct clk_gate_def clkdef_gate; struct prci_softc *sc; clk_t clk_parent; phandle_t node; int i, ncells, error; struct prci_config *cfg; struct prci_pll_def *pll_clk; + struct prci_div_def *div_clk; + struct prci_gate_def *gate_clk; sc = device_get_softc(dev); sc->dev = dev; @@ -308,6 +498,41 @@ prci_attach(device_t dev) prci_pll_register(sc, &clkdef, pll_clk->reg); } + if (cfg->div_clks != NULL) { + bzero(&clkdef_div, sizeof(clkdef_div)); + for (div_clk = cfg->div_clks; div_clk->name; div_clk++) { + clkdef_div.id = div_clk->id; + clkdef_div.name = div_clk->name; + clkdef_div.parent_names = &div_clk->parent_name; + clkdef_div.parent_cnt = 1; + prci_div_register(sc, &clkdef_div, div_clk->reg, + div_clk->bias); + } + } + + if (cfg->gate_clks != NULL) { + bzero(&clkdef_gate, sizeof(clkdef_gate)); + for (gate_clk = cfg->gate_clks; gate_clk->name; gate_clk++) { + clkdef_gate.clkdef.id = gate_clk->id; + clkdef_gate.clkdef.name = gate_clk->name; + clkdef_gate.clkdef.parent_names = &gate_clk->parent_name; + clkdef_gate.clkdef.parent_cnt = 1; + clkdef_gate.offset = gate_clk->reg; + clkdef_gate.shift = 0; + clkdef_gate.mask = 1; + clkdef_gate.on_value = 1; + clkdef_gate.off_value = 0; + error = clknode_gate_register(sc->clkdom, + &clkdef_gate); + if (error != 0) { + device_printf(dev, + "Couldn't create gated clock %s: %d\n", + gate_clk->name, error); + goto fail; + } + } + } + /* * Register the fixed clock "tlclk". * @@ -333,10 +558,75 @@ fail: return (error); } +static int +prci_write_4(device_t dev, bus_addr_t addr, uint32_t val) +{ + struct prci_softc *sc; + + sc = device_get_softc(dev); + + PRCI_WRITE(sc, addr, val); + + return (0); +} + +static int +prci_read_4(device_t dev, bus_addr_t addr, uint32_t *val) +{ + struct prci_softc *sc; + + sc = device_get_softc(dev); + + *val = PRCI_READ(sc, addr); + + return (0); +} + +static int +prci_modify_4(device_t dev, bus_addr_t addr, uint32_t clr, uint32_t set) +{ + struct prci_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + reg = PRCI_READ(sc, addr); + reg &= ~clr; + reg |= set; + PRCI_WRITE(sc, addr, reg); + + return (0); +} + +static void +prci_device_lock(device_t dev) +{ + struct prci_softc *sc; + + sc = device_get_softc(dev); + PRCI_LOCK(sc); +} + +static void +prci_device_unlock(device_t dev) +{ + struct prci_softc *sc; + + sc = device_get_softc(dev); + PRCI_UNLOCK(sc); +} + static device_method_t prci_methods[] = { DEVMETHOD(device_probe, prci_probe), DEVMETHOD(device_attach, prci_attach), + /* clkdev interface */ + DEVMETHOD(clkdev_write_4, prci_write_4), + DEVMETHOD(clkdev_read_4, prci_read_4), + DEVMETHOD(clkdev_modify_4, prci_modify_4), + DEVMETHOD(clkdev_device_lock, prci_device_lock), + DEVMETHOD(clkdev_device_unlock, prci_device_unlock), + DEVMETHOD_END }; From owner-dev-commits-src-main@freebsd.org Sat Aug 7 18:28:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E7FD66F077; Sat, 7 Aug 2021 18:28:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhrSg3wtnz4ZJt; Sat, 7 Aug 2021 18:28:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6989025F8C; Sat, 7 Aug 2021 18:28:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177ISJXC082448; Sat, 7 Aug 2021 18:28:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177ISJl1082447; Sat, 7 Aug 2021 18:28:19 GMT (envelope-from git) Date: Sat, 7 Aug 2021 18:28:19 GMT Message-Id: <202108071828.177ISJl1082447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: dcbea9a2f465 - main - sifive_prci: Delay attachment until after clk_fixed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dcbea9a2f465be1786db21523a7f55db3f7ab3dd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 18:28:19 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=dcbea9a2f465be1786db21523a7f55db3f7ab3dd commit dcbea9a2f465be1786db21523a7f55db3f7ab3dd Author: Jessica Clarke AuthorDate: 2021-08-07 18:27:29 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 18:27:29 +0000 sifive_prci: Delay attachment until after clk_fixed This avoids noisy output from early attempts to attach before clk_fixed has attached to the parent clocks. Reviewed by: kp, mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31023 --- sys/riscv/sifive/sifive_prci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/riscv/sifive/sifive_prci.c b/sys/riscv/sifive/sifive_prci.c index 21b9cd568f32..36f2f6705f7e 100644 --- a/sys/riscv/sifive/sifive_prci.c +++ b/sys/riscv/sifive/sifive_prci.c @@ -638,5 +638,9 @@ static driver_t prci_driver = { static devclass_t prci_devclass; +/* + * hfclk and rtcclk appear later in the device tree than prci, so we must + * attach late. + */ EARLY_DRIVER_MODULE(sifive_prci, simplebus, prci_driver, prci_devclass, 0, 0, - BUS_PASS_BUS); + BUS_PASS_BUS + BUS_PASS_ORDER_LATE); From owner-dev-commits-src-main@freebsd.org Sat Aug 7 18:28:20 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B67B066F56B; Sat, 7 Aug 2021 18:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhrSh4LBVz4ZSh; Sat, 7 Aug 2021 18:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C4DA25F1A; Sat, 7 Aug 2021 18:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177ISKIM082472; Sat, 7 Aug 2021 18:28:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177ISKBu082471; Sat, 7 Aug 2021 18:28:20 GMT (envelope-from git) Date: Sat, 7 Aug 2021 18:28:20 GMT Message-Id: <202108071828.177ISKBu082471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 8e7e0690ecd7 - main - sifive_prci: Add reset support for the FU540 and FU740 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e7e0690ecd79e8adc9182d486c05748bd97d26d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 18:28:20 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8e7e0690ecd79e8adc9182d486c05748bd97d26d commit 8e7e0690ecd79e8adc9182d486c05748bd97d26d Author: Jessica Clarke AuthorDate: 2021-08-07 18:27:29 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 18:27:29 +0000 sifive_prci: Add reset support for the FU540 and FU740 This is needed for FU740 PCIe support. Whilst we don't need the FU540's resets they are also defined for completeness. Reviewed by: manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31024 --- sys/riscv/conf/GENERIC | 1 + sys/riscv/sifive/sifive_prci.c | 57 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index c6cd8e0fdedb..2af5f8803be7 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -82,6 +82,7 @@ device rcons # EXT_RESOURCES pseudo devices options EXT_RESOURCES device clk +device hwreset device syscon device syscon_power device riscv_syscon diff --git a/sys/riscv/sifive/sifive_prci.c b/sys/riscv/sifive/sifive_prci.c index 36f2f6705f7e..fee67bb153ac 100644 --- a/sys/riscv/sifive/sifive_prci.c +++ b/sys/riscv/sifive/sifive_prci.c @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include "clkdev_if.h" +#include "hwreset_if.h" static struct resource_spec prci_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -69,6 +70,8 @@ struct prci_softc { struct resource *res; bus_space_tag_t bst; bus_space_handle_t bsh; + + int nresets; }; struct prci_clk_pll_sc { @@ -94,6 +97,9 @@ struct prci_clk_div_sc { #define PRCI_PLL_DIVQ_MASK 0x38000 #define PRCI_PLL_DIVQ_SHIFT 15 +/* Called devicesresetreg on the FU540 */ +#define PRCI_DEVICES_RESET_N 0x28 + #define PRCI_READ(_sc, _reg) \ bus_space_read_4((_sc)->bst, (_sc)->bsh, (_reg)) #define PRCI_WRITE(_sc, _reg, _val) \ @@ -155,6 +161,7 @@ struct prci_config { struct prci_div_def *div_clks; struct prci_gate_def *gate_clks; struct clk_fixed_def *tlclk_def; + int nresets; }; /* FU540 clock numbers */ @@ -191,6 +198,7 @@ static struct clk_fixed_def fu540_tlclk_def = { struct prci_config fu540_prci_config = { .pll_clks = fu540_pll_clks, .tlclk_def = &fu540_tlclk_def, + .nresets = 6, }; /* FU740 clock numbers */ @@ -254,6 +262,7 @@ struct prci_config fu740_prci_config = { .div_clks = fu740_div_clks, .gate_clks = fu740_gate_clks, .tlclk_def = &fu740_tlclk_def, + .nresets = 7, }; static struct ofw_compat_data compat_data[] = { @@ -547,6 +556,8 @@ prci_attach(device_t dev) if (error) panic("Couldn't finalise clock domain"); + sc->nresets = cfg->nresets; + return (0); fail1: @@ -616,6 +627,48 @@ prci_device_unlock(device_t dev) PRCI_UNLOCK(sc); } +static int +prci_reset_assert(device_t dev, intptr_t id, bool reset) +{ + struct prci_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + if (id >= sc->nresets) + return (ENXIO); + + PRCI_LOCK(sc); + reg = PRCI_READ(sc, PRCI_DEVICES_RESET_N); + if (reset) + reg &= ~(1u << id); + else + reg |= (1u << id); + PRCI_WRITE(sc, PRCI_DEVICES_RESET_N, reg); + PRCI_UNLOCK(sc); + + return (0); +} + +static int +prci_reset_is_asserted(device_t dev, intptr_t id, bool *reset) +{ + struct prci_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + if (id >= sc->nresets) + return (ENXIO); + + PRCI_LOCK(sc); + reg = PRCI_READ(sc, PRCI_DEVICES_RESET_N); + *reset = (reg & (1u << id)) == 0; + PRCI_UNLOCK(sc); + + return (0); +} + static device_method_t prci_methods[] = { DEVMETHOD(device_probe, prci_probe), DEVMETHOD(device_attach, prci_attach), @@ -627,6 +680,10 @@ static device_method_t prci_methods[] = { DEVMETHOD(clkdev_device_lock, prci_device_lock), DEVMETHOD(clkdev_device_unlock, prci_device_unlock), + /* Reset interface */ + DEVMETHOD(hwreset_assert, prci_reset_assert), + DEVMETHOD(hwreset_is_asserted, prci_reset_is_asserted), + DEVMETHOD_END }; From owner-dev-commits-src-main@freebsd.org Sat Aug 7 18:28:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 385D966F2C8; Sat, 7 Aug 2021 18:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhrSj6jYJz4ZmP; Sat, 7 Aug 2021 18:28:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F4DD260EA; Sat, 7 Aug 2021 18:28:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177ISLE6082503; Sat, 7 Aug 2021 18:28:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177ISL77082502; Sat, 7 Aug 2021 18:28:21 GMT (envelope-from git) Date: Sat, 7 Aug 2021 18:28:21 GMT Message-Id: <202108071828.177ISL77082502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 90a089cf2a74 - main - fu540_spi: Rename to sifive_spi MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90a089cf2a7462e4101907e2a6161734b2487a78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 18:28:22 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=90a089cf2a7462e4101907e2a6161734b2487a78 commit 90a089cf2a7462e4101907e2a6161734b2487a78 Author: Jessica Clarke AuthorDate: 2021-08-07 18:27:30 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 18:27:30 +0000 fu540_spi: Rename to sifive_spi The FU740 also uses the same SPI controller. Reviewed by: kp, philip MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31026 --- sys/riscv/conf/GENERIC | 2 +- sys/riscv/conf/NOTES | 2 +- sys/riscv/sifive/files.sifive | 2 +- sys/riscv/sifive/{fu540_spi.c => sifive_spi.c} | 228 ++++++++++++------------- 4 files changed, 117 insertions(+), 117 deletions(-) diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 2af5f8803be7..b65c0317f28d 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -174,5 +174,5 @@ options FDT makeoptions MODULES_EXTRA+="dtb/sifive" # SiFive device drivers -device fu540spi +device sifive_spi include "../sifive/std.sifive" diff --git a/sys/riscv/conf/NOTES b/sys/riscv/conf/NOTES index 9680728de6de..0a067ab19d34 100644 --- a/sys/riscv/conf/NOTES +++ b/sys/riscv/conf/NOTES @@ -66,7 +66,7 @@ device xilinx_spi # Xilinx AXI Quad-SPI Controller # SOC-specific device fe310aon -device fu540spi +device sifive_spi files "../sifive/files.sifive" # Flattened Device Tree diff --git a/sys/riscv/sifive/files.sifive b/sys/riscv/sifive/files.sifive index 5426f703c27c..2eb73f1607ac 100644 --- a/sys/riscv/sifive/files.sifive +++ b/sys/riscv/sifive/files.sifive @@ -1,6 +1,6 @@ # $FreeBSD$ riscv/sifive/fe310_aon.c optional fe310aon -riscv/sifive/fu540_spi.c optional fu540spi spibus riscv/sifive/sifive_prci.c standard +riscv/sifive/sifive_spi.c optional sifive_spi spibus riscv/sifive/sifive_uart.c standard diff --git a/sys/riscv/sifive/fu540_spi.c b/sys/riscv/sifive/sifive_spi.c similarity index 56% rename from sys/riscv/sifive/fu540_spi.c rename to sys/riscv/sifive/sifive_spi.c index 7cd132b9cda4..df72beaac7ae 100644 --- a/sys/riscv/sifive/fu540_spi.c +++ b/sys/riscv/sifive/sifive_spi.c @@ -62,12 +62,12 @@ __FBSDID("$FreeBSD$"); #define DBGPRINT(dev, fmt, args...) #endif -static struct resource_spec fuspi_spec[] = { +static struct resource_spec sfspi_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, RESOURCE_SPEC_END }; -struct fuspi_softc { +struct sfspi_softc { device_t dev; device_t parent; @@ -84,67 +84,67 @@ struct fuspi_softc { uint32_t cs_max; }; -#define FUSPI_LOCK(sc) mtx_lock(&(sc)->mtx) -#define FUSPI_UNLOCK(sc) mtx_unlock(&(sc)->mtx) -#define FUSPI_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED); -#define FUSPI_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED); +#define SFSPI_LOCK(sc) mtx_lock(&(sc)->mtx) +#define SFSPI_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define SFSPI_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED); +#define SFSPI_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED); /* * Register offsets. * From Sifive-Unleashed-FU540-C000-v1.0.pdf page 101. */ -#define FUSPI_REG_SCKDIV 0x00 /* Serial clock divisor */ -#define FUSPI_REG_SCKMODE 0x04 /* Serial clock mode */ -#define FUSPI_REG_CSID 0x10 /* Chip select ID */ -#define FUSPI_REG_CSDEF 0x14 /* Chip select default */ -#define FUSPI_REG_CSMODE 0x18 /* Chip select mode */ -#define FUSPI_REG_DELAY0 0x28 /* Delay control 0 */ -#define FUSPI_REG_DELAY1 0x2C /* Delay control 1 */ -#define FUSPI_REG_FMT 0x40 /* Frame format */ -#define FUSPI_REG_TXDATA 0x48 /* Tx FIFO data */ -#define FUSPI_REG_RXDATA 0x4C /* Rx FIFO data */ -#define FUSPI_REG_TXMARK 0x50 /* Tx FIFO watermark */ -#define FUSPI_REG_RXMARK 0x54 /* Rx FIFO watermark */ -#define FUSPI_REG_FCTRL 0x60 /* SPI flash interface control* */ -#define FUSPI_REG_FFMT 0x64 /* SPI flash instruction format* */ -#define FUSPI_REG_IE 0x70 /* SPI interrupt enable */ -#define FUSPI_REG_IP 0x74 /* SPI interrupt pending */ - -#define FUSPI_SCKDIV_MASK 0xfff - -#define FUSPI_CSDEF_ALL ((1 << sc->cs_max)-1) - -#define FUSPI_CSMODE_AUTO 0x0U -#define FUSPI_CSMODE_HOLD 0x2U -#define FUSPI_CSMODE_OFF 0x3U - -#define FUSPI_TXDATA_DATA_MASK 0xff -#define FUSPI_TXDATA_FULL (1 << 31) - -#define FUSPI_RXDATA_DATA_MASK 0xff -#define FUSPI_RXDATA_EMPTY (1 << 31) - -#define FUSPI_SCKMODE_PHA (1 << 0) -#define FUSPI_SCKMODE_POL (1 << 1) - -#define FUSPI_FMT_PROTO_SINGLE 0x0U -#define FUSPI_FMT_PROTO_DUAL 0x1U -#define FUSPI_FMT_PROTO_QUAD 0x2U -#define FUSPI_FMT_PROTO_MASK 0x3U -#define FUSPI_FMT_ENDIAN (1 << 2) -#define FUSPI_FMT_DIR (1 << 3) -#define FUSPI_FMT_LEN(x) ((uint32_t)(x) << 16) -#define FUSPI_FMT_LEN_MASK (0xfU << 16) - -#define FUSPI_FIFO_DEPTH 8 - -#define FUSPI_READ(_sc, _reg) \ +#define SFSPI_REG_SCKDIV 0x00 /* Serial clock divisor */ +#define SFSPI_REG_SCKMODE 0x04 /* Serial clock mode */ +#define SFSPI_REG_CSID 0x10 /* Chip select ID */ +#define SFSPI_REG_CSDEF 0x14 /* Chip select default */ +#define SFSPI_REG_CSMODE 0x18 /* Chip select mode */ +#define SFSPI_REG_DELAY0 0x28 /* Delay control 0 */ +#define SFSPI_REG_DELAY1 0x2C /* Delay control 1 */ +#define SFSPI_REG_FMT 0x40 /* Frame format */ +#define SFSPI_REG_TXDATA 0x48 /* Tx FIFO data */ +#define SFSPI_REG_RXDATA 0x4C /* Rx FIFO data */ +#define SFSPI_REG_TXMARK 0x50 /* Tx FIFO watermark */ +#define SFSPI_REG_RXMARK 0x54 /* Rx FIFO watermark */ +#define SFSPI_REG_FCTRL 0x60 /* SPI flash interface control* */ +#define SFSPI_REG_FFMT 0x64 /* SPI flash instruction format* */ +#define SFSPI_REG_IE 0x70 /* SPI interrupt enable */ +#define SFSPI_REG_IP 0x74 /* SPI interrupt pending */ + +#define SFSPI_SCKDIV_MASK 0xfff + +#define SFSPI_CSDEF_ALL ((1 << sc->cs_max)-1) + +#define SFSPI_CSMODE_AUTO 0x0U +#define SFSPI_CSMODE_HOLD 0x2U +#define SFSPI_CSMODE_OFF 0x3U + +#define SFSPI_TXDATA_DATA_MASK 0xff +#define SFSPI_TXDATA_FULL (1 << 31) + +#define SFSPI_RXDATA_DATA_MASK 0xff +#define SFSPI_RXDATA_EMPTY (1 << 31) + +#define SFSPI_SCKMODE_PHA (1 << 0) +#define SFSPI_SCKMODE_POL (1 << 1) + +#define SFSPI_FMT_PROTO_SINGLE 0x0U +#define SFSPI_FMT_PROTO_DUAL 0x1U +#define SFSPI_FMT_PROTO_QUAD 0x2U +#define SFSPI_FMT_PROTO_MASK 0x3U +#define SFSPI_FMT_ENDIAN (1 << 2) +#define SFSPI_FMT_DIR (1 << 3) +#define SFSPI_FMT_LEN(x) ((uint32_t)(x) << 16) +#define SFSPI_FMT_LEN_MASK (0xfU << 16) + +#define SFSPI_FIFO_DEPTH 8 + +#define SFSPI_READ(_sc, _reg) \ bus_space_read_4((_sc)->bst, (_sc)->bsh, (_reg)) -#define FUSPI_WRITE(_sc, _reg, _val) \ +#define SFSPI_WRITE(_sc, _reg, _val) \ bus_space_write_4((_sc)->bst, (_sc)->bsh, (_reg), (_val)) static void -fuspi_tx(struct fuspi_softc *sc, uint8_t *buf, uint32_t bufsiz) +sfspi_tx(struct sfspi_softc *sc, uint8_t *buf, uint32_t bufsiz) { uint32_t val; uint8_t *p, *end; @@ -154,35 +154,35 @@ fuspi_tx(struct fuspi_softc *sc, uint8_t *buf, uint32_t bufsiz) end = buf + bufsiz; for (p = buf; p < end; p++) { do { - val = FUSPI_READ(sc, FUSPI_REG_TXDATA); - } while (val & FUSPI_TXDATA_FULL); + val = SFSPI_READ(sc, SFSPI_REG_TXDATA); + } while (val & SFSPI_TXDATA_FULL); val = *p; - FUSPI_WRITE(sc, FUSPI_REG_TXDATA, val); + SFSPI_WRITE(sc, SFSPI_REG_TXDATA, val); } } static void -fuspi_rx(struct fuspi_softc *sc, uint8_t *buf, uint32_t bufsiz) +sfspi_rx(struct sfspi_softc *sc, uint8_t *buf, uint32_t bufsiz) { uint32_t val; uint8_t *p, *end; KASSERT(buf != NULL, ("RX buffer cannot be NULL")); - KASSERT(bufsiz <= FUSPI_FIFO_DEPTH, + KASSERT(bufsiz <= SFSPI_FIFO_DEPTH, ("Cannot receive more than %d bytes at a time\n", - FUSPI_FIFO_DEPTH)); + SFSPI_FIFO_DEPTH)); end = buf + bufsiz; for (p = buf; p < end; p++) { do { - val = FUSPI_READ(sc, FUSPI_REG_RXDATA); - } while (val & FUSPI_RXDATA_EMPTY); - *p = val & FUSPI_RXDATA_DATA_MASK; + val = SFSPI_READ(sc, SFSPI_REG_RXDATA); + } while (val & SFSPI_RXDATA_EMPTY); + *p = val & SFSPI_RXDATA_DATA_MASK; }; } static int -fuspi_xfer_buf(struct fuspi_softc *sc, uint8_t *rxbuf, uint8_t *txbuf, +sfspi_xfer_buf(struct sfspi_softc *sc, uint8_t *rxbuf, uint8_t *txbuf, uint32_t txlen, uint32_t rxlen) { uint32_t bytes; @@ -192,10 +192,10 @@ fuspi_xfer_buf(struct fuspi_softc *sc, uint8_t *rxbuf, uint8_t *txbuf, KASSERT(txbuf != NULL, ("TX buffer cannot be NULL")); while (txlen) { - bytes = (txlen > FUSPI_FIFO_DEPTH) ? FUSPI_FIFO_DEPTH : txlen; - fuspi_tx(sc, txbuf, bytes); + bytes = (txlen > SFSPI_FIFO_DEPTH) ? SFSPI_FIFO_DEPTH : txlen; + sfspi_tx(sc, txbuf, bytes); txbuf += bytes; - fuspi_rx(sc, rxbuf, bytes); + sfspi_rx(sc, rxbuf, bytes); rxbuf += bytes; txlen -= bytes; } @@ -204,50 +204,50 @@ fuspi_xfer_buf(struct fuspi_softc *sc, uint8_t *rxbuf, uint8_t *txbuf, } static int -fuspi_setup(struct fuspi_softc *sc, uint32_t cs, uint32_t mode, +sfspi_setup(struct sfspi_softc *sc, uint32_t cs, uint32_t mode, uint32_t freq) { uint32_t csmode, fmt, sckdiv, sckmode; - FUSPI_ASSERT_LOCKED(sc); + SFSPI_ASSERT_LOCKED(sc); /* * Fsck = Fin / 2 * (div + 1) * -> div = Fin / (2 * Fsck) - 1 */ - sckdiv = (howmany(sc->freq >> 1, freq) - 1) & FUSPI_SCKDIV_MASK; - FUSPI_WRITE(sc, FUSPI_REG_SCKDIV, sckdiv); + sckdiv = (howmany(sc->freq >> 1, freq) - 1) & SFSPI_SCKDIV_MASK; + SFSPI_WRITE(sc, SFSPI_REG_SCKDIV, sckdiv); switch (mode) { case SPIBUS_MODE_CPHA: - sckmode = FUSPI_SCKMODE_PHA; + sckmode = SFSPI_SCKMODE_PHA; break; case SPIBUS_MODE_CPOL: - sckmode = FUSPI_SCKMODE_POL; + sckmode = SFSPI_SCKMODE_POL; break; case SPIBUS_MODE_CPOL_CPHA: - sckmode = FUSPI_SCKMODE_PHA | FUSPI_SCKMODE_POL; + sckmode = SFSPI_SCKMODE_PHA | SFSPI_SCKMODE_POL; break; } - FUSPI_WRITE(sc, FUSPI_REG_SCKMODE, sckmode); + SFSPI_WRITE(sc, SFSPI_REG_SCKMODE, sckmode); - csmode = FUSPI_CSMODE_HOLD; + csmode = SFSPI_CSMODE_HOLD; if (cs & SPIBUS_CS_HIGH) - csmode = FUSPI_CSMODE_AUTO; - FUSPI_WRITE(sc, FUSPI_REG_CSMODE, csmode); + csmode = SFSPI_CSMODE_AUTO; + SFSPI_WRITE(sc, SFSPI_REG_CSMODE, csmode); - FUSPI_WRITE(sc, FUSPI_REG_CSID, cs & ~SPIBUS_CS_HIGH); + SFSPI_WRITE(sc, SFSPI_REG_CSID, cs & ~SPIBUS_CS_HIGH); - fmt = FUSPI_FMT_PROTO_SINGLE | FUSPI_FMT_LEN(8); - FUSPI_WRITE(sc, FUSPI_REG_FMT, fmt); + fmt = SFSPI_FMT_PROTO_SINGLE | SFSPI_FMT_LEN(8); + SFSPI_WRITE(sc, SFSPI_REG_FMT, fmt); return (0); } static int -fuspi_transfer(device_t dev, device_t child, struct spi_command *cmd) +sfspi_transfer(device_t dev, device_t child, struct spi_command *cmd) { - struct fuspi_softc *sc; + struct sfspi_softc *sc; uint32_t clock, cs, csdef, mode; int err; @@ -266,38 +266,38 @@ fuspi_transfer(device_t dev, device_t child, struct spi_command *cmd) return (EINVAL); } - FUSPI_LOCK(sc); + SFSPI_LOCK(sc); device_busy(sc->dev); - err = fuspi_setup(sc, cs, mode, clock); + err = sfspi_setup(sc, cs, mode, clock); if (err != 0) { - FUSPI_UNLOCK(sc); + SFSPI_UNLOCK(sc); return (err); } err = 0; if (cmd->tx_cmd_sz > 0) - err = fuspi_xfer_buf(sc, cmd->rx_cmd, cmd->tx_cmd, + err = sfspi_xfer_buf(sc, cmd->rx_cmd, cmd->tx_cmd, cmd->tx_cmd_sz, cmd->rx_cmd_sz); if (cmd->tx_data_sz > 0 && err == 0) - err = fuspi_xfer_buf(sc, cmd->rx_data, cmd->tx_data, + err = sfspi_xfer_buf(sc, cmd->rx_data, cmd->tx_data, cmd->tx_data_sz, cmd->rx_data_sz); /* Deassert chip select. */ - csdef = FUSPI_CSDEF_ALL & ~(1 << cs); - FUSPI_WRITE(sc, FUSPI_REG_CSDEF, csdef); - FUSPI_WRITE(sc, FUSPI_REG_CSDEF, FUSPI_CSDEF_ALL); + csdef = SFSPI_CSDEF_ALL & ~(1 << cs); + SFSPI_WRITE(sc, SFSPI_REG_CSDEF, csdef); + SFSPI_WRITE(sc, SFSPI_REG_CSDEF, SFSPI_CSDEF_ALL); device_unbusy(sc->dev); - FUSPI_UNLOCK(sc); + SFSPI_UNLOCK(sc); return (err); } static int -fuspi_attach(device_t dev) +sfspi_attach(device_t dev) { - struct fuspi_softc *sc; + struct sfspi_softc *sc; int error; sc = device_get_softc(dev); @@ -305,7 +305,7 @@ fuspi_attach(device_t dev) mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); - error = bus_alloc_resources(dev, fuspi_spec, &sc->res); + error = bus_alloc_resources(dev, sfspi_spec, &sc->res); if (error) { device_printf(dev, "Couldn't allocate resources\n"); goto fail; @@ -334,13 +334,13 @@ fuspi_attach(device_t dev) * From Sifive-Unleashed-FU540-C000-v1.0.pdf page 103: * csdef is cs_width bits wide and all ones on reset. */ - sc->cs_max = FUSPI_READ(sc, FUSPI_REG_CSDEF); + sc->cs_max = SFSPI_READ(sc, SFSPI_REG_CSDEF); /* * We don't support the direct-mapped flash interface. * Disable it. */ - FUSPI_WRITE(sc, FUSPI_REG_FCTRL, 0x0); + SFSPI_WRITE(sc, SFSPI_REG_FCTRL, 0x0); /* Probe and attach the spibus when interrupts are available. */ sc->parent = device_add_child(dev, "spibus", -1); @@ -349,13 +349,13 @@ fuspi_attach(device_t dev) return (0); fail: - bus_release_resources(dev, fuspi_spec, &sc->res); + bus_release_resources(dev, sfspi_spec, &sc->res); mtx_destroy(&sc->mtx); return (error); } static int -fuspi_probe(device_t dev) +sfspi_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) @@ -364,37 +364,37 @@ fuspi_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "sifive,spi0")) return (ENXIO); - device_set_desc(dev, "SiFive FU540 SPI controller"); + device_set_desc(dev, "SiFive SPI controller"); return (BUS_PROBE_DEFAULT); } static phandle_t -fuspi_get_node(device_t bus, device_t dev) +sfspi_get_node(device_t bus, device_t dev) { return (ofw_bus_get_node(bus)); } -static device_method_t fuspi_methods[] = { - DEVMETHOD(device_probe, fuspi_probe), - DEVMETHOD(device_attach, fuspi_attach), +static device_method_t sfspi_methods[] = { + DEVMETHOD(device_probe, sfspi_probe), + DEVMETHOD(device_attach, sfspi_attach), - DEVMETHOD(spibus_transfer, fuspi_transfer), + DEVMETHOD(spibus_transfer, sfspi_transfer), - DEVMETHOD(ofw_bus_get_node, fuspi_get_node), + DEVMETHOD(ofw_bus_get_node, sfspi_get_node), DEVMETHOD_END }; -static driver_t fuspi_driver = { - "fu540spi", - fuspi_methods, - sizeof(struct fuspi_softc) +static driver_t sfspi_driver = { + "sifive_spi", + sfspi_methods, + sizeof(struct sfspi_softc) }; -static devclass_t fuspi_devclass; +static devclass_t sfspi_devclass; -DRIVER_MODULE(fu540spi, simplebus, fuspi_driver, fuspi_devclass, 0, 0); -DRIVER_MODULE(ofw_spibus, fu540spi, ofw_spibus_driver, ofw_spibus_devclass, 0, 0); -MODULE_DEPEND(fu540spi, ofw_spibus, 1, 1, 1); +DRIVER_MODULE(sifive_spi, simplebus, sfspi_driver, sfspi_devclass, 0, 0); +DRIVER_MODULE(ofw_spibus, sifive_spi, ofw_spibus_driver, ofw_spibus_devclass, 0, 0); +MODULE_DEPEND(sifive_spi, ofw_spibus, 1, 1, 1); From owner-dev-commits-src-main@freebsd.org Sat Aug 7 18:28:23 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2921D66F334; Sat, 7 Aug 2021 18:28:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhrSl08tYz4ZkQ; Sat, 7 Aug 2021 18:28:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFAE425CBF; Sat, 7 Aug 2021 18:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177ISMia082527; Sat, 7 Aug 2021 18:28:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177ISM51082526; Sat, 7 Aug 2021 18:28:22 GMT (envelope-from git) Date: Sat, 7 Aug 2021 18:28:22 GMT Message-Id: <202108071828.177ISM51082526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: b47e5c5dbe20 - main - sifive_gpio: Add SiFive GPIO controller driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b47e5c5dbe2058b6a178230dc7796c37bfeaa926 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 18:28:23 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=b47e5c5dbe2058b6a178230dc7796c37bfeaa926 commit b47e5c5dbe2058b6a178230dc7796c37bfeaa926 Author: Jessica Clarke AuthorDate: 2021-08-07 18:27:31 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 18:27:31 +0000 sifive_gpio: Add SiFive GPIO controller driver This is present on both the FU540 and FU740, but only needed for the FU740 in order to assert reset and power enable signals for its PCIe controller. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31031 --- sys/riscv/conf/GENERIC | 4 + sys/riscv/sifive/files.sifive | 1 + sys/riscv/sifive/sifive_gpio.c | 464 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 469 insertions(+) diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index b65c0317f28d..360d6b163d45 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -123,6 +123,9 @@ device xae # Xilinx AXI Ethernet MAC device xdma # DMA interface device axidma # Xilinx AXI DMA Controller +# GPIO +device gpio + # SPI device spibus device spigen @@ -174,5 +177,6 @@ options FDT makeoptions MODULES_EXTRA+="dtb/sifive" # SiFive device drivers +device sifive_gpio device sifive_spi include "../sifive/std.sifive" diff --git a/sys/riscv/sifive/files.sifive b/sys/riscv/sifive/files.sifive index 2eb73f1607ac..9ea71c4fcd27 100644 --- a/sys/riscv/sifive/files.sifive +++ b/sys/riscv/sifive/files.sifive @@ -1,6 +1,7 @@ # $FreeBSD$ riscv/sifive/fe310_aon.c optional fe310aon +riscv/sifive/sifive_gpio.c optional sifive_gpio gpio riscv/sifive/sifive_prci.c standard riscv/sifive/sifive_spi.c optional sifive_spi spibus riscv/sifive/sifive_uart.c standard diff --git a/sys/riscv/sifive/sifive_gpio.c b/sys/riscv/sifive/sifive_gpio.c new file mode 100644 index 000000000000..47d03ca448d5 --- /dev/null +++ b/sys/riscv/sifive/sifive_gpio.c @@ -0,0 +1,464 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Jessica Clarke + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* TODO: Provide interrupt controller interface */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +/* Registers are 32-bit so can only fit 32 pins */ +#define SFGPIO_MAX_PINS 32 + +#define SFGPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) + +#define SFGPIO_INPUT_VAL 0x0 +#define SFGPIO_INPUT_EN 0x4 +#define SFGPIO_OUTPUT_EN 0x8 +#define SFGPIO_OUTPUT_VAL 0xc +#define SFGPIO_RISE_IE 0x18 +#define SFGPIO_RISE_IP 0x1c +#define SFGPIO_FALL_IE 0x20 +#define SFGPIO_FALL_IP 0x24 +#define SFGPIO_HIGH_IE 0x28 +#define SFGPIO_HIGH_IP 0x2c +#define SFGPIO_LOW_IE 0x30 +#define SFGPIO_LOW_IP 0x34 + +struct sfgpio_softc { + device_t dev; + device_t busdev; + struct mtx mtx; + struct resource *mem_res; + int mem_rid; + struct resource *irq_res; + int irq_rid; + int npins; + struct gpio_pin gpio_pins[SFGPIO_MAX_PINS]; +}; + +#define SFGPIO_LOCK(_sc) mtx_lock(&(_sc)->mtx) +#define SFGPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) + +#define SFGPIO_READ(_sc, _off) \ + bus_read_4((_sc)->mem_res, (_off)) +#define SFGPIO_WRITE(_sc, _off, _val) \ + bus_write_4((_sc)->mem_res, (_off), (_val)) + +static struct ofw_compat_data compat_data[] = { + { "sifive,gpio0", 1 }, + { NULL, 0 }, +}; + +static int +sfgpio_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "SiFive GPIO Controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +sfgpio_attach(device_t dev) +{ + struct sfgpio_softc *sc; + phandle_t node; + int error, i; + pcell_t npins; + uint32_t input_en, output_en; + + sc = device_get_softc(dev); + sc->dev = dev; + + node = ofw_bus_get_node(dev); + + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); + + sc->mem_rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mem_rid, RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resource\n"); + error = ENXIO; + goto fail; + } + + if (OF_getencprop(node, "ngpios", &npins, sizeof(npins)) <= 0) { + /* Optional; defaults to 16 */ + npins = 16; + } else if (npins > SFGPIO_MAX_PINS) { + device_printf(dev, "Too many pins: %d\n", npins); + error = ENXIO; + goto fail; + } + sc->npins = npins; + + sc->irq_rid = 0; + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_ACTIVE); + if (sc->irq_res == NULL) { + device_printf(dev, "Cannot allocate IRQ resource\n"); + error = ENXIO; + goto fail; + } + + input_en = SFGPIO_READ(sc, SFGPIO_INPUT_EN); + output_en = SFGPIO_READ(sc, SFGPIO_OUTPUT_EN); + for (i = 0; i < sc->npins; ++i) { + sc->gpio_pins[i].gp_pin = i; + sc->gpio_pins[i].gp_caps = SFGPIO_DEFAULT_CAPS; + sc->gpio_pins[i].gp_flags = + ((input_en & (1u << i)) ? GPIO_PIN_INPUT : 0) | + ((output_en & (1u << i)) ? GPIO_PIN_OUTPUT : 0); + snprintf(sc->gpio_pins[i].gp_name, GPIOMAXNAME, "GPIO%d", i); + sc->gpio_pins[i].gp_name[GPIOMAXNAME - 1] = '\0'; + } + + sc->busdev = gpiobus_attach_bus(dev); + if (sc->busdev == NULL) { + device_printf(dev, "Cannot attach gpiobus\n"); + error = ENXIO; + goto fail; + } + + return (0); + +fail: + if (sc->busdev != NULL) + gpiobus_detach_bus(dev); + if (sc->irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, + sc->irq_res); + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, + sc->mem_res); + mtx_destroy(&sc->mtx); + return (error); +} + +static device_t +sfgpio_get_bus(device_t dev) +{ + struct sfgpio_softc *sc; + + sc = device_get_softc(dev); + + return (sc->busdev); +} + +static int +sfgpio_pin_max(device_t dev, int *maxpin) +{ + struct sfgpio_softc *sc; + + sc = device_get_softc(dev); + + *maxpin = sc->npins - 1; + + return (0); +} + +static int +sfgpio_pin_set(device_t dev, uint32_t pin, unsigned int val) +{ + struct sfgpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + if (pin >= sc->npins) + return (EINVAL); + + SFGPIO_LOCK(sc); + reg = SFGPIO_READ(sc, SFGPIO_OUTPUT_VAL); + if (val) + reg |= (1u << pin); + else + reg &= ~(1u << pin); + SFGPIO_WRITE(sc, SFGPIO_OUTPUT_VAL, reg); + SFGPIO_UNLOCK(sc); + + return (0); +} + +static int +sfgpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct sfgpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + if (pin >= sc->npins) + return (EINVAL); + + SFGPIO_LOCK(sc); + if (sc->gpio_pins[pin].gp_flags & GPIO_PIN_OUTPUT) + reg = SFGPIO_READ(sc, SFGPIO_OUTPUT_VAL); + else + reg = SFGPIO_READ(sc, SFGPIO_INPUT_VAL); + *val = (reg & (1u << pin)) ? 1 : 0; + SFGPIO_UNLOCK(sc); + + return (0); +} + +static int +sfgpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct sfgpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + if (pin >= sc->npins) + return (EINVAL); + + SFGPIO_LOCK(sc); + reg = SFGPIO_READ(sc, SFGPIO_OUTPUT_VAL); + reg ^= (1u << pin); + SFGPIO_WRITE(sc, SFGPIO_OUTPUT_VAL, reg); + SFGPIO_UNLOCK(sc); + + return (0); +} + +static int +sfgpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct sfgpio_softc *sc; + + sc = device_get_softc(dev); + + if (pin >= sc->npins) + return (EINVAL); + + SFGPIO_LOCK(sc); + *caps = sc->gpio_pins[pin].gp_caps; + SFGPIO_UNLOCK(sc); + + return (0); +} + +static int +sfgpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct sfgpio_softc *sc; + + sc = device_get_softc(dev); + + if (pin >= sc->npins) + return (EINVAL); + + SFGPIO_LOCK(sc); + *flags = sc->gpio_pins[pin].gp_flags; + SFGPIO_UNLOCK(sc); + + return (0); +} + +static int +sfgpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct sfgpio_softc *sc; + + sc = device_get_softc(dev); + + if (pin >= sc->npins) + return (EINVAL); + + SFGPIO_LOCK(sc); + memcpy(name, sc->gpio_pins[pin].gp_name, GPIOMAXNAME); + SFGPIO_UNLOCK(sc); + + return (0); +} + +static int +sfgpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct sfgpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + if (pin >= sc->npins) + return (EINVAL); + + SFGPIO_LOCK(sc); + + reg = SFGPIO_READ(sc, SFGPIO_INPUT_EN); + if (flags & GPIO_PIN_INPUT) { + reg |= (1u << pin); + sc->gpio_pins[pin].gp_flags |= GPIO_PIN_INPUT; + } else { + reg &= ~(1u << pin); + sc->gpio_pins[pin].gp_flags &= ~GPIO_PIN_INPUT; + } + SFGPIO_WRITE(sc, SFGPIO_INPUT_EN, reg); + + reg = SFGPIO_READ(sc, SFGPIO_OUTPUT_EN); + if (flags & GPIO_PIN_OUTPUT) { + reg |= (1u << pin); + sc->gpio_pins[pin].gp_flags |= GPIO_PIN_OUTPUT; + } else { + reg &= ~(1u << pin); + sc->gpio_pins[pin].gp_flags &= ~GPIO_PIN_OUTPUT; + } + SFGPIO_WRITE(sc, SFGPIO_OUTPUT_EN, reg); + + SFGPIO_UNLOCK(sc); + + return (0); +} + +static int +sfgpio_pin_access_32(device_t dev, uint32_t first_pin, uint32_t clear_pins, + uint32_t change_pins, uint32_t *orig_pins) +{ + struct sfgpio_softc *sc; + uint32_t reg; + + if (first_pin != 0) + return (EINVAL); + + sc = device_get_softc(dev); + + SFGPIO_LOCK(sc); + + reg = SFGPIO_READ(sc, SFGPIO_OUTPUT_VAL); + + if (orig_pins != NULL) + /* Only input_val is implicitly masked by input_en */ + *orig_pins = SFGPIO_READ(sc, SFGPIO_INPUT_VAL) | + (reg & SFGPIO_READ(sc, SFGPIO_OUTPUT_EN)); + + if ((clear_pins | change_pins) != 0) + SFGPIO_WRITE(sc, SFGPIO_OUTPUT_VAL, + (reg & ~clear_pins) ^ change_pins); + + SFGPIO_UNLOCK(sc); + + return (0); +} + +static int +sfgpio_pin_config_32(device_t dev, uint32_t first_pin, uint32_t num_pins, + uint32_t *pin_flags) +{ + struct sfgpio_softc *sc; + uint32_t ireg, oreg; + int i; + + sc = device_get_softc(dev); + + if (first_pin != 0 || num_pins > sc->npins) + return (EINVAL); + + SFGPIO_LOCK(sc); + + ireg = SFGPIO_READ(sc, SFGPIO_INPUT_EN); + oreg = SFGPIO_READ(sc, SFGPIO_OUTPUT_EN); + for (i = 0; i < num_pins; ++i) { + if (pin_flags[i] & GPIO_PIN_INPUT) { + ireg |= (1u << i); + oreg &= ~(1u << i); + sc->gpio_pins[i].gp_flags |= GPIO_PIN_INPUT; + sc->gpio_pins[i].gp_flags &= ~GPIO_PIN_OUTPUT; + } else if (pin_flags[i] & GPIO_PIN_OUTPUT) { + ireg &= ~(1u << i); + oreg |= (1u << i); + sc->gpio_pins[i].gp_flags &= ~GPIO_PIN_INPUT; + sc->gpio_pins[i].gp_flags |= GPIO_PIN_OUTPUT; + } + } + SFGPIO_WRITE(sc, SFGPIO_INPUT_EN, ireg); + SFGPIO_WRITE(sc, SFGPIO_OUTPUT_EN, oreg); + + SFGPIO_UNLOCK(sc); + + return (0); +} + +static phandle_t +sfgpio_get_node(device_t bus, device_t dev) +{ + return (ofw_bus_get_node(bus)); +} + +static device_method_t sfgpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, sfgpio_probe), + DEVMETHOD(device_attach, sfgpio_attach), + + /* GPIO protocol */ + DEVMETHOD(gpio_get_bus, sfgpio_get_bus), + DEVMETHOD(gpio_pin_max, sfgpio_pin_max), + DEVMETHOD(gpio_pin_set, sfgpio_pin_set), + DEVMETHOD(gpio_pin_get, sfgpio_pin_get), + DEVMETHOD(gpio_pin_toggle, sfgpio_pin_toggle), + DEVMETHOD(gpio_pin_getcaps, sfgpio_pin_getcaps), + DEVMETHOD(gpio_pin_getflags, sfgpio_pin_getflags), + DEVMETHOD(gpio_pin_getname, sfgpio_pin_getname), + DEVMETHOD(gpio_pin_setflags, sfgpio_pin_setflags), + DEVMETHOD(gpio_pin_access_32, sfgpio_pin_access_32), + DEVMETHOD(gpio_pin_config_32, sfgpio_pin_config_32), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, sfgpio_get_node), + + DEVMETHOD_END +}; + +static devclass_t sfgpio_devclass; +DEFINE_CLASS_0(gpio, sfgpio_driver, sfgpio_methods, + sizeof(struct sfgpio_softc)); +EARLY_DRIVER_MODULE(gpio, simplebus, sfgpio_driver, sfgpio_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); +MODULE_DEPEND(sfgpio, gpiobus, 1, 1, 1); From owner-dev-commits-src-main@freebsd.org Sat Aug 7 18:28:24 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C28066F2CC; Sat, 7 Aug 2021 18:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhrSm0jrLz4ZQ5; Sat, 7 Aug 2021 18:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA7C725B4A; Sat, 7 Aug 2021 18:28:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177ISNeO082551; Sat, 7 Aug 2021 18:28:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177ISN4K082550; Sat, 7 Aug 2021 18:28:23 GMT (envelope-from git) Date: Sat, 7 Aug 2021 18:28:23 GMT Message-Id: <202108071828.177ISN4K082550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 896e217a0eae - main - fu740_pci_dw: Add SiFive FU740 PCIe controller driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 896e217a0eae692b1fe3de5d1354478541fb13ff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 18:28:24 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=896e217a0eae692b1fe3de5d1354478541fb13ff commit 896e217a0eae692b1fe3de5d1354478541fb13ff Author: Jessica Clarke AuthorDate: 2021-08-07 18:27:31 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 18:27:31 +0000 fu740_pci_dw: Add SiFive FU740 PCIe controller driver Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31033 --- sys/conf/files.riscv | 2 + sys/riscv/conf/GENERIC | 1 + sys/riscv/sifive/files.sifive | 1 + sys/riscv/sifive/fu740_pci_dw.c | 465 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 469 insertions(+) diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index cf7b58bfe4e3..d46d520bd0b7 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -5,6 +5,8 @@ cddl/dev/fbt/riscv/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${ crypto/des/des_enc.c optional netsmb dev/ofw/ofw_cpu.c optional fdt dev/ofw/ofw_pcib.c optional pci fdt +dev/pci/pci_dw.c optional pci fdt +dev/pci/pci_dw_if.m optional pci fdt dev/pci/pci_host_generic.c optional pci dev/pci/pci_host_generic_fdt.c optional pci fdt dev/uart/uart_cpu_fdt.c optional uart fdt diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 360d6b163d45..09882853ada2 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -177,6 +177,7 @@ options FDT makeoptions MODULES_EXTRA+="dtb/sifive" # SiFive device drivers +device fu740_pci_dw device sifive_gpio device sifive_spi include "../sifive/std.sifive" diff --git a/sys/riscv/sifive/files.sifive b/sys/riscv/sifive/files.sifive index 9ea71c4fcd27..f38bacb48e3b 100644 --- a/sys/riscv/sifive/files.sifive +++ b/sys/riscv/sifive/files.sifive @@ -1,6 +1,7 @@ # $FreeBSD$ riscv/sifive/fe310_aon.c optional fe310aon +riscv/sifive/fu740_pci_dw.c optional fu740_pci_dw pci fdt riscv/sifive/sifive_gpio.c optional sifive_gpio gpio riscv/sifive/sifive_prci.c standard riscv/sifive/sifive_spi.c optional sifive_spi spibus diff --git a/sys/riscv/sifive/fu740_pci_dw.c b/sys/riscv/sifive/fu740_pci_dw.c new file mode 100644 index 000000000000..fbb62cc44e65 --- /dev/null +++ b/sys/riscv/sifive/fu740_pci_dw.c @@ -0,0 +1,465 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2021 Jessica Clarke + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* SiFive FU740 DesignWare PCIe driver */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pcib_if.h" +#include "pci_dw_if.h" + +#define FUDW_PHYS 2 +#define FUDW_LANES_PER_PHY 4 + +#define FUDW_MGMT_PERST_N 0x0 +#define FUDW_MGMT_LTSSM_EN 0x10 +#define FUDW_MGMT_HOLD_PHY_RST 0x18 +#define FUDW_MGMT_DEVICE_TYPE 0x708 +#define FUDW_MGMT_DEVICE_TYPE_RC 0x4 +#define FUDW_MGMT_PHY_CR_PARA_REG(_n, _r) \ + (0x860 + (_n) * 0x40 + FUDW_MGMT_PHY_CR_PARA_##_r) +#define FUDW_MGMT_PHY_CR_PARA_ADDR 0x0 +#define FUDW_MGMT_PHY_CR_PARA_READ_EN 0x10 +#define FUDW_MGMT_PHY_CR_PARA_READ_DATA 0x18 +#define FUDW_MGMT_PHY_CR_PARA_SEL 0x20 +#define FUDW_MGMT_PHY_CR_PARA_WRITE_DATA 0x28 +#define FUDW_MGMT_PHY_CR_PARA_WRITE_EN 0x30 +#define FUDW_MGMT_PHY_CR_PARA_ACK 0x38 + +#define FUDW_MGMT_PHY_LANE(_n) (0x1008 + (_n) * 0x100) +#define FUDW_MGMT_PHY_LANE_CDR_TRACK_EN (1 << 0) +#define FUDW_MGMT_PHY_LANE_LOS_THRESH (1 << 5) +#define FUDW_MGMT_PHY_LANE_TERM_EN (1 << 9) +#define FUDW_MGMT_PHY_LANE_TERM_ACDC (1 << 10) +#define FUDW_MGMT_PHY_LANE_EN (1 << 11) +#define FUDW_MGMT_PHY_LANE_INIT \ + (FUDW_MGMT_PHY_LANE_CDR_TRACK_EN | FUDW_MGMT_PHY_LANE_LOS_THRESH | \ + FUDW_MGMT_PHY_LANE_TERM_EN | FUDW_MGMT_PHY_LANE_TERM_ACDC | \ + FUDW_MGMT_PHY_LANE_EN) + +#define FUDW_DBI_PORT_DBG1 0x72c +#define FUDW_DBI_PORT_DBG1_LINK_UP (1 << 4) +#define FUDW_DBI_PORT_DBG1_LINK_IN_TRAINING (1 << 29) + +struct fupci_softc { + struct pci_dw_softc dw_sc; + device_t dev; + struct resource *mgmt_res; + gpio_pin_t porst_pin; + gpio_pin_t pwren_pin; + clk_t pcie_aux_clk; + hwreset_t pcie_aux_rst; +}; + +#define FUDW_MGMT_READ(_sc, _o) bus_read_4((_sc)->mgmt_res, (_o)) +#define FUDW_MGMT_WRITE(_sc, _o, _v) bus_write_4((_sc)->mgmt_res, (_o), (_v)) + +static struct ofw_compat_data compat_data[] = { + { "sifive,fu740-pcie", 1 }, + { NULL, 0 }, +}; + +/* Currently unused; included for completeness */ +static int __unused +fupci_phy_read(struct fupci_softc *sc, int phy, uint32_t reg, uint32_t *val) +{ + unsigned timeout; + uint32_t ack; + + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, ADDR), reg); + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, READ_EN), 1); + + timeout = 10; + do { + ack = FUDW_MGMT_READ(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, ACK)); + if (ack != 0) + break; + DELAY(10); + } while (--timeout > 0); + + if (timeout == 0) { + device_printf(sc->dev, "Timeout waiting for read ACK\n"); + return (ETIMEDOUT); + } + + *val = FUDW_MGMT_READ(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, READ_DATA)); + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, READ_EN), 0); + + timeout = 10; + do { + ack = FUDW_MGMT_READ(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, ACK)); + if (ack == 0) + break; + DELAY(10); + } while (--timeout > 0); + + if (timeout == 0) { + device_printf(sc->dev, "Timeout waiting for read un-ACK\n"); + return (ETIMEDOUT); + } + + return (0); +} + +static int +fupci_phy_write(struct fupci_softc *sc, int phy, uint32_t reg, uint32_t val) +{ + unsigned timeout; + uint32_t ack; + + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, ADDR), reg); + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, WRITE_DATA), val); + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, WRITE_EN), 1); + + timeout = 10; + do { + ack = FUDW_MGMT_READ(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, ACK)); + if (ack != 0) + break; + DELAY(10); + } while (--timeout > 0); + + if (timeout == 0) { + device_printf(sc->dev, "Timeout waiting for write ACK\n"); + return (ETIMEDOUT); + } + + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, WRITE_EN), 0); + + timeout = 10; + do { + ack = FUDW_MGMT_READ(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, ACK)); + if (ack == 0) + break; + DELAY(10); + } while (--timeout > 0); + + if (timeout == 0) { + device_printf(sc->dev, "Timeout waiting for write un-ACK\n"); + return (ETIMEDOUT); + } + + return (0); +} + +static int +fupci_phy_init(struct fupci_softc *sc) +{ + device_t dev; + int error, phy, lane; + + dev = sc->dev; + + /* Assert core power-on reset (active low) */ + error = gpio_pin_set_active(sc->porst_pin, false); + if (error != 0) { + device_printf(dev, "Cannot assert power-on reset: %d\n", + error); + return (error); + } + + /* Assert PERST_N */ + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PERST_N, 0); + + /* Enable power */ + error = gpio_pin_set_active(sc->pwren_pin, true); + if (error != 0) { + device_printf(dev, "Cannot enable power: %d\n", error); + return (error); + } + + /* Hold PERST for 100ms as per the PCIe spec */ + DELAY(100); + + /* Deassert PERST_N */ + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PERST_N, 1); + + /* Deassert core power-on reset (active low) */ + error = gpio_pin_set_active(sc->porst_pin, true); + if (error != 0) { + device_printf(dev, "Cannot deassert power-on reset: %d\n", + error); + return (error); + } + + /* Enable the aux clock */ + error = clk_enable(sc->pcie_aux_clk); + if (error != 0) { + device_printf(dev, "Cannot enable aux clock: %d\n", error); + return (error); + } + + /* Hold LTSSM in reset whilst initialising the PHYs */ + FUDW_MGMT_WRITE(sc, FUDW_MGMT_HOLD_PHY_RST, 1); + + /* Deassert the aux reset */ + error = hwreset_deassert(sc->pcie_aux_rst); + if (error != 0) { + device_printf(dev, "Cannot deassert aux reset: %d\n", error); + return (error); + } + + /* Enable control register interface */ + for (phy = 0; phy < FUDW_PHYS; ++phy) + FUDW_MGMT_WRITE(sc, FUDW_MGMT_PHY_CR_PARA_REG(phy, SEL), 1); + + /* Wait for enable to take effect */ + DELAY(1); + + /* Initialise lane configuration */ + for (phy = 0; phy < FUDW_PHYS; ++phy) { + for (lane = 0; lane < FUDW_LANES_PER_PHY; ++lane) + fupci_phy_write(sc, phy, FUDW_MGMT_PHY_LANE(lane), + FUDW_MGMT_PHY_LANE_INIT); + } + + /* Disable the aux clock whilst taking the LTSSM out of reset */ + error = clk_disable(sc->pcie_aux_clk); + if (error != 0) { + device_printf(dev, "Cannot disable aux clock: %d\n", error); + return (error); + } + + /* Take LTSSM out of reset */ + FUDW_MGMT_WRITE(sc, FUDW_MGMT_HOLD_PHY_RST, 0); + + /* Enable the aux clock again */ + error = clk_enable(sc->pcie_aux_clk); + if (error != 0) { + device_printf(dev, "Cannot re-enable aux clock: %d\n", error); + return (error); + } + + /* Put the controller in Root Complex mode */ + FUDW_MGMT_WRITE(sc, FUDW_MGMT_DEVICE_TYPE, FUDW_MGMT_DEVICE_TYPE_RC); + + return (0); +} + +static void +fupci_dbi_protect(struct fupci_softc *sc, bool protect) +{ + uint32_t reg; + + reg = pci_dw_dbi_rd4(sc->dev, DW_MISC_CONTROL_1); + if (protect) + reg &= ~DBI_RO_WR_EN; + else + reg |= DBI_RO_WR_EN; + pci_dw_dbi_wr4(sc->dev, DW_MISC_CONTROL_1, reg); +} + +static int +fupci_init(struct fupci_softc *sc) +{ + /* Enable 32-bit I/O window */ + fupci_dbi_protect(sc, false); + pci_dw_dbi_wr2(sc->dev, PCIR_IOBASEL_1, + (PCIM_BRIO_32 << 8) | PCIM_BRIO_32); + fupci_dbi_protect(sc, true); + + /* Enable LTSSM */ + FUDW_MGMT_WRITE(sc, FUDW_MGMT_LTSSM_EN, 1); + + return (0); +} + +static int +fupci_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "SiFive FU740 PCIe Controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +fupci_attach(device_t dev) +{ + struct fupci_softc *sc; + phandle_t node; + int error, rid; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + sc->dev = dev; + + rid = 0; + error = ofw_bus_find_string_index(node, "reg-names", "dbi", &rid); + if (error != 0) { + device_printf(dev, "Cannot get DBI memory: %d\n", error); + goto fail; + } + sc->dw_sc.dbi_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->dw_sc.dbi_res == NULL) { + device_printf(dev, "Cannot allocate DBI memory\n"); + error = ENXIO; + goto fail; + } + + rid = 0; + error = ofw_bus_find_string_index(node, "reg-names", "mgmt", &rid); + if (error != 0) { + device_printf(dev, "Cannot get management space memory: %d\n", + error); + goto fail; + } + sc->mgmt_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mgmt_res == NULL) { + device_printf(dev, "Cannot allocate management space memory\n"); + error = ENXIO; + goto fail; + } + + error = gpio_pin_get_by_ofw_property(dev, node, "reset-gpios", + &sc->porst_pin); + /* Old U-Boot device tree uses perstn-gpios */ + if (error == ENOENT) + error = gpio_pin_get_by_ofw_property(dev, node, "perstn-gpios", + &sc->porst_pin); + if (error != 0) { + device_printf(dev, "Cannot get power-on reset GPIO: %d\n", + error); + goto fail; + } + error = gpio_pin_setflags(sc->porst_pin, GPIO_PIN_OUTPUT); + if (error != 0) { + device_printf(dev, "Cannot configure power-on reset GPIO: %d\n", + error); + goto fail; + } + + error = gpio_pin_get_by_ofw_property(dev, node, "pwren-gpios", + &sc->pwren_pin); + if (error != 0) { + device_printf(dev, "Cannot get power enable GPIO: %d\n", + error); + goto fail; + } + error = gpio_pin_setflags(sc->pwren_pin, GPIO_PIN_OUTPUT); + if (error != 0) { + device_printf(dev, "Cannot configure power enable GPIO: %d\n", + error); + goto fail; + } + + error = clk_get_by_ofw_name(dev, node, "pcie_aux", &sc->pcie_aux_clk); + /* Old U-Boot device tree uses pcieaux */ + if (error == ENOENT) + error = clk_get_by_ofw_name(dev, node, "pcieaux", + &sc->pcie_aux_clk); + if (error != 0) { + device_printf(dev, "Cannot get aux clock: %d\n", error); + goto fail; + } + + error = hwreset_get_by_ofw_idx(dev, node, 0, &sc->pcie_aux_rst); + if (error != 0) { + device_printf(dev, "Cannot get aux reset: %d\n", error); + goto fail; + } + + error = fupci_phy_init(sc); + if (error != 0) + goto fail; + + error = pci_dw_init(dev); + if (error != 0) + goto fail; + + error = fupci_init(sc); + if (error != 0) + goto fail; + + return (bus_generic_attach(dev)); + +fail: + /* XXX Cleanup */ + return (error); +} + +static int +fupci_get_link(device_t dev, bool *status) +{ + uint32_t reg; + + reg = pci_dw_dbi_rd4(dev, FUDW_DBI_PORT_DBG1); + *status = (reg & FUDW_DBI_PORT_DBG1_LINK_UP) != 0 && + (reg & FUDW_DBI_PORT_DBG1_LINK_IN_TRAINING) == 0; + + return (0); +} + +static device_method_t fupci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fupci_probe), + DEVMETHOD(device_attach, fupci_attach), + + /* PCI DW interface */ + DEVMETHOD(pci_dw_get_link, fupci_get_link), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(pcib, fupci_driver, fupci_methods, + sizeof(struct fupci_softc), pci_dw_driver); +static devclass_t fupci_devclass; +DRIVER_MODULE(fu740_pci_dw, simplebus, fupci_driver, fupci_devclass, + NULL, NULL); From owner-dev-commits-src-main@freebsd.org Sat Aug 7 18:28:25 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FF3366F2D8; Sat, 7 Aug 2021 18:28:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhrSn1QWdz4ZT1; Sat, 7 Aug 2021 18:28:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0FFC25B4B; Sat, 7 Aug 2021 18:28:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177ISOF4082575; Sat, 7 Aug 2021 18:28:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177ISOsp082574; Sat, 7 Aug 2021 18:28:24 GMT (envelope-from git) Date: Sat, 7 Aug 2021 18:28:24 GMT Message-Id: <202108071828.177ISOsp082574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 262459806433 - main - pci_pci: Support growing windows in bus_adjust_resource for NEW_PCIB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 262459806433f838bb2e54cc4733c0887328a170 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 18:28:25 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=262459806433f838bb2e54cc4733c0887328a170 commit 262459806433f838bb2e54cc4733c0887328a170 Author: Jessica Clarke AuthorDate: 2021-08-07 18:27:32 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 18:27:32 +0000 pci_pci: Support growing windows in bus_adjust_resource for NEW_PCIB If we allocate a new window for a bridge rather than reusing an existing one set up by firmware to cover all the devices then the new window only includes the range needed for the first device to allocate the resource. If a request comes in to adjust this resource in order to extend a downstream window for another device then this will fail as the rman doesn't have any space, so we must first grow the bridge's own window. This is needed to support successfully attaching more than one PCI device on SiFive's HiFive Unmatched, which has the following topology: Root Port <---> Bridge <---> Bridge <-+-> Bridge <---> (Unused) (pcib0) (pcib1) (pcib2) | (pcib3) +-> Bridge <---> xHCI | (pcib4) +-> Bridge <---> M.2 E-key | (pcib5) +-> Bridge <---> M.2 M-key | (pcib6) +-> Bridge <---> x16 slot (pcib7) Without this, the xHCI endpoint successfully attaches but NVMe M.2 M-key endpoint fails to attach as, when its adjacent bridge (pcib6) attempts to allocate a window from its parent (pcib2) on the other side of the switch, its parent attempts to grow its own window by calling bus_adjust_resource on its own parent (pcib1) which fails to call the root port device (pcib0) to request more memory to grow its own window. Had the root port been directly connected to the switch without the bridge in the middle then the existing code would have worked, but the extra hop broke it. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31035 --- sys/dev/pci/pci_pci.c | 77 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 62 insertions(+), 15 deletions(-) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index d6fbb06a61ac..83106eaa455b 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -148,6 +148,30 @@ static int pci_clear_pcib; SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0, "Clear firmware-assigned resources for PCI-PCI bridge I/O windows."); +/* + * Get the corresponding window if this resource from a child device was + * sub-allocated from one of our window resource managers. + */ +static struct pcib_window * +pcib_get_resource_window(struct pcib_softc *sc, int type, struct resource *r) +{ + switch (type) { + case SYS_RES_IOPORT: + if (rman_is_region_manager(r, &sc->io.rman)) + return (&sc->io); + break; + case SYS_RES_MEMORY: + /* Prefetchable resources may live in either memory rman. */ + if (rman_get_flags(r) & RF_PREFETCHABLE && + rman_is_region_manager(r, &sc->pmem.rman)) + return (&sc->pmem); + if (rman_is_region_manager(r, &sc->mem.rman)) + return (&sc->mem); + break; + } + return (NULL); +} + /* * Is a resource from a child device sub-allocated from one of our * resource managers? @@ -156,21 +180,11 @@ static int pcib_is_resource_managed(struct pcib_softc *sc, int type, struct resource *r) { - switch (type) { #ifdef PCI_RES_BUS - case PCI_RES_BUS: + if (type == PCI_RES_BUS) return (rman_is_region_manager(r, &sc->bus.rman)); #endif - case SYS_RES_IOPORT: - return (rman_is_region_manager(r, &sc->io.rman)); - case SYS_RES_MEMORY: - /* Prefetchable resources may live in either memory rman. */ - if (rman_get_flags(r) & RF_PREFETCHABLE && - rman_is_region_manager(r, &sc->pmem.rman)) - return (1); - return (rman_is_region_manager(r, &sc->mem.rman)); - } - return (0); + return (pcib_get_resource_window(sc, type, r) != NULL); } static int @@ -2330,11 +2344,44 @@ pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) { struct pcib_softc *sc; + struct pcib_window *w; + int error; sc = device_get_softc(bus); - if (pcib_is_resource_managed(sc, type, r)) - return (rman_adjust_resource(r, start, end)); - return (bus_generic_adjust_resource(bus, child, type, r, start, end)); + + /* + * If the resource wasn't sub-allocated from one of our region + * managers then just pass the request up. + */ + if (!pcib_is_resource_managed(sc, type, r)) + return (bus_generic_adjust_resource(bus, child, type, r, + start, end)); + +#ifdef PCI_RES_BUS + if (type != PCI_RES_BUS) +#endif + { + /* + * Resource is managed and not a secondary bus number, must + * be from one of our windows. + */ + w = pcib_get_resource_window(sc, type, r); + KASSERT(w != NULL, + ("%s: no window for resource (%#jx-%#jx) type %d", + __func__, rman_get_start(r), rman_get_end(r), type)); + + /* + * If our window isn't big enough to grow the sub-allocation + * then we need to expand the window. + */ + if (start < w->base || end > w->limit) { + error = pcib_expand_window(sc, w, type, start, end); + if (error != 0) + return (error); + } + } + + return (rman_adjust_resource(r, start, end)); } int From owner-dev-commits-src-main@freebsd.org Sat Aug 7 18:28:26 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85CFC66F2DE; Sat, 7 Aug 2021 18:28:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhrSp2KMRz4ZVx; Sat, 7 Aug 2021 18:28:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22C3825D59; Sat, 7 Aug 2021 18:28:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177ISQh4082599; Sat, 7 Aug 2021 18:28:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177ISQja082598; Sat, 7 Aug 2021 18:28:26 GMT (envelope-from git) Date: Sat, 7 Aug 2021 18:28:26 GMT Message-Id: <202108071828.177ISQja082598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 6e162bd2f298 - main - riscv: Add NVMe, USB and HID support to GENERIC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e162bd2f298b58a418a17d49f5671a9a113fc4e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 18:28:26 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=6e162bd2f298b58a418a17d49f5671a9a113fc4e commit 6e162bd2f298b58a418a17d49f5671a9a113fc4e Author: Jessica Clarke AuthorDate: 2021-08-07 18:27:33 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 18:27:33 +0000 riscv: Add NVMe, USB and HID support to GENERIC The SiFive FU740 has both NVMe and USB so we need both to ensure we can mount root, and HID is a dependency of USB. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31036 --- sys/riscv/conf/GENERIC | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 09882853ada2..ae7f1c166273 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -90,6 +90,10 @@ device riscv_syscon # Bus drivers device pci +# Block devices +device scbus +device da + # VirtIO support device virtio # Generic VirtIO bus (required) device virtio_pci # VirtIO PCI device @@ -97,6 +101,25 @@ device vtnet # VirtIO Ethernet device device virtio_blk # VirtIO Block device device virtio_mmio # VirtIO MMIO bus +# NVM Express (NVMe) support +device nvme # base NVMe driver +options NVME_USE_NVD=0 # prefer the cam(4) based nda(4) driver +device nvd # expose NVMe namespaces as disks, depends on nvme + +# USB support +options USB_DEBUG # enable debug msgs +device ohci # OHCI USB interface +device uhci # UHCI USB interface +device ehci # EHCI USB interface (USB 2.0) +device xhci # XHCI USB interface (USB 3.0) +device usb # USB Bus (required) +device ukbd # Keyboard +device umass # Disks/Mass storage - Requires scbus and da + +# HID support +options HID_DEBUG # enable debug msgs +device hid # Generic HID support + # DTrace support # device dtrace # device dtrace_profile From owner-dev-commits-src-main@freebsd.org Sat Aug 7 18:31:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97DF766F944; Sat, 7 Aug 2021 18:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhrXV3wGWz4bLq; Sat, 7 Aug 2021 18:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EC6B25FAF; Sat, 7 Aug 2021 18:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177IVcvU091892; Sat, 7 Aug 2021 18:31:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177IVcwl091891; Sat, 7 Aug 2021 18:31:38 GMT (envelope-from git) Date: Sat, 7 Aug 2021 18:31:38 GMT Message-Id: <202108071831.177IVcwl091891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 5668a155cbe6 - main - gpio.4: Mention new sifive_gpio driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5668a155cbe6cef802bc95666477a440fdb6f606 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 18:31:38 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=5668a155cbe6cef802bc95666477a440fdb6f606 commit 5668a155cbe6cef802bc95666477a440fdb6f606 Author: Jessica Clarke AuthorDate: 2021-08-07 18:31:34 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 18:31:34 +0000 gpio.4: Mention new sifive_gpio driver Suggested by: mhorne MFC after: 1 week --- share/man/man4/gpio.4 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/share/man/man4/gpio.4 b/share/man/man4/gpio.4 index da95c39f8e98..276d6855b49b 100644 --- a/share/man/man4/gpio.4 +++ b/share/man/man4/gpio.4 @@ -72,6 +72,13 @@ architecture include: .Cd "device wiigpio" .Cd "device macgpio" .Ed +.Pp +Additional device entries for the +.Li RISC-V +architecture include: +.Bd -ragged -offset indent +.Cd "device sifive_gpio" +.Ed .Sh DESCRIPTION The .Nm From owner-dev-commits-src-main@freebsd.org Sat Aug 7 20:26:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33F41670B46; Sat, 7 Aug 2021 20:26:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ghv4z0nSpz4h7r; Sat, 7 Aug 2021 20:26:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0336C27828; Sat, 7 Aug 2021 20:26:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177KQQMk042105; Sat, 7 Aug 2021 20:26:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177KQQLA042104; Sat, 7 Aug 2021 20:26:26 GMT (envelope-from git) Date: Sat, 7 Aug 2021 20:26:26 GMT Message-Id: <202108072026.177KQQLA042104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 22997b755013 - main - pci_dw: Drop unconditional explicit DEBUG define MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22997b755013bdde60119fdc781769192ab7e1e0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 20:26:27 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=22997b755013bdde60119fdc781769192ab7e1e0 commit 22997b755013bdde60119fdc781769192ab7e1e0 Author: Jessica Clarke AuthorDate: 2021-08-07 20:25:36 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 20:25:36 +0000 pci_dw: Drop unconditional explicit DEBUG define This has been present since the first revision of the file. The debugf macros have always been unused so it doesn't actually do anything useful, and besides, debugging should not be unconditionally turned on for a production driver. Moreover, this breaks the riscv LINT kernel build as sys/conf/NOTES includes options DEBUG, resulting in a macro redefinition error. This does not show up in the arm64 LINT kernel build since that has an explicit nooptions DEBUG, which is dubious and should be revisited. Rather than copy such a hack to riscv's NOTES, fix this specific instance of DEBUG breaking. Fixes: 896e217a0eae ("fu740_pci_dw: Add SiFive FU740 PCIe controller driver") MFC after: 1 week --- sys/dev/pci/pci_dw.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/pci/pci_dw.c b/sys/dev/pci/pci_dw.c index 9eb7b04dfd28..e31779b2bea1 100644 --- a/sys/dev/pci/pci_dw.c +++ b/sys/dev/pci/pci_dw.c @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" #include "pci_dw_if.h" -#define DEBUG #ifdef DEBUG #define debugf(fmt, args...) do { printf(fmt,##args); } while (0) #else From owner-dev-commits-src-main@freebsd.org Sat Aug 7 22:21:01 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A784D672A85; Sat, 7 Aug 2021 22:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ghxd94PT2z4n5f; Sat, 7 Aug 2021 22:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EFE5ED1; Sat, 7 Aug 2021 22:21:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177ML1J9099509; Sat, 7 Aug 2021 22:21:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177ML1nw099508; Sat, 7 Aug 2021 22:21:01 GMT (envelope-from git) Date: Sat, 7 Aug 2021 22:21:01 GMT Message-Id: <202108072221.177ML1nw099508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 0a4cb54506e3 - main - riscv: Add hwreset to NOTES to fix LINT build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a4cb54506e3e2c0d911ddd12416eb2fdc6a7bd7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 22:21:01 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=0a4cb54506e3e2c0d911ddd12416eb2fdc6a7bd7 commit 0a4cb54506e3e2c0d911ddd12416eb2fdc6a7bd7 Author: Jessica Clarke AuthorDate: 2021-08-07 22:15:20 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 22:15:20 +0000 riscv: Add hwreset to NOTES to fix LINT build Fixes: 8e7e0690ecd7 ("sifive_prci: Add reset support for the FU540 and FU740") MFC after: 1 week --- sys/riscv/conf/NOTES | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/riscv/conf/NOTES b/sys/riscv/conf/NOTES index 0a067ab19d34..a99567ac16a5 100644 --- a/sys/riscv/conf/NOTES +++ b/sys/riscv/conf/NOTES @@ -26,6 +26,7 @@ device rcons # EXT_RESOURCES pseudo devices options EXT_RESOURCES device clk +device hwreset device phy device regulator device syscon From owner-dev-commits-src-main@freebsd.org Sat Aug 7 22:21:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5E876725EC; Sat, 7 Aug 2021 22:21:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GhxdB5DWpz4n3g; Sat, 7 Aug 2021 22:21:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9ADB8ED5; Sat, 7 Aug 2021 22:21:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 177ML2It099533; Sat, 7 Aug 2021 22:21:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 177ML2H9099532; Sat, 7 Aug 2021 22:21:02 GMT (envelope-from git) Date: Sat, 7 Aug 2021 22:21:02 GMT Message-Id: <202108072221.177ML2H9099532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: c5e5202a3d5d - main - riscv: Sync NOTES with GENERIC changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5e5202a3d5d6b7d47a6da7b678bc5c4320c91e9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2021 22:21:02 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=c5e5202a3d5d6b7d47a6da7b678bc5c4320c91e9 commit c5e5202a3d5d6b7d47a6da7b678bc5c4320c91e9 Author: Jessica Clarke AuthorDate: 2021-08-07 22:20:38 +0000 Commit: Jessica Clarke CommitDate: 2021-08-07 22:20:38 +0000 riscv: Sync NOTES with GENERIC changes USB is already in sys/conf/NOTES, but NVMe is not, nor of course are the new SiFive device drivers. MFC after: 1 week --- sys/riscv/conf/NOTES | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/riscv/conf/NOTES b/sys/riscv/conf/NOTES index a99567ac16a5..7dda89bfe1a8 100644 --- a/sys/riscv/conf/NOTES +++ b/sys/riscv/conf/NOTES @@ -44,6 +44,11 @@ device virtio_blk # VirtIO Block device device virtio_mmio # VirtIO MMIO bus device virtio_random # VirtIO Entropy device +# NVM Express (NVMe) support +device nvme # base NVMe driver +options NVME_USE_NVD=0 # prefer the cam(4) based nda(4) driver +device nvd # expose NVMe namespaces as disks, depends on nvme + # NOTE: dtrace introduces CDDL-licensed components into the kernel device dtrace # dtrace core device dtraceall # include all dtrace modules @@ -65,8 +70,10 @@ device axidma # Xilinx AXI DMA Controller # SPI device xilinx_spi # Xilinx AXI Quad-SPI Controller -# SOC-specific +# SiFive device drivers device fe310aon +device fu740_pci_dw +device sifive_gpio device sifive_spi files "../sifive/files.sifive" From owner-dev-commits-src-main@freebsd.org Sun Aug 8 00:26:35 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 628166744B3; Sun, 8 Aug 2021 00:26:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gj0Q31yVsz4vFb; Sun, 8 Aug 2021 00:26:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26FCB2D2D; Sun, 8 Aug 2021 00:26:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1780QZh4062874; Sun, 8 Aug 2021 00:26:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1780QZDM062873; Sun, 8 Aug 2021 00:26:35 GMT (envelope-from git) Date: Sun, 8 Aug 2021 00:26:35 GMT Message-Id: <202108080026.1780QZDM062873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: fe52b7f60ef4 - main - Disable PROFILE option by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe52b7f60ef46b65b24d7810a07be04483299d89 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 00:26:35 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fe52b7f60ef46b65b24d7810a07be04483299d89 commit fe52b7f60ef46b65b24d7810a07be04483299d89 Author: Ed Maste AuthorDate: 2020-01-16 17:40:32 +0000 Commit: Ed Maste CommitDate: 2021-08-08 00:24:36 +0000 Disable PROFILE option by default Hardware based profiling (e.g. hwpmc) is much better and produces more useful results. Today the profiling lib archives (_p.a) serve no real purpose other than increasing the library build time. Both upstream and base system (in commit b762974cf4b9) Clang have been modified to remove the special case for linking against these libraries. Clang's -pg support and mcount() remain, so building with -pg can still be used on code that the user builds; we just no longer provide prebuilt libraries compiled with -pg. Discussed on freebsd-hackers[1] / freebsd-current [2] in 2020 and freebsd-arch [3] in 2021. A deprecation notice was added in commit 175841285e28. [1] https://lists.freebsd.org/pipermail/freebsd-hackers/2020-January/055551.html [2] https://lists.freebsd.org/pipermail/freebsd-current/2020-January/075105.html [3] https://lists.freebsd.org/archives/freebsd-arch/2021-June/000016.html PR: 256873 [exp-run] Reviewed by: imp, jhb, kib Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30833 --- share/mk/bsd.opts.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 6e81484a09ab..2504e5038d6e 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -61,7 +61,6 @@ __DEFAULT_YES_OPTIONS = \ NIS \ NLS \ OPENSSH \ - PROFILE \ SSP \ TESTS \ TOOLCHAIN \ @@ -77,6 +76,7 @@ __DEFAULT_NO_OPTIONS = \ INIT_ALL_ZERO \ INSTALL_AS_USER \ MANSPLITPKG \ + PROFILE \ RETPOLINE \ STALE_STAGED \ UBSAN From owner-dev-commits-src-main@freebsd.org Sun Aug 8 00:31:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55BF66741D6; Sun, 8 Aug 2021 00:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gj0WB23jtz4vjK; Sun, 8 Aug 2021 00:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F00427CF; Sun, 8 Aug 2021 00:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1780V23R072329; Sun, 8 Aug 2021 00:31:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1780V2WT072328; Sun, 8 Aug 2021 00:31:02 GMT (envelope-from git) Date: Sun, 8 Aug 2021 00:31:02 GMT Message-Id: <202108080031.1780V2WT072328@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 3e5bff102b4b - main - bsdinstall: Remove unused sysctl.h header #include MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e5bff102b4bd09962b0f735217635cb513d53a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 00:31:02 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3e5bff102b4bd09962b0f735217635cb513d53a3 commit 3e5bff102b4bd09962b0f735217635cb513d53a3 Author: Ed Maste AuthorDate: 2021-05-19 16:28:47 +0000 Commit: Ed Maste CommitDate: 2021-08-08 00:30:29 +0000 bsdinstall: Remove unused sysctl.h header #include --- usr.sbin/bsdinstall/partedit/part_wizard.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/bsdinstall/partedit/part_wizard.c b/usr.sbin/bsdinstall/partedit/part_wizard.c index 9f7158a4801e..52c5d7f649cc 100644 --- a/usr.sbin/bsdinstall/partedit/part_wizard.c +++ b/usr.sbin/bsdinstall/partedit/part_wizard.c @@ -29,7 +29,6 @@ */ #include -#include #include #include #include From owner-dev-commits-src-main@freebsd.org Sun Aug 8 00:52:37 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F710674C1E; Sun, 8 Aug 2021 00:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gj10527JMz3Cc0; Sun, 8 Aug 2021 00:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 314952F34; Sun, 8 Aug 2021 00:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1780qbol002665; Sun, 8 Aug 2021 00:52:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1780qbGh002664; Sun, 8 Aug 2021 00:52:37 GMT (envelope-from git) Date: Sun, 8 Aug 2021 00:52:37 GMT Message-Id: <202108080052.1780qbGh002664@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b0dafb1b6f35 - main - src.conf.5: Regen after fe52b7f60ef4, PROFILE default off MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0dafb1b6f352a90cf164210598e778ecedaea48 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 00:52:37 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b0dafb1b6f352a90cf164210598e778ecedaea48 commit b0dafb1b6f352a90cf164210598e778ecedaea48 Author: Ed Maste AuthorDate: 2021-08-08 00:51:44 +0000 Commit: Ed Maste CommitDate: 2021-08-08 00:51:44 +0000 src.conf.5: Regen after fe52b7f60ef4, PROFILE default off --- share/man/man5/src.conf.5 | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 658161f65d2f..60f2f0af02aa 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd July 27, 2021 +.Dd August 7, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1348,20 +1348,11 @@ and related files. Do not build .Xr ppp 8 and related programs. -.It Va WITHOUT_PROFILE -Do not build profiled libraries for use with -.Xr gprof 8 . -.Pp -This is a default setting on -mips/mips64. .It Va WITH_PROFILE Build profiled libraries for use with .Xr gprof 8 . This option is deprecated and is not present in .Fx 14 . -.Pp -This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mips, powerpc/powerpc, powerpc/powerpc64, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_QUOTAS Do not build .Xr quota 1 From owner-dev-commits-src-main@freebsd.org Sun Aug 8 02:39:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5950675AAB; Sun, 8 Aug 2021 02:39:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gj3Lt47fLz3Hcn; Sun, 8 Aug 2021 02:39:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 719ED4941; Sun, 8 Aug 2021 02:39:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1782d2Wc036059; Sun, 8 Aug 2021 02:39:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1782d2SV036058; Sun, 8 Aug 2021 02:39:02 GMT (envelope-from git) Date: Sun, 8 Aug 2021 02:39:02 GMT Message-Id: <202108080239.1782d2SV036058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 1f88aa09417f - main - zfs: merge openzfs/zfs@f3678d70f (master) into main MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f88aa09417f1cfb3929fd37531b1ab51213c2d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 02:39:02 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=1f88aa09417f1cfb3929fd37531b1ab51213c2d6 commit 1f88aa09417f1cfb3929fd37531b1ab51213c2d6 Merge: b0dafb1b6f35 f3678d70ff8f Author: Martin Matuska AuthorDate: 2021-08-08 01:57:07 +0000 Commit: Martin Matuska CommitDate: 2021-08-08 02:01:26 +0000 zfs: merge openzfs/zfs@f3678d70f (master) into main Notable upstream pull request merges: #12339 Read past end of argv array in zpool_do_import() #12365 Fixes in persistent L2ARC #12383 Fixes for KMSAN reports #12425 Avoid small buffer copying on write #12428 Fix unfortunate NULL in spa_update_dspace #12446 Allow disabling of unmapped I/O on FreeBSD Obtained from: OpenZFS OpenZFS commit: f3678d70ff8f98d67caf377ec0326c9a6c7bcf29 sys/contrib/openzfs/cmd/mount_zfs/mount_zfs.c | 2 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 2 +- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 6 +- sys/contrib/openzfs/cmd/zgenhostid/zgenhostid.c | 3 +- sys/contrib/openzfs/cmd/zhack/zhack.c | 11 +- .../openzfs/cmd/zpool/os/freebsd/zpool_vdev_os.c | 6 + .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 6 + sys/contrib/openzfs/cmd/zpool/zpool_main.c | 19 +- sys/contrib/openzfs/cmd/zpool/zpool_util.h | 3 +- sys/contrib/openzfs/cmd/zpool/zpool_vdev.c | 28 +- .../openzfs/cmd/zpool_influxdb/zpool_influxdb.c | 1 + sys/contrib/openzfs/cmd/ztest/ztest.c | 344 +- sys/contrib/openzfs/config/Abigail.am | 4 +- .../openzfs/config/kernel-make-request-fn.m4 | 20 + .../openzfs/config/kernel-vfs-set_page_dirty.m4 | 34 + sys/contrib/openzfs/config/kernel.m4 | 2 + sys/contrib/openzfs/include/libuutil.h | 25 +- sys/contrib/openzfs/include/libuutil_impl.h | 3 +- .../openzfs/include/os/freebsd/spl/sys/ccompile.h | 91 - .../openzfs/include/os/freebsd/spl/sys/cmn_err.h | 23 +- .../openzfs/include/os/linux/spl/sys/cmn_err.h | 9 +- sys/contrib/openzfs/include/sys/Makefile.am | 1 - sys/contrib/openzfs/include/sys/abd.h | 1 + sys/contrib/openzfs/include/sys/abd_impl.h | 1 - sys/contrib/openzfs/include/sys/arc.h | 4 +- sys/contrib/openzfs/include/sys/arc_impl.h | 1 - sys/contrib/openzfs/include/sys/bitops.h | 11 +- sys/contrib/openzfs/include/sys/dbuf.h | 4 +- sys/contrib/openzfs/include/sys/dnode.h | 2 +- sys/contrib/openzfs/include/sys/dsl_dataset.h | 2 +- sys/contrib/openzfs/include/sys/dsl_dir.h | 2 +- sys/contrib/openzfs/include/sys/note.h | 56 - sys/contrib/openzfs/include/sys/spa.h | 20 +- sys/contrib/openzfs/include/sys/vdev.h | 3 +- sys/contrib/openzfs/include/sys/zfs_context.h | 2 - sys/contrib/openzfs/lib/libnvpair/libnvpair.abi | 4771 +++++----- sys/contrib/openzfs/lib/libnvpair/libnvpair.c | 9 +- .../lib/libspl/include/os/linux/sys/sysmacros.h | 2 - sys/contrib/openzfs/lib/libuutil/libuutil.abi | 3273 +++---- sys/contrib/openzfs/lib/libuutil/uu_pname.c | 14 +- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 9972 ++++++++------------ sys/contrib/openzfs/lib/libzfs/libzfs_crypto.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 5 - .../openzfs/lib/libzfs_core/libzfs_core.abi | 5561 +++++------ .../openzfs/lib/libzfsbootenv/libzfsbootenv.abi | 409 +- sys/contrib/openzfs/lib/libzpool/kernel.c | 1 - sys/contrib/openzfs/lib/libzutil/zutil_import.c | 15 +- sys/contrib/openzfs/man/man8/zfs-allow.8 | 28 +- sys/contrib/openzfs/man/man8/zpool-scrub.8 | 29 +- .../openzfs/module/icp/algs/skein/skein_impl.h | 8 - .../openzfs/module/icp/core/kcf_prov_tabs.c | 2 +- sys/contrib/openzfs/module/icp/io/aes.c | 2 +- sys/contrib/openzfs/module/icp/io/skein_mod.c | 1 - sys/contrib/openzfs/module/lua/llex.c | 2 +- sys/contrib/openzfs/module/lua/ltable.c | 2 +- sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 2 +- .../openzfs/module/os/freebsd/zfs/vdev_geom.c | 4 + .../openzfs/module/os/freebsd/zfs/zfs_acl.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_ctldir.c | 2 +- .../openzfs/module/os/freebsd/zfs/zio_crypt.c | 2 - sys/contrib/openzfs/module/os/linux/zfs/abd_os.c | 2 +- .../openzfs/module/os/linux/zfs/qat_compress.c | 27 +- .../openzfs/module/os/linux/zfs/vdev_disk.c | 4 +- sys/contrib/openzfs/module/os/linux/zfs/zfs_acl.c | 4 +- .../openzfs/module/os/linux/zfs/zfs_znode.c | 2 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 6 + sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 44 +- sys/contrib/openzfs/module/zfs/abd.c | 2 +- sys/contrib/openzfs/module/zfs/arc.c | 186 +- sys/contrib/openzfs/module/zfs/ddt.c | 1 - sys/contrib/openzfs/module/zfs/dnode.c | 1 + sys/contrib/openzfs/module/zfs/dsl_prop.c | 2 +- sys/contrib/openzfs/module/zfs/metaslab.c | 7 + sys/contrib/openzfs/module/zfs/spa.c | 2 +- sys/contrib/openzfs/module/zfs/spa_log_spacemap.c | 4 +- sys/contrib/openzfs/module/zfs/spa_misc.c | 11 +- sys/contrib/openzfs/module/zfs/vdev.c | 4 +- sys/contrib/openzfs/module/zfs/vdev_raidz_math.c | 8 +- sys/contrib/openzfs/module/zfs/zfs_log.c | 5 +- sys/contrib/openzfs/module/zfs/zfs_replay.c | 10 +- sys/contrib/openzfs/module/zfs/zil.c | 15 +- sys/contrib/openzfs/scripts/zfs-tests.sh | 27 +- sys/contrib/openzfs/tests/runfiles/common.run | 3 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 2 - .../openzfs/tests/zfs-tests/cmd/mkbusy/Makefile.am | 2 + .../openzfs/tests/zfs-tests/cmd/mkbusy/mkbusy.c | 116 +- .../openzfs/tests/zfs-tests/cmd/mkfile/mkfile.c | 3 +- .../tests/zfs-tests/cmd/mmapwrite/mmapwrite.c | 11 +- .../openzfs/tests/zfs-tests/include/tunables.cfg | 2 +- .../tests/functional/checksum/edonr_test.c | 3 - .../tests/functional/checksum/sha2_test.c | 3 - .../tests/functional/checksum/skein_test.c | 3 - .../zfs-tests/tests/functional/l2arc/Makefile.am | 5 +- .../tests/functional/l2arc/l2arc_arcstats_pos.ksh | 1 - .../functional/l2arc/persist_l2arc_004_pos.ksh | 55 +- .../functional/l2arc/persist_l2arc_005_pos.ksh | 69 +- .../functional/l2arc/persist_l2arc_006_pos.ksh | 101 - .../functional/l2arc/persist_l2arc_007_pos.ksh | 97 - .../functional/l2arc/persist_l2arc_008_pos.ksh | 143 - .../openzfs/tests/zfs-tests/tests/perf/perf.shlib | 61 +- .../tests/perf/regression/random_reads.ksh | 30 +- .../tests/perf/regression/random_readwrite.ksh | 30 +- .../perf/regression/random_readwrite_fixed.ksh | 30 +- .../tests/perf/regression/random_writes.ksh | 30 +- .../tests/perf/regression/random_writes_zil.ksh | 31 +- .../tests/perf/regression/sequential_reads.ksh | 30 +- .../regression/sequential_reads_arc_cached.ksh | 30 +- .../sequential_reads_arc_cached_clone.ksh | 31 +- .../regression/sequential_reads_dbuf_cached.ksh | 32 +- .../tests/perf/regression/sequential_writes.ksh | 30 +- .../zfs-tests/tests/perf/regression/setup.ksh | 3 +- sys/modules/zfs/zfs_config.h | 10 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 114 files changed, 10956 insertions(+), 15293 deletions(-) diff --cc sys/contrib/openzfs/config/kernel-vfs-set_page_dirty.m4 index 000000000000,a9d252e4e01e..a9d252e4e01e mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-vfs-set_page_dirty.m4 +++ b/sys/contrib/openzfs/config/kernel-vfs-set_page_dirty.m4 diff --cc sys/modules/zfs/zfs_config.h index f3b53d243ae3,000000000000..9542f241179f mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,843 -1,0 +1,849 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + ++/* blk_alloc_disk() exists */ ++/* #undef HAVE_BLK_ALLOC_DISK */ ++ +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAPPED */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* iops->mkdir() takes umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_add_batch() is defined */ +/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */ + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() exists, takes 3 args */ +/* #undef HAVE_SET_ACL */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* set_special_state() exists */ +/* #undef HAVE_SET_SPECIAL_STATE */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +/* signal_stop() exists */ +/* #undef HAVE_SIGNAL_STOP */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* ->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* super_setup_bdi_name() exits */ +/* #undef HAVE_SUPER_SETUP_BDI_NAME */ + +/* super_block->s_user_ns exists */ +/* #undef HAVE_SUPER_USER_NS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* i_op->tmpfile() exists */ +/* #undef HAVE_TMPFILE */ + +/* i_op->tmpfile() has userns */ +/* #undef HAVE_TMPFILE_USERNS */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_GETATTR */ + +/* iops->getattr() takes a vfsmount */ +/* #undef HAVE_VFSMOUNT_IOPS_GETATTR */ + +/* aops->direct_IO() uses iovec */ +/* #undef HAVE_VFS_DIRECT_IO_IOVEC */ + +/* aops->direct_IO() uses iov_iter without rw */ +/* #undef HAVE_VFS_DIRECT_IO_ITER */ + +/* aops->direct_IO() uses iov_iter with offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */ + +/* aops->direct_IO() uses iov_iter with rw and offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ + +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + +/* fops->iterate() is available */ +/* #undef HAVE_VFS_ITERATE */ + +/* fops->iterate_shared() is available */ +/* #undef HAVE_VFS_ITERATE_SHARED */ + +/* fops->readdir() is available */ +/* #undef HAVE_VFS_READDIR */ + +/* fops->read/write_iter() are available */ +/* #undef HAVE_VFS_RW_ITERATE */ + ++/* __set_page_dirty_nobuffers exists */ ++/* #undef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS */ ++ +/* __vmalloc page flags exists */ +/* #undef HAVE_VMALLOC_PAGE_KERNEL */ + +/* yes */ +/* #undef HAVE_WAIT_ON_BIT_ACTION */ + +/* wait_queue_entry_t exists */ +/* #undef HAVE_WAIT_QUEUE_ENTRY_T */ + +/* wq_head->head and wq_entry->entry exist */ +/* #undef HAVE_WAIT_QUEUE_HEAD_ENTRY */ + +/* xattr_handler->get() wants dentry */ +/* #undef HAVE_XATTR_GET_DENTRY */ + +/* xattr_handler->get() wants both dentry and inode */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE */ + +/* xattr_handler->get() wants xattr_handler */ +/* #undef HAVE_XATTR_GET_HANDLER */ + +/* xattr_handler has name */ +/* #undef HAVE_XATTR_HANDLER_NAME */ + +/* xattr_handler->list() wants dentry */ +/* #undef HAVE_XATTR_LIST_DENTRY */ + +/* xattr_handler->list() wants xattr_handler */ +/* #undef HAVE_XATTR_LIST_HANDLER */ + +/* xattr_handler->list() wants simple */ +/* #undef HAVE_XATTR_LIST_SIMPLE */ + +/* xattr_handler->set() wants dentry */ +/* #undef HAVE_XATTR_SET_DENTRY */ + +/* xattr_handler->set() wants both dentry and inode */ +/* #undef HAVE_XATTR_SET_DENTRY_INODE */ + +/* xattr_handler->set() wants xattr_handler */ +/* #undef HAVE_XATTR_SET_HANDLER */ + +/* xattr_handler->set() takes user_namespace */ +/* #undef HAVE_XATTR_SET_USERNS */ + +/* Define if you have [z] */ +#define HAVE_ZLIB 1 + +/* __posix_acl_chmod() exists */ +/* #undef HAVE___POSIX_ACL_CHMOD */ + +/* kernel exports FPU functions */ +/* #undef KERNEL_EXPORTS_X86_FPU */ + +/* TBD: fetch(3) support */ +#if 0 +/* whether the chosen libfetch is to be loaded at run-time */ +#define LIBFETCH_DYNAMIC 1 + +/* libfetch is fetch(3) */ +#define LIBFETCH_IS_FETCH 1 + +/* libfetch is libcurl */ +#define LIBFETCH_IS_LIBCURL 0 + +/* soname of chosen libfetch */ +#define LIBFETCH_SONAME "libfetch.so.6" +#endif + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* make_request_fn() return type */ +/* #undef MAKE_REQUEST_FN_RET */ + +/* hardened module_param_call */ +/* #undef MODULE_PARAM_CALL_CONST */ + +/* struct shrink_control has nid */ +/* #undef SHRINK_CONTROL_HAS_NID */ + +/* Defined for legacy compatibility. */ +#define SPL_META_ALIAS ZFS_META_ALIAS + +/* Defined for legacy compatibility. */ +#define SPL_META_RELEASE ZFS_META_RELEASE + +/* Defined for legacy compatibility. */ +#define SPL_META_VERSION ZFS_META_VERSION + +/* True if ZFS is to be compiled for a FreeBSD system */ +#define SYSTEM_FREEBSD 1 + +/* True if ZFS is to be compiled for a Linux system */ +/* #undef SYSTEM_LINUX */ + +/* zfs debugging enabled */ +/* #undef ZFS_DEBUG */ + +/* /dev/zfs minor */ +/* #undef ZFS_DEVICE_MINOR */ + +/* enum node_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum node_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum node_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* enum zone_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum zone_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum zone_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* global_node_page_state() exists */ +/* #undef ZFS_GLOBAL_NODE_PAGE_STATE */ + +/* global_zone_page_state() exists */ +/* #undef ZFS_GLOBAL_ZONE_PAGE_STATE */ + +/* Define to 1 if GPL-only symbols can be used */ +/* #undef ZFS_IS_GPL_COMPATIBLE */ + +/* Define the project alias string. */ - #define ZFS_META_ALIAS "zfs-2.1.99-FreeBSD_g14b43fbd9" ++#define ZFS_META_ALIAS "zfs-2.1.99-FreeBSD_gf3678d70f" + +/* Define the project author. */ +#define ZFS_META_AUTHOR "OpenZFS" + +/* Define the project release date. */ +/* #undef ZFS_META_DATA */ + +/* Define the maximum compatible kernel version. */ +#define ZFS_META_KVER_MAX "5.13" + +/* Define the minimum compatible kernel version. */ +#define ZFS_META_KVER_MIN "3.10" + +/* Define the project license. */ +#define ZFS_META_LICENSE "CDDL" + +/* Define the libtool library 'age' version information. */ +/* #undef ZFS_META_LT_AGE */ + +/* Define the libtool library 'current' version information. */ +/* #undef ZFS_META_LT_CURRENT */ + +/* Define the libtool library 'revision' version information. */ *** 27 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Sun Aug 8 03:14:46 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08F50675DE0; Sun, 8 Aug 2021 03:14:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gj4856blNz3KMQ; Sun, 8 Aug 2021 03:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CADD9554F; Sun, 8 Aug 2021 03:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1783Ej3S090160; Sun, 8 Aug 2021 03:14:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1783EjMt090159; Sun, 8 Aug 2021 03:14:45 GMT (envelope-from git) Date: Sun, 8 Aug 2021 03:14:45 GMT Message-Id: <202108080314.1783EjMt090159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 54247ce1f96f - main - Makefile.inc1: Avoid hanging if pkg is not installed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54247ce1f96f04d16f1429007bac3607c8a0a39e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 03:14:46 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=54247ce1f96f04d16f1429007bac3607c8a0a39e commit 54247ce1f96f04d16f1429007bac3607c8a0a39e Author: Ed Maste AuthorDate: 2021-08-08 01:50:32 +0000 Commit: Ed Maste CommitDate: 2021-08-08 03:13:40 +0000 Makefile.inc1: Avoid hanging if pkg is not installed For `pkg --version`, Redirect stdin from /dev/null to avoid waiting on /usr/sbin/pkg's bootstrap prompt if the pkg package is not installed. Also redirect stderr to /dev/null to discard the warning message in this case. Reported by: mjg Fixes: 4e224e4be7c3 ("pkgbase: accommodate pkg < 1.17") Sponsored by: The FreeBSD Foundation --- Makefile.inc1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index be8ac02353e1..2c1f72085110 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1889,7 +1889,8 @@ _pkgbootstrap: .PHONY .if make(create-world-packages-jobs) || make(create-kernel-packages*) || make(real-update-packages) || make(sign-packages) PKG_ABI!=${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI .endif -PKG_BIN_VERSION!=${PKG_CMD} --version | awk -F. '/^[0-9.]+$$/ {print $$1 * 10000 + $$2 * 100 + $$3}' +PKG_BIN_VERSION!=${PKG_CMD} --version /dev/null |\ + awk -F. '/^[0-9.]+$$/ {print $$1 * 10000 + $$2 * 100 + $$3}' .if ${PKG_BIN_VERSION} < 11700 PKG_EXT= ${PKG_FORMAT} .else From owner-dev-commits-src-main@freebsd.org Sun Aug 8 07:16:03 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 714A8650B65 for ; Sun, 8 Aug 2021 07:16:03 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (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 4Gj9VV4jHLz3mW2 for ; Sun, 8 Aug 2021 07:16:02 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-qt1-x832.google.com with SMTP id c5so9966842qtp.13 for ; Sun, 08 Aug 2021 00:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AxHM7cCD94wFdDWu1/8FZcGPJG1u8O4WZCY3kHek8fM=; b=lLfl96RGjKaPd1CIlJsl8/j0xfCcPFi4tVyeq7GevCpAC9AJ0KS5VTZEwP5QYd8p81 8Pch38PrMr2IAuM+Gpws/KOSH7K7j1SPDxv7Zg8s/HAgMLuKP7acKQVIGk6RI6QqEzaD pvVTivYVnTUtc0CrU3i/XqBlpTi8wkKh4zzuIKvHYHYQUUqPgscZG6b2sVbEZhPSSuOi fz6oyQFm9VA8J/xrRVIEjzWUKnLJLoi8Dpc7t7QabYjtjFHYAfDWLf4wNMoON4EVrJOy uwtciTDWpum8NVBdAjn7oJookujyd86iI/jaTK17AHagYzZ1eCQGqBhukB/+Sv1uJTOI tpsw== 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:content-transfer-encoding; bh=AxHM7cCD94wFdDWu1/8FZcGPJG1u8O4WZCY3kHek8fM=; b=UA1tAJtucEFsrHA0a9RnUaz6uig+0M/Fyw4ky/yLC8gzbyHI5P4u5C6w1ZyYSYYOCj q+OvhmpZN5vuR/f5wKEln8oZtwCm6VfiDgeFaDvdRCv9gQAOyqCyNlfaUmV8JYYo7yRx CdX2QLNybEKTixeF4mQUIkr9GEDzyb7CfYKZZGuxq/1realE+5wUQihh5p6vsC9Z9DkL qHn7Fm/R6av+Hp2GVwnMVqQ9r1ykcmaEqtTLaHizdLkOLr0OKhz5UiH3PEslkKRakGpj yAclOr/Bm98Lj1+DO+SvQkXY1+K95/HAeDDHyYqzwvMMwXmOdHWDE6kiNy1D0qz1NlHs tdag== X-Gm-Message-State: AOAM530C4E/ORly4bJxpM3JW1hd0uAF/5iXkdyU7w+BWi7ANcbixG9MC NuWTNK+aiqUkVLyQTmBzwPNqxxScT6AIUZggHSD3Kg== X-Google-Smtp-Source: ABdhPJw4B0uix3gReVFRmrs8pirsQkjiJIG/qTkXlpjgXtvcGpPQNBcl8aasRQ4345V0AmI2KtwZjWb/P7wlhG36QAc= X-Received: by 2002:ac8:44c2:: with SMTP id b2mr14897748qto.216.1628406962111; Sun, 08 Aug 2021 00:16:02 -0700 (PDT) MIME-Version: 1.0 References: <202108031008.173A84BG096694@gitrepo.freebsd.org> In-Reply-To: From: Marcin Wojtas Date: Sun, 8 Aug 2021 09:15:52 +0200 Message-ID: Subject: Re: git: dfcaa2c18bf9 - main - enetc_mdio: Support building the driver as a loadable module. To: Ian Lepore Cc: Marcin Wojtas , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Gj9VV4jHLz3mW2 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=lLfl96RG; dmarc=none; spf=none (mx1.freebsd.org: domain of mw@semihalf.com has no SPF policy when checking 2607:f8b0:4864:20::832) smtp.mailfrom=mw@semihalf.com X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[semihalf-com.20150623.gappssmtp.com:s=20150623]; FREEFALL_USER(0.00)[mw]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[semihalf.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[semihalf-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::832:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 07:16:03 -0000 Hi Ian, wt., 3 sie 2021 o 18:31 Ian Lepore napisa=C5=82(a): > > On Tue, 2021-08-03 at 10:08 +0000, Marcin Wojtas wrote: > > The branch main has been updated by mw: > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=3Ddfcaa2c18bf9c69b94d531364f891= 3b23f19505f > > > > commit dfcaa2c18bf9c69b94d531364f8913b23f19505f > > Author: Kornel Duleba > > AuthorDate: 2021-07-28 11:38:53 +0000 > > Commit: Marcin Wojtas > > CommitDate: 2021-08-03 10:07:49 +0000 > > > > enetc_mdio: Support building the driver as a loadable module. > > > > [...] > > diff --git a/sys/modules/enetc_mdio/Makefile > > b/sys/modules/enetc_mdio/Makefile > > new file mode 100644 > > index 000000000000..f448fc526705 > > --- /dev/null > > +++ b/sys/modules/enetc_mdio/Makefile > > @@ -0,0 +1,8 @@ > > +#$FreeBSD$ > > + > > +.PATH: ${SRCTOP}/sys/dev/enetc > > + > > +KMOD =3D enetc_mdio > > +SRCS =3D enetc_mdio_pci.c enetc_mdio.c > > + > > +.include > > A module makefile must list all the header files it uses which are > generated at build time from interface definitions (.m files) in its > SRCS list. For this driver, I think that means ifdi_if.h and > miibus_if.h. > > -- Ian > Agreed. Part of it was already fixed by manu, I'm about to add remaining dependencies. Thanks, Marcin From owner-dev-commits-src-main@freebsd.org Sun Aug 8 07:17:42 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B0B665111C for ; Sun, 8 Aug 2021 07:17:42 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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 4Gj9XP0t5Jz3mt5 for ; Sun, 8 Aug 2021 07:17:41 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-qk1-x72b.google.com with SMTP id t66so14958640qkb.0 for ; Sun, 08 Aug 2021 00:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=K5BjvU0YYByF4fQPqKPaL+V6x37LVgrwi04mXqRd4Ao=; b=HRLoqW0oEM728pmgCDVYDxRbrsvJfkJKUgIrrfmcdLWdgPnR3s0Dva1vOoq3TdKSGm KByooceui46udZ8t18U8T4N69cZ4I0L0I8PLD3Nc3zzOsyXe7z99omxrkclfC3grSWoa yQGddqXJJXr4mWMlU95jGgRrXmQe3vY10lEatjKSpV/6ic7XfTIsPPI82L/JBgN7tbso g5CRh1C0ouiFKUgP1K8hz77I0Zfcdjm3uUQ3lsaMyUds9xZIEhSrxORIkA+sz85Nowmu OKHPl2TiyXpSRM8PT0cHeJSn9i2BrgHiErw8mAdiZ2o+Tkz1UoGtMgnN3G5RBIQMzO2J +UKw== 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:content-transfer-encoding; bh=K5BjvU0YYByF4fQPqKPaL+V6x37LVgrwi04mXqRd4Ao=; b=lNMtvFtInNxeLrLB/4B7HxQN3xFEDcHroOtvHffUfVm24Npp/d2DCvIOAPR/uhmLuQ CzcAOUZinB/ayyklmN29r5+6arc7UU3VEyKDiVfO4l3cVAys7zJ4YMckTRNQWNk7gVZb XTcEBYhPL/pwROEptUD4OP21uDXchZU2+50p7Ks1xY1IyjwoIFZFVWj6gYvCNcYR0Vch wTn+x87mhatNDMCyekJ08HLe/qSsNvjnlhNj11UyiLYhnNccOrB+nVCh6WsyHrU1AbyG tNHWEbmpm/BtTmyTeruWCXm6v3+vFOUJK8BZt8egqTk/mdooNZ03mtzcC57e95wL3OiV cOwQ== X-Gm-Message-State: AOAM532hF+g3gJtuL3HI9+qH0WteMShp1Reuv0r6q4OrWLTXssmUJv3n 6489DvmANSsYKA3e6g6FwR8NZxw35T0T3aY+7bCXGA== X-Google-Smtp-Source: ABdhPJxr00GaJ+QRRiXFUCo0UnU9KlX36UwaP+e1XDA3QBfaE+qaV94aMnIfsx7tZXn8HG15c1Bi10gDBrzQJ8IFaqg= X-Received: by 2002:a05:620a:12af:: with SMTP id x15mr10793769qki.300.1628407060679; Sun, 08 Aug 2021 00:17:40 -0700 (PDT) MIME-Version: 1.0 References: <202108031008.173A83HA096670@gitrepo.freebsd.org> In-Reply-To: From: Marcin Wojtas Date: Sun, 8 Aug 2021 09:17:30 +0200 Message-ID: Subject: Re: git: 5ad6d28cbe6b - main - enetc: Support building the driver as a loadable module. To: John Baldwin Cc: Marcin Wojtas , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Gj9XP0t5Jz3mt5 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=HRLoqW0o; dmarc=none; spf=none (mx1.freebsd.org: domain of mw@semihalf.com has no SPF policy when checking 2607:f8b0:4864:20::72b) smtp.mailfrom=mw@semihalf.com X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[semihalf-com.20150623.gappssmtp.com:s=20150623]; FREEFALL_USER(0.00)[mw]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[semihalf.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[semihalf-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72b:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-main] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 07:17:42 -0000 =C5=9Br., 4 sie 2021 o 20:18 John Baldwin napisa=C5=82(a)= : > > On 8/3/21 3:08 AM, Marcin Wojtas wrote: > > The branch main has been updated by mw: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D5ad6d28cbe6b3ff85e49607a= 7e04cb68db3ed6df > > > > commit 5ad6d28cbe6b3ff85e49607a7e04cb68db3ed6df > > Author: Kornel Duleba > > AuthorDate: 2021-07-28 09:23:23 +0000 > > Commit: Marcin Wojtas > > CommitDate: 2021-08-03 10:07:49 +0000 > > > > enetc: Support building the driver as a loadable module. > > > > Function level reset has to be done in attach in order to put the > > hardware in a known state before configuring it. > > The order of DRIVER_MODULEs was changed to ensure that the miibus = driver > > is loaded when mii_attach is called. > > > > Obtained from: Semihalf > > Sponsored by: Alstom Group > > --- > > sys/dev/enetc/if_enetc.c | 6 +++++- > > sys/modules/Makefile | 2 ++ > > sys/modules/enetc/Makefile | 8 ++++++++ > > 3 files changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c > > index 54cdc6ea9ad4..46327eb419bf 100644 > > --- a/sys/dev/enetc/if_enetc.c > > +++ b/sys/dev/enetc/if_enetc.c > > @@ -158,8 +158,8 @@ static driver_t enetc_driver =3D { > > }; > > > > static devclass_t enetc_devclass; > > -DRIVER_MODULE(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL); > > DRIVER_MODULE(miibus, enetc, miibus_driver, miibus_devclass, NULL, NU= LL); > > +DRIVER_MODULE(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL); > > MODULE_VERSION(enetc, 1); > > This is not the right way to fix this as the toolchain is free to reorder > symbols. You should instead use 'DRIVER_MODULE_ORDERED(..., SI_ORDER_LAS= T)' > for enetc so that the miibus driver is registered first. > Thank you for the remark - I will submit a fix for that. Best regards, Marcin From owner-dev-commits-src-main@freebsd.org Sun Aug 8 08:17:51 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B31E65218E; Sun, 8 Aug 2021 08:17:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjBsq2JF6z3pmj; Sun, 8 Aug 2021 08:17:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3787311341; Sun, 8 Aug 2021 08:17:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1788HpiF087545; Sun, 8 Aug 2021 08:17:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1788Hpid087544; Sun, 8 Aug 2021 08:17:51 GMT (envelope-from git) Date: Sun, 8 Aug 2021 08:17:51 GMT Message-Id: <202108080817.1788Hpid087544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 04389c855e56 - main - Fix some common typos in comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04389c855e56d1715637fa43575ec13455a68b2e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 08:17:51 -0000 The branch main has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=04389c855e56d1715637fa43575ec13455a68b2e commit 04389c855e56d1715637fa43575ec13455a68b2e Author: Gordon Bergling AuthorDate: 2021-08-08 08:16:06 +0000 Commit: Gordon Bergling CommitDate: 2021-08-08 08:16:06 +0000 Fix some common typos in comments - s/configuraiton/configuration/ - s/specifed/specified/ - s/compatiblity/compatibility/ MFC after: 5 days --- sys/cam/scsi/scsi_enc_ses.c | 2 +- sys/dev/aic7xxx/aic7xxx.reg | 2 +- sys/dev/gpio/gpio_if.m | 6 +++--- sys/dev/gpio/gpiobus_if.m | 6 +++--- sys/dev/hpt27xx/hptintf.h | 2 +- sys/dev/hwpmc/hwpmc_amd.c | 2 +- sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c | 2 +- sys/dev/qlnx/qlnxe/ecore_sriov.h | 2 +- sys/dev/sound/fdt/audio_soc.c | 2 +- sys/netinet/in_fib.c | 2 +- sys/netinet6/in6_pcb.c | 2 +- sys/sys/user.h | 2 +- usr.bin/quota/quota.c | 4 ++-- usr.sbin/lpr/lpc/cmds.c | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sys/cam/scsi/scsi_enc_ses.c b/sys/cam/scsi/scsi_enc_ses.c index 32e523923fd2..f4f1c4a23516 100644 --- a/sys/cam/scsi/scsi_enc_ses.c +++ b/sys/cam/scsi/scsi_enc_ses.c @@ -418,7 +418,7 @@ ses_iter_init(enc_softc_t *enc, enc_cache_t *cache, struct ses_iterator *iter) /** * \brief Traverse the provided SES iterator to the next element - * within the configuraiton. + * within the configuration. * * \param iter The iterator to move. * diff --git a/sys/dev/aic7xxx/aic7xxx.reg b/sys/dev/aic7xxx/aic7xxx.reg index 7a15b5613163..a9253aa94b6e 100644 --- a/sys/dev/aic7xxx/aic7xxx.reg +++ b/sys/dev/aic7xxx/aic7xxx.reg @@ -1510,7 +1510,7 @@ scratch_ram { size 6 /* * These are reserved registers in the card's scratch ram on the 2742. - * The EISA configuraiton chip is mapped here. On Rev E. of the + * The EISA configuration chip is mapped here. On Rev E. of the * aic7770, the sequencer can use this area for scratch, but the * host cannot directly access these registers. On later chips, this * area can be read and written by both the host and the sequencer. diff --git a/sys/dev/gpio/gpio_if.m b/sys/dev/gpio/gpio_if.m index 70838cd1042b..4a97f532b1e2 100644 --- a/sys/dev/gpio/gpio_if.m +++ b/sys/dev/gpio/gpio_if.m @@ -85,7 +85,7 @@ METHOD int pin_max { }; # -# Set value of pin specifed by pin_num +# Set value of pin specified by pin_num # METHOD int pin_set { device_t dev; @@ -94,7 +94,7 @@ METHOD int pin_set { }; # -# Get value of pin specifed by pin_num +# Get value of pin specified by pin_num # METHOD int pin_get { device_t dev; @@ -103,7 +103,7 @@ METHOD int pin_get { }; # -# Toggle value of pin specifed by pin_num +# Toggle value of pin specified by pin_num # METHOD int pin_toggle { device_t dev; diff --git a/sys/dev/gpio/gpiobus_if.m b/sys/dev/gpio/gpiobus_if.m index ee926d5b96f0..63324645a4de 100644 --- a/sys/dev/gpio/gpiobus_if.m +++ b/sys/dev/gpio/gpiobus_if.m @@ -49,7 +49,7 @@ METHOD void release_bus { }; # -# Set value of pin specifed by pin_num +# Set value of pin specified by pin_num # METHOD int pin_set { device_t dev; @@ -59,7 +59,7 @@ METHOD int pin_set { }; # -# Get value of pin specifed by pin_num +# Get value of pin specified by pin_num # METHOD int pin_get { device_t dev; @@ -69,7 +69,7 @@ METHOD int pin_get { }; # -# Toggle value of pin specifed by pin_num +# Toggle value of pin specified by pin_num # METHOD int pin_toggle { device_t dev; diff --git a/sys/dev/hpt27xx/hptintf.h b/sys/dev/hpt27xx/hptintf.h index ce768b846fba..7a988ccc566f 100644 --- a/sys/dev/hpt27xx/hptintf.h +++ b/sys/dev/hpt27xx/hptintf.h @@ -132,7 +132,7 @@ typedef HPT_U32 DEVICEID; #define MAX_ARRAY_MEMBERS_V3 64 #endif -/* keep definition for source code compatiblity */ +/* keep definition for source code compatibility */ #define MAX_ARRAY_MEMBERS MAX_ARRAY_MEMBERS_V1 /* diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c index a95615926bc3..024024ece19b 100644 --- a/sys/dev/hwpmc/hwpmc_amd.c +++ b/sys/dev/hwpmc/hwpmc_amd.c @@ -771,7 +771,7 @@ amd_stop_pmc(int cpu, int ri) /* * Due to NMI latency on newer AMD processors * NMI interrupts are ignored, which leads to - * panic or messages based on kernel configuraiton + * panic or messages based on kernel configuration */ /* Wait for the count to be reset */ diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c b/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c index f453b4759e27..6a623f4c9cad 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_port_buffer.c @@ -178,7 +178,7 @@ static int update_xoff_threshold(struct mlx5e_priv *priv, * port_buffer: port receive buffer configuration * change: * - * Update buffer configuration based on pfc configuraiton and priority + * Update buffer configuration based on pfc configuration and priority * to buffer mapping. * Buffer's lossy bit is changed to: * lossless if there is at least one PFC enabled priority mapped to this buffer diff --git a/sys/dev/qlnx/qlnxe/ecore_sriov.h b/sys/dev/qlnx/qlnxe/ecore_sriov.h index 57097df30948..84d954404e13 100644 --- a/sys/dev/qlnx/qlnxe/ecore_sriov.h +++ b/sys/dev/qlnx/qlnxe/ecore_sriov.h @@ -222,7 +222,7 @@ struct ecore_pf_iov { #ifdef CONFIG_ECORE_SRIOV /** * @brief Read sriov related information and allocated resources - * reads from configuraiton space, shmem, etc. + * reads from configuration space, shmem, etc. * * @param p_hwfn * diff --git a/sys/dev/sound/fdt/audio_soc.c b/sys/dev/sound/fdt/audio_soc.c index cd5807d955c9..eeb55d85420e 100644 --- a/sys/dev/sound/fdt/audio_soc.c +++ b/sys/dev/sound/fdt/audio_soc.c @@ -61,7 +61,7 @@ struct audio_soc_channel { struct audio_soc_softc { /* * pcm_register assumes that sc is snddev_info, - * so this has to be first structure member for "compatiblity" + * so this has to be first structure member for "compatibility" */ struct snddev_info info; device_t dev; diff --git a/sys/netinet/in_fib.c b/sys/netinet/in_fib.c index 8a6e64876b3d..3e09be7dc6e2 100644 --- a/sys/netinet/in_fib.c +++ b/sys/netinet/in_fib.c @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #ifdef INET -/* Verify struct route compatiblity */ +/* Verify struct route compatibility */ /* Assert 'struct route_in' is compatible with 'struct route' */ CHK_STRUCT_ROUTE_COMPAT(struct route_in, ro_dst4); diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 9572efaf5e1d..14b95dfe0254 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -699,7 +699,7 @@ in6_pcbnotify(struct inpcbinfo *pcbinfo, struct sockaddr *dst, /* * Detect if we should notify the error. If no source and - * destination ports are specifed, but non-zero flowinfo and + * destination ports are specified, but non-zero flowinfo and * local address match, notify the error. This is the case * when the error is delivered with an encrypted buffer * by ESP. Otherwise, just compare addresses and ports diff --git a/sys/sys/user.h b/sys/sys/user.h index 14471c91572f..e8bfba981e83 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -349,7 +349,7 @@ struct kinfo_file { int64_t kf_offset; /* Seek location. */ union { struct { - /* API compatiblity with FreeBSD < 12. */ + /* API compatibility with FreeBSD < 12. */ int kf_vnode_type; int kf_sock_domain; int kf_sock_type; diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c index 71e63208884f..7dceb67b23e8 100644 --- a/usr.bin/quota/quota.c +++ b/usr.bin/quota/quota.c @@ -215,7 +215,7 @@ showuid(u_long uid) } /* - * Print out quotas for a specifed user name. + * Print out quotas for a specified user name. */ static int showusrname(char *name) @@ -246,7 +246,7 @@ showgid(u_long gid) } /* - * Print out quotas for a specifed group name. + * Print out quotas for a specified group name. */ static int showgrpname(char *name) diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c index 0fb2e676f6a7..c0debb1fcbcd 100644 --- a/usr.sbin/lpr/lpc/cmds.c +++ b/usr.sbin/lpr/lpc/cmds.c @@ -94,7 +94,7 @@ static void wrapup_clean(int _laststatus); */ enum qsel_val { /* how a given ptr was selected */ QSEL_UNKNOWN = -1, /* ... not selected yet */ - QSEL_BYNAME = 0, /* ... user specifed it by name */ + QSEL_BYNAME = 0, /* ... user specified it by name */ QSEL_ALL = 1 /* ... user wants "all" printers */ /* (with more to come) */ }; From owner-dev-commits-src-main@freebsd.org Sun Aug 8 09:21:19 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A49B5652C1C; Sun, 8 Aug 2021 09:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjDH34FKBz3slW; Sun, 8 Aug 2021 09:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7943312340; Sun, 8 Aug 2021 09:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1789LJIv076238; Sun, 8 Aug 2021 09:21:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1789LJNj076237; Sun, 8 Aug 2021 09:21:19 GMT (envelope-from git) Date: Sun, 8 Aug 2021 09:21:19 GMT Message-Id: <202108080921.1789LJNj076237@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 9748eb742791 - main - Simplify nhop operations in ip_output(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9748eb742791dcfbb6496dc5c7c72c9283759baf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 09:21:19 -0000 The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=9748eb742791dcfbb6496dc5c7c72c9283759baf commit 9748eb742791dcfbb6496dc5c7c72c9283759baf Author: Alexander V. Chernikov AuthorDate: 2021-08-07 11:18:02 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-08-08 09:19:27 +0000 Simplify nhop operations in ip_output(). Consistently use `nh` instead of always dereferencing ro->ro_nh inside the if block. Always use nexthop mtu, as it provides guarantee that mtu is accurate. Pass `nh` pointer to rt_update_ro_flags() to allow upcoming uses of updating ro flags based on different nexthop. Differential Revision: https://reviews.freebsd.org/D31451 Reviewed by: kp MFC after: 2 weeks --- sys/net/route/route_ctl.c | 21 +++++++++++++++++++-- sys/netinet/ip_output.c | 27 +++++++++++++-------------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index 582901d67a8d..a686d1623053 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -567,6 +567,24 @@ rib_add_route(uint32_t fibnum, struct rt_addrinfo *info, return (error); } +/* + * Checks if @dst and @gateway is valid combination. + * + * Returns true if is valid, false otherwise. + */ +static bool +check_gateway(struct rib_head *rnh, struct sockaddr *dst, + struct sockaddr *gateway) +{ + if (dst->sa_family == gateway->sa_family) + return (true); + else if (gateway->sa_family == AF_UNSPEC) + return (true); + else if (gateway->sa_family == AF_LINK) + return (true); + return (false); +} + /* * Creates rtentry and nexthop based on @info data. * Return 0 and fills in rtentry into @prt on success, @@ -589,8 +607,7 @@ create_rtentry(struct rib_head *rnh, struct rt_addrinfo *info, if ((flags & RTF_GATEWAY) && !gateway) return (EINVAL); - if (dst && gateway && (dst->sa_family != gateway->sa_family) && - (gateway->sa_family != AF_UNSPEC) && (gateway->sa_family != AF_LINK)) + if (dst && gateway && !check_gateway(rnh, dst, gateway)) return (EINVAL); if (dst->sa_len > sizeof(((struct rtentry *)NULL)->rt_dstb)) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index f913a2591fcc..3041232b7223 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -293,9 +293,9 @@ done: /* rte<>ro_flags translation */ static inline void -rt_update_ro_flags(struct route *ro) +rt_update_ro_flags(struct route *ro, const struct nhop_object *nh) { - int nh_flags = ro->ro_nh->nh_flags; + int nh_flags = nh->nh_flags; ro->ro_flags &= ~ (RT_REJECT|RT_BLACKHOLE|RT_HAS_GW); @@ -495,22 +495,21 @@ again: goto bad; } } - ia = ifatoia(ro->ro_nh->nh_ifa); - ifp = ro->ro_nh->nh_ifp; - counter_u64_add(ro->ro_nh->nh_pksent, 1); - rt_update_ro_flags(ro); - if (ro->ro_nh->nh_flags & NHF_GATEWAY) - gw = &ro->ro_nh->gw4_sa; - if (ro->ro_nh->nh_flags & NHF_HOST) - isbroadcast = (ro->ro_nh->nh_flags & NHF_BROADCAST); + struct nhop_object *nh = ro->ro_nh; + + ia = ifatoia(nh->nh_ifa); + ifp = nh->nh_ifp; + counter_u64_add(nh->nh_pksent, 1); + rt_update_ro_flags(ro, nh); + if (nh->nh_flags & NHF_GATEWAY) + gw = &nh->gw4_sa; + if (nh->nh_flags & NHF_HOST) + isbroadcast = (nh->nh_flags & NHF_BROADCAST); else if (ifp->if_flags & IFF_BROADCAST) isbroadcast = in_ifaddr_broadcast(gw->sin_addr, ia); else isbroadcast = 0; - if (ro->ro_nh->nh_flags & NHF_HOST) - mtu = ro->ro_nh->nh_mtu; - else - mtu = ifp->if_mtu; + mtu = nh->nh_mtu; src = IA_SIN(ia)->sin_addr; } else { struct nhop_object *nh; From owner-dev-commits-src-main@freebsd.org Sun Aug 8 13:34:16 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14FA6656762; Sun, 8 Aug 2021 13:34:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjKtw03zWz4cyX; Sun, 8 Aug 2021 13:34:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE2C71581F; Sun, 8 Aug 2021 13:34:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178DYFff012785; Sun, 8 Aug 2021 13:34:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178DYFiR012784; Sun, 8 Aug 2021 13:34:15 GMT (envelope-from git) Date: Sun, 8 Aug 2021 13:34:15 GMT Message-Id: <202108081334.178DYFiR012784@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: b0cf8194c236 - main - cam: revert half of 75b5caa08ef MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0cf8194c2369b6a31960c52e0e47ac8c3b455d2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 13:34:16 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=b0cf8194c2369b6a31960c52e0e47ac8c3b455d2 commit b0cf8194c2369b6a31960c52e0e47ac8c3b455d2 Author: Edward Tomasz Napierala AuthorDate: 2021-08-08 13:24:07 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-08-08 13:24:19 +0000 cam: revert half of 75b5caa08ef This turns debugging printf() into a KASSERT(). It's for ATA for now; SCSI will came later. Reviewed By: imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31380 --- sys/cam/ata/ata_xpt.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 946763342160..ee0fe65e2ada 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -1799,18 +1799,10 @@ ata_action(union ccb *start_ccb) { if (start_ccb->ccb_h.func_code != XPT_ATA_IO) { -#ifdef notyet KASSERT((start_ccb->ccb_h.alloc_flags & CAM_CCB_FROM_UMA) == 0, ("%s: ccb %p, func_code %#x should not be allocated " "from UMA zone\n", __func__, start_ccb, start_ccb->ccb_h.func_code)); -#else - if ((start_ccb->ccb_h.alloc_flags & CAM_CCB_FROM_UMA) != 0) { - printf("%s: ccb %p, func_code %#x should not be allocated " - "from UMA zone\n", - __func__, start_ccb, start_ccb->ccb_h.func_code); - } -#endif } switch (start_ccb->ccb_h.func_code) { From owner-dev-commits-src-main@freebsd.org Sun Aug 8 14:43:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87768657BC3; Sun, 8 Aug 2021 14:43:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjMQG3Fs7z4hcV; Sun, 8 Aug 2021 14:43:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5798E1662D; Sun, 8 Aug 2021 14:43:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178Eh2KJ006047; Sun, 8 Aug 2021 14:43:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178Eh2S9006046; Sun, 8 Aug 2021 14:43:02 GMT (envelope-from git) Date: Sun, 8 Aug 2021 14:43:02 GMT Message-Id: <202108081443.178Eh2S9006046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 9feff969a010 - main - Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9feff969a01044c3083b552f06f7eb6416bc0524 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 14:43:02 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9feff969a01044c3083b552f06f7eb6416bc0524 commit 9feff969a01044c3083b552f06f7eb6416bc0524 Author: Ed Maste AuthorDate: 2021-08-08 14:38:01 +0000 Commit: Ed Maste CommitDate: 2021-08-08 14:42:24 +0000 Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights These ones were unambiguous cases where the Foundation was the only listed copyright holder (in the associated license block). Sponsored by: The FreeBSD Foundation --- sys/amd64/amd64/copyout.c | 1 - sys/amd64/amd64/efirt_support.S | 1 - sys/amd64/include/efi.h | 1 - sys/amd64/include/frame.h | 1 - sys/arm/arm/gic_common.h | 1 - sys/arm/freescale/imx/imx51_sdmareg.h | 1 - sys/arm/freescale/imx/imx51_ssireg.h | 1 - sys/arm/freescale/imx/imx_console.c | 1 - sys/arm/freescale/imx/imx_gpio.c | 1 - sys/arm/freescale/imx/imx_gpt.c | 1 - sys/arm/freescale/imx/imx_gptreg.h | 1 - sys/arm/freescale/imx/imx_wdog.c | 1 - sys/arm/freescale/imx/imx_wdogreg.h | 1 - sys/arm/freescale/imx/tzic.c | 1 - sys/arm/include/debug_monitor.h | 1 - sys/arm/include/fdt.h | 1 - sys/arm/include/ofw_machdep.h | 1 - sys/arm64/acpica/acpi_wakeup.c | 1 - sys/arm64/acpica/pci_cfgreg.c | 1 - sys/arm64/arm64/autoconf.c | 1 - sys/arm64/arm64/copyinout.S | 1 - sys/arm64/arm64/db_disasm.c | 1 - sys/arm64/arm64/db_interface.c | 1 - sys/arm64/arm64/db_trace.c | 1 - sys/arm64/arm64/debug_monitor.c | 1 - sys/arm64/arm64/dump_machdep.c | 1 - sys/arm64/arm64/gic_v3.c | 1 - sys/arm64/arm64/gic_v3_acpi.c | 1 - sys/arm64/arm64/gic_v3_fdt.c | 1 - sys/arm64/arm64/gic_v3_reg.h | 1 - sys/arm64/arm64/gic_v3_var.h | 1 - sys/arm64/arm64/gicv3_its.c | 1 - sys/arm64/arm64/mp_machdep.c | 1 - sys/arm64/arm64/stack_machdep.c | 1 - sys/arm64/arm64/sys_machdep.c | 1 - sys/arm64/arm64/unwind.c | 1 - sys/arm64/arm64/vfp.c | 1 - sys/arm64/cavium/thunder_pcie_common.c | 1 - sys/arm64/cavium/thunder_pcie_common.h | 1 - sys/arm64/cavium/thunder_pcie_pem.c | 1 - sys/arm64/include/bus_dma_impl.h | 1 - sys/arm64/include/debug_monitor.h | 1 - sys/arm64/include/ifunc.h | 1 - sys/arm64/include/iodev.h | 1 - sys/arm64/include/ofw_machdep.h | 1 - sys/arm64/include/pci_cfgreg.h | 1 - sys/arm64/include/vfp.h | 1 - sys/compat/freebsd32/freebsd32_capability.c | 1 - sys/compat/freebsd32/freebsd32_misc.h | 1 - sys/contrib/libnv/dnvlist.c | 1 - sys/crypto/armv8/armv8_crypto.h | 1 - sys/dev/acpica/acpi_bus_if.m | 1 - sys/dev/agp/agp_i810.h | 1 - sys/dev/ata/chipsets/ata-fsl.c | 1 - sys/dev/bhnd/bhnd_eromvar.h | 1 - sys/dev/bhnd/bhnd_private.h | 1 - sys/dev/bhnd/cores/chipc/chipc_gpio.c | 1 - sys/dev/bhnd/cores/chipc/chipc_gpiovar.h | 1 - sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.h | 1 - sys/dev/bhnd/cores/pmu/bhnd_pmu_types.h | 1 - sys/dev/drm2/drm_gem.c | 1 - sys/dev/drm2/drm_gem_names.c | 1 - sys/dev/drm2/drm_gem_names.h | 1 - sys/dev/drm2/drm_linux_list_sort.c | 1 - sys/dev/fb/fbd.c | 1 - sys/dev/fdt/fdt_common.c | 1 - sys/dev/fdt/fdt_common.h | 1 - sys/dev/fdt/fdt_static_dtb.S | 1 - sys/dev/iommu/busdma_iommu.c | 1 - sys/dev/iommu/busdma_iommu.h | 1 - sys/dev/iommu/iommu.h | 1 - sys/dev/iommu/iommu_gas.c | 1 - sys/dev/iommu/iommu_gas.h | 1 - sys/dev/iommu/iommu_types.h | 1 - sys/dev/ofw/ofw_cpu.h | 1 - sys/dev/ofw/ofw_fdt.c | 1 - sys/dev/uart/uart_bus_fdt.c | 1 - sys/dev/uart/uart_cpu_arm64.c | 1 - sys/dev/uart/uart_cpu_fdt.c | 1 - sys/dev/uart/uart_dev_imx.c | 1 - sys/dev/uart/uart_dev_imx.h | 1 - sys/dev/vnic/lmac_if.m | 1 - sys/dev/vnic/thunder_bgx_fdt.c | 1 - sys/dev/vnic/thunder_mdio.c | 1 - sys/dev/vnic/thunder_mdio_fdt.c | 1 - sys/dev/vnic/thunder_mdio_var.h | 1 - sys/dev/vt/colors/vt_termcolors.c | 1 - sys/dev/vt/colors/vt_termcolors.h | 1 - sys/dev/vt/font/vt_mouse_cursor.c | 1 - sys/dev/vt/hw/efifb/efifb.c | 1 - sys/dev/vt/hw/fb/vt_early_fb.c | 1 - sys/dev/vt/hw/fb/vt_fb.c | 1 - sys/dev/vt/hw/fb/vt_fb.h | 1 - sys/dev/vt/hw/vbefb/vbefb.c | 1 - sys/dev/vt/logo/logo_freebsd.c | 1 - sys/dev/vt/vt.h | 1 - sys/dev/vt/vt_buf.c | 1 - sys/dev/vt/vt_consolectl.c | 1 - sys/dev/vt/vt_core.c | 1 - sys/dev/vt/vt_font.c | 1 - sys/dts/arm/efikamx.dts | 1 - sys/dts/arm/imx51x.dtsi | 1 - sys/i386/i386/copyout.c | 1 - sys/i386/i386/copyout_fast.s | 1 - sys/i386/i386/minidump_machdep_nopae.c | 1 - sys/i386/i386/minidump_machdep_pae.c | 1 - sys/i386/i386/pmap_nopae.c | 1 - sys/i386/i386/pmap_pae.c | 1 - sys/i386/include/pmap_base.h | 1 - sys/i386/linux/linux_copyout.c | 1 - sys/kern/kern_tc.c | 1 - sys/kern/msi_if.m | 1 - sys/kern/subr_capability.c | 1 - sys/kern/subr_rangeset.c | 1 - sys/kern/subr_terminal.c | 1 - sys/libkern/arc4random.c | 1 - sys/mips/broadcom/bcm_mips.c | 1 - sys/mips/broadcom/bcm_mipsvar.h | 1 - sys/mips/include/fdt.h | 1 - sys/net/ieee_oui.h | 1 - sys/net80211/ieee80211_hwmp.c | 1 - sys/net80211/ieee80211_mesh.c | 1 - sys/net80211/ieee80211_mesh.h | 1 - sys/opencrypto/gfmult.c | 1 - sys/opencrypto/gfmult.h | 1 - sys/opencrypto/gmac.c | 1 - sys/opencrypto/gmac.h | 1 - sys/riscv/include/bus_dma_impl.h | 1 - sys/riscv/riscv/db_interface.c | 1 - sys/sys/_rangeset.h | 1 - sys/sys/atomic_common.h | 1 - sys/sys/caprights.h | 1 - sys/sys/dnv.h | 1 - sys/sys/font.h | 1 - sys/sys/rangeset.h | 1 - sys/sys/terminal.h | 1 - sys/sys/timepps.h | 1 - sys/tools/fdt/embed_dtb.sh | 1 - sys/x86/include/busdma_impl.h | 1 - sys/x86/include/ifunc.h | 1 - sys/x86/iommu/intel_ctx.c | 1 - sys/x86/iommu/intel_dmar.h | 1 - sys/x86/iommu/intel_drv.c | 1 - sys/x86/iommu/intel_fault.c | 1 - sys/x86/iommu/intel_idpgtbl.c | 1 - sys/x86/iommu/intel_intrmap.c | 1 - sys/x86/iommu/intel_qi.c | 1 - sys/x86/iommu/intel_quirks.c | 1 - sys/x86/iommu/intel_reg.h | 1 - sys/x86/iommu/intel_utils.c | 1 - sys/x86/iommu/iommu_intrmap.h | 1 - 151 files changed, 151 deletions(-) diff --git a/sys/amd64/amd64/copyout.c b/sys/amd64/amd64/copyout.c index 36e817635694..d5f94dd39276 100644 --- a/sys/amd64/amd64/copyout.c +++ b/sys/amd64/amd64/copyout.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2018 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/sys/amd64/amd64/efirt_support.S b/sys/amd64/amd64/efirt_support.S index b54b13b01fe6..7546a0765204 100644 --- a/sys/amd64/amd64/efirt_support.S +++ b/sys/amd64/amd64/efirt_support.S @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2018 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/sys/amd64/include/efi.h b/sys/amd64/include/efi.h index 2c24bebfe548..b7bda5388c21 100644 --- a/sys/amd64/include/efi.h +++ b/sys/amd64/include/efi.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/sys/amd64/include/frame.h b/sys/amd64/include/frame.h index f0a6fcf5bc9c..fef5ab2b3765 100644 --- a/sys/amd64/include/frame.h +++ b/sys/amd64/include/frame.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2018 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/sys/arm/arm/gic_common.h b/sys/arm/arm/gic_common.h index 4289146b0086..9e8fb19300ca 100644 --- a/sys/arm/arm/gic_common.h +++ b/sys/arm/arm/gic_common.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm/freescale/imx/imx51_sdmareg.h b/sys/arm/freescale/imx/imx51_sdmareg.h index 71c28f6bec14..7c6f14a3e715 100644 --- a/sys/arm/freescale/imx/imx51_sdmareg.h +++ b/sys/arm/freescale/imx/imx51_sdmareg.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2012, 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship * from the FreeBSD Foundation. diff --git a/sys/arm/freescale/imx/imx51_ssireg.h b/sys/arm/freescale/imx/imx51_ssireg.h index 3846b4950750..05c01a79a449 100644 --- a/sys/arm/freescale/imx/imx51_ssireg.h +++ b/sys/arm/freescale/imx/imx51_ssireg.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2012, 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship * from the FreeBSD Foundation. diff --git a/sys/arm/freescale/imx/imx_console.c b/sys/arm/freescale/imx/imx_console.c index d5ade2decd7b..b497b9cf3a14 100644 --- a/sys/arm/freescale/imx/imx_console.c +++ b/sys/arm/freescale/imx/imx_console.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2012, 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship * from the FreeBSD Foundation. diff --git a/sys/arm/freescale/imx/imx_gpio.c b/sys/arm/freescale/imx/imx_gpio.c index 8324d8daa30c..ef4c7917f342 100644 --- a/sys/arm/freescale/imx/imx_gpio.c +++ b/sys/arm/freescale/imx/imx_gpio.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2012, 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship * from the FreeBSD Foundation. diff --git a/sys/arm/freescale/imx/imx_gpt.c b/sys/arm/freescale/imx/imx_gpt.c index 6149ec6c6f04..0605f5ca3558 100644 --- a/sys/arm/freescale/imx/imx_gpt.c +++ b/sys/arm/freescale/imx/imx_gpt.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2012, 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship * from the FreeBSD Foundation. diff --git a/sys/arm/freescale/imx/imx_gptreg.h b/sys/arm/freescale/imx/imx_gptreg.h index e1c13b7d0d6a..f37f94b88425 100644 --- a/sys/arm/freescale/imx/imx_gptreg.h +++ b/sys/arm/freescale/imx/imx_gptreg.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2012, 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship * from the FreeBSD Foundation. diff --git a/sys/arm/freescale/imx/imx_wdog.c b/sys/arm/freescale/imx/imx_wdog.c index df2ae510e5fb..287a8771f791 100644 --- a/sys/arm/freescale/imx/imx_wdog.c +++ b/sys/arm/freescale/imx/imx_wdog.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2012, 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship * from the FreeBSD Foundation. diff --git a/sys/arm/freescale/imx/imx_wdogreg.h b/sys/arm/freescale/imx/imx_wdogreg.h index d192a28bbdc5..a66ca5adfc8e 100644 --- a/sys/arm/freescale/imx/imx_wdogreg.h +++ b/sys/arm/freescale/imx/imx_wdogreg.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2012, 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship * from the FreeBSD Foundation. diff --git a/sys/arm/freescale/imx/tzic.c b/sys/arm/freescale/imx/tzic.c index 6f3aca14da84..cddbd6ba9919 100644 --- a/sys/arm/freescale/imx/tzic.c +++ b/sys/arm/freescale/imx/tzic.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2012, 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship * from the FreeBSD Foundation. diff --git a/sys/arm/include/debug_monitor.h b/sys/arm/include/debug_monitor.h index c160397393ad..1271d9ec052b 100644 --- a/sys/arm/include/debug_monitor.h +++ b/sys/arm/include/debug_monitor.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2014 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm/include/fdt.h b/sys/arm/include/fdt.h index e8af11c8c4b0..37849d381372 100644 --- a/sys/arm/include/fdt.h +++ b/sys/arm/include/fdt.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under sponsorship from * the FreeBSD Foundation. diff --git a/sys/arm/include/ofw_machdep.h b/sys/arm/include/ofw_machdep.h index 76ab31c963cf..1adbb02965c3 100644 --- a/sys/arm/include/ofw_machdep.h +++ b/sys/arm/include/ofw_machdep.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2009 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under sponsorship from * the FreeBSD Foundation. diff --git a/sys/arm64/acpica/acpi_wakeup.c b/sys/arm64/acpica/acpi_wakeup.c index 7724fddd0fde..8504cac5894f 100644 --- a/sys/arm64/acpica/acpi_wakeup.c +++ b/sys/arm64/acpica/acpi_wakeup.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/sys/arm64/acpica/pci_cfgreg.c b/sys/arm64/acpica/pci_cfgreg.c index e80803fbaa4a..f8e777b65ff4 100644 --- a/sys/arm64/acpica/pci_cfgreg.c +++ b/sys/arm64/acpica/pci_cfgreg.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/autoconf.c b/sys/arm64/arm64/autoconf.c index 9788c789cfc4..f762a0fe858e 100644 --- a/sys/arm64/arm64/autoconf.c +++ b/sys/arm64/arm64/autoconf.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/sys/arm64/arm64/copyinout.S b/sys/arm64/arm64/copyinout.S index 45d08d3ac545..86e3c55f9a09 100644 --- a/sys/arm64/arm64/copyinout.S +++ b/sys/arm64/arm64/copyinout.S @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/sys/arm64/arm64/db_disasm.c b/sys/arm64/arm64/db_disasm.c index 73efca0bdee9..a7d65845acbf 100644 --- a/sys/arm64/arm64/db_disasm.c +++ b/sys/arm64/arm64/db_disasm.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/db_interface.c b/sys/arm64/arm64/db_interface.c index 5138bf3f1cab..d8ae79715a19 100644 --- a/sys/arm64/arm64/db_interface.c +++ b/sys/arm64/arm64/db_interface.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/db_trace.c b/sys/arm64/arm64/db_trace.c index 5f018f2133b6..f6edb34e55d5 100644 --- a/sys/arm64/arm64/db_trace.c +++ b/sys/arm64/arm64/db_trace.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/debug_monitor.c b/sys/arm64/arm64/debug_monitor.c index 8ef2ba360786..83b1f2b8b65b 100644 --- a/sys/arm64/arm64/debug_monitor.c +++ b/sys/arm64/arm64/debug_monitor.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2014 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/dump_machdep.c b/sys/arm64/arm64/dump_machdep.c index d92777fea051..dc5126bee058 100644 --- a/sys/arm64/arm64/dump_machdep.c +++ b/sys/arm64/arm64/dump_machdep.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c index 03b6490e7d61..3e7cd30140eb 100644 --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015-2016 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c index e73e37f8e851..6a090baffacf 100644 --- a/sys/arm64/arm64/gic_v3_acpi.c +++ b/sys/arm64/arm64/gic_v3_acpi.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c index 483d67ba6deb..d2c0611c9167 100644 --- a/sys/arm64/arm64/gic_v3_fdt.c +++ b/sys/arm64/arm64/gic_v3_fdt.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/gic_v3_reg.h b/sys/arm64/arm64/gic_v3_reg.h index 2ba35ec9dab3..94033d28cb01 100644 --- a/sys/arm64/arm64/gic_v3_reg.h +++ b/sys/arm64/arm64/gic_v3_reg.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/gic_v3_var.h b/sys/arm64/arm64/gic_v3_var.h index 1645c417fd8d..7722a48cb456 100644 --- a/sys/arm64/arm64/gic_v3_var.h +++ b/sys/arm64/arm64/gic_v3_var.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c index 8ba7aa3b2047..af587247626b 100644 --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015-2016 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 3b1a8cc89cab..63715c64641c 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015-2016 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/sys/arm64/arm64/stack_machdep.c b/sys/arm64/arm64/stack_machdep.c index 9486e4815294..001164e7b6e3 100644 --- a/sys/arm64/arm64/stack_machdep.c +++ b/sys/arm64/arm64/stack_machdep.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/sys/arm64/arm64/sys_machdep.c b/sys/arm64/arm64/sys_machdep.c index dfb2c4ad85b8..937a9f761a7c 100644 --- a/sys/arm64/arm64/sys_machdep.c +++ b/sys/arm64/arm64/sys_machdep.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/sys/arm64/arm64/unwind.c b/sys/arm64/arm64/unwind.c index cd994fffb953..770158295fb5 100644 --- a/sys/arm64/arm64/unwind.c +++ b/sys/arm64/arm64/unwind.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index 9de27349fb8d..a481b5ebb3ba 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015-2016 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/sys/arm64/cavium/thunder_pcie_common.c b/sys/arm64/cavium/thunder_pcie_common.c index 8f1d4834b1a5..a47b3ba18908 100644 --- a/sys/arm64/cavium/thunder_pcie_common.c +++ b/sys/arm64/cavium/thunder_pcie_common.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/cavium/thunder_pcie_common.h b/sys/arm64/cavium/thunder_pcie_common.h index 057dff5d3b4b..d9a34148a513 100644 --- a/sys/arm64/cavium/thunder_pcie_common.h +++ b/sys/arm64/cavium/thunder_pcie_common.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/arm64/cavium/thunder_pcie_pem.c b/sys/arm64/cavium/thunder_pcie_pem.c index 9296280ad95f..45d9880571b0 100644 --- a/sys/arm64/cavium/thunder_pcie_pem.c +++ b/sys/arm64/cavium/thunder_pcie_pem.c @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/include/bus_dma_impl.h b/sys/arm64/include/bus_dma_impl.h index 736376c13864..1488bd3a55da 100644 --- a/sys/arm64/include/bus_dma_impl.h +++ b/sys/arm64/include/bus_dma_impl.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/sys/arm64/include/debug_monitor.h b/sys/arm64/include/debug_monitor.h index 4ca1a4c9248e..befc51e88304 100644 --- a/sys/arm64/include/debug_monitor.h +++ b/sys/arm64/include/debug_monitor.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2014 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under * the sponsorship of the FreeBSD Foundation. diff --git a/sys/arm64/include/ifunc.h b/sys/arm64/include/ifunc.h index cf89af7c7142..da4d856f7f92 100644 --- a/sys/arm64/include/ifunc.h +++ b/sys/arm64/include/ifunc.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015-2018 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/sys/arm64/include/iodev.h b/sys/arm64/include/iodev.h index 5521ff71bc5f..8752c4cb7f6b 100644 --- a/sys/arm64/include/iodev.h +++ b/sys/arm64/include/iodev.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/sys/arm64/include/ofw_machdep.h b/sys/arm64/include/ofw_machdep.h index 511fc8d71c19..b2ba37cb441c 100644 --- a/sys/arm64/include/ofw_machdep.h +++ b/sys/arm64/include/ofw_machdep.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2009 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under sponsorship from * the FreeBSD Foundation. diff --git a/sys/arm64/include/pci_cfgreg.h b/sys/arm64/include/pci_cfgreg.h index 68b38aaeb5bb..fa7e93f1a7e7 100644 --- a/sys/arm64/include/pci_cfgreg.h +++ b/sys/arm64/include/pci_cfgreg.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h index 6689be1b15d7..629b1b7fadf4 100644 --- a/sys/arm64/include/vfp.h +++ b/sys/arm64/include/vfp.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/sys/compat/freebsd32/freebsd32_capability.c b/sys/compat/freebsd32/freebsd32_capability.c index 9a39b4f4cd71..2796d2e9384f 100644 --- a/sys/compat/freebsd32/freebsd32_capability.c +++ b/sys/compat/freebsd32/freebsd32_capability.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sys/compat/freebsd32/freebsd32_misc.h b/sys/compat/freebsd32/freebsd32_misc.h index 9e0f55ae8478..f6f85adc8e72 100644 --- a/sys/compat/freebsd32/freebsd32_misc.h +++ b/sys/compat/freebsd32/freebsd32_misc.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sys/contrib/libnv/dnvlist.c b/sys/contrib/libnv/dnvlist.c index b118d379406f..3c6898d51256 100644 --- a/sys/contrib/libnv/dnvlist.c +++ b/sys/contrib/libnv/dnvlist.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. diff --git a/sys/crypto/armv8/armv8_crypto.h b/sys/crypto/armv8/armv8_crypto.h index 0e4cd91e7062..855aabd8bac3 100644 --- a/sys/crypto/armv8/armv8_crypto.h +++ b/sys/crypto/armv8/armv8_crypto.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2016 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under * sponsorship from the FreeBSD Foundation. diff --git a/sys/dev/acpica/acpi_bus_if.m b/sys/dev/acpica/acpi_bus_if.m index df3f930af086..9142a89453c5 100644 --- a/sys/dev/acpica/acpi_bus_if.m +++ b/sys/dev/acpica/acpi_bus_if.m @@ -1,6 +1,5 @@ #- # Copyright (c) 2016 The FreeBSD Foundation -# All rights reserved. # # This software was developed by Andrew Turner under # sponsorship from the FreeBSD Foundation. diff --git a/sys/dev/agp/agp_i810.h b/sys/dev/agp/agp_i810.h index 211675c4a67d..d3633150fed5 100644 --- a/sys/dev/agp/agp_i810.h +++ b/sys/dev/agp/agp_i810.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2011 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/ata/chipsets/ata-fsl.c b/sys/dev/ata/chipsets/ata-fsl.c index 32fe2a04bd19..25187390611a 100644 --- a/sys/dev/ata/chipsets/ata-fsl.c +++ b/sys/dev/ata/chipsets/ata-fsl.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2012 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship * from the FreeBSD Foundation. diff --git a/sys/dev/bhnd/bhnd_eromvar.h b/sys/dev/bhnd/bhnd_eromvar.h index a7e6e2cf98f2..dbfed9f520ed 100644 --- a/sys/dev/bhnd/bhnd_eromvar.h +++ b/sys/dev/bhnd/bhnd_eromvar.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Landon Fuller under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/bhnd/bhnd_private.h b/sys/dev/bhnd/bhnd_private.h index aae25349e90e..224ea67a0b76 100644 --- a/sys/dev/bhnd/bhnd_private.h +++ b/sys/dev/bhnd/bhnd_private.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Landon Fuller under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/bhnd/cores/chipc/chipc_gpio.c b/sys/dev/bhnd/cores/chipc/chipc_gpio.c index 9123531d3ab6..7c75259c226f 100644 --- a/sys/dev/bhnd/cores/chipc/chipc_gpio.c +++ b/sys/dev/bhnd/cores/chipc/chipc_gpio.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Landon Fuller under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h b/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h index 640fbc1560d4..c4bbcdf47688 100644 --- a/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h +++ b/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Landon Fuller under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.h b/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.h index 3d05709d5b38..01d3e76298dd 100644 --- a/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.h +++ b/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.h @@ -1,6 +1,5 @@ /*- * Copyright (c) 2017 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Landon Fuller under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/bhnd/cores/pmu/bhnd_pmu_types.h b/sys/dev/bhnd/cores/pmu/bhnd_pmu_types.h index 700ff3287b16..48f54f235d80 100644 --- a/sys/dev/bhnd/cores/pmu/bhnd_pmu_types.h +++ b/sys/dev/bhnd/cores/pmu/bhnd_pmu_types.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Landon Fuller under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/drm2/drm_gem.c b/sys/dev/drm2/drm_gem.c index 47d363a811ad..2692eb2499ae 100644 --- a/sys/dev/drm2/drm_gem.c +++ b/sys/dev/drm2/drm_gem.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2011 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/drm2/drm_gem_names.c b/sys/dev/drm2/drm_gem_names.c index 6b0046fc042e..58dbc5a26c8f 100644 --- a/sys/dev/drm2/drm_gem_names.c +++ b/sys/dev/drm2/drm_gem_names.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2011 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/drm2/drm_gem_names.h b/sys/dev/drm2/drm_gem_names.h index bb97c0797f74..dad66f6ef9a6 100644 --- a/sys/dev/drm2/drm_gem_names.h +++ b/sys/dev/drm2/drm_gem_names.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2011 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/drm2/drm_linux_list_sort.c b/sys/dev/drm2/drm_linux_list_sort.c index bd7085e2a86d..f9a64154c796 100644 --- a/sys/dev/drm2/drm_linux_list_sort.c +++ b/sys/dev/drm2/drm_linux_list_sort.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2011 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/fb/fbd.c b/sys/dev/fb/fbd.c index 36439af9256c..e577768eafdb 100644 --- a/sys/dev/fb/fbd.c +++ b/sys/dev/fb/fbd.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Aleksandr Rybalko under sponsorship from the * FreeBSD Foundation. diff --git a/sys/dev/fdt/fdt_common.c b/sys/dev/fdt/fdt_common.c index 107c91e11425..18ac3957f7f9 100644 --- a/sys/dev/fdt/fdt_common.c +++ b/sys/dev/fdt/fdt_common.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2009-2014 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Andrew Turner under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/fdt/fdt_common.h b/sys/dev/fdt/fdt_common.h index 3bf4df41973c..fc2990cdae29 100644 --- a/sys/dev/fdt/fdt_common.h +++ b/sys/dev/fdt/fdt_common.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2009-2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/fdt/fdt_static_dtb.S b/sys/dev/fdt/fdt_static_dtb.S index ae1fc03e5b4a..1686bc4b0099 100644 --- a/sys/dev/fdt/fdt_static_dtb.S +++ b/sys/dev/fdt/fdt_static_dtb.S @@ -1,6 +1,5 @@ /*- * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Semihalf under sponsorship from * the FreeBSD Foundation. diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c index 9cafd49807ff..07a16e87eeda 100644 --- a/sys/dev/iommu/busdma_iommu.c +++ b/sys/dev/iommu/busdma_iommu.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/sys/dev/iommu/busdma_iommu.h b/sys/dev/iommu/busdma_iommu.h index 857d3670fc6f..f911f26fa0f7 100644 --- a/sys/dev/iommu/busdma_iommu.h +++ b/sys/dev/iommu/busdma_iommu.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/sys/dev/iommu/iommu.h b/sys/dev/iommu/iommu.h index ba592ea08ff1..dd803e84c2ee 100644 --- a/sys/dev/iommu/iommu.h +++ b/sys/dev/iommu/iommu.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2013 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Konstantin Belousov * under sponsorship from the FreeBSD Foundation. diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c index 431c0c195c35..ae54f41953c8 100644 --- a/sys/dev/iommu/iommu_gas.c +++ b/sys/dev/iommu/iommu_gas.c *** 933 LINES SKIPPED *** From owner-dev-commits-src-main@freebsd.org Sun Aug 8 17:35:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8318B660AF5; Sun, 8 Aug 2021 17:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjRFN3FSwz3HKB; Sun, 8 Aug 2021 17:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5692718E09; Sun, 8 Aug 2021 17:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178HZaLY048455; Sun, 8 Aug 2021 17:35:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178HZaUo048454; Sun, 8 Aug 2021 17:35:36 GMT (envelope-from git) Date: Sun, 8 Aug 2021 17:35:36 GMT Message-Id: <202108081735.178HZaUo048454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 47363e99d3d3 - main - Enable compressed debug on little-endian targets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47363e99d3d312c510902b68d5cf3094ddc7bb76 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 17:35:36 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=47363e99d3d312c510902b68d5cf3094ddc7bb76 commit 47363e99d3d312c510902b68d5cf3094ddc7bb76 Author: Ed Maste AuthorDate: 2021-08-07 14:46:07 +0000 Commit: Ed Maste CommitDate: 2021-08-08 17:31:28 +0000 Enable compressed debug on little-endian targets Compressed debug was enabled by default in commit c910570e7573, but broke the build on big-endian targets, and so was disabled in 89ed2ecb14ce. Older versions of LLD fail with big-endian compressed debug sections. This was fixed in LLD upstream (commit c6ebc651b6fa) and merged to FreeBSD main (commit d69d07569ee2) by dim. External toolchains (e.g. the llvm12 package) will not yet have the fix. These may be used to link against base system .a archives, so compressed debug sections would cause trouble even though the base system is fixed. Enable compressed debug sections again, for little-endian targets only. As discussed on freebsd-hackers[1] I expect to undo this in the future (using compressed debug everywhere), once fixed versions of lld are widely available. Note that to be pedantically correct we should check both the compiler and the linker for compressed debug support, but given the external toolchain constraint the extra complexity does not seem worthwhile. [1] https://lists.freebsd.org/archives/freebsd-hackers/2021-August/000188.html PR: 257638 Reported by: jrtc27 [impact of .a archives] Discussed with: imp Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31454 Revert "Disable compressed debug by default" This reverts commit 89ed2ecb14ceabc27883282cf96559a9e7d52717. --- share/mk/bsd.compiler.mk | 9 ++++++++- share/mk/bsd.sys.mk | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index 681f6ffec14c..757361a566dd 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -235,7 +235,14 @@ ${X_}COMPILER_FEATURES+= c++11 c++14 ${X_}COMPILER_FEATURES+= c++17 .endif .if ${${X_}COMPILER_TYPE} == "clang" -${X_}COMPILER_FEATURES+= compressed-debug retpoline init-all +${X_}COMPILER_FEATURES+= retpoline init-all +# PR257638 lld fails with BE compressed debug. Fixed in main but external tool +# chains will initially not have the fix. For now limit the feature to LE +# targets. +.include +.if ${TARGET_ENDIANNESS} == "1234" +${X_}COMPILER_FEATURES+= compressed-debug +.endif .endif .if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 100000 || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 80100) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 031d49bbaca2..a964cf6e596c 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -247,7 +247,7 @@ CFLAGS+= ${SSP_CFLAGS} # Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is # enabled. -DEBUG_FILES_CFLAGS?= -g +DEBUG_FILES_CFLAGS?= -g -gz=zlib # Allow user-specified additional warning flags, plus compiler and file # specific flag overrides, unless we've overridden this... From owner-dev-commits-src-main@freebsd.org Sun Aug 8 19:51:30 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08C26662B56; Sun, 8 Aug 2021 19:51:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjVG96tNHz3hL6; Sun, 8 Aug 2021 19:51:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4C341AB7C; Sun, 8 Aug 2021 19:51:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178JpTHC030425; Sun, 8 Aug 2021 19:51:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178JpTuo030424; Sun, 8 Aug 2021 19:51:29 GMT (envelope-from git) Date: Sun, 8 Aug 2021 19:51:29 GMT Message-Id: <202108081951.178JpTuo030424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2a51e8823a60 - main - fork(2): comment about doubtful use of stdio and exit(3) in example MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a51e8823a60180feb534176bc41d5d10e2a01b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 19:51:30 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2a51e8823a60180feb534176bc41d5d10e2a01b1 commit 2a51e8823a60180feb534176bc41d5d10e2a01b1 Author: Konstantin Belousov AuthorDate: 2021-08-05 16:03:03 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-08 19:38:59 +0000 fork(2): comment about doubtful use of stdio and exit(3) in example Add fflush(stdout) as the common idiom. Explain the need to use exit() but advise against it. Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D31425 --- lib/libc/sys/fork.2 | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/fork.2 b/lib/libc/sys/fork.2 index d841b0bc38e1..dbde8f5275aa 100644 --- a/lib/libc/sys/fork.2 +++ b/lib/libc/sys/fork.2 @@ -28,7 +28,7 @@ .\" @(#)fork.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 2, 2021 +.Dd August 5, 2021 .Dt FORK 2 .Os .Sh NAME @@ -172,11 +172,28 @@ main(void) { pid_t pid; + /* + * If child is expected to use stdio(3), state of + * the reused io streams must be synchronized between + * parent and child, to avoid double output and other + * possible issues. + */ + fflush(stdout); + switch (pid = fork()) { case -1: err(1, "Failed to fork"); case 0: printf("Hello from child process!\en"); + + /* + * Since we wrote into stdout, child needs to use + * exit(3) and not _exit(2). This causes handlers + * registered with atexit(3) to be called twice, + * once in parent, and once in the child. If such + * behavior is undesirable, consider + * terminating child with _exit(2) or _Exit(3). + */ exit(0); default: break; From owner-dev-commits-src-main@freebsd.org Sun Aug 8 19:51:31 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27F93662A92; Sun, 8 Aug 2021 19:51:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjVGC0WpHz3h7W; Sun, 8 Aug 2021 19:51:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED5E11AA12; Sun, 8 Aug 2021 19:51:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178JpUOf030450; Sun, 8 Aug 2021 19:51:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178JpUko030449; Sun, 8 Aug 2021 19:51:30 GMT (envelope-from git) Date: Sun, 8 Aug 2021 19:51:30 GMT Message-Id: <202108081951.178JpUko030449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ee62fb2e1e14 - main - _Exit(3): document implementation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee62fb2e1e14eab35d4e4e92535bcac9fc91eeb8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 19:51:31 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ee62fb2e1e14eab35d4e4e92535bcac9fc91eeb8 commit ee62fb2e1e14eab35d4e4e92535bcac9fc91eeb8 Author: Konstantin Belousov AuthorDate: 2021-08-05 16:04:44 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-08 19:39:46 +0000 _Exit(3): document implementation Remove a useless note about unlinking temporary files, they are unlinked in tmpfile(3) [1]. Add a note about __cxa_atexit(). Explain exactly what are the FreeBSD implementation differences between exit() and _Exit(). Noted by: markj [1] Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D31425 --- lib/libc/stdlib/exit.3 | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/libc/stdlib/exit.3 b/lib/libc/stdlib/exit.3 index 9c2b79b72956..ff7a67ffcb85 100644 --- a/lib/libc/stdlib/exit.3 +++ b/lib/libc/stdlib/exit.3 @@ -32,7 +32,7 @@ .\" @(#)exit.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 22, 2020 +.Dd August 5, 2021 .Dt EXIT 3 .Os .Sh NAME @@ -58,17 +58,17 @@ Before termination, performs the following functions in the order listed: .Bl -enum -offset indent .It -Call the functions registered with the +Call all functions registered with the +.Xr __cxa_atexit 3 +function +(which are typically destructors from the loaded dynamic objects), +and the functions registered with the .Xr atexit 3 function, in the reverse order of their registration. .It Flush all open output streams. .It Close all open streams. -.It -Unlink all files created with the -.Xr tmpfile 3 -function. .El .Pp The @@ -76,6 +76,14 @@ The function terminates without calling the functions registered with the .Xr atexit 3 function, and may or may not perform the other actions listed. +The +.Fx +implementation of the +.Fn _Exit +function does not call destructors registered with +.Xr __cxa_atexit 3, +does not flush buffers, and does not close streams. +.Pp Both functions make the low-order eight bits of the .Fa status argument available to a parent process which has called a From owner-dev-commits-src-main@freebsd.org Sun Aug 8 19:53:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2023C662AAF; Sun, 8 Aug 2021 19:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjVJ00MP5z3hFF; Sun, 8 Aug 2021 19:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E96091AC0A; Sun, 8 Aug 2021 19:53:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178Jr37S034566; Sun, 8 Aug 2021 19:53:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178Jr3Av034565; Sun, 8 Aug 2021 19:53:03 GMT (envelope-from git) Date: Sun, 8 Aug 2021 19:53:03 GMT Message-Id: <202108081953.178Jr3Av034565@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f75caed644a5 - main - amd64 UEFI loader: stop copying staging area to 2M physical MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f75caed644a5c8c342a1ea5e7a6d5251f82ed0b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 19:53:04 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f75caed644a5c8c342a1ea5e7a6d5251f82ed0b1 commit f75caed644a5c8c342a1ea5e7a6d5251f82ed0b1 Author: Konstantin Belousov AuthorDate: 2021-07-10 19:55:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-08 19:52:29 +0000 amd64 UEFI loader: stop copying staging area to 2M physical On amd64, add a possibility to activate kernel with staging area in place. Add 'copy_staging' command to control this. For now, by default the old mode of copying kernel to 2M phys is retained. It is going to be changed in several weeks. On amd64, add some slop to the staging area to satisfy both requirements of the kernel startup allocator, and to have space for minor staging data increase after the final size is calculated. Add a new command 'staging_slop' to control its size. Improve staging area resizing, in particular, reallocate it anew if we cannot grow it neither down nor up. Reviewed by: kevans, markj Discussed with: emaste (the delivery plan) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31121 --- stand/common/bootstrap.h | 3 + stand/common/load_elf.c | 15 ++ stand/efi/loader/arch/amd64/elf64_freebsd.c | 142 +++++++++++++---- stand/efi/loader/bootinfo.c | 6 +- stand/efi/loader/copy.c | 232 ++++++++++++++++++++++++---- stand/efi/loader/loader_efi.h | 10 ++ 6 files changed, 348 insertions(+), 60 deletions(-) diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h index b7e1f8553f47..eb4e50203133 100644 --- a/stand/common/bootstrap.h +++ b/stand/common/bootstrap.h @@ -228,6 +228,9 @@ struct preloaded_file size_t f_size; /* file size */ struct kernel_module *f_modules; /* list of modules if any */ struct preloaded_file *f_next; /* next file */ +#ifdef __amd64__ + bool f_kernphys_relocatable; +#endif }; struct file_format diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index f1a9ff8e0c22..9ae91036dbb4 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -207,6 +207,18 @@ static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr) #undef CONVERT_SWITCH #undef CONVERT_FIELD + +#ifdef __amd64__ +static bool +is_kernphys_relocatable(elf_file_t ef) +{ + Elf_Sym sym; + + return (__elfN(lookup_symbol)(ef, "kernphys", &sym, STT_OBJECT) == 0 && + sym.st_size == 8); +} +#endif + static int __elfN(load_elf_header)(char *filename, elf_file_t ef) { @@ -434,6 +446,9 @@ __elfN(loadfile_raw)(char *filename, uint64_t dest, /* Load OK, return module pointer */ *result = (struct preloaded_file *)fp; err = 0; +#ifdef __amd64__ + fp->f_kernphys_relocatable = is_kernphys_relocatable(&ef); +#endif goto out; ioerr: diff --git a/stand/efi/loader/arch/amd64/elf64_freebsd.c b/stand/efi/loader/arch/amd64/elf64_freebsd.c index a950ca55e843..d0c8ef96eeea 100644 --- a/stand/efi/loader/arch/amd64/elf64_freebsd.c +++ b/stand/efi/loader/arch/amd64/elf64_freebsd.c @@ -82,7 +82,11 @@ struct file_format *file_formats[] = { static pml4_entry_t *PT4; static pdp_entry_t *PT3; +static pdp_entry_t *PT3_l, *PT3_u; static pd_entry_t *PT2; +static pd_entry_t *PT2_l0, *PT2_l1, *PT2_l2, *PT2_l3, *PT2_u0, *PT2_u1; + +extern EFI_PHYSICAL_ADDRESS staging; static void (*trampoline)(uint64_t stack, void *copy_finish, uint64_t kernend, uint64_t modulep, pml4_entry_t *pagetable, uint64_t entry); @@ -105,6 +109,12 @@ elf64_exec(struct preloaded_file *fp) ACPI_TABLE_RSDP *rsdp; char buf[24]; int revision; + bool copy_auto; + + copy_auto = copy_staging == COPY_STAGING_AUTO; + if (copy_auto) + copy_staging = fp->f_kernphys_relocatable ? + COPY_STAGING_DISABLE : COPY_STAGING_ENABLE; /* * Report the RSDP to the kernel. While this can be found with @@ -151,57 +161,133 @@ elf64_exec(struct preloaded_file *fp) } if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) - return(EFTYPE); + return (EFTYPE); ehdr = (Elf_Ehdr *)&(md->md_data); - trampcode = (vm_offset_t)0x0000000040000000; + trampcode = copy_staging == COPY_STAGING_ENABLE ? + (vm_offset_t)0x0000000040000000 /* 1G */ : + (vm_offset_t)0x0000000100000000; /* 4G */; err = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, 1, (EFI_PHYSICAL_ADDRESS *)&trampcode); + if (EFI_ERROR(err)) { + printf("Unable to allocate trampoline\n"); + if (copy_auto) + copy_staging = COPY_STAGING_AUTO; + return (ENOMEM); + } bzero((void *)trampcode, EFI_PAGE_SIZE); trampstack = trampcode + EFI_PAGE_SIZE - 8; bcopy((void *)&amd64_tramp, (void *)trampcode, amd64_tramp_size); trampoline = (void *)trampcode; - PT4 = (pml4_entry_t *)0x0000000040000000; - err = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, 3, - (EFI_PHYSICAL_ADDRESS *)&PT4); - bzero(PT4, 3 * EFI_PAGE_SIZE); + if (copy_staging == COPY_STAGING_ENABLE) { + PT4 = (pml4_entry_t *)0x0000000040000000; + err = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, 3, + (EFI_PHYSICAL_ADDRESS *)&PT4); + if (EFI_ERROR(err)) { + printf("Unable to allocate trampoline page table\n"); + BS->FreePages(trampcode, 1); + if (copy_auto) + copy_staging = COPY_STAGING_AUTO; + return (ENOMEM); + } + bzero(PT4, 3 * EFI_PAGE_SIZE); + PT3 = &PT4[512]; + PT2 = &PT3[512]; + + /* + * This is kinda brutal, but every single 1GB VM + * memory segment points to the same first 1GB of + * physical memory. But it is more than adequate. + */ + for (i = 0; i < NPTEPG; i++) { + /* + * Each slot of the L4 pages points to the + * same L3 page. + */ + PT4[i] = (pml4_entry_t)PT3; + PT4[i] |= PG_V | PG_RW; + + /* + * Each slot of the L3 pages points to the + * same L2 page. + */ + PT3[i] = (pdp_entry_t)PT2; + PT3[i] |= PG_V | PG_RW; + + /* + * The L2 page slots are mapped with 2MB pages for 1GB. + */ + PT2[i] = (pd_entry_t)i * (2 * 1024 * 1024); + PT2[i] |= PG_V | PG_RW | PG_PS; + } + } else { + PT4 = (pml4_entry_t *)0x0000000100000000; /* 4G */ + err = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, 9, + (EFI_PHYSICAL_ADDRESS *)&PT4); + if (EFI_ERROR(err)) { + printf("Unable to allocate trampoline page table\n"); + BS->FreePages(trampcode, 9); + if (copy_auto) + copy_staging = COPY_STAGING_AUTO; + return (ENOMEM); + } - PT3 = &PT4[512]; - PT2 = &PT3[512]; + bzero(PT4, 9 * EFI_PAGE_SIZE); + + PT3_l = &PT4[NPML4EPG * 1]; + PT3_u = &PT4[NPML4EPG * 2]; + PT2_l0 = &PT4[NPML4EPG * 3]; + PT2_l1 = &PT4[NPML4EPG * 4]; + PT2_l2 = &PT4[NPML4EPG * 5]; + PT2_l3 = &PT4[NPML4EPG * 6]; + PT2_u0 = &PT4[NPML4EPG * 7]; + PT2_u1 = &PT4[NPML4EPG * 8]; + + /* 1:1 mapping of lower 4G */ + PT4[0] = (pml4_entry_t)PT3_l | PG_V | PG_RW; + PT3_l[0] = (pdp_entry_t)PT2_l0 | PG_V | PG_RW; + PT3_l[1] = (pdp_entry_t)PT2_l1 | PG_V | PG_RW; + PT3_l[2] = (pdp_entry_t)PT2_l2 | PG_V | PG_RW; + PT3_l[3] = (pdp_entry_t)PT2_l3 | PG_V | PG_RW; + for (i = 0; i < 4 * NPDEPG; i++) { + PT2_l0[i] = ((pd_entry_t)i << PDRSHIFT) | PG_V | + PG_RW | PG_PS; + } - /* - * This is kinda brutal, but every single 1GB VM memory segment points - * to the same first 1GB of physical memory. But it is more than - * adequate. - */ - for (i = 0; i < 512; i++) { - /* Each slot of the L4 pages points to the same L3 page. */ - PT4[i] = (pml4_entry_t)PT3; - PT4[i] |= PG_V | PG_RW; - - /* Each slot of the L3 pages points to the same L2 page. */ - PT3[i] = (pdp_entry_t)PT2; - PT3[i] |= PG_V | PG_RW; - - /* The L2 page slots are mapped with 2MB pages for 1GB. */ - PT2[i] = i * (2 * 1024 * 1024); - PT2[i] |= PG_V | PG_RW | PG_PS; + /* mapping of kernel 2G below top */ + PT4[NPML4EPG - 1] = (pml4_entry_t)PT3_u | PG_V | PG_RW; + PT3_u[NPDPEPG - 2] = (pdp_entry_t)PT2_u0 | PG_V | PG_RW; + PT3_u[NPDPEPG - 1] = (pdp_entry_t)PT2_u1 | PG_V | PG_RW; + /* compat mapping of phys @0 */ + PT2_u0[0] = PG_PS | PG_V | PG_RW; + /* this maps past staging area */ + for (i = 1; i < 2 * NPDEPG; i++) { + PT2_u0[i] = ((pd_entry_t)staging + + ((pd_entry_t)i - 1) * NBPDR) | + PG_V | PG_RW | PG_PS; + } } + printf("staging %#lx (%scoping) tramp %p PT4 %p\n", + staging, copy_staging == COPY_STAGING_ENABLE ? "" : "not ", + trampoline, PT4); printf("Start @ 0x%lx ...\n", ehdr->e_entry); efi_time_fini(); err = bi_load(fp->f_args, &modulep, &kernend, true); if (err != 0) { efi_time_init(); - return(err); + if (copy_auto) + copy_staging = COPY_STAGING_AUTO; + return (err); } dev_cleanup(); - trampoline(trampstack, efi_copy_finish, kernend, modulep, PT4, - ehdr->e_entry); + trampoline(trampstack, copy_staging == COPY_STAGING_ENABLE ? + efi_copy_finish : efi_copy_finish_nop, kernend, modulep, + PT4, ehdr->e_entry); panic("exec returned"); } diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index 9924901d29e6..f4501f18f14c 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -65,6 +65,8 @@ int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, extern EFI_SYSTEM_TABLE *ST; +int boot_services_gone; + static int bi_getboothowto(char *kargs) { @@ -396,8 +398,10 @@ bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) if (!exit_bs) break; status = BS->ExitBootServices(IH, efi_mapkey); - if (!EFI_ERROR(status)) + if (!EFI_ERROR(status)) { + boot_services_gone = 1; break; + } } if (retry == 0) { diff --git a/stand/efi/loader/copy.c b/stand/efi/loader/copy.c index e723b61e3bca..b8ed4c8e027e 100644 --- a/stand/efi/loader/copy.c +++ b/stand/efi/loader/copy.c @@ -39,6 +39,11 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" +#define M(x) ((x) * 1024 * 1024) +#define G(x) (1UL * (x) * 1024 * 1024 * 1024) + +extern int boot_services_gone; + #if defined(__i386__) || defined(__amd64__) #include #include @@ -175,24 +180,142 @@ out: #ifndef EFI_STAGING_SIZE #if defined(__arm__) -#define EFI_STAGING_SIZE 32 +#define EFI_STAGING_SIZE M(32) +#else +#define EFI_STAGING_SIZE M(64) +#endif +#endif + +#if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \ + defined(__riscv) +#define EFI_STAGING_2M_ALIGN 1 #else -#define EFI_STAGING_SIZE 64 +#define EFI_STAGING_2M_ALIGN 0 #endif + +#if defined(__amd64__) +#define EFI_STAGING_SLOP M(8) +#else +#define EFI_STAGING_SLOP 0 #endif +static u_long staging_slop = EFI_STAGING_SLOP; + EFI_PHYSICAL_ADDRESS staging, staging_end, staging_base; int stage_offset_set = 0; ssize_t stage_offset; +static void +efi_copy_free(void) +{ + BS->FreePages(staging_base, (staging_end - staging_base) / + EFI_PAGE_SIZE); + stage_offset_set = 0; + stage_offset = 0; +} + +#ifdef __amd64__ +int copy_staging = COPY_STAGING_ENABLE; + +static int +command_copy_staging(int argc, char *argv[]) +{ + static const char *const mode[3] = { + [COPY_STAGING_ENABLE] = "enable", + [COPY_STAGING_DISABLE] = "disable", + [COPY_STAGING_AUTO] = "auto", + }; + int prev, res; + + res = CMD_OK; + if (argc > 2) { + res = CMD_ERROR; + } else if (argc == 2) { + prev = copy_staging; + if (strcmp(argv[1], "enable") == 0) + copy_staging = COPY_STAGING_ENABLE; + else if (strcmp(argv[1], "disable") == 0) + copy_staging = COPY_STAGING_DISABLE; + else if (strcmp(argv[1], "auto") == 0) + copy_staging = COPY_STAGING_AUTO; + else { + printf("usage: copy_staging enable|disable|auto\n"); + res = CMD_ERROR; + } + if (res == CMD_OK && prev != copy_staging) { + printf("changed copy_staging, unloading kernel\n"); + unload(); + efi_copy_free(); + efi_copy_init(); + } + } else { + printf("copy staging: %s\n", mode[copy_staging]); + } + return (res); +} +COMMAND_SET(copy_staging, "copy_staging", "copy staging", command_copy_staging); +#endif + +static int +command_staging_slop(int argc, char *argv[]) +{ + char *endp; + u_long new, prev; + int res; + + res = CMD_OK; + if (argc > 2) { + res = CMD_ERROR; + } else if (argc == 2) { + new = strtoul(argv[1], &endp, 0); + if (*endp != '\0') { + printf("invalid slop value\n"); + res = CMD_ERROR; + } + if (res == CMD_OK && staging_slop != new) { + printf("changed slop, unloading kernel\n"); + unload(); + efi_copy_free(); + efi_copy_init(); + } + } else { + printf("staging slop %#lx\n", staging_slop); + } + return (res); +} +COMMAND_SET(staging_slop, "staging_slop", "set staging slop", + command_staging_slop); + +#if defined(__i386__) || defined(__amd64__) +/* + * The staging area must reside in the the first 1GB or 4GB physical + * memory: see elf64_exec() in + * boot/efi/loader/arch/amd64/elf64_freebsd.c. + */ +static EFI_PHYSICAL_ADDRESS +get_staging_max(void) +{ + EFI_PHYSICAL_ADDRESS res; + +#if defined(__i386__) + res = G(1); +#elif defined(__amd64__) + res = copy_staging == COPY_STAGING_ENABLE ? G(1) : G(4); +#endif + return (res); +} +#define EFI_ALLOC_METHOD AllocateMaxAddress +#else +#define EFI_ALLOC_METHOD AllocateAnyPages +#endif + int efi_copy_init(void) { EFI_STATUS status; - unsigned long nr_pages; - nr_pages = EFI_SIZE_TO_PAGES((EFI_STAGING_SIZE) * 1024 * 1024); + nr_pages = EFI_SIZE_TO_PAGES((EFI_STAGING_SIZE)); #if defined(__i386__) || defined(__amd64__) /* @@ -203,18 +326,10 @@ efi_copy_init(void) if (running_on_hyperv()) efi_verify_staging_size(&nr_pages); - /* - * The staging area must reside in the the first 1GB physical - * memory: see elf64_exec() in - * boot/efi/loader/arch/amd64/elf64_freebsd.c. - */ - staging = 1024*1024*1024; - status = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, - nr_pages, &staging); -#else - status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, - nr_pages, &staging); + staging = get_staging_max(); #endif + status = BS->AllocatePages(EFI_ALLOC_METHOD, EfiLoaderData, + nr_pages, &staging); if (EFI_ERROR(status)) { printf("failed to allocate staging area: %lu\n", EFI_ERROR_CODE(status)); @@ -223,7 +338,7 @@ efi_copy_init(void) staging_base = staging; staging_end = staging + nr_pages * EFI_PAGE_SIZE; -#if defined(__aarch64__) || defined(__arm__) || defined(__riscv) +#if EFI_STAGING_2M_ALIGN /* * Round the kernel load address to a 2MiB value. This is needed * because the kernel builds a page table based on where it has @@ -231,7 +346,7 @@ efi_copy_init(void) * either a 1MiB or 2MiB page for this we need to make sure it * is correctly aligned for both cases. */ - staging = roundup2(staging, 2 * 1024 * 1024); + staging = roundup2(staging, M(2)); #endif return (0); @@ -240,20 +355,42 @@ efi_copy_init(void) static bool efi_check_space(vm_offset_t end) { - EFI_PHYSICAL_ADDRESS addr; + EFI_PHYSICAL_ADDRESS addr, new_base, new_staging; EFI_STATUS status; unsigned long nr_pages; + end = roundup2(end, EFI_PAGE_SIZE); + /* There is already enough space */ - if (end <= staging_end) + if (end + staging_slop <= staging_end) return (true); - end = roundup2(end, EFI_PAGE_SIZE); - nr_pages = EFI_SIZE_TO_PAGES(end - staging_end); + if (boot_services_gone) { + if (end <= staging_end) + return (true); + panic("efi_check_space: cannot expand staging area " + "after boot services were exited\n"); + } + + /* + * Add slop at the end: + * 1. amd64 kernel expects to do some very early allocations + * by carving out memory after kernend. Slop guarantees + * that it does not ovewrite anything useful. + * 2. It seems that initial calculation of the staging size + * could be somewhat smaller than actually copying in after + * boot services are exited. Slop avoids calling + * BS->AllocatePages() when it cannot work. + */ + end += staging_slop; + nr_pages = EFI_SIZE_TO_PAGES(end - staging_end); #if defined(__i386__) || defined(__amd64__) - /* X86 needs all memory to be allocated under the 1G boundary */ - if (end > 1024*1024*1024) + /* + * i386 needs all memory to be allocated under the 1G boundary. + * amd64 needs all memory to be allocated under the 1G or 4G boundary. + */ + if (end > get_staging_max()) goto before_staging; #endif @@ -268,14 +405,12 @@ efi_check_space(vm_offset_t end) before_staging: /* Try allocating space before the previous allocation */ - if (staging < nr_pages * EFI_PAGE_SIZE) { - printf("Not enough space before allocation\n"); - return (false); - } + if (staging < nr_pages * EFI_PAGE_SIZE) + goto expand; addr = staging - nr_pages * EFI_PAGE_SIZE; -#if defined(__aarch64__) || defined(__arm__) || defined(__riscv) +#if EFI_STAGING_2M_ALIGN /* See efi_copy_init for why this is needed */ - addr = rounddown2(addr, 2 * 1024 * 1024); + addr = rounddown2(addr, M(2)); #endif nr_pages = EFI_SIZE_TO_PAGES(staging_base - addr); status = BS->AllocatePages(AllocateAddress, EfiLoaderData, nr_pages, @@ -288,11 +423,42 @@ before_staging: staging_base = addr; memmove((void *)(uintptr_t)staging_base, (void *)(uintptr_t)staging, staging_end - staging); - stage_offset -= (staging - staging_base); + stage_offset -= staging - staging_base; staging = staging_base; return (true); } +expand: + nr_pages = EFI_SIZE_TO_PAGES(end - (vm_offset_t)staging); +#if EFI_STAGING_2M_ALIGN + nr_pages += M(2) / EFI_PAGE_SIZE; +#endif +#if defined(__i386__) || defined(__amd64__) + new_base = get_staging_max(); +#endif + status = BS->AllocatePages(EFI_ALLOC_METHOD, EfiLoaderData, + nr_pages, &new_base); + if (!EFI_ERROR(status)) { +#if EFI_STAGING_2M_ALIGN + new_staging = roundup2(new_base, M(2)); +#else + new_staging = new_base; +#endif + /* + * Move the old allocation and update the state so + * translation still works. + */ + memcpy((void *)(uintptr_t)new_staging, + (void *)(uintptr_t)staging, staging_end - staging); + BS->FreePages(staging_base, (staging_end - staging_base) / + EFI_PAGE_SIZE); + stage_offset -= staging - new_staging; + staging = new_staging; + staging_end = new_base + nr_pages * EFI_PAGE_SIZE; + staging_base = new_base; + return (true); + } + printf("efi_check_space: Unable to expand staging area\n"); return (false); } @@ -335,7 +501,6 @@ efi_copyout(const vm_offset_t src, void *dest, const size_t len) return (len); } - ssize_t efi_readin(readin_handle_t fd, vm_offset_t dest, const size_t len) { @@ -364,3 +529,8 @@ efi_copy_finish(void) while (src < last) *dst++ = *src++; } + +void +efi_copy_finish_nop(void) +{ +} diff --git a/stand/efi/loader/loader_efi.h b/stand/efi/loader/loader_efi.h index 4d077514e423..8254d16b1592 100644 --- a/stand/efi/loader/loader_efi.h +++ b/stand/efi/loader/loader_efi.h @@ -34,6 +34,15 @@ #include #include +#ifdef __amd64__ +enum { + COPY_STAGING_ENABLE, + COPY_STAGING_DISABLE, + COPY_STAGING_AUTO, +}; +extern int copy_staging; +#endif + int efi_autoload(void); int efi_copy_init(void); @@ -44,5 +53,6 @@ ssize_t efi_readin(readin_handle_t fd, vm_offset_t dest, const size_t len); void * efi_translate(vm_offset_t ptr); void efi_copy_finish(void); +void efi_copy_finish_nop(void); #endif /* _LOADER_EFI_COPY_H_ */ From owner-dev-commits-src-main@freebsd.org Sun Aug 8 20:27:43 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9675D66305A; Sun, 8 Aug 2021 20:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjW3z3VJNz3kT6; Sun, 8 Aug 2021 20:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FEEB1B02F; Sun, 8 Aug 2021 20:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178KRhWS074987; Sun, 8 Aug 2021 20:27:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178KRhaM074986; Sun, 8 Aug 2021 20:27:43 GMT (envelope-from git) Date: Sun, 8 Aug 2021 20:27:43 GMT Message-Id: <202108082027.178KRhaM074986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 5f2fe88377b1 - main - felix: Add autogenerated files to Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f2fe88377b1b1e57c392e2284e2080f13bf3427 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 20:27:43 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=5f2fe88377b1b1e57c392e2284e2080f13bf3427 commit 5f2fe88377b1b1e57c392e2284e2080f13bf3427 Author: Kornel Duleba AuthorDate: 2021-08-05 12:07:22 +0000 Commit: Marcin Wojtas CommitDate: 2021-08-08 20:27:15 +0000 felix: Add autogenerated files to Makefile A module makefile must list all the header files it uses which are generated at build time from interface definitions (.m files) in its SRCS list. Fixes: 451bcf1b3601 Reported by: ian --- sys/modules/felix/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/modules/felix/Makefile b/sys/modules/felix/Makefile index 47747ffaa11e..a9eac1080c91 100644 --- a/sys/modules/felix/Makefile +++ b/sys/modules/felix/Makefile @@ -30,5 +30,6 @@ KMOD = felix SRCS = felix.c etherswitch_if.c etherswitch_if.h +SRCS += bus_if.h device_if.h miibus_if.h ofw_bus_if.h pci_if.h .include From owner-dev-commits-src-main@freebsd.org Sun Aug 8 20:27:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CDA7E663217; Sun, 8 Aug 2021 20:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjW404dXbz3kT9; Sun, 8 Aug 2021 20:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81A071ADEA; Sun, 8 Aug 2021 20:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178KRiw4075011; Sun, 8 Aug 2021 20:27:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178KRiZq075010; Sun, 8 Aug 2021 20:27:44 GMT (envelope-from git) Date: Sun, 8 Aug 2021 20:27:44 GMT Message-Id: <202108082027.178KRiZq075010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 4b64193bed12 - main - enetc: Force correct order with DRIVER_MODULE_ORDERED MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b64193bed12f604c1aba348472c98f7f8e64316 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 20:27:44 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=4b64193bed12f604c1aba348472c98f7f8e64316 commit 4b64193bed12f604c1aba348472c98f7f8e64316 Author: Kornel Duleba AuthorDate: 2021-08-05 12:09:08 +0000 Commit: Marcin Wojtas CommitDate: 2021-08-08 20:27:15 +0000 enetc: Force correct order with DRIVER_MODULE_ORDERED The toolchain can reorder symbols, meaning that changing the order of DRIVER_MODULE macros is not enough to ensure that miibus gets registered first. Use DRIVER_MODULE_ORDERED instead to fix the problem properly. Fixes: 5ad6d28cbe6b ("enetc: Support building the driver as a loadable module.") Reported by: jhb --- sys/dev/enetc/if_enetc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c index 46327eb419bf..2a72f807acd7 100644 --- a/sys/dev/enetc/if_enetc.c +++ b/sys/dev/enetc/if_enetc.c @@ -159,7 +159,9 @@ static driver_t enetc_driver = { static devclass_t enetc_devclass; DRIVER_MODULE(miibus, enetc, miibus_driver, miibus_devclass, NULL, NULL); -DRIVER_MODULE(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL); +/* Make sure miibus gets procesed first. */ +DRIVER_MODULE_ORDERED(enetc, pci, enetc_driver, enetc_devclass, NULL, NULL, + SI_ORDER_ANY); MODULE_VERSION(enetc, 1); IFLIB_PNP_INFO(pci, enetc, enetc_vendor_info_array); From owner-dev-commits-src-main@freebsd.org Sun Aug 8 20:27:46 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B25F66360B; Sun, 8 Aug 2021 20:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjW415kBDz3kTG; Sun, 8 Aug 2021 20:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A46431AFA8; Sun, 8 Aug 2021 20:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178KRjHH075041; Sun, 8 Aug 2021 20:27:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178KRjBV075040; Sun, 8 Aug 2021 20:27:45 GMT (envelope-from git) Date: Sun, 8 Aug 2021 20:27:45 GMT Message-Id: <202108082027.178KRjBV075040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: ad560dee552e - main - enetc: Add autogenerated files to Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad560dee552e24145b6a527ee94ef9e29a2d9cd2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 20:27:46 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=ad560dee552e24145b6a527ee94ef9e29a2d9cd2 commit ad560dee552e24145b6a527ee94ef9e29a2d9cd2 Author: Marcin Wojtas AuthorDate: 2021-08-08 20:23:44 +0000 Commit: Marcin Wojtas CommitDate: 2021-08-08 20:27:16 +0000 enetc: Add autogenerated files to Makefile A module makefile must list all the header files it uses which are generated at build time from interface definitions (.m files) in its SRCS list. Fixes: 5ad6d28cbe6b ("enetc: Support building the driver as a loadable module.") --- sys/modules/enetc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/modules/enetc/Makefile b/sys/modules/enetc/Makefile index 694ec2043f37..1f6bf36927bb 100644 --- a/sys/modules/enetc/Makefile +++ b/sys/modules/enetc/Makefile @@ -4,5 +4,6 @@ KMOD = if_enetc SRCS = if_enetc.c enetc_mdio.c +SRCS += bus_if.h device_if.h ifdi_if.h miibus_if.h ofw_bus_if.h pci_if.h .include From owner-dev-commits-src-main@freebsd.org Sun Aug 8 21:27:12 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95462664084; Sun, 8 Aug 2021 21:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjXNc3p6xz3sdx; Sun, 8 Aug 2021 21:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69F911BF9F; Sun, 8 Aug 2021 21:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178LRCAh054895; Sun, 8 Aug 2021 21:27:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178LRCXH054894; Sun, 8 Aug 2021 21:27:12 GMT (envelope-from git) Date: Sun, 8 Aug 2021 21:27:12 GMT Message-Id: <202108082127.178LRCXH054894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 66b8eced9723 - main - dtrace: use %zu format specifier for data of size_t type MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66b8eced9723b5b1fa5b05b286a9312a4d32237b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 21:27:12 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=66b8eced9723b5b1fa5b05b286a9312a4d32237b commit 66b8eced9723b5b1fa5b05b286a9312a4d32237b Author: Konstantin Belousov AuthorDate: 2021-08-08 21:25:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-08-08 21:27:04 +0000 dtrace: use %zu format specifier for data of size_t type Sponsored by: The FreeBSD Foundation --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 2 +- sys/cddl/dev/dtrace/dtrace_load.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index ca6fa5481856..a59edb05e2b6 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -17106,7 +17106,7 @@ dtrace_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) offsetof(dtrace_probe_t, dtpr_prevname)); if (dtrace_retain_max < 1) { - cmn_err(CE_WARN, "illegal value (%lu) for dtrace_retain_max; " + cmn_err(CE_WARN, "illegal value (%zu) for dtrace_retain_max; " "setting to 1", dtrace_retain_max); dtrace_retain_max = 1; } diff --git a/sys/cddl/dev/dtrace/dtrace_load.c b/sys/cddl/dev/dtrace/dtrace_load.c index 029af60d1cd8..232d7df6999c 100644 --- a/sys/cddl/dev/dtrace/dtrace_load.c +++ b/sys/cddl/dev/dtrace/dtrace_load.c @@ -119,7 +119,7 @@ dtrace_load(void *dummy) offsetof(dtrace_probe_t, dtpr_prevname)); if (dtrace_retain_max < 1) { - cmn_err(CE_WARN, "illegal value (%lu) for dtrace_retain_max; " + cmn_err(CE_WARN, "illegal value (%zu) for dtrace_retain_max; " "setting to 1", dtrace_retain_max); dtrace_retain_max = 1; } From owner-dev-commits-src-main@freebsd.org Sun Aug 8 22:29:57 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A2976697BD; Sun, 8 Aug 2021 22:29:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GjYn06sqBz4b2G; Sun, 8 Aug 2021 22:29:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF55D1CD4B; Sun, 8 Aug 2021 22:29:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 178MTuoK047591; Sun, 8 Aug 2021 22:29:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 178MTutC047590; Sun, 8 Aug 2021 22:29:56 GMT (envelope-from git) Date: Sun, 8 Aug 2021 22:29:56 GMT Message-Id: <202108082229.178MTutC047590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: e5018628e76a - main - kbdmux(4): Make callout handler mpsafe. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5018628e76a27e0f61ca03e2aa2247b3c62a158 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Aug 2021 22:29:57 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=e5018628e76a27e0f61ca03e2aa2247b3c62a158 commit e5018628e76a27e0f61ca03e2aa2247b3c62a158 Author: Alexander Motin AuthorDate: 2021-08-08 22:19:08 +0000 Commit: Alexander Motin CommitDate: 2021-08-08 22:29:48 +0000 kbdmux(4): Make callout handler mpsafe. Both callout and taskqueue now have drain() routines not requiring external locking. It allows to remove TASK flag and manual drain, so the only thing remaining for lock to protect inside the callout handler is ks_inq_length zero comparison, that can be lockless. MFC after: 2 weeks --- sys/dev/kbdmux/kbdmux.c | 61 ++++++++----------------------------------------- 1 file changed, 10 insertions(+), 51 deletions(-) diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index 409e52c21716..3bbdc78b7c1a 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -105,12 +105,6 @@ MALLOC_DEFINE(M_KBDMUX, KEYBOARD_NAME, "Keyboard multiplexor"); mtx_unlock(&(s)->ks_lock) #define KBDMUX_LOCK_ASSERT(s, w) \ mtx_assert(&(s)->ks_lock, (w)) -#define KBDMUX_SLEEP(s, f, d, t) \ - msleep(&(s)->f, &(s)->ks_lock, PCATCH | (PZERO + 1), (d), (t)) -#define KBDMUX_CALLOUT_INIT(s) \ - callout_init_mtx(&(s)->ks_timo, &(s)->ks_lock, 0) -#define KBDMUX_QUEUE_INTR(s) \ - taskqueue_enqueue(taskqueue_swi_giant, &(s)->ks_task) #else #define KBDMUX_LOCK_DECL_GLOBAL @@ -124,12 +118,6 @@ MALLOC_DEFINE(M_KBDMUX, KEYBOARD_NAME, "Keyboard multiplexor"); #define KBDMUX_LOCK_ASSERT(s, w) -#define KBDMUX_SLEEP(s, f, d, t) \ - tsleep(&(s)->f, PCATCH | (PZERO + 1), (d), (t)) -#define KBDMUX_CALLOUT_INIT(s) \ - callout_init(&(s)->ks_timo, 0) -#define KBDMUX_QUEUE_INTR(s) \ - taskqueue_enqueue(taskqueue_swi_giant, &(s)->ks_task) #endif /* not yet */ /* @@ -157,7 +145,6 @@ struct kbdmux_state int ks_flags; /* flags */ #define COMPOSE (1 << 0) /* compose char flag */ -#define TASK (1 << 2) /* interrupt task queued */ int ks_polling; /* poll nesting count */ int ks_mode; /* K_XLATE, K_RAW, K_CODE */ @@ -223,16 +210,8 @@ void kbdmux_kbd_intr(void *xkbd, int pending) { keyboard_t *kbd = (keyboard_t *) xkbd; - kbdmux_state_t *state = (kbdmux_state_t *) kbd->kb_data; kbdd_intr(kbd, NULL); - - KBDMUX_LOCK(state); - - state->ks_flags &= ~TASK; - wakeup(&state->ks_task); - - KBDMUX_UNLOCK(state); } /* @@ -243,23 +222,12 @@ kbdmux_kbd_intr_timo(void *xstate) { kbdmux_state_t *state = (kbdmux_state_t *) xstate; - KBDMUX_LOCK_ASSERT(state, MA_OWNED); - - if (callout_pending(&state->ks_timo)) - return; /* callout was reset */ - - if (!callout_active(&state->ks_timo)) - return; /* callout was stopped */ - - callout_deactivate(&state->ks_timo); - /* queue interrupt task if needed */ - if (state->ks_inq_length > 0 && !(state->ks_flags & TASK) && - KBDMUX_QUEUE_INTR(state) == 0) - state->ks_flags |= TASK; + if (state->ks_inq_length > 0) + taskqueue_enqueue(taskqueue_swi_giant, &state->ks_task); /* re-schedule timeout */ - callout_reset(&state->ks_timo, TICKS, kbdmux_kbd_intr_timo, state); + callout_schedule(&state->ks_timo, TICKS); } /* @@ -299,9 +267,8 @@ kbdmux_kbd_event(keyboard_t *kbd, int event, void *arg) } /* queue interrupt task if needed */ - if (state->ks_inq_length > 0 && !(state->ks_flags & TASK) && - KBDMUX_QUEUE_INTR(state) == 0) - state->ks_flags |= TASK; + if (state->ks_inq_length > 0) + taskqueue_enqueue(taskqueue_swi_giant, &state->ks_task); KBDMUX_UNLOCK(state); } break; @@ -444,7 +411,7 @@ kbdmux_init(int unit, keyboard_t **kbdp, void *arg, int flags) KBDMUX_LOCK_INIT(state); TASK_INIT(&state->ks_task, 0, kbdmux_kbd_intr, (void *) kbd); - KBDMUX_CALLOUT_INIT(state); + callout_init(&state->ks_timo, 1); SLIST_INIT(&state->ks_kbds); } else if (KBD_IS_INITIALIZED(*kbdp) && KBD_IS_CONFIGURED(*kbdp)) { return (0); @@ -521,9 +488,7 @@ kbdmux_init(int unit, keyboard_t **kbdp, void *arg, int flags) KBD_CONFIG_DONE(kbd); - KBDMUX_LOCK(state); callout_reset(&state->ks_timo, TICKS, kbdmux_kbd_intr_timo, state); - KBDMUX_UNLOCK(state); } return (0); @@ -555,16 +520,8 @@ kbdmux_term(keyboard_t *kbd) kbdmux_state_t *state = (kbdmux_state_t *) kbd->kb_data; kbdmux_kbd_t *k; - KBDMUX_LOCK(state); - - /* kill callout */ - callout_stop(&state->ks_timo); - - /* wait for interrupt task */ - while (state->ks_flags & TASK) - KBDMUX_SLEEP(state, ks_task, "kbdmuxc", 0); - /* release all keyboards from the mux */ + KBDMUX_LOCK(state); while ((k = SLIST_FIRST(&state->ks_kbds)) != NULL) { kbd_release(k->kbd, &k->kbd); SLIST_REMOVE_HEAD(&state->ks_kbds, next); @@ -573,9 +530,11 @@ kbdmux_term(keyboard_t *kbd) free(k, M_KBDMUX); } - KBDMUX_UNLOCK(state); + callout_drain(&state->ks_timo); + taskqueue_drain(taskqueue_swi_giant, &state->ks_task); + kbd_unregister(kbd); #ifdef EVDEV_SUPPORT