summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-02-26 10:20:47 -0800
committerJakub Kicinski <kuba@kernel.org>2026-02-26 10:23:00 -0800
commit0314e382cf02983eb3c33ac537ad9701e7858bc9 (patch)
tree3f74249b7d05f4e08542675a4dc0f173a2aa43b9 /include
parent4916f2e2f3fc9aef289fcd07949301e5c29094c2 (diff)
parentb9c8fc2caea6ff7e45c6942de8fee53515c66b34 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR (net-7.0-rc2). Conflicts: tools/testing/selftests/drivers/net/hw/rss_ctx.py 19c3a2a81d2b ("selftests: drv-net: rss: Generate unique ports for RSS context tests") ce5a0f4612db ("selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up") include/net/inet_connection_sock.h 858d2a4f67ff6 ("tcp: fix potential race in tcp_v6_syn_recv_sock()") fcd3d039fab69 ("tcp: make tcp_v{4,6}_send_check() static") https://lore.kernel.org/aZ8PSFLzBrEU3I89@sirena.org.uk drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c drivers/net/ethernet/mellanox/mlx5/core/en/xsk/pool.c 69050f8d6d075 ("treewide: Replace kmalloc with kmalloc_obj for non-scalar types") bf4afc53b77ae ("Convert 'alloc_obj' family to use the new default GFP_KERNEL argument") 8a96b9144f18a ("net/mlx5e: Alloc xsk channel param out of mlx5e_open_xsk()") Adjacent changes: net/netfilter/ipvs/ip_vs_ctl.c c59bd9e62e06 ("ipvs: use more counters to avoid service lookups") bf4afc53b77a ("Convert 'alloc_obj' family to use the new default GFP_KERNEL argument") Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/mshyperv.h13
-rw-r--r--include/drm/drm_pagemap.h2
-rw-r--r--include/hyperv/hvgdk_mini.h58
-rw-r--r--include/hyperv/hvhdk.h9
-rw-r--r--include/hyperv/hvhdk_mini.h9
-rw-r--r--include/kunit/resource.h4
-rw-r--r--include/linux/acpi.h2
-rw-r--r--include/linux/bpf.h2
-rw-r--r--include/linux/compiler_types.h3
-rw-r--r--include/linux/crash_dump.h2
-rw-r--r--include/linux/dma-fence-chain.h2
-rw-r--r--include/linux/fsnotify.h13
-rw-r--r--include/linux/fsverity.h15
-rw-r--r--include/linux/ftrace.h13
-rw-r--r--include/linux/gameport.h2
-rw-r--r--include/linux/gfp.h4
-rw-r--r--include/linux/io-mapping.h2
-rw-r--r--include/linux/io_uring/cmd.h15
-rw-r--r--include/linux/kvm_host.h2
-rw-r--r--include/linux/ntb.h14
-rw-r--r--include/linux/overflow.h2
-rw-r--r--include/linux/skmsg.h3
-rw-r--r--include/linux/slab.h54
-rw-r--r--include/linux/spi/spi.h2
-rw-r--r--include/linux/trace_events.h5
-rw-r--r--include/net/act_api.h2
-rw-r--r--include/net/af_vsock.h13
-rw-r--r--include/net/bluetooth/l2cap.h8
-rw-r--r--include/net/fq_impl.h2
-rw-r--r--include/net/inet_connection_sock.h4
-rw-r--r--include/net/iucv/iucv.h2
-rw-r--r--include/net/netns/vsock.h3
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/tc_act/tc_gate.h2
-rw-r--r--include/net/tcp.h4
-rw-r--r--include/net/udp.h3
-rw-r--r--include/rv/da_monitor.h16
-rw-r--r--include/uapi/drm/amdgpu_drm.h1
-rw-r--r--include/uapi/linux/mshv.h2
39 files changed, 183 insertions, 133 deletions
diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h
index ecedab554c80..d37b68238c97 100644
--- a/include/asm-generic/mshyperv.h
+++ b/include/asm-generic/mshyperv.h
@@ -342,6 +342,9 @@ static inline bool hv_parent_partition(void)
{
return hv_root_partition() || hv_l1vh_partition();
}
+
+bool hv_result_needs_memory(u64 status);
+int hv_deposit_memory_node(int node, u64 partition_id, u64 status);
int hv_call_deposit_pages(int node, u64 partition_id, u32 num_pages);
int hv_call_add_logical_proc(int node, u32 lp_index, u32 acpi_id);
int hv_call_create_vp(int node, u64 partition_id, u32 vp_index, u32 flags);
@@ -350,6 +353,11 @@ int hv_call_create_vp(int node, u64 partition_id, u32 vp_index, u32 flags);
static inline bool hv_root_partition(void) { return false; }
static inline bool hv_l1vh_partition(void) { return false; }
static inline bool hv_parent_partition(void) { return false; }
+static inline bool hv_result_needs_memory(u64 status) { return false; }
+static inline int hv_deposit_memory_node(int node, u64 partition_id, u64 status)
+{
+ return -EOPNOTSUPP;
+}
static inline int hv_call_deposit_pages(int node, u64 partition_id, u32 num_pages)
{
return -EOPNOTSUPP;
@@ -364,6 +372,11 @@ static inline int hv_call_create_vp(int node, u64 partition_id, u32 vp_index, u3
}
#endif /* CONFIG_MSHV_ROOT */
+static inline int hv_deposit_memory(u64 partition_id, u64 status)
+{
+ return hv_deposit_memory_node(NUMA_NO_NODE, partition_id, status);
+}
+
#if IS_ENABLED(CONFIG_HYPERV_VTL_MODE)
u8 __init get_vtl(void);
#else
diff --git a/include/drm/drm_pagemap.h b/include/drm/drm_pagemap.h
index 2baf0861f78f..c848f578e3da 100644
--- a/include/drm/drm_pagemap.h
+++ b/include/drm/drm_pagemap.h
@@ -95,7 +95,7 @@ struct drm_pagemap_ops {
*/
void (*device_unmap)(struct drm_pagemap *dpagemap,
struct device *dev,
- struct drm_pagemap_addr addr);
+ const struct drm_pagemap_addr *addr);
/**
* @populate_mm: Populate part of the mm with @dpagemap memory,
diff --git a/include/hyperv/hvgdk_mini.h b/include/hyperv/hvgdk_mini.h
index 30fbbde81c5c..056ef7b6b360 100644
--- a/include/hyperv/hvgdk_mini.h
+++ b/include/hyperv/hvgdk_mini.h
@@ -14,33 +14,36 @@ struct hv_u128 {
} __packed;
/* NOTE: when adding below, update hv_result_to_string() */
-#define HV_STATUS_SUCCESS 0x0
-#define HV_STATUS_INVALID_HYPERCALL_CODE 0x2
-#define HV_STATUS_INVALID_HYPERCALL_INPUT 0x3
-#define HV_STATUS_INVALID_ALIGNMENT 0x4
-#define HV_STATUS_INVALID_PARAMETER 0x5
-#define HV_STATUS_ACCESS_DENIED 0x6
-#define HV_STATUS_INVALID_PARTITION_STATE 0x7
-#define HV_STATUS_OPERATION_DENIED 0x8
-#define HV_STATUS_UNKNOWN_PROPERTY 0x9
-#define HV_STATUS_PROPERTY_VALUE_OUT_OF_RANGE 0xA
-#define HV_STATUS_INSUFFICIENT_MEMORY 0xB
-#define HV_STATUS_INVALID_PARTITION_ID 0xD
-#define HV_STATUS_INVALID_VP_INDEX 0xE
-#define HV_STATUS_NOT_FOUND 0x10
-#define HV_STATUS_INVALID_PORT_ID 0x11
-#define HV_STATUS_INVALID_CONNECTION_ID 0x12
-#define HV_STATUS_INSUFFICIENT_BUFFERS 0x13
-#define HV_STATUS_NOT_ACKNOWLEDGED 0x14
-#define HV_STATUS_INVALID_VP_STATE 0x15
-#define HV_STATUS_NO_RESOURCES 0x1D
-#define HV_STATUS_PROCESSOR_FEATURE_NOT_SUPPORTED 0x20
-#define HV_STATUS_INVALID_LP_INDEX 0x41
-#define HV_STATUS_INVALID_REGISTER_VALUE 0x50
-#define HV_STATUS_OPERATION_FAILED 0x71
-#define HV_STATUS_TIME_OUT 0x78
-#define HV_STATUS_CALL_PENDING 0x79
-#define HV_STATUS_VTL_ALREADY_ENABLED 0x86
+#define HV_STATUS_SUCCESS 0x0
+#define HV_STATUS_INVALID_HYPERCALL_CODE 0x2
+#define HV_STATUS_INVALID_HYPERCALL_INPUT 0x3
+#define HV_STATUS_INVALID_ALIGNMENT 0x4
+#define HV_STATUS_INVALID_PARAMETER 0x5
+#define HV_STATUS_ACCESS_DENIED 0x6
+#define HV_STATUS_INVALID_PARTITION_STATE 0x7
+#define HV_STATUS_OPERATION_DENIED 0x8
+#define HV_STATUS_UNKNOWN_PROPERTY 0x9
+#define HV_STATUS_PROPERTY_VALUE_OUT_OF_RANGE 0xA
+#define HV_STATUS_INSUFFICIENT_MEMORY 0xB
+#define HV_STATUS_INVALID_PARTITION_ID 0xD
+#define HV_STATUS_INVALID_VP_INDEX 0xE
+#define HV_STATUS_NOT_FOUND 0x10
+#define HV_STATUS_INVALID_PORT_ID 0x11
+#define HV_STATUS_INVALID_CONNECTION_ID 0x12
+#define HV_STATUS_INSUFFICIENT_BUFFERS 0x13
+#define HV_STATUS_NOT_ACKNOWLEDGED 0x14
+#define HV_STATUS_INVALID_VP_STATE 0x15
+#define HV_STATUS_NO_RESOURCES 0x1D
+#define HV_STATUS_PROCESSOR_FEATURE_NOT_SUPPORTED 0x20
+#define HV_STATUS_INVALID_LP_INDEX 0x41
+#define HV_STATUS_INVALID_REGISTER_VALUE 0x50
+#define HV_STATUS_OPERATION_FAILED 0x71
+#define HV_STATUS_INSUFFICIENT_ROOT_MEMORY 0x73
+#define HV_STATUS_INSUFFICIENT_CONTIGUOUS_MEMORY 0x75
+#define HV_STATUS_TIME_OUT 0x78
+#define HV_STATUS_CALL_PENDING 0x79
+#define HV_STATUS_INSUFFICIENT_CONTIGUOUS_ROOT_MEMORY 0x83
+#define HV_STATUS_VTL_ALREADY_ENABLED 0x86
/*
* The Hyper-V TimeRefCount register and the TSC
@@ -474,6 +477,7 @@ union hv_vp_assist_msr_contents { /* HV_REGISTER_VP_ASSIST_PAGE */
#define HVCALL_NOTIFY_PARTITION_EVENT 0x0087
#define HVCALL_ENTER_SLEEP_STATE 0x0084
#define HVCALL_NOTIFY_PORT_RING_EMPTY 0x008b
+#define HVCALL_SCRUB_PARTITION 0x008d
#define HVCALL_REGISTER_INTERCEPT_RESULT 0x0091
#define HVCALL_ASSERT_VIRTUAL_INTERRUPT 0x0094
#define HVCALL_CREATE_PORT 0x0095
diff --git a/include/hyperv/hvhdk.h b/include/hyperv/hvhdk.h
index 08965970c17d..245f3db53bf1 100644
--- a/include/hyperv/hvhdk.h
+++ b/include/hyperv/hvhdk.h
@@ -10,6 +10,13 @@
#include "hvhdk_mini.h"
#include "hvgdk.h"
+/*
+ * Hypervisor statistics page format
+ */
+struct hv_stats_page {
+ u64 data[HV_HYP_PAGE_SIZE / sizeof(u64)];
+} __packed;
+
/* Bits for dirty mask of hv_vp_register_page */
#define HV_X64_REGISTER_CLASS_GENERAL 0
#define HV_X64_REGISTER_CLASS_IP 1
@@ -328,6 +335,8 @@ union hv_partition_isolation_properties {
#define HV_PARTITION_ISOLATION_HOST_TYPE_RESERVED 0x2
/* Note: Exo partition is enabled by default */
+#define HV_PARTITION_CREATION_FLAG_SMT_ENABLED_GUEST BIT(0)
+#define HV_PARTITION_CREATION_FLAG_NESTED_VIRTUALIZATION_CAPABLE BIT(1)
#define HV_PARTITION_CREATION_FLAG_GPA_SUPER_PAGES_ENABLED BIT(4)
#define HV_PARTITION_CREATION_FLAG_EXO_PARTITION BIT(8)
#define HV_PARTITION_CREATION_FLAG_LAPIC_ENABLED BIT(13)
diff --git a/include/hyperv/hvhdk_mini.h b/include/hyperv/hvhdk_mini.h
index 41a29bf8ec14..091c03e26046 100644
--- a/include/hyperv/hvhdk_mini.h
+++ b/include/hyperv/hvhdk_mini.h
@@ -7,6 +7,8 @@
#include "hvgdk_mini.h"
+#define HV_MAX_CONTIGUOUS_ALLOCATION_PAGES 8
+
/*
* Doorbell connection_info flags.
*/
@@ -87,6 +89,9 @@ enum hv_partition_property_code {
HV_PARTITION_PROPERTY_PRIVILEGE_FLAGS = 0x00010000,
HV_PARTITION_PROPERTY_SYNTHETIC_PROC_FEATURES = 0x00010001,
+ /* Integrated scheduling properties */
+ HV_PARTITION_PROPERTY_INTEGRATED_SCHEDULER_ENABLED = 0x00020005,
+
/* Resource properties */
HV_PARTITION_PROPERTY_GPA_PAGE_ACCESS_TRACKING = 0x00050005,
HV_PARTITION_PROPERTY_UNIMPLEMENTED_MSR_ACTION = 0x00050017,
@@ -102,7 +107,7 @@ enum hv_partition_property_code {
};
#define HV_PARTITION_VMM_CAPABILITIES_BANK_COUNT 1
-#define HV_PARTITION_VMM_CAPABILITIES_RESERVED_BITFIELD_COUNT 59
+#define HV_PARTITION_VMM_CAPABILITIES_RESERVED_BITFIELD_COUNT 57
struct hv_partition_property_vmm_capabilities {
u16 bank_count;
@@ -119,6 +124,8 @@ struct hv_partition_property_vmm_capabilities {
u64 reservedbit3: 1;
#endif
u64 assignable_synthetic_proc_features: 1;
+ u64 reservedbit5: 1;
+ u64 vmm_enable_integrated_scheduler : 1;
u64 reserved0: HV_PARTITION_VMM_CAPABILITIES_RESERVED_BITFIELD_COUNT;
} __packed;
};
diff --git a/include/kunit/resource.h b/include/kunit/resource.h
index 4ad69a2642a5..c330ed3e751c 100644
--- a/include/kunit/resource.h
+++ b/include/kunit/resource.h
@@ -243,7 +243,7 @@ kunit_alloc_and_get_resource(struct kunit *test,
struct kunit_resource *res;
int ret;
- res = kzalloc(sizeof(*res), internal_gfp);
+ res = kzalloc_obj(*res, internal_gfp);
if (!res)
return NULL;
@@ -285,7 +285,7 @@ static inline void *kunit_alloc_resource(struct kunit *test,
{
struct kunit_resource *res;
- res = kzalloc(sizeof(*res), internal_gfp);
+ res = kzalloc_obj(*res, internal_gfp);
if (!res)
return NULL;
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 3a412dcebc29..4d2f0bed7a06 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -66,7 +66,7 @@ static inline struct fwnode_handle *acpi_alloc_fwnode_static(void)
{
struct fwnode_handle *fwnode;
- fwnode = kzalloc(sizeof(struct fwnode_handle), GFP_KERNEL);
+ fwnode = kzalloc_obj(struct fwnode_handle);
if (!fwnode)
return NULL;
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index cd9b96434904..b78b53198a2e 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -2299,7 +2299,7 @@ static inline bool bpf_map_flags_access_ok(u32 access_flags)
static inline struct bpf_map_owner *bpf_map_owner_alloc(struct bpf_map *map)
{
- return kzalloc(sizeof(*map->owner), GFP_ATOMIC);
+ return kzalloc_obj(*map->owner, GFP_ATOMIC);
}
static inline void bpf_map_owner_free(struct bpf_map *map)
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index b1b141394d13..890076d0974b 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -552,7 +552,8 @@ struct ftrace_likely_data {
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fcounted_005fby_005fref
* clang: https://clang.llvm.org/docs/LanguageExtensions.html#builtin-counted-by-ref
*/
-#if __has_builtin(__builtin_counted_by_ref)
+#if __has_builtin(__builtin_counted_by_ref) && \
+ !defined(CONFIG_CC_HAS_BROKEN_COUNTED_BY_REF)
/**
* __flex_counter() - Get pointer to counter member for the given
* flexible array, if it was annotated with __counted_by()
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index dd6fc3b2133b..8315270e27b7 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -136,7 +136,7 @@ struct vmcore_range {
static inline int vmcore_alloc_add_range(struct list_head *list,
unsigned long long paddr, unsigned long long size)
{
- struct vmcore_range *m = kzalloc(sizeof(*m), GFP_KERNEL);
+ struct vmcore_range *m = kzalloc_obj(*m);
if (!m)
return -ENOMEM;
diff --git a/include/linux/dma-fence-chain.h b/include/linux/dma-fence-chain.h
index 68c3c1e41014..5cd3ba53b4a1 100644
--- a/include/linux/dma-fence-chain.h
+++ b/include/linux/dma-fence-chain.h
@@ -91,7 +91,7 @@ dma_fence_chain_contained(struct dma_fence *fence)
* intentional to enforce typesafety.
*/
#define dma_fence_chain_alloc() \
- ((struct dma_fence_chain *)kmalloc(sizeof(struct dma_fence_chain), GFP_KERNEL))
+ kmalloc_obj(struct dma_fence_chain)
/**
* dma_fence_chain_free
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 28a9cb13fbfa..079c18bcdbde 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -495,19 +495,6 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid)
fsnotify_dentry(dentry, mask);
}
-static inline int fsnotify_sb_error(struct super_block *sb, struct inode *inode,
- int error)
-{
- struct fs_error_report report = {
- .error = error,
- .inode = inode,
- .sb = sb,
- };
-
- return fsnotify(FS_ERROR, &report, FSNOTIFY_EVENT_ERROR,
- NULL, NULL, NULL, 0);
-}
-
static inline void fsnotify_mnt_attach(struct mnt_namespace *ns, struct vfsmount *mnt)
{
fsnotify_mnt(FS_MNT_ATTACH, ns, mnt);
diff --git a/include/linux/fsverity.h b/include/linux/fsverity.h
index fed91023bea9..a8f9aa75b792 100644
--- a/include/linux/fsverity.h
+++ b/include/linux/fsverity.h
@@ -195,6 +195,8 @@ int fsverity_ioctl_read_metadata(struct file *filp, const void __user *uarg);
/* verify.c */
+void fsverity_readahead(struct fsverity_info *vi, pgoff_t index,
+ unsigned long nr_pages);
bool fsverity_verify_blocks(struct fsverity_info *vi, struct folio *folio,
size_t len, size_t offset);
void fsverity_verify_bio(struct fsverity_info *vi, struct bio *bio);
@@ -255,6 +257,11 @@ static inline int fsverity_ioctl_read_metadata(struct file *filp,
/* verify.c */
+static inline void fsverity_readahead(struct fsverity_info *vi, pgoff_t index,
+ unsigned long nr_pages)
+{
+}
+
static inline bool fsverity_verify_blocks(struct fsverity_info *vi,
struct folio *folio, size_t len,
size_t offset)
@@ -282,12 +289,6 @@ static inline bool fsverity_verify_folio(struct fsverity_info *vi,
return fsverity_verify_blocks(vi, folio, folio_size(folio), 0);
}
-static inline bool fsverity_verify_page(struct fsverity_info *vi,
- struct page *page)
-{
- return fsverity_verify_blocks(vi, page_folio(page), PAGE_SIZE, 0);
-}
-
/**
* fsverity_file_open() - prepare to open a verity file
* @inode: the inode being opened
@@ -309,8 +310,6 @@ static inline int fsverity_file_open(struct inode *inode, struct file *filp)
}
void fsverity_cleanup_inode(struct inode *inode);
-void fsverity_readahead(struct fsverity_info *vi, pgoff_t index,
- unsigned long nr_pages);
struct page *generic_read_merkle_tree_page(struct inode *inode, pgoff_t index);
void generic_readahead_merkle_tree(struct inode *inode, pgoff_t index,
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 1a4d36fc9085..c242fe49af4c 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -1092,10 +1092,17 @@ static inline bool is_ftrace_trampoline(unsigned long addr)
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
#ifndef ftrace_graph_func
-#define ftrace_graph_func ftrace_stub
-#define FTRACE_OPS_GRAPH_STUB FTRACE_OPS_FL_STUB
+# define ftrace_graph_func ftrace_stub
+# define FTRACE_OPS_GRAPH_STUB FTRACE_OPS_FL_STUB
+/*
+ * The function graph is called every time the function tracer is called.
+ * It must always test the ops hash and cannot just directly call
+ * the handler.
+ */
+# define FGRAPH_NO_DIRECT 1
#else
-#define FTRACE_OPS_GRAPH_STUB 0
+# define FTRACE_OPS_GRAPH_STUB 0
+# define FGRAPH_NO_DIRECT 0
#endif
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 86d62fdafd7a..9625347c7ac0 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -97,7 +97,7 @@ void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
static inline struct gameport *gameport_allocate_port(void)
{
- struct gameport *gameport = kzalloc(sizeof(struct gameport), GFP_KERNEL);
+ struct gameport *gameport = kzalloc_obj(struct gameport);
return gameport;
}
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 6ecf6dda93e0..90536b2bc42e 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -13,6 +13,10 @@
struct vm_area_struct;
struct mempolicy;
+/* Helper macro to avoid gfp flags if they are the default one */
+#define __default_gfp(a,b,...) b
+#define default_gfp(...) __default_gfp(,##__VA_ARGS__,GFP_KERNEL)
+
/* Convert GFP flags to their corresponding migrate type */
#define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE)
#define GFP_MOVABLE_SHIFT 3
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index c16353cc6e3c..e5a884e72f29 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -206,7 +206,7 @@ io_mapping_create_wc(resource_size_t base,
{
struct io_mapping *iomap;
- iomap = kmalloc(sizeof(*iomap), GFP_KERNEL);
+ iomap = kmalloc_obj(*iomap);
if (!iomap)
return NULL;
diff --git a/include/linux/io_uring/cmd.h b/include/linux/io_uring/cmd.h
index 375fd048c4cb..331dcbefe72f 100644
--- a/include/linux/io_uring/cmd.h
+++ b/include/linux/io_uring/cmd.h
@@ -20,10 +20,17 @@ struct io_uring_cmd {
u8 unused[8];
};
-static inline const void *io_uring_sqe_cmd(const struct io_uring_sqe *sqe)
-{
- return sqe->cmd;
-}
+#define io_uring_sqe128_cmd(sqe, type) ({ \
+ BUILD_BUG_ON(sizeof(type) > ((2 * sizeof(struct io_uring_sqe)) - \
+ offsetof(struct io_uring_sqe, cmd))); \
+ (const type *)(sqe)->cmd; \
+})
+
+#define io_uring_sqe_cmd(sqe, type) ({ \
+ BUILD_BUG_ON(sizeof(type) > (sizeof(struct io_uring_sqe) - \
+ offsetof(struct io_uring_sqe, cmd))); \
+ (const type *)(sqe)->cmd; \
+})
static inline void io_uring_cmd_private_sz_check(size_t cmd_sz)
{
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index d42a95cbcfbc..dde605cb894e 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1664,7 +1664,7 @@ void kvm_arch_create_vm_debugfs(struct kvm *kvm);
*/
static inline struct kvm *kvm_arch_alloc_vm(void)
{
- return kzalloc(sizeof(struct kvm), GFP_KERNEL_ACCOUNT);
+ return kzalloc_obj(struct kvm, GFP_KERNEL_ACCOUNT);
}
#endif
diff --git a/include/linux/ntb.h b/include/linux/ntb.h
index 191b524e5c0d..8ff9d663096b 100644
--- a/include/linux/ntb.h
+++ b/include/linux/ntb.h
@@ -1647,12 +1647,8 @@ int ntbm_msi_request_threaded_irq(struct ntb_dev *ntb, irq_handler_t handler,
irq_handler_t thread_fn,
const char *name, void *dev_id,
struct ntb_msi_desc *msi_desc);
-void ntbm_msi_free_irq(struct ntb_dev *ntb, unsigned int irq, void *dev_id);
int ntb_msi_peer_trigger(struct ntb_dev *ntb, int peer,
struct ntb_msi_desc *desc);
-int ntb_msi_peer_addr(struct ntb_dev *ntb, int peer,
- struct ntb_msi_desc *desc,
- phys_addr_t *msi_addr);
#else /* not CONFIG_NTB_MSI */
@@ -1674,21 +1670,11 @@ static inline int ntbm_msi_request_threaded_irq(struct ntb_dev *ntb,
{
return -EOPNOTSUPP;
}
-static inline void ntbm_msi_free_irq(struct ntb_dev *ntb, unsigned int irq,
- void *dev_id) {}
static inline int ntb_msi_peer_trigger(struct ntb_dev *ntb, int peer,
struct ntb_msi_desc *desc)
{
return -EOPNOTSUPP;
}
-static inline int ntb_msi_peer_addr(struct ntb_dev *ntb, int peer,
- struct ntb_msi_desc *desc,
- phys_addr_t *msi_addr)
-{
- return -EOPNOTSUPP;
-
-}
-
#endif /* CONFIG_NTB_MSI */
static inline int ntbm_msi_request_irq(struct ntb_dev *ntb,
diff --git a/include/linux/overflow.h b/include/linux/overflow.h
index a5e95dbce220..eddd987a8513 100644
--- a/include/linux/overflow.h
+++ b/include/linux/overflow.h
@@ -570,7 +570,7 @@ static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend)
* @FAM is not annotated with __counted_by(), always returns true.
*/
#define overflows_flex_counter_type(TYPE, FAM, COUNT) \
- (!overflows_type(COUNT, typeof_flex_counter(((TYPE *)NULL)->FAM)))
+ (overflows_type(COUNT, typeof_flex_counter(((TYPE *)NULL)->FAM)))
/**
* __set_flex_counter() - Set the counter associated with the given flexible
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
index 829b281d6c9c..19f4f253b4f9 100644
--- a/include/linux/skmsg.h
+++ b/include/linux/skmsg.h
@@ -460,8 +460,7 @@ int sk_psock_msg_verdict(struct sock *sk, struct sk_psock *psock,
* intentional to enforce typesafety.
*/
#define sk_psock_init_link() \
- ((struct sk_psock_link *)kzalloc(sizeof(struct sk_psock_link), \
- GFP_ATOMIC | __GFP_NOWARN))
+ kzalloc_obj(struct sk_psock_link, GFP_ATOMIC | __GFP_NOWARN)
static inline void sk_psock_free_link(struct sk_psock_link *link)
{
diff --git a/include/linux/slab.h b/include/linux/slab.h
index c5fde8740281..a5a5e4108ae5 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -1003,11 +1003,7 @@ void *kmalloc_nolock_noprof(size_t size, gfp_t gfp_flags, int node);
({ \
const size_t __count = (COUNT); \
const size_t __obj_size = struct_size_t(TYPE, FAM, __count); \
- TYPE *__obj_ptr; \
- if (WARN_ON_ONCE(overflows_flex_counter_type(TYPE, FAM, __count))) \
- __obj_ptr = NULL; \
- else \
- __obj_ptr = KMALLOC(__obj_size, GFP); \
+ TYPE *__obj_ptr = KMALLOC(__obj_size, GFP); \
if (__obj_ptr) \
__set_flex_counter(__obj_ptr->FAM, __count); \
__obj_ptr; \
@@ -1021,8 +1017,8 @@ void *kmalloc_nolock_noprof(size_t size, gfp_t gfp_flags, int node);
* Returns: newly allocated pointer to a @VAR_OR_TYPE on success, or NULL
* on failure.
*/
-#define kmalloc_obj(VAR_OR_TYPE, GFP) \
- __alloc_objs(kmalloc, GFP, typeof(VAR_OR_TYPE), 1)
+#define kmalloc_obj(VAR_OR_TYPE, ...) \
+ __alloc_objs(kmalloc, default_gfp(__VA_ARGS__), typeof(VAR_OR_TYPE), 1)
/**
* kmalloc_objs - Allocate an array of the given type
@@ -1033,8 +1029,8 @@ void *kmalloc_nolock_noprof(size_t size, gfp_t gfp_flags, int node);
* Returns: newly allocated pointer to array of @VAR_OR_TYPE on success,
* or NULL on failure.
*/
-#define kmalloc_objs(VAR_OR_TYPE, COUNT, GFP) \
- __alloc_objs(kmalloc, GFP, typeof(VAR_OR_TYPE), COUNT)
+#define kmalloc_objs(VAR_OR_TYPE, COUNT, ...) \
+ __alloc_objs(kmalloc, default_gfp(__VA_ARGS__), typeof(VAR_OR_TYPE), COUNT)
/**
* kmalloc_flex - Allocate a single instance of the given flexible structure
@@ -1048,32 +1044,32 @@ void *kmalloc_nolock_noprof(size_t size, gfp_t gfp_flags, int node);
* will immediately fail if @COUNT is larger than what the type of the
* struct's counter variable can represent.
*/
-#define kmalloc_flex(VAR_OR_TYPE, FAM, COUNT, GFP) \
- __alloc_flex(kmalloc, GFP, typeof(VAR_OR_TYPE), FAM, COUNT)
+#define kmalloc_flex(VAR_OR_TYPE, FAM, COUNT, ...) \
+ __alloc_flex(kmalloc, default_gfp(__VA_ARGS__), typeof(VAR_OR_TYPE), FAM, COUNT)
/* All kzalloc aliases for kmalloc_(obj|objs|flex). */
-#define kzalloc_obj(P, GFP) \
- __alloc_objs(kzalloc, GFP, typeof(P), 1)
-#define kzalloc_objs(P, COUNT, GFP) \
- __alloc_objs(kzalloc, GFP, typeof(P), COUNT)
-#define kzalloc_flex(P, FAM, COUNT, GFP) \
- __alloc_flex(kzalloc, GFP, typeof(P), FAM, COUNT)
+#define kzalloc_obj(P, ...) \
+ __alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
+#define kzalloc_objs(P, COUNT, ...) \
+ __alloc_objs(kzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
+#define kzalloc_flex(P, FAM, COUNT, ...) \
+ __alloc_flex(kzalloc, default_gfp(__VA_ARGS__), typeof(P), FAM, COUNT)
/* All kvmalloc aliases for kmalloc_(obj|objs|flex). */
-#define kvmalloc_obj(P, GFP) \
- __alloc_objs(kvmalloc, GFP, typeof(P), 1)
-#define kvmalloc_objs(P, COUNT, GFP) \
- __alloc_objs(kvmalloc, GFP, typeof(P), COUNT)
-#define kvmalloc_flex(P, FAM, COUNT, GFP) \
- __alloc_flex(kvmalloc, GFP, typeof(P), FAM, COUNT)
+#define kvmalloc_obj(P, ...) \
+ __alloc_objs(kvmalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
+#define kvmalloc_objs(P, COUNT, ...) \
+ __alloc_objs(kvmalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
+#define kvmalloc_flex(P, FAM, COUNT, ...) \
+ __alloc_flex(kvmalloc, default_gfp(__VA_ARGS__), typeof(P), FAM, COUNT)
/* All kvzalloc aliases for kmalloc_(obj|objs|flex). */
-#define kvzalloc_obj(P, GFP) \
- __alloc_objs(kvzalloc, GFP, typeof(P), 1)
-#define kvzalloc_objs(P, COUNT, GFP) \
- __alloc_objs(kvzalloc, GFP, typeof(P), COUNT)
-#define kvzalloc_flex(P, FAM, COUNT, GFP) \
- __alloc_flex(kvzalloc, GFP, typeof(P), FAM, COUNT)
+#define kvzalloc_obj(P, ...) \
+ __alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), 1)
+#define kvzalloc_objs(P, COUNT, ...) \
+ __alloc_objs(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), COUNT)
+#define kvzalloc_flex(P, FAM, COUNT, ...) \
+ __alloc_flex(kvzalloc, default_gfp(__VA_ARGS__), typeof(P), FAM, COUNT)
#define kmem_buckets_alloc(_b, _size, _flags) \
alloc_hooks(__kmalloc_node_noprof(PASS_BUCKET_PARAMS(_size, _b), _flags, NUMA_NO_NODE))
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index fd8dce4169f7..af7cfee7b8f6 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -1309,7 +1309,7 @@ static inline struct spi_message *spi_message_alloc(unsigned ntrans, gfp_t flags
} *mwt;
unsigned i;
- mwt = kzalloc(struct_size(mwt, t, ntrans), flags);
+ mwt = kzalloc_flex(*mwt, t, ntrans, flags);
if (!mwt)
return NULL;
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index 0a2b8229b999..37eb2f0f3dd8 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -683,6 +683,11 @@ static inline void hist_poll_wakeup(void)
#define hist_poll_wait(file, wait) \
poll_wait(file, &hist_poll_wq, wait)
+
+#else
+static inline void hist_poll_wakeup(void)
+{
+}
#endif
#define __TRACE_EVENT_FLAGS(name, value) \
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 91a24b5e0b93..e1e8f0f7dacb 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -159,7 +159,7 @@ int tc_action_net_init(struct net *net, struct tc_action_net *tn,
{
int err = 0;
- tn->idrinfo = kmalloc(sizeof(*tn->idrinfo), GFP_KERNEL);
+ tn->idrinfo = kmalloc_obj(*tn->idrinfo);
if (!tn->idrinfo)
return -ENOMEM;
tn->ops = ops;
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
index d3ff48a2fbe0..533d8e75f7bb 100644
--- a/include/net/af_vsock.h
+++ b/include/net/af_vsock.h
@@ -276,10 +276,19 @@ static inline bool vsock_net_mode_global(struct vsock_sock *vsk)
return vsock_net_mode(sock_net(sk_vsock(vsk))) == VSOCK_NET_MODE_GLOBAL;
}
-static inline void vsock_net_set_child_mode(struct net *net,
+static inline bool vsock_net_set_child_mode(struct net *net,
enum vsock_net_mode mode)
{
- WRITE_ONCE(net->vsock.child_ns_mode, mode);
+ int new_locked = mode + 1;
+ int old_locked = 0; /* unlocked */
+
+ if (try_cmpxchg(&net->vsock.child_ns_mode_locked,
+ &old_locked, new_locked)) {
+ WRITE_ONCE(net->vsock.child_ns_mode, mode);
+ return true;
+ }
+
+ return old_locked == new_locked;
}
static inline enum vsock_net_mode vsock_net_child_mode(struct net *net)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index ec3af01e4db9..010f1a8fd15f 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -284,9 +284,9 @@ struct l2cap_conn_rsp {
#define L2CAP_CR_LE_BAD_KEY_SIZE 0x0007
#define L2CAP_CR_LE_ENCRYPTION 0x0008
#define L2CAP_CR_LE_INVALID_SCID 0x0009
-#define L2CAP_CR_LE_SCID_IN_USE 0X000A
-#define L2CAP_CR_LE_UNACCEPT_PARAMS 0X000B
-#define L2CAP_CR_LE_INVALID_PARAMS 0X000C
+#define L2CAP_CR_LE_SCID_IN_USE 0x000A
+#define L2CAP_CR_LE_UNACCEPT_PARAMS 0x000B
+#define L2CAP_CR_LE_INVALID_PARAMS 0x000C
/* connect/create channel status */
#define L2CAP_CS_NO_INFO 0x0000
@@ -493,6 +493,8 @@ struct l2cap_ecred_reconf_req {
#define L2CAP_RECONF_SUCCESS 0x0000
#define L2CAP_RECONF_INVALID_MTU 0x0001
#define L2CAP_RECONF_INVALID_MPS 0x0002
+#define L2CAP_RECONF_INVALID_CID 0x0003
+#define L2CAP_RECONF_INVALID_PARAMS 0x0004
struct l2cap_ecred_reconf_rsp {
__le16 result;
diff --git a/include/net/fq_impl.h b/include/net/fq_impl.h
index 9467e33dfb36..8aca881937da 100644
--- a/include/net/fq_impl.h
+++ b/include/net/fq_impl.h
@@ -358,7 +358,7 @@ static int fq_init(struct fq *fq, int flows_cnt)
fq->limit = 8192;
fq->memory_limit = 16 << 20; /* 16 MBytes */
- fq->flows = kvcalloc(fq->flows_cnt, sizeof(fq->flows[0]), GFP_KERNEL);
+ fq->flows = kvzalloc_objs(fq->flows[0], fq->flows_cnt);
if (!fq->flows)
return -ENOMEM;
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index bbc9355871c7..433c2df23076 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -42,7 +42,9 @@ struct inet_connection_sock_af_ops {
struct request_sock *req,
struct dst_entry *dst,
struct request_sock *req_unhash,
- bool *own_req);
+ bool *own_req,
+ void (*opt_child_init)(struct sock *newsk,
+ const struct sock *sk));
int (*setsockopt)(struct sock *sk, int level, int optname,
sockptr_t optval, unsigned int optlen);
int (*getsockopt)(struct sock *sk, int level, int optname,
diff --git a/include/net/iucv/iucv.h b/include/net/iucv/iucv.h
index 5606ed6e7084..18f511da9a09 100644
--- a/include/net/iucv/iucv.h
+++ b/include/net/iucv/iucv.h
@@ -211,7 +211,7 @@ static inline struct iucv_path *iucv_path_alloc(u16 msglim, u8 flags, gfp_t gfp)
{
struct iucv_path *path;
- path = kzalloc(sizeof(struct iucv_path), gfp);
+ path = kzalloc_obj(struct iucv_path, gfp);
if (path) {
path->msglim = msglim;
path->flags = flags;
diff --git a/include/net/netns/vsock.h b/include/net/netns/vsock.h
index b34d69a22fa8..dc8cbe45f406 100644
--- a/include/net/netns/vsock.h
+++ b/include/net/netns/vsock.h
@@ -17,5 +17,8 @@ struct netns_vsock {
enum vsock_net_mode mode;
enum vsock_net_mode child_ns_mode;
+
+ /* 0 = unlocked, 1 = locked to global, 2 = locked to local */
+ int child_ns_mode_locked;
};
#endif /* __NET_NET_NAMESPACE_VSOCK_H */
diff --git a/include/net/sock.h b/include/net/sock.h
index 55b61e4b0d83..e7099d3d0416 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2097,7 +2097,7 @@ static inline int sk_rx_queue_get(const struct sock *sk)
static inline void sk_set_socket(struct sock *sk, struct socket *sock)
{
- sk->sk_socket = sock;
+ WRITE_ONCE(sk->sk_socket, sock);
if (sock) {
WRITE_ONCE(sk->sk_uid, SOCK_INODE(sock)->i_uid);
WRITE_ONCE(sk->sk_ino, SOCK_INODE(sock)->i_ino);
diff --git a/include/net/tc_act/tc_gate.h b/include/net/tc_act/tc_gate.h
index c1a67149c6b6..b147a3bb1a46 100644
--- a/include/net/tc_act/tc_gate.h
+++ b/include/net/tc_act/tc_gate.h
@@ -114,7 +114,7 @@ static inline struct action_gate_entry
if (i != num_entries)
return NULL;
- oe = kcalloc(num_entries, sizeof(*oe), GFP_ATOMIC);
+ oe = kzalloc_objs(*oe, num_entries, GFP_ATOMIC);
if (!oe)
return NULL;
diff --git a/include/net/tcp.h b/include/net/tcp.h
index dfcd38089f11..9921c47491a5 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -543,7 +543,9 @@ struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
struct request_sock *req,
struct dst_entry *dst,
struct request_sock *req_unhash,
- bool *own_req);
+ bool *own_req,
+ void (*opt_child_init)(struct sock *newsk,
+ const struct sock *sk));
int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb);
int tcp_v4_connect(struct sock *sk, struct sockaddr_unsized *uaddr, int addr_len);
int tcp_connect(struct sock *sk);
diff --git a/include/net/udp.h b/include/net/udp.h
index 700dbedcb15f..da68702ddf6e 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -294,8 +294,7 @@ static inline int udp_lib_init_sock(struct sock *sk)
up->forward_threshold = sk->sk_rcvbuf >> 2;
set_bit(SOCK_CUSTOM_SOCKOPT, &sk->sk_socket->flags);
- up->udp_prod_queue = kcalloc(nr_node_ids, sizeof(*up->udp_prod_queue),
- GFP_KERNEL);
+ up->udp_prod_queue = kzalloc_objs(*up->udp_prod_queue, nr_node_ids);
if (!up->udp_prod_queue)
return -ENOMEM;
for (int i = 0; i < nr_node_ids; i++)
diff --git a/include/rv/da_monitor.h b/include/rv/da_monitor.h
index db11d41bb438..7511f5464c48 100644
--- a/include/rv/da_monitor.h
+++ b/include/rv/da_monitor.h
@@ -20,6 +20,12 @@
#include <linux/bug.h>
#include <linux/sched.h>
+/*
+ * Per-cpu variables require a unique name although static in some
+ * configurations (e.g. CONFIG_DEBUG_FORCE_WEAK_PER_CPU or alpha modules).
+ */
+#define DA_MON_NAME CONCATENATE(da_mon_, MONITOR_NAME)
+
static struct rv_monitor rv_this;
static void react(enum states curr_state, enum events event)
@@ -183,14 +189,14 @@ static inline bool da_event(struct da_monitor *da_mon, struct task_struct *tsk,
/*
* global monitor (a single variable)
*/
-static struct da_monitor da_mon_this;
+static struct da_monitor DA_MON_NAME;
/*
* da_get_monitor - return the global monitor address
*/
static struct da_monitor *da_get_monitor(void)
{
- return &da_mon_this;
+ return &DA_MON_NAME;
}
/*
@@ -223,14 +229,14 @@ static inline void da_monitor_destroy(void) { }
/*
* per-cpu monitor variables
*/
-static DEFINE_PER_CPU(struct da_monitor, da_mon_this);
+static DEFINE_PER_CPU(struct da_monitor, DA_MON_NAME);
/*
* da_get_monitor - return current CPU monitor address
*/
static struct da_monitor *da_get_monitor(void)
{
- return this_cpu_ptr(&da_mon_this);
+ return this_cpu_ptr(&DA_MON_NAME);
}
/*
@@ -242,7 +248,7 @@ static void da_monitor_reset_all(void)
int cpu;
for_each_cpu(cpu, cpu_online_mask) {
- da_mon = per_cpu_ptr(&da_mon_this, cpu);
+ da_mon = per_cpu_ptr(&DA_MON_NAME, cpu);
da_monitor_reset(da_mon);
}
}
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index 1d34daa0ebcd..ebbd861ef0bc 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -1667,6 +1667,7 @@ struct drm_amdgpu_info_uq_metadata {
#define AMDGPU_FAMILY_GC_10_3_6 149 /* GC 10.3.6 */
#define AMDGPU_FAMILY_GC_10_3_7 151 /* GC 10.3.7 */
#define AMDGPU_FAMILY_GC_11_5_0 150 /* GC 11.5.0 */
+#define AMDGPU_FAMILY_GC_11_5_4 154 /* GC 11.5.4 */
#define AMDGPU_FAMILY_GC_12_0_0 152 /* GC 12.0.0 */
#if defined(__cplusplus)
diff --git a/include/uapi/linux/mshv.h b/include/uapi/linux/mshv.h
index dee3ece28ce5..e0645a34b55b 100644
--- a/include/uapi/linux/mshv.h
+++ b/include/uapi/linux/mshv.h
@@ -27,6 +27,8 @@ enum {
MSHV_PT_BIT_X2APIC,
MSHV_PT_BIT_GPA_SUPER_PAGES,
MSHV_PT_BIT_CPU_AND_XSAVE_FEATURES,
+ MSHV_PT_BIT_NESTED_VIRTUALIZATION,
+ MSHV_PT_BIT_SMT_ENABLED_GUEST,
MSHV_PT_BIT_COUNT,
};