FreeBSD/src 8840941sys/kern sys_process.c

kern_ptrace(): reduce code duplication

(cherry picked from commit 9b21a52495758294e3a50542a59bc47a0c184173)
DeltaFile
+15-10sys/kern/sys_process.c
+15-101 files

FreeBSD/src 2cbf21fsys/kern kern_sig.c

thread_stopped(): style

(cherry picked from commit 2038232e3e40cfc3dedba1a9f4a66984448eca1e)
DeltaFile
+2-2sys/kern/kern_sig.c
+2-21 files

FreeBSD/src 1e5d774sys/kern sys_process.c

kern/sys_ptrace: do not skip P2_PTRACEREQ wait for PT_CLEARSTEP/PT_GET_CHILDREN

(cherry picked from commit eca7b25c101a240472c4c274e725bc294284c827)
DeltaFile
+16-17sys/kern/sys_process.c
+16-171 files

FreeBSD/src 18ea957sys/kern kern_prot.c

getpgrp(2), getsid(2): allow to call on zombies

(cherry picked from commit 8f320c2bc473a775ea9a55d17fa61f729e593867)
DeltaFile
+8-4sys/kern/kern_prot.c
+8-41 files

FreeBSD/src c0addb9sys/compat/freebsd32 freebsd32_misc.c, sys/kern sys_process.c

ptrace(2): add PT_GET_CHILDREN

(cherry picked from commit d3b7bbee9275d5a3c58a9e75d1fffc60a9333352)
DeltaFile
+137-2sys/kern/sys_process.c
+16-0sys/compat/freebsd32/freebsd32_misc.c
+12-0sys/sys/ptrace.h
+165-23 files

FreeBSD/src 4c6c49alib/libsys ptrace.2

ptrace.2: document PT_GET_CHILDREN

(cherry picked from commit 6dbeaf1afaba52ba224f24773cbaac6317e11ff2)
DeltaFile
+55-0lib/libsys/ptrace.2
+55-01 files

FreeBSD/src 643fe6blib/libsys ptrace.2

ptrace.2: Document PT_SET_SC_RET

(cherry picked from commit f967dd04c880e9c9c68cd20de135d77b3ca1c26d)
DeltaFile
+20-0lib/libsys/ptrace.2
+20-01 files

FreeBSD/src 03c5b4dsys/compat/freebsd32 freebsd32_misc.c, sys/kern sys_process.c subr_syscall.c

ptrace(2): PT_SET_SC_RET request

(cherry picked from commit fd5faa5629aed98f4daee84063da3494c4d1eee9)
DeltaFile
+24-0sys/kern/sys_process.c
+19-0sys/compat/freebsd32/freebsd32_misc.c
+8-4sys/kern/subr_syscall.c
+2-1sys/sys/ptrace.h
+1-0sys/sys/proc.h
+54-55 files

FreeBSD/src 02b4a95sys/kern vfs_lookup.c vfs_syscalls.c

lookup: do not return vp_crossmp as dvp for mount over the reg file

(cherry picked from commit 29d1a3248a6da1ed9f1a46d7d525fb779306a90f)
DeltaFile
+30-4sys/kern/vfs_lookup.c
+8-1sys/kern/vfs_syscalls.c
+38-52 files

FreeBSD/src 3987022sys/x86/include apicvar.h, sys/x86/xen xen_arch_intr.c

x86 xen: provide the prototype for xen_arch_intr_handle_upcall() in x86/apicvar.h

(cherry picked from commit 0e5b1384df10e9b9700047cb79c347874212d2a9)
DeltaFile
+2-0sys/x86/include/apicvar.h
+0-1sys/x86/xen/xen_arch_intr.c
+2-12 files

FreeBSD/src 95439b8sys/dev/sound/pci envy24.c envy24ht.c

sound: Stop using legacy u_int types

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+107-107sys/dev/sound/pci/envy24.c
+100-100sys/dev/sound/pci/envy24ht.c
+84-84sys/dev/sound/pci/maestro3.c
+65-65sys/dev/sound/pci/emu10k1.c
+49-49sys/dev/sound/pci/vibes.c
+48-48sys/dev/sound/pci/cs4281.c
+453-45338 files not shown
+1,016-1,01644 files

FreeBSD/src 34ae0f7sys/cam/scsi scsi_cd.c

cam/cd: avoid integer divide fault in cdstart()

If something goes very badly (e.g. forcibly removing a medium while
the OS tries to start it), this could end up in params.blksize being 0
(and params.disksize 1).  Avoid an integer divide fault, panicking the
kernel, by bailing out before.

MFC after:      3 days
DeltaFile
+10-0sys/cam/scsi/scsi_cd.c
+10-01 files

FreeBSD/src 038a737sys/modules/mt76/core Makefile, sys/modules/mt76/mt7921 Makefile

mt76: disable debugfs due to missing piece still in review

Until D57524 is not reviewed and committed we will have a missing
function declaration which prevents us to compile (in) debugfs for
mt76 core and mt7921.  Temporary disable debugfs again.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit c589dc4ef77d8e165e449a861c3705002ca4a762)
DeltaFile
+1-1sys/modules/mt76/core/Makefile
+1-1sys/modules/mt76/mt7921/Makefile
+2-22 files

FreeBSD/src ea8db6bsys/modules/mt76 Makefile.inc, sys/modules/mt76/core Makefile

mt76: further adjust debugfs compile time options

The debugfs options between the various modules (core and chipsets)
are not 100% de-coupled.  This means we may run into unresolveable
symbols at load time of the modules if we enable certain options
generally or for core but not for the chipset.
For now: always build the core module with debugfs support.
Migrate the CONFIG_MAC80211_DEBUGFS flag into the Makefile of each
chipset so we can individually turn it on.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit ec17c2454bf03f954e460bfe3c95e35f638ba71e)
DeltaFile
+0-5sys/modules/mt76/Makefile.inc
+3-0sys/modules/mt76/core/Makefile
+1-0sys/modules/mt76/mt7615/Makefile
+1-0sys/modules/mt76/mt7915/Makefile
+1-0sys/modules/mt76/mt7921/Makefile
+1-0sys/modules/mt76/mt7925/Makefile
+7-51 files not shown
+8-57 files

FreeBSD/src 66891edsys/compat/linuxkpi/common/include/net/page_pool helpers.h types.h, sys/compat/linuxkpi/common/src linuxkpi_page_pool.c

LinuxKPI: page pool updates and add to the build

Split implementation out from the header files.

This "page pool" is the very minimalistic version we need in order to
support packets on mt76.
We allocate the page pool in order to have the meta data available of
which we only make limited use.
This implementation does no pooling, it does no page fragments for now,
it always hands out a full page and frees it upon return.

It is written in a way that it can be in the tree before the 'struct page'
work it depends on has landed in order to reduce friction for people who
want to try mt7921 (or others later) upfront.  We use the same #ifdef
as in the struct page work for that reason so one knob will turn everything
on or off.

Once the struct page work has landed and settled we can start filling this
with more complexity.

    [9 lines not shown]
DeltaFile
+156-0sys/compat/linuxkpi/common/src/linuxkpi_page_pool.c
+30-28sys/compat/linuxkpi/common/include/net/page_pool/helpers.h
+18-1sys/compat/linuxkpi/common/include/net/page_pool/types.h
+2-0sys/conf/files
+1-0sys/modules/linuxkpi/Makefile
+207-295 files

FreeBSD/src 7e06bfdsys/compat/linuxkpi/common/include/linux page.h

LinuxKPI: page.h: resort lines

Two of the "page macros" can be abstracted elsewhere in the upcoming
struct page work, so sort them away from the four which are here to
stay.

No functional change.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D58299

(cherry picked from commit 0b8d22019dcf708a8d047817963658783cd53c46)
DeltaFile
+3-2sys/compat/linuxkpi/common/include/linux/page.h
+3-21 files

FreeBSD/src 86da56esys/compat/linuxkpi/common/include/linux page.h

LinuxKPI: page.h: use atop() and ptoa() instead of PAGE_SHIFT

With upcoming changes to 'struct page' this will make the lines
easier to read by using the predefined macros from param.h.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    markj, kib
Differential Revision: https://reviews.freebsd.org/D58298

(cherry picked from commit f45506c6a6f4742cd5129d636902b61045c4754b)
DeltaFile
+2-2sys/compat/linuxkpi/common/include/linux/page.h
+2-21 files

FreeBSD/src 9a52d30sys/compat/linuxkpi/common/src linux_page.c

LinuxKPI: prefer struct page [*] over struct vm_page[_t]

LinuxKPI is based on Linux 'struct page' which is currently aliased
to struct vm_page.  Upcoming changes may change that so start using
'struct page *' instead vm_page_t to make future changes transparent.

This is a continuation of 9e9c682ff3a1 and should be a NOP.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste (no objections)
Differential Revision: https://reviews.freebsd.org/D58297

(cherry picked from commit ac4b43b7b9dd2dac5d7caf5d4c7aa0d670d38aec)
DeltaFile
+2-2sys/compat/linuxkpi/common/src/linux_page.c
+2-21 files

FreeBSD/src b17957bsys/compat/linuxkpi/common/include/linux page.h

LinuxKPI: move clear_page() within the linux/page.h file

clear_page() would normally live in asm/page.h but adding the file
and fixing the dependencies would be too much for a single line.

Move the function to the end of the file with a clear separator
and make it clear that it does not operate on a 'struct page'
but on a page address by changing the argument name and leaving
a comment.

The function is currently used by at least mthca(4) as the only
in-tree consumer, and drm-kmod ttm_pool.c.

No functional changes.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D58296

(cherry picked from commit 0845efe88b355547b103dca90e69e46a3ebdd016)
DeltaFile
+7-1sys/compat/linuxkpi/common/include/linux/page.h
+7-11 files

FreeBSD/src b85f775sys/compat/linuxkpi/common/include/linux scatterlist.h

LinuxKPI: sg_page() remove superfluous ()

Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D58295

(cherry picked from commit fe1784004d6e43b3080ab7b7115ee0ea3ba317f2)
DeltaFile
+1-1sys/compat/linuxkpi/common/include/linux/scatterlist.h
+1-11 files

FreeBSD/src a7d0df9sys/compat/linuxkpi/common/src linux_pci.c

LinuxKPI: pci: fix dma handle type in match function

dma_addr_t is a vm_paddr_t which is a uint of some width.  Rather than
passing pointers of it around pass the value.

Comparing the addresses of different storage for the same dma handle
(the actual bug here) will not work when passed to the devres match
function.

Sponsored by:   The FreeBSD Foundation
Fixes:          0a575891211ef ("implement dmam_free_coherent()")
Differential Revision: https://reviews.freebsd.org/D58285

(cherry picked from commit 2099bf27126f6fef10128c3cd0ea8476c88b28c5)
DeltaFile
+4-4sys/compat/linuxkpi/common/src/linux_pci.c
+4-41 files

FreeBSD/src 94ab8desys/compat/linuxkpi/common/src linux_80211_macops.c linux_80211.c

LinuxKPI: 802.11: always lock around (*set_{frag,rts}_threshold)

We would lock the downcalls during normal operation but not during
vap (vif) creation as there was no need for locking.
Add the missing locking there as drivers seem to always expect it
(by assertion) and cannot distinguish between state.
Add the assertions to the downcalls as we need both of them locked
and both of them can sleep.

PR:             296185 ("rtw89(4) freezes the system with INVARIANTS kernel")
Debugged by:    Artem Bunichev (temcbun gmail.com)
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 5d479b75a8944faeabb367d1234a9fc3fefa8df1)
DeltaFile
+6-0sys/compat/linuxkpi/common/src/linux_80211_macops.c
+2-0sys/compat/linuxkpi/common/src/linux_80211.c
+8-02 files

FreeBSD/src 912251asys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: stop ieee80211_start_tx_ba_session() if no HT supported

rtw89(4) would constantly try to start a TX BlockACK session even if no
HT or higher was available.  The only way to stop this (currently) is
to return -EINVAL instead of any other error.

Note: we should investigate if/when to call (*set_tid_config)() as that
will also offer the ability to forbid BA.

Sponsored by:   The FreeBSD Foundation
Reported by:    arved, bnovkov
Tested by:      bnovkov

(cherry picked from commit 8a1600428e937a41b65869c78ce847f7cabbad24)
DeltaFile
+1-1sys/compat/linuxkpi/common/src/linux_80211.c
+1-11 files

FreeBSD/src b37a29fsys/compat/linuxkpi/common/include/linux skbuff.h, sys/compat/linuxkpi/common/src linux_skbuff.c

LinuxKPI: skbuff: add initial page pool support

Add an internal flag which is set by skb_mark_for_recycle() and upon
"skb_free" then selects whether the skb is freed or returned to the
page pool.
There will likely be more details to figure out once the LinuxKPI page
work is done and we support more of the page pool than the bare minimum.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit e4795d3dbee71c463429e2901dad111fbc2d08fc)
DeltaFile
+8-1sys/compat/linuxkpi/common/src/linux_skbuff.c
+3-2sys/compat/linuxkpi/common/include/linux/skbuff.h
+11-32 files

FreeBSD/src 36ed9a8sys/compat/linuxkpi/common/src linux_skbuff.c

LinuxKPI: skbuff: add reference counting to the skb

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit cb13e826ec45e11e964e1921d281e0a06ca5e152)
DeltaFile
+21-0sys/compat/linuxkpi/common/src/linux_skbuff.c
+21-01 files

FreeBSD/src be02517sys/compat/linuxkpi/common/src linux_skbuff.c

LinuxKPI: skbuff: add support for frags in linuxkpi_skb_copy()

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 1e4ec01603c4b1e0b0eb524f28f731eb5cb5f6dc)
DeltaFile
+10-4sys/compat/linuxkpi/common/src/linux_skbuff.c
+10-41 files

FreeBSD/src 4352733sys/compat/linuxkpi/common/include/linux skbuff.h, sys/compat/linuxkpi/common/src linux_skbuff.c

LinuxKPI: skbuff: implement __skb_linearize()

skb_linearize() is used by mt7921, mt7925, and in the general mt76 tx dma
code. __skb_linearize() is used in the general iwlwifi TX code but given
the way we currently create TX skbs in LinuxKPI 802.11 we never hit that
case.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 9de11cc26ab61d7f80e8af84dbc55d8cbd6f832d)
DeltaFile
+60-0sys/compat/linuxkpi/common/src/linux_skbuff.c
+3-3sys/compat/linuxkpi/common/include/linux/skbuff.h
+63-32 files

FreeBSD/src 271a659sys/compat/linuxkpi/common/include/linux skbuff.h

LinuxKPI: skbuff: implement napi_build_skb()

Implement napi_build_skb() around linuxkpi_build_skb().

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit b36460e5ec4659d0fa14b35c9342c5a154b3db7d)
DeltaFile
+6-2sys/compat/linuxkpi/common/include/linux/skbuff.h
+6-21 files

FreeBSD/src 299f6dcsys/compat/linuxkpi/common/include/linux skbuff.h

LinuxKPI: skbuff: add skb_put_zero()

Add skb_put_zero() as a simple wrapper around __skb_put_zero().

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 32c983449a7c802bf47578d5304c6d505db7821a)
DeltaFile
+7-1sys/compat/linuxkpi/common/include/linux/skbuff.h
+7-11 files

FreeBSD/src f16c8e3sys/compat/linuxkpi/common/include/linux skbuff.h

LinuxKPI: skbuff: improve debugging

Deal with SKB_TRACE_FMT optional arguments; while here properly indent.

Add KASSERT to __skb_unlink() to catch incorrect skbuffs encountered
while debugging a wireless driver (which had other pre-conditions failing).

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit e5bcf7b99fcbe06d381525ffdd5027b846cdc1d3)
DeltaFile
+5-3sys/compat/linuxkpi/common/include/linux/skbuff.h
+5-31 files