[RFC PATCH v2 0/3] KVM: allow mapping of compound tail pages for IO or PFNMAP mapping

2024-01-03 Thread Yan Zhao
This is a v2 for previous series [1] to allow mapping for compound tail pages for IO or PFNMAP mapping. Compared to v1, this version provides selftest to check functionality in KVM to map memslots for MMIO BARs (VMAs with flag VM_IO | VM_PFNMAP), as requested by Sean in [1]. The selftest can also

[RFC PATCH v2 1/3] KVM: allow mapping of compound tail pages for IO or PFNMAP mapping

2024-01-03 Thread Yan Zhao
Allow mapping of tail pages of compound pages for IO or PFNMAP mapping by trying and getting ref count of its head page. For IO or PFNMAP mapping, sometimes it's backed by compound pages. KVM will just return error on mapping of tail pages of the compound pages, as ref count of the tail pages are

[RFC PATCH v2 2/3] KVM: selftests: add selftest driver for KVM to test memory slots for MMIO BARs

2024-01-03 Thread Yan Zhao
This driver is for testing KVM memory slots for device MMIO BARs that are mapped to pages serving as device resources. This driver implements a mock device whose device resources are pages array that can be mmaped into user space. It provides ioctl interface to users to configure whether the pages

[RFC PATCH v2 3/3] KVM: selftests: Add set_memory_region_io to test memslots for MMIO BARs

2024-01-03 Thread Yan Zhao
Added a selftest set_memory_region_io to test memslots for MMIO BARs. The MMIO BARs' backends are compound/non-compound huge pages serving as device resources allocated by a mock device driver. This selftest will assert and report "errno=14 - Bad address" in vcpu_run() if any failure is met to add

Re: [PATCH v10 10/10] iommu/vt-d: Add iotlb flush for nested domain

2024-01-03 Thread Jason Gunthorpe
On Wed, Jan 03, 2024 at 11:06:19AM +0800, Baolu Lu wrote: > On 2024/1/3 9:33, Yi Liu wrote: > > On 2024/1/3 02:44, Jason Gunthorpe wrote: > > > On Tue, Jan 02, 2024 at 06:38:34AM -0800, Yi Liu wrote: > > > > > > > +static void intel_nested_flush_cache(struct dmar_domain > > > > *domain, u64 addr,

Re: [PATCH net-next v2 2/3] net: gro: parse ipv6 ext headers without frag0 invalidation

2024-01-03 Thread Richard Gobert
Eric Dumazet wrote: > On Tue, Jan 2, 2024 at 2:25 PM Richard Gobert > wrote: >> >> The existing code always pulls the IPv6 header and sets the transport >> offset initially. Then optionally again pulls any extension headers in >> ipv6_gso_pull_exthdrs and sets the transport offset again on ret

Re: [PATCH net-next v2 2/3] net: gro: parse ipv6 ext headers without frag0 invalidation

2024-01-03 Thread Eric Dumazet
On Wed, Jan 3, 2024 at 2:08 PM Richard Gobert wrote: > > > > Eric Dumazet wrote: > > On Tue, Jan 2, 2024 at 2:25 PM Richard Gobert > > wrote: > >> > >> The existing code always pulls the IPv6 header and sets the transport > >> offset initially. Then optionally again pulls any extension headers i

Re: [PATCH net-next v2 2/3] net: gro: parse ipv6 ext headers without frag0 invalidation

2024-01-03 Thread Richard Gobert
Eric Dumazet wrote: > > > Hmm... I was looking at > > skb_checksum_setup_ipv6() , it uses skb_maybe_pull_tail( ... > sizeof(struct ipv6_opt_hdr)) > ipv6_skip_exthdr() also uses sizeof(struct ipv6_opt_hdr) > ip6_tnl_parse_tlv_enc_lim also uses the same. > hbh_mt6(), ipv6header_mt6(), .. same..

[PATCH net-next v3 0/3] net: gro: reduce extension header parsing overhead

2024-01-03 Thread Richard Gobert
This series attempts to reduce the parsing overhead of IPv6 extension headers in GRO and GSO, by removing extension header specific code and enabling the frag0 fast path. The following changes were made: - Removed some unnecessary HBH conditionals by adding HBH offload to inet6_offloads - Ad

[PATCH net-next v3 1/3] net: gso: add HBH extension header offload support

2024-01-03 Thread Richard Gobert
This commit adds net_offload to IPv6 Hop-by-Hop extension headers (as it is done for routing and dstopts) since it is supported in GSO and GRO. This allows to remove specific HBH conditionals in GSO and GRO when pulling and parsing an incoming packet. Signed-off-by: Richard Gobert Reviewed-by: Wi

[PATCH net-next v3 2/3] net: gro: parse ipv6 ext headers without frag0 invalidation

2024-01-03 Thread Richard Gobert
The existing code always pulls the IPv6 header and sets the transport offset initially. Then optionally again pulls any extension headers in ipv6_gso_pull_exthdrs and sets the transport offset again on return from that call. skb->data is set at the start of the first extension header before calling

[PATCH net-next v3 3/3] selftests/net: fix GRO coalesce test and add ext header coalesce tests

2024-01-03 Thread Richard Gobert
Currently there is no test which checks that IPv6 extension header packets successfully coalesce. This commit adds a test, which verifies two IPv6 packets with HBH extension headers do coalesce, and another test which checks that packets with different extension header data do not coalesce in GRO.

Re: [PATCH v7 1/3] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2024-01-03 Thread Jason Gunthorpe
On Wed, Jan 03, 2024 at 10:24:42AM +0800, Yi Liu wrote: > On 2024/1/3 07:38, Jason Gunthorpe wrote: > > On Fri, Dec 15, 2023 at 12:01:19PM +0800, Yi Liu wrote: > > > > I think I misread Yi's narrative: dev_id is a working approach > > > > for VMM to convert to a vRID, while he is asking for a bette

Re: [PATCH net-next v3 2/3] net: gro: parse ipv6 ext headers without frag0 invalidation

2024-01-03 Thread Eric Dumazet
On Wed, Jan 3, 2024 at 3:44 PM Richard Gobert wrote: > > The existing code always pulls the IPv6 header and sets the transport > offset initially. Then optionally again pulls any extension headers in > ipv6_gso_pull_exthdrs and sets the transport offset again on return from > that call. skb->data

Re: [PATCH v7 1/3] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2024-01-03 Thread Nicolin Chen
On Wed, Jan 03, 2024 at 12:01:08PM -0400, Jason Gunthorpe wrote: > On Wed, Jan 03, 2024 at 10:24:42AM +0800, Yi Liu wrote: > > On 2024/1/3 07:38, Jason Gunthorpe wrote: > > > On Fri, Dec 15, 2023 at 12:01:19PM +0800, Yi Liu wrote: > > > > > I think I misread Yi's narrative: dev_id is a working appr

Re: [PATCH v7 1/3] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2024-01-03 Thread Jason Gunthorpe
On Wed, Jan 03, 2024 at 08:48:46AM -0800, Nicolin Chen wrote: > > You can pass the ctx to the invalidate op, it is already implied > > because the passed iommu_domain is linked to a single iommufd ctx. > > The device virtual id lookup API needs something similar, yet it > likely needs a viommu poi

Re: [PATCH v7 1/3] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2024-01-03 Thread Nicolin Chen
On Wed, Jan 03, 2024 at 12:58:48PM -0400, Jason Gunthorpe wrote: > On Wed, Jan 03, 2024 at 08:48:46AM -0800, Nicolin Chen wrote: > > > You can pass the ctx to the invalidate op, it is already implied > > > because the passed iommu_domain is linked to a single iommufd ctx. > > > > The device virtua

Re: [PATCH v7 1/3] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2024-01-03 Thread Jason Gunthorpe
On Wed, Jan 03, 2024 at 09:06:23AM -0800, Nicolin Chen wrote: > On Wed, Jan 03, 2024 at 12:58:48PM -0400, Jason Gunthorpe wrote: > > On Wed, Jan 03, 2024 at 08:48:46AM -0800, Nicolin Chen wrote: > > > > You can pass the ctx to the invalidate op, it is already implied > > > > because the passed iomm

Re: [PATCH RESEND v4 0/3] livepatch: Move modules to selftests and add a new test

2024-01-03 Thread Joe Lawrence
On Wed, Dec 20, 2023 at 01:53:11PM -0300, Marcos Paulo de Souza wrote: > Changes in v4: > * Documented how to compile the livepatch selftests without running the > tests (Joe) > * Removed the mention to lib/livepatch on MAINTAINERS file, reported by > checkpatch. > > Changes in v3: > * Rebased

Re: [PATCH v7 1/3] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2024-01-03 Thread Nicolin Chen
On Wed, Jan 03, 2024 at 01:52:02PM -0400, Jason Gunthorpe wrote: > On Wed, Jan 03, 2024 at 09:06:23AM -0800, Nicolin Chen wrote: > > On Wed, Jan 03, 2024 at 12:58:48PM -0400, Jason Gunthorpe wrote: > > > On Wed, Jan 03, 2024 at 08:48:46AM -0800, Nicolin Chen wrote: > > > > > You can pass the ctx to

Re: [PATCH RESEND v4 1/3] kselftests: lib.mk: Add TEST_GEN_MODS_DIR variable

2024-01-03 Thread Shuah Khan
On 1/2/24 15:31, Joe Lawrence wrote: On Wed, Dec 20, 2023 at 01:53:12PM -0300, Marcos Paulo de Souza wrote: Add TEST_GEN_MODS_DIR variable for kselftests. It can point to a directory containing kernel modules that will be used by selftest scripts. The modules are built as external modules for t

[PATCH bpf-next 0/2] Annotate kfuncs in .BTF_ids section

2024-01-03 Thread Daniel Xu
This is a bpf-treewide change that annotates all kfuncs as such inside .BTF_ids. This annotation eventually allows us to automatically generate kfunc prototypes from bpftool. We store this metadata inside a yet-unused flags field inside struct btf_id_set8 (thanks Kumar!). pahole will be taught whe

[PATCH bpf-next 2/2] bpf: treewide: Annotate BPF kfuncs in BTF

2024-01-03 Thread Daniel Xu
This commit marks kfuncs as such inside the .BTF_ids section. The upshot of these annotations is that we'll be able to automatically generate kfunc prototypes for downstream users. The process is as follows: 1. In source, tag kfunc BTF_SET8 sets with BTF_SET8_KFUNC flag 2. During build, pahole inj

Re: [PATCH v7 1/3] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2024-01-03 Thread Jason Gunthorpe
On Wed, Jan 03, 2024 at 12:18:35PM -0800, Nicolin Chen wrote: > > The driver would have to create it and there would be some driver > > specific enclosing struct to go with it > > > > Perhaps device_ids goes in the driver specific struct, I don't know. > > +struct iommufd_viommu { > + struct

Re: [PATCH v2 net-next] selftests/net: change shebang to bash to support "source"

2024-01-03 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Fri, 29 Dec 2023 21:19:31 +0800 you wrote: > The patch set [1] added a general lib.sh in net selftests, and converted > several test scripts to source the lib.sh. > > unicast_extensions.sh (converted in [1]) and p