Re: [PATCH] docs: submitting-patches: document the format for affiliation

2025-02-04 Thread Yanteng Si
在 2025/2/4 01:46, Jakub Kicinski 写道: Adding company name in round brackets to From/SoB lines is fairly common, but I don't see it documented anywhere. Every now and then people try to add the sponsorship lines to the commit message, fun example from this merge window: Sponsored by: The

[PATCH net-next v5 7/7] tap: Use tun's vnet-related code

2025-02-04 Thread Akihiko Odaki
tun and tap implements the same vnet-related features so reuse the code. Signed-off-by: Akihiko Odaki --- drivers/net/tap.c | 152 ++ 1 file changed, 16 insertions(+), 136 deletions(-) diff --git a/drivers/net/tap.c b/drivers/net/tap.c index

[PATCH net-next v5 6/7] tap: Keep hdr_len in tap_get_user()

2025-02-04 Thread Akihiko Odaki
hdr_len is repeatedly used so keep it in a local variable. Signed-off-by: Akihiko Odaki --- drivers/net/tap.c | 30 +- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/drivers/net/tap.c b/drivers/net/tap.c index 5aa41d5f7765a6dcf185bccd3cba2299bad89398

[PATCH net-next v5 5/7] tun: Extract the vnet handling code

2025-02-04 Thread Akihiko Odaki
The vnet handling code will be reused by tap. Signed-off-by: Akihiko Odaki --- MAINTAINERS| 2 +- drivers/net/tun.c | 179 +-- drivers/net/tun_vnet.h | 184 + 3 files changed, 187 inser

[PATCH net-next v5 4/7] tun: Decouple vnet handling

2025-02-04 Thread Akihiko Odaki
Decouple the vnet handling code so that we can reuse it for tap. Signed-off-by: Akihiko Odaki Reviewed-by: Willem de Bruijn --- drivers/net/tun.c | 237 -- 1 file changed, 139 insertions(+), 98 deletions(-) diff --git a/drivers/net/tun.c b/dr

[PATCH net-next v5 3/7] tun: Decouple vnet from tun_struct

2025-02-04 Thread Akihiko Odaki
Decouple vnet-related functions from tun_struct so that we can reuse them for tap in the future. Signed-off-by: Akihiko Odaki Reviewed-by: Willem de Bruijn --- drivers/net/tun.c | 51 ++- 1 file changed, 26 insertions(+), 25 deletions(-) diff --g

[PATCH net-next v5 2/7] tun: Keep hdr_len in tun_get_user()

2025-02-04 Thread Akihiko Odaki
hdr_len is repeatedly used so keep it in a local variable. Signed-off-by: Akihiko Odaki Reviewed-by: Willem de Bruijn --- drivers/net/tun.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 452fc5104260fe7

[PATCH net-next v5 1/7] tun: Refactor CONFIG_TUN_VNET_CROSS_LE

2025-02-04 Thread Akihiko Odaki
Check IS_ENABLED(CONFIG_TUN_VNET_CROSS_LE) to save some lines and make future changes easier. Signed-off-by: Akihiko Odaki Reviewed-by: Willem de Bruijn --- drivers/net/tun.c | 26 -- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/drivers/net/tun.c b/driv

[PATCH net-next v5 0/7] tun: Unify vnet implementation

2025-02-04 Thread Akihiko Odaki
When I implemented virtio's hash-related features to tun/tap [1], I found tun/tap does not fill the entire region reserved for the virtio header, leaving some uninitialized hole in the middle of the buffer after read()/recvmesg(). This series fills the uninitialized hole. More concretely, the num_

Re: [PATCH v7 01/20] fuse: Fix dax truncate/punch_hole fault path

2025-02-04 Thread Balbir Singh
On 2/5/25 09:47, Alistair Popple wrote: > FS DAX requires file systems to call into the DAX layout prior to unlinking > inodes to ensure there is no ongoing DMA or other remote access to the > direct mapped page. The fuse file system implements > fuse_dax_break_layouts() to do this which includes a

[PATCH v9 13/26] prctl: arch-agnostic prctl for indirect branch tracking

2025-02-04 Thread Deepak Gupta
Three architectures (x86, aarch64, riscv) have support for indirect branch tracking feature in a very similar fashion. On a very high level, indirect branch tracking is a CPU feature where CPU tracks branches which uses memory operand to perform control transfer in program. As part of this tracking

Re: [PATCH v7 02/20] fs/dax: Return unmapped busy pages from dax_layout_busy_page_range()

2025-02-04 Thread Balbir Singh
On 2/5/25 09:47, Alistair Popple wrote: > dax_layout_busy_page_range() is used by file systems to scan the DAX > page-cache to unmap mapping pages from user-space and to determine if > any pages in the given range are busy, either due to ongoing DMA or > other get_user_pages() usage. > > Currently

[PATCH bpf-next v8 5/5] igc: Add launch time support to XDP ZC

2025-02-04 Thread Song Yoong Siang
Enable Launch Time Control (LTC) support for XDP zero copy via XDP Tx metadata framework. This patch has been tested with tools/testing/selftests/bpf/xdp_hw_metadata on Intel I225-LM Ethernet controller. Below are the test steps and result. Test 1: Send a single packet with the launch time set to

[PATCH bpf-next v8 4/5] igc: Refactor empty packet insertion into a reusable function

2025-02-04 Thread Song Yoong Siang
Refactor the code for inserting an empty packet into a new function igc_insert_empty_packet(). This change extracts the logic for inserting an empty packet from igc_xmit_frame_ring() into a separate function, allowing it to be reused in future implementations, such as the XDP zero copy transmit fun

[PATCH bpf-next v8 3/5] net: stmmac: Add launch time support to XDP ZC

2025-02-04 Thread Song Yoong Siang
Enable launch time (Time-Based Scheduling) support for XDP zero copy via the XDP Tx metadata framework. This patch has been tested with tools/testing/selftests/bpf/xdp_hw_metadata on Intel Tiger Lake platform. Below are the test steps and result. Test 1: Send a single packet with the launch time

[PATCH bpf-next v8 2/5] selftests/bpf: Add launch time request to xdp_hw_metadata

2025-02-04 Thread Song Yoong Siang
Add launch time hardware offload request to xdp_hw_metadata. Users can configure the delta of launch time relative to HW RX-time using the "-l" argument. By default, the delta is set to 0 ns, which means the launch time is disabled. By setting the delta to a non-zero value, the launch time hardware

[PATCH bpf-next v8 1/5] xsk: Add launch time hardware offload support to XDP Tx metadata

2025-02-04 Thread Song Yoong Siang
Extend the XDP Tx metadata framework so that user can requests launch time hardware offload, where the Ethernet device will schedule the packet for transmission at a pre-determined time called launch time. The value of launch time is communicated from user space to Ethernet driver via launch_time f

[PATCH bpf-next v8 0/5] xsk: TX metadata Launch Time support

2025-02-04 Thread Song Yoong Siang
This series expands the XDP TX metadata framework to allow user applications to pass per packet 64-bit launch time directly to the kernel driver, requesting launch time hardware offload support. The XDP TX metadata framework will not perform any clock conversion or packet reordering. Please note t

[PATCH v9 11/26] riscv/shstk: If needed allocate a new shadow stack on clone

2025-02-04 Thread Deepak Gupta
Userspace specifies CLONE_VM to share address space and spawn new thread. `clone` allow userspace to specify a new stack for new thread. However there is no way to specify new shadow stack base address without changing API. This patch allocates a new shadow stack whenever CLONE_VM is given. In cas

Re: [PATCH net-next v3 0/6] Device memory TCP TX

2025-02-04 Thread Jakub Kicinski
On Mon, 3 Feb 2025 22:39:10 + Mina Almasry wrote: > v3: https://patchwork.kernel.org/project/netdevbpf/list/?series=929401&state=* > === > > RFC v2: > https://patchwork.kernel.org/project/netdevbpf/list/?series=920056&state=* nit: lore links are better please stick to RFC until a driver im

Re: [PATCH net-next v3 0/6] Device memory TCP TX

2025-02-04 Thread Jakub Kicinski
On Tue, 4 Feb 2025 11:41:09 -0800 Stanislav Fomichev wrote: > > > Don't we need some way for the device to opt-in (or opt-out) and avoid > > > such issues? > > > > > > > Yeah, I think likely the driver needs to declare support (i.e. it's > > not using dma-mapping API with dma-buf addresses). >

[PATCH v9 20/26] riscv: Add Firmware Feature SBI extensions definitions

2025-02-04 Thread Deepak Gupta
From: Clément Léger Add necessary SBI definitions to use the FWFT extension. Signed-off-by: Clément Léger --- arch/riscv/include/asm/sbi.h | 26 ++ 1 file changed, 26 insertions(+) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 3d2508241

[PATCH v9 26/26] kselftest/riscv: kselftest for user mode cfi

2025-02-04 Thread Deepak Gupta
Adds kselftest for RISC-V control flow integrity implementation for user mode. There is not a lot going on in kernel for enabling landing pad for user mode. cfi selftest are intended to be compiled with zicfilp and zicfiss enabled compiler. Thus kselftest simply checks if landing pad and shadow sta

[PATCH v9 25/26] riscv: Documentation for shadow stack on riscv

2025-02-04 Thread Deepak Gupta
Adding documentation on shadow stack for user mode on riscv and kernel interfaces exposed so that user tasks can enable it. Signed-off-by: Deepak Gupta --- Documentation/arch/riscv/index.rst | 1 + Documentation/arch/riscv/zicfiss.rst | 176 +++ 2 files change

[PATCH v9 21/26] riscv: enable kernel access to shadow stack memory via FWFT sbi call

2025-02-04 Thread Deepak Gupta
Kernel will have to perform shadow stack operations on user shadow stack. Like during signal delivery and sigreturn, shadow stack token must be created and validated respectively. Thus shadow stack access for kernel must be enabled. In future when kernel shadow stacks are enabled for linux kernel,

[PATCH v9 23/26] riscv: create a config for shadow stack and landing pad instr support

2025-02-04 Thread Deepak Gupta
This patch creates a config for shadow stack support and landing pad instr support. Shadow stack support and landing instr support can be enabled by selecting `CONFIG_RISCV_USER_CFI`. Selecting `CONFIG_RISCV_USER_CFI` wires up path to enumerate CPU support and if cpu support exists, kernel will sup

[PATCH v9 24/26] riscv: Documentation for landing pad / indirect branch tracking

2025-02-04 Thread Deepak Gupta
Adding documentation on landing pad aka indirect branch tracking on riscv and kernel interfaces exposed so that user tasks can enable it. Signed-off-by: Deepak Gupta --- Documentation/arch/riscv/index.rst | 1 + Documentation/arch/riscv/zicfilp.rst | 115 +++

[PATCH v9 22/26] riscv: kernel command line option to opt out of user cfi

2025-02-04 Thread Deepak Gupta
This commit adds a kernel command line option using which user cfi can be disabled. Signed-off-by: Deepak Gupta --- arch/riscv/kernel/usercfi.c | 21 + 1 file changed, 21 insertions(+) diff --git a/arch/riscv/kernel/usercfi.c b/arch/riscv/kernel/usercfi.c index 6e561256bfaf.

[PATCH v9 19/26] riscv/hwprobe: zicfilp / zicfiss enumeration in hwprobe

2025-02-04 Thread Deepak Gupta
Adding enumeration of zicfilp and zicfiss extensions in hwprobe syscall. Signed-off-by: Deepak Gupta --- arch/riscv/include/uapi/asm/hwprobe.h | 2 ++ arch/riscv/kernel/sys_hwprobe.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/

[PATCH v9 18/26] riscv/ptrace: riscv cfi status and state via ptrace and in core files

2025-02-04 Thread Deepak Gupta
Expose a new register type NT_RISCV_USER_CFI for risc-v cfi status and state. Intentionally both landing pad and shadow stack status and state are rolled into cfi state. Creating two different NT_RISCV_USER_XXX would not be useful and wastage of a note type. Enabling or disabling of feature is not

[PATCH v9 17/26] riscv/kernel: update __show_regs to print shadow stack register

2025-02-04 Thread Deepak Gupta
Updating __show_regs to print captured shadow stack pointer as well. On tasks where shadow stack is disabled, it'll simply print 0. Signed-off-by: Deepak Gupta Reviewed-by: Alexandre Ghiti --- arch/riscv/kernel/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ar

[PATCH v9 16/26] riscv/signal: save and restore of shadow stack for signal

2025-02-04 Thread Deepak Gupta
Save shadow stack pointer in sigcontext structure while delivering signal. Restore shadow stack pointer from sigcontext on sigreturn. As part of save operation, kernel uses `ssamoswap` to save snapshot of current shadow stack on shadow stack itself (can be called as a save token). During restore o

[PATCH v9 14/26] riscv/traps: Introduce software check exception

2025-02-04 Thread Deepak Gupta
zicfiss / zicfilp introduces a new exception to priv isa `software check exception` with cause code = 18. This patch implements software check exception. Additionally it implements a cfi violation handler which checks for code in xtval. If xtval=2, it means that sw check exception happened because

[PATCH v9 15/26] riscv: signal: abstract header saving for setup_sigcontext

2025-02-04 Thread Deepak Gupta
From: Andy Chiu The function save_v_state() served two purposes. First, it saved extension context into the signal stack. Then, it constructed the extension header if there was no fault. The second part is independent of the extension itself. As a result, we can pull that part out, so future exte

[PATCH v9 12/26] riscv: Implements arch agnostic shadow stack prctls

2025-02-04 Thread Deepak Gupta
Implement architecture agnostic prctls() interface for setting and getting shadow stack status. prctls implemented are PR_GET_SHADOW_STACK_STATUS, PR_SET_SHADOW_STACK_STATUS and PR_LOCK_SHADOW_STACK_STATUS. As part of PR_SET_SHADOW_STACK_STATUS/PR_GET_SHADOW_STACK_STATUS, only PR_SHADOW_STACK_ENA

[PATCH v9 09/26] riscv mmu: write protect and shadow stack

2025-02-04 Thread Deepak Gupta
`fork` implements copy on write (COW) by making pages readonly in child and parent both. ptep_set_wrprotect and pte_wrprotect clears _PAGE_WRITE in PTE. Assumption is that page is readable and on fault copy on write happens. To implement COW on shadow stack pages, clearing up W bit makes them XWR

[PATCH v9 10/26] riscv/mm: Implement map_shadow_stack() syscall

2025-02-04 Thread Deepak Gupta
As discussed extensively in the changelog for the addition of this syscall on x86 ("x86/shstk: Introduce map_shadow_stack syscall") the existing mmap() and madvise() syscalls do not map entirely well onto the security requirements for shadow stack memory since they lead to windows where memory is a

[PATCH v9 07/26] riscv mm: manufacture shadow stack pte

2025-02-04 Thread Deepak Gupta
This patch implements creating shadow stack pte (on riscv). Creating shadow stack PTE on riscv means that clearing RWX and then setting W=1. Signed-off-by: Deepak Gupta Reviewed-by: Alexandre Ghiti --- arch/riscv/include/asm/pgtable.h | 10 ++ 1 file changed, 10 insertions(+) diff --gi

[PATCH v9 08/26] riscv mmu: teach pte_mkwrite to manufacture shadow stack PTEs

2025-02-04 Thread Deepak Gupta
pte_mkwrite creates PTEs with WRITE encodings for underlying arch. Underlying arch can have two types of writeable mappings. One that can be written using regular store instructions. Another one that can only be written using specialized store instructions (like shadow stack stores). pte_mkwrite ca

[PATCH v9 06/26] riscv/mm : ensure PROT_WRITE leads to VM_READ | VM_WRITE

2025-02-04 Thread Deepak Gupta
`arch_calc_vm_prot_bits` is implemented on risc-v to return VM_READ | VM_WRITE if PROT_WRITE is specified. Similarly `riscv_sys_mmap` is updated to convert all incoming PROT_WRITE to (PROT_WRITE | PROT_READ). This is to make sure that any existing apps using PROT_WRITE still work. Earlier `protect

[PATCH v9 05/26] riscv: usercfi state for task and save/restore of CSR_SSP on trap entry/exit

2025-02-04 Thread Deepak Gupta
Carves out space in arch specific thread struct for cfi status and shadow stack in usermode on riscv. This patch does following - defines a new structure cfi_status with status bit for cfi feature - defines shadow stack pointer, base and size in cfi_status structure - defines offsets to new member

[PATCH v9 04/26] riscv: zicfiss / zicfilp extension csr and bit definitions

2025-02-04 Thread Deepak Gupta
zicfiss and zicfilp extension gets enabled via b3 and b2 in *envcfg CSR. menvcfg controls enabling for S/HS mode. henvcfg control enabling for VS while senvcfg controls enabling for U/VU mode. zicfilp extension extends *status CSR to hold `expected landing pad` bit. A trap or interrupt can occur b

[PATCH v9 02/26] dt-bindings: riscv: zicfilp and zicfiss in dt-bindings (extensions.yaml)

2025-02-04 Thread Deepak Gupta
Make an entry for cfi extensions in extensions.yaml. Signed-off-by: Deepak Gupta Acked-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/riscv/extensions.yaml | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b

[PATCH v9 03/26] riscv: zicfiss / zicfilp enumeration

2025-02-04 Thread Deepak Gupta
This patch adds support for detecting zicfiss and zicfilp. zicfiss and zicfilp stands for unprivleged integer spec extension for shadow stack and branch tracking on indirect branches, respectively. This patch looks for zicfiss and zicfilp in device tree and accordinlgy lights up bit in cpu feature

[PATCH v9 01/26] mm: helper `is_shadow_stack_vma` to check shadow stack vma

2025-02-04 Thread Deepak Gupta
VM_SHADOW_STACK (alias to VM_HIGH_ARCH_5) is used to encode shadow stack VMA on three architectures (x86 shadow stack, arm GCS and RISC-V shadow stack). In case architecture doesn't implement shadow stack, it's VM_NONE Introducing a helper `is_shadow_stack_vma` to determine shadow stack vma or not.

[PATCH v9 00/26] riscv control-flow integrity for usermode

2025-02-04 Thread Deepak Gupta
Basics and overview === Software with larger attack surfaces (e.g. network facing apps like databases, browsers or apps relying on browser runtimes) suffer from memory corruption issues which can be utilized by attackers to bend control flow of the program to eventually gain contro

Re: [PATCH net-next v3 0/6] Device memory TCP TX

2025-02-04 Thread Stanislav Fomichev
On 02/04, Samiullah Khawaja wrote: > On Tue, Feb 4, 2025 at 11:43 AM Stanislav Fomichev > wrote: > > > > On 02/04, Mina Almasry wrote: > > > On Tue, Feb 4, 2025 at 10:06 AM Stanislav Fomichev > > > wrote: > > > > > > > > On 02/04, Mina Almasry wrote: > > > > > On Tue, Feb 4, 2025 at 4:32 AM Pao

Re: [PATCH net-next v3 0/6] Device memory TCP TX

2025-02-04 Thread Samiullah Khawaja
On Tue, Feb 4, 2025 at 11:43 AM Stanislav Fomichev wrote: > > On 02/04, Mina Almasry wrote: > > On Tue, Feb 4, 2025 at 10:06 AM Stanislav Fomichev > > wrote: > > > > > > On 02/04, Mina Almasry wrote: > > > > On Tue, Feb 4, 2025 at 4:32 AM Paolo Abeni wrote: > > > > > > > > > > On 2/3/25 11:39 P

[PATCH v7 04/20] fs/dax: Refactor wait for dax idle page

2025-02-04 Thread Alistair Popple
A FS DAX page is considered idle when its refcount drops to one. This is currently open-coded in all file systems supporting FS DAX. Move the idle detection to a common function to make future changes easier. Signed-off-by: Alistair Popple Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Re

[PATCH v7 00/20] fs/dax: Fix ZONE_DEVICE page reference counts

2025-02-04 Thread Alistair Popple
Main updates since v6: - Clean ups and fixes based on feedback from David and Dan. - Rebased from next-20241216 to v6.14-rc1. No conflicts. - Dropped the PTE bit removals and clean-ups - will post this as a separate series to be merged after this one as Dan wanted it split up more and t

[PATCH v7 20/20] device/dax: Properly refcount device dax pages when mapping

2025-02-04 Thread Alistair Popple
Device DAX pages are currently not reference counted when mapped, instead relying on the devmap PTE bit to ensure mapping code will not get/put references. This requires special handling in various page table walkers, particularly GUP, to manage references on the underlying pgmap to ensure the page

[PATCH v7 19/20] fs/dax: Properly refcount fs dax pages

2025-02-04 Thread Alistair Popple
Currently fs dax pages are considered free when the refcount drops to one and their refcounts are not increased when mapped via PTEs or decreased when unmapped. This requires special logic in mm paths to detect that these pages should not be properly refcounted, and to detect when the refcount drop

[PATCH v7 18/20] dcssblk: Mark DAX broken, remove FS_DAX_LIMITED support

2025-02-04 Thread Alistair Popple
From: Dan Williams The dcssblk driver has long needed special case supoprt to enable limited dax operation, so called CONFIG_FS_DAX_LIMITED. This mode works around the incomplete support for ZONE_DEVICE on s390 by forgoing the ability of dax-mapped pages to support GUP. Now, pending cleanups to

[PATCH v7 17/20] mm/gup: Don't allow FOLL_LONGTERM pinning of FS DAX pages

2025-02-04 Thread Alistair Popple
Longterm pinning of FS DAX pages should already be disallowed by various pXX_devmap checks. However a future change will cause these checks to be invalid for FS DAX pages so make folio_is_longterm_pinnable() return false for FS DAX pages. Signed-off-by: Alistair Popple Reviewed-by: John Hubbard

[PATCH v7 16/20] huge_memory: Add vmf_insert_folio_pmd()

2025-02-04 Thread Alistair Popple
Currently DAX folio/page reference counts are managed differently to normal pages. To allow these to be managed the same as normal pages introduce vmf_insert_folio_pmd. This will map the entire PMD-sized folio and take references as it would for a normally mapped page. This is distinct from the cu

[PATCH v7 15/20] huge_memory: Add vmf_insert_folio_pud()

2025-02-04 Thread Alistair Popple
Currently DAX folio/page reference counts are managed differently to normal pages. To allow these to be managed the same as normal pages introduce vmf_insert_folio_pud. This will map the entire PUD-sized folio and take references as it would for a normally mapped page. This is distinct from the cu

[PATCH v7 14/20] rmap: Add support for PUD sized mappings to rmap

2025-02-04 Thread Alistair Popple
The rmap doesn't currently support adding a PUD mapping of a folio. This patch adds support for entire PUD mappings of folios, primarily to allow for more standard refcounting of device DAX folios. Currently DAX is the only user of this and it doesn't require support for partially mapped PUD-sized

[PATCH v7 13/20] mm/memory: Add vmf_insert_page_mkwrite()

2025-02-04 Thread Alistair Popple
Currently to map a DAX page the DAX driver calls vmf_insert_pfn. This creates a special devmap PTE entry for the pfn but does not take a reference on the underlying struct page for the mapping. This is because DAX page refcounts are treated specially, as indicated by the presence of a devmap entry.

[PATCH v7 12/20] mm/memory: Enhance insert_page_into_pte_locked() to create writable mappings

2025-02-04 Thread Alistair Popple
In preparation for using insert_page() for DAX, enhance insert_page_into_pte_locked() to handle establishing writable mappings. Recall that DAX returns VM_FAULT_NOPAGE after installing a PTE which bypasses the typical set_pte_range() in finish_fault. Signed-off-by: Alistair Popple Suggested-by:

[PATCH v7 11/20] mm: Allow compound zone device pages

2025-02-04 Thread Alistair Popple
Zone device pages are used to represent various type of device memory managed by device drivers. Currently compound zone device pages are not supported. This is because MEMORY_DEVICE_FS_DAX pages are the only user of higher order zone device pages and have their own page reference counting. A futu

[PATCH v7 10/20] mm/mm_init: Move p2pdma page refcount initialisation to p2pdma

2025-02-04 Thread Alistair Popple
Currently ZONE_DEVICE page reference counts are initialised by core memory management code in __init_zone_device_page() as part of the memremap() call which driver modules make to obtain ZONE_DEVICE pages. This initialises page refcounts to 1 before returning them to the driver. This was presumabl

[PATCH v7 09/20] mm/gup: Remove redundant check for PCI P2PDMA page

2025-02-04 Thread Alistair Popple
PCI P2PDMA pages are not mapped with pXX_devmap PTEs therefore the check in __gup_device_huge() is redundant. Remove it Signed-off-by: Alistair Popple Reviewed-by: Jason Gunthorpe Reviewed-by: Dan Wiliams Acked-by: David Hildenbrand --- mm/gup.c | 5 - 1 file changed, 5 deletions(-) diff

[PATCH v7 08/20] fs/dax: Remove PAGE_MAPPING_DAX_SHARED mapping flag

2025-02-04 Thread Alistair Popple
The page ->mapping pointer can have magic values like PAGE_MAPPING_DAX_SHARED and PAGE_MAPPING_ANON for page owner specific usage. Currently PAGE_MAPPING_DAX_SHARED and PAGE_MAPPING_ANON alias to the same value. This isn't a problem because FS DAX pages are never seen by the anonymous mapping code

[PATCH v7 07/20] fs/dax: Ensure all pages are idle prior to filesystem unmount

2025-02-04 Thread Alistair Popple
File systems call dax_break_mapping() prior to reallocating file system blocks to ensure the page is not undergoing any DMA or other accesses. Generally this is needed when a file is truncated to ensure that if a block is reallocated nothing is writing to it. However filesystems currently don't cal

[PATCH v7 06/20] fs/dax: Always remove DAX page-cache entries when breaking layouts

2025-02-04 Thread Alistair Popple
Prior to any truncation operations file systems call dax_break_mapping() to ensure pages in the range are not under going DMA. Later DAX page-cache entries will be removed by truncate_folio_batch_exceptionals() in the generic page-cache code. However this makes it possible for folios to be removed

[PATCH v7 05/20] fs/dax: Create a common implementation to break DAX layouts

2025-02-04 Thread Alistair Popple
Prior to freeing a block file systems supporting FS DAX must check that the associated pages are both unmapped from user-space and not undergoing DMA or other access from eg. get_user_pages(). This is achieved by unmapping the file range and scanning the FS DAX page-cache to see if any pages within

[PATCH v7 03/20] fs/dax: Don't skip locked entries when scanning entries

2025-02-04 Thread Alistair Popple
Several functions internal to FS DAX use the following pattern when trying to obtain an unlocked entry: xas_for_each(&xas, entry, end_idx) { if (dax_is_locked(entry)) entry = get_unlocked_entry(&xas, 0); This is problematic because get_unlocked_entry() will get the next pr

[PATCH v7 02/20] fs/dax: Return unmapped busy pages from dax_layout_busy_page_range()

2025-02-04 Thread Alistair Popple
dax_layout_busy_page_range() is used by file systems to scan the DAX page-cache to unmap mapping pages from user-space and to determine if any pages in the given range are busy, either due to ongoing DMA or other get_user_pages() usage. Currently it checks to see the file mapping is mapped into us

[PATCH v7 01/20] fuse: Fix dax truncate/punch_hole fault path

2025-02-04 Thread Alistair Popple
FS DAX requires file systems to call into the DAX layout prior to unlinking inodes to ensure there is no ongoing DMA or other remote access to the direct mapped page. The fuse file system implements fuse_dax_break_layouts() to do this which includes a comment indicating that passing dmap_end == 0 l

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-04 Thread David Laight
... > > +Inline functions > > + > > + > > +The use of static inline functions in .c file is strongly discouraged > > +unless there is a demonstrable reason for them, usually performance > > +related. Rather, it is preferred to omit the inline keyword and allow the > > +compiler to

Re: [PATCH v2 6/6] module: Introduce hash-based integrity checking

2025-02-04 Thread Thomas Weißschuh
Hi Petr, On 2025-02-03 15:22:54+0100, Petr Pavlu wrote: > On 1/20/25 18:44, Thomas Weißschuh wrote: > > The current signature-based module integrity checking has some drawbacks > > in combination with reproducible builds: > > Either the module signing key is generated at build time, which makes >

Re: [PATCH v2 0/6] module: Introduce hash-based integrity checking

2025-02-04 Thread Thomas Weißschuh
On 2025-02-03 14:14:41+0100, Christian Heusel wrote: > Hey Thomas, > > On 25/01/20 06:44PM, Thomas Weißschuh wrote: > > Thomas Weißschuh (6): > > kbuild: add stamp file for vmlinux BTF data > > module: Make module loading policy usable without MODULE_SIG > > module: Move integrit

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-04 Thread Simon Horman
On Tue, Feb 04, 2025 at 02:25:07PM +0100, Andrew Lunn wrote: > > Thanks, perhaps something like this would help: > > > > Using inline in .h files is fine and is encouraged in place of macros > > [reference section 12]. > > The other major use of them in headers is for stub functions when an >

Re: [PATCH] docs: submitting-patches: document the format for affiliation

2025-02-04 Thread Konstantin Ryabitsev
On Tue, Feb 04, 2025 at 10:05:12AM -0800, Randy Dunlap wrote: > I thought that > Signed-off-by: John Doe # Company > would be acceptable also. > > It looks like that format is documented for Acked-by: but I don't know > why it is not more generally applicable. I'm pretty sure that I have used it

Re: [PATCH] docs: submitting-patches: document the format for affiliation

2025-02-04 Thread Geert Uytterhoeven
Hi Jakub, On Tue, 4 Feb 2025 at 20:33, Jakub Kicinski wrote: > On Tue, 4 Feb 2025 10:05:12 -0800 Randy Dunlap wrote: > > Signed-off-by: John Doe # Company > > Interesting :) > > On a quick look this seems to be the format of choice for maintainers > who edit patches: > > Signed-off-by: Mr Mainta

Re: [PATCH net-next v3 0/6] Device memory TCP TX

2025-02-04 Thread Stanislav Fomichev
On 02/04, Mina Almasry wrote: > On Tue, Feb 4, 2025 at 10:06 AM Stanislav Fomichev > wrote: > > > > On 02/04, Mina Almasry wrote: > > > On Tue, Feb 4, 2025 at 4:32 AM Paolo Abeni wrote: > > > > > > > > On 2/3/25 11:39 PM, Mina Almasry wrote: > > > > > The TX path had been dropped from the Device

Re: [PATCH net-next v3 0/6] Device memory TCP TX

2025-02-04 Thread Stanislav Fomichev
On 02/04, Mina Almasry wrote: > On Tue, Feb 4, 2025 at 10:32 AM Paolo Abeni wrote: > > > > On 2/4/25 7:06 PM, Stanislav Fomichev wrote: > > > On 02/04, Mina Almasry wrote: > > >> On Tue, Feb 4, 2025 at 4:32 AM Paolo Abeni wrote: > > >>> > > >>> On 2/3/25 11:39 PM, Mina Almasry wrote: > > The

Re: [PATCH] docs: submitting-patches: document the format for affiliation

2025-02-04 Thread Jakub Kicinski
On Tue, 4 Feb 2025 10:05:12 -0800 Randy Dunlap wrote: > Signed-off-by: John Doe # Company Interesting :) On a quick look this seems to be the format of choice for maintainers who edit patches: Signed-off-by: Mr Maintainer # fixed xyz I don't see a single # use in the From lines. I think the #

Re: [PATCH v6 23/26] mm: Remove pXX_devmap callers

2025-02-04 Thread Dan Williams
Alistair Popple wrote: > On Tue, Jan 14, 2025 at 10:50:49AM -0800, Dan Williams wrote: > > Alistair Popple wrote: > > > The devmap PTE special bit was used to detect mappings of FS DAX > > > pages. This tracking was required to ensure the generic mm did not > > > manipulate the page reference count

Re: [PATCH net-next v3 0/6] Device memory TCP TX

2025-02-04 Thread Mina Almasry
On Tue, Feb 4, 2025 at 10:32 AM Paolo Abeni wrote: > > On 2/4/25 7:06 PM, Stanislav Fomichev wrote: > > On 02/04, Mina Almasry wrote: > >> On Tue, Feb 4, 2025 at 4:32 AM Paolo Abeni wrote: > >>> > >>> On 2/3/25 11:39 PM, Mina Almasry wrote: > The TX path had been dropped from the Device Memo

Re: [PATCH net-next v3 0/6] Device memory TCP TX

2025-02-04 Thread Mina Almasry
On Tue, Feb 4, 2025 at 10:06 AM Stanislav Fomichev wrote: > > On 02/04, Mina Almasry wrote: > > On Tue, Feb 4, 2025 at 4:32 AM Paolo Abeni wrote: > > > > > > On 2/3/25 11:39 PM, Mina Almasry wrote: > > > > The TX path had been dropped from the Device Memory TCP patch series > > > > post RFCv1 [1]

Re: [PATCH net-next v3 0/6] Device memory TCP TX

2025-02-04 Thread Paolo Abeni
On 2/4/25 7:06 PM, Stanislav Fomichev wrote: > On 02/04, Mina Almasry wrote: >> On Tue, Feb 4, 2025 at 4:32 AM Paolo Abeni wrote: >>> >>> On 2/3/25 11:39 PM, Mina Almasry wrote: The TX path had been dropped from the Device Memory TCP patch series post RFCv1 [1], to make that series sligh

Re: [PATCH net-next v3 2/6] selftests: ncdevmem: Implement devmem TCP TX

2025-02-04 Thread Stanislav Fomichev
On 02/04, Mina Almasry wrote: > On Tue, Feb 4, 2025 at 9:56 AM Paolo Abeni wrote: > > > > On 2/4/25 6:35 PM, Mina Almasry wrote: > > > On Tue, Feb 4, 2025 at 4:29 AM Paolo Abeni wrote: > > >>> .../selftests/drivers/net/hw/ncdevmem.c | 300 +- > > >>> 1 file changed, 289 ins

Re: [PATCH net-next v3 0/6] Device memory TCP TX

2025-02-04 Thread Stanislav Fomichev
On 02/04, Mina Almasry wrote: > On Tue, Feb 4, 2025 at 4:32 AM Paolo Abeni wrote: > > > > On 2/3/25 11:39 PM, Mina Almasry wrote: > > > The TX path had been dropped from the Device Memory TCP patch series > > > post RFCv1 [1], to make that series slightly easier to review. This > > > series rebase

Re: [PATCH] docs: submitting-patches: document the format for affiliation

2025-02-04 Thread Randy Dunlap
Hi, On 2/4/25 8:13 AM, Jakub Kicinski wrote: > On Tue, 4 Feb 2025 17:49:38 +0200 Laurent Pinchart wrote: >> Or apparently project or customer names for consulting companies: >> >> 29 Kory Maincent (Dent Project) >> 34 Alexis Lothoré (eBPF Foundation) > > FWIW these are customer names,

Re: [PATCH net-next v3 2/6] selftests: ncdevmem: Implement devmem TCP TX

2025-02-04 Thread Mina Almasry
On Tue, Feb 4, 2025 at 9:56 AM Paolo Abeni wrote: > > On 2/4/25 6:35 PM, Mina Almasry wrote: > > On Tue, Feb 4, 2025 at 4:29 AM Paolo Abeni wrote: > >>> .../selftests/drivers/net/hw/ncdevmem.c | 300 +- > >>> 1 file changed, 289 insertions(+), 11 deletions(-) > >> > >> Why

Re: [PATCH net-next v3 2/6] selftests: ncdevmem: Implement devmem TCP TX

2025-02-04 Thread Paolo Abeni
On 2/4/25 6:35 PM, Mina Almasry wrote: > On Tue, Feb 4, 2025 at 4:29 AM Paolo Abeni wrote: >>> .../selftests/drivers/net/hw/ncdevmem.c | 300 +- >>> 1 file changed, 289 insertions(+), 11 deletions(-) >> >> Why devmem.py is not touched? AFAICS the test currently run ncdevmem

Re: [PATCH net-next v3 2/6] selftests: ncdevmem: Implement devmem TCP TX

2025-02-04 Thread Mina Almasry
On Tue, Feb 4, 2025 at 4:29 AM Paolo Abeni wrote: > > On 2/3/25 11:39 PM, Mina Almasry wrote: > > Add support for devmem TX in ncdevmem. > > > > This is a combination of the ncdevmem from the devmem TCP series RFCv1 > > which included the TX path, and work by Stan to include the netlink API > > an

Re: [PATCH net-next v3 0/6] Device memory TCP TX

2025-02-04 Thread Mina Almasry
On Tue, Feb 4, 2025 at 4:32 AM Paolo Abeni wrote: > > On 2/3/25 11:39 PM, Mina Almasry wrote: > > The TX path had been dropped from the Device Memory TCP patch series > > post RFCv1 [1], to make that series slightly easier to review. This > > series rebases the implementation of the TX path on top

Re: [PATCH net-next v3 2/6] selftests: ncdevmem: Implement devmem TCP TX

2025-02-04 Thread Jakub Kicinski
On Tue, 4 Feb 2025 13:29:18 +0100 Paolo Abeni wrote: > On 2/3/25 11:39 PM, Mina Almasry wrote: > > Add support for devmem TX in ncdevmem. > > > > This is a combination of the ncdevmem from the devmem TCP series RFCv1 > > which included the TX path, and work by Stan to include the netlink API > > a

Re: [PATCH] docs: submitting-patches: document the format for affiliation

2025-02-04 Thread Jakub Kicinski
On Tue, 4 Feb 2025 17:49:38 +0200 Laurent Pinchart wrote: > Or apparently project or customer names for consulting companies: > > 29 Kory Maincent (Dent Project) > 34 Alexis Lothoré (eBPF Foundation) FWIW these are customer names, indeed. Project/Foundation pays for contracting work i

Re: [xdp-hints] [PATCH bpf-next v7 5/5] igc: Add launch time support to XDP ZC

2025-02-04 Thread Maciej Fijalkowski
On Tue, Feb 04, 2025 at 02:14:00PM +0100, Song, Yoong Siang wrote: > On Tuesday, February 4, 2025 6:10 PM, Fijalkowski, Maciej > wrote: > >On Tue, Feb 04, 2025 at 08:49:07AM +0800, Song Yoong Siang wrote: > > > >> Enable Launch Time Control (LTC) support for XDP zero copy via XDP Tx > >> metadata

Re: [PATCH] docs: submitting-patches: document the format for affiliation

2025-02-04 Thread Laurent Pinchart
On Tue, Feb 04, 2025 at 07:18:34AM -0800, Jakub Kicinski wrote: > On Tue, 4 Feb 2025 08:59:28 +0100 Geert Uytterhoeven wrote: > > You probably also want to document the other popular[*] solution: > > > > From: Patch Author > > > > [*] Statistics for v6.0..v6.14-rc1: > > - "(Company): 3

RE: [xdp-hints] [PATCH bpf-next v7 5/5] igc: Add launch time support to XDP ZC

2025-02-04 Thread Song, Yoong Siang
On Tuesday, February 4, 2025 11:18 PM, Fijalkowski, Maciej wrote: >On Tue, Feb 04, 2025 at 03:49:32PM +0100, Song, Yoong Siang wrote: [...] >> With above, IMHO, we no need to clear igc_tx_buffer::type, >> Are you agree? > >Yes, the contract should be that every routine that produces descriptors

Re: [PATCH] docs: submitting-patches: document the format for affiliation

2025-02-04 Thread Jakub Kicinski
On Tue, 4 Feb 2025 08:59:28 +0100 Geert Uytterhoeven wrote: > You probably also want to document the other popular[*] solution: > > From: Patch Author > > [*] Statistics for v6.0..v6.14-rc1: > - "(Company): 3430 > - "+company": 2871 Hm, I mostly associate that format with MAINTA

Re: [xdp-hints] [PATCH bpf-next v7 5/5] igc: Add launch time support to XDP ZC

2025-02-04 Thread Maciej Fijalkowski
On Tue, Feb 04, 2025 at 03:49:32PM +0100, Song, Yoong Siang wrote: > On Tuesday, February 4, 2025 10:04 PM, Fijalkowski, Maciej > wrote: > >On Tue, Feb 04, 2025 at 02:14:00PM +0100, Song, Yoong Siang wrote: > >> On Tuesday, February 4, 2025 6:10 PM, Fijalkowski, > >> Maciej wrote: > >> >On Tue,

RE: [xdp-hints] [PATCH bpf-next v7 5/5] igc: Add launch time support to XDP ZC

2025-02-04 Thread Song, Yoong Siang
On Tuesday, February 4, 2025 10:04 PM, Fijalkowski, Maciej wrote: >On Tue, Feb 04, 2025 at 02:14:00PM +0100, Song, Yoong Siang wrote: >> On Tuesday, February 4, 2025 6:10 PM, Fijalkowski, >> Maciej wrote: >> >On Tue, Feb 04, 2025 at 08:49:07AM +0800, Song Yoong Siang wrote: >> > >> >> Enable Lau

RE: [PATCH bpf-next v7 4/5] igc: Refactor empty packet insertion into a reusable function

2025-02-04 Thread Song, Yoong Siang
On Tuesday, February 4, 2025 8:36 PM, Fijalkowski, Maciej wrote: >On Tue, Feb 04, 2025 at 12:07:21PM +0100, Song, Yoong Siang wrote: [...] >> >> "insert an empty packet" is a launch time trick to send a packet in >> next Qbv cycle. The design is, the driver will still sending the >> packet, eve

Re: [PATCH net] docs: netdev: Document guidance on inline functions

2025-02-04 Thread Andrew Lunn
> Thanks, perhaps something like this would help: > > Using inline in .h files is fine and is encouraged in place of macros > [reference section 12]. The other major use of them in headers is for stub functions when an API implementation has a Kconfig option. The question is, do we really wan

RE: [xdp-hints] [PATCH bpf-next v7 5/5] igc: Add launch time support to XDP ZC

2025-02-04 Thread Song, Yoong Siang
On Tuesday, February 4, 2025 6:10 PM, Fijalkowski, Maciej wrote: >On Tue, Feb 04, 2025 at 08:49:07AM +0800, Song Yoong Siang wrote: > >> Enable Launch Time Control (LTC) support for XDP zero copy via XDP Tx >> metadata framework. >> >> This patch has been tested with tools/testing/selftests/bpf/x

  1   2   >