diff options
Diffstat (limited to 'include/linux')
60 files changed, 314 insertions, 132 deletions
| diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 9f432411e988..3bdcfc4401b7 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -222,10 +222,14 @@ void __iomem *__acpi_map_table(unsigned long phys, unsigned long size);  void __acpi_unmap_table(void __iomem *map, unsigned long size);  int early_acpi_boot_init(void);  int acpi_boot_init (void); +void acpi_boot_table_prepare (void);  void acpi_boot_table_init (void);  int acpi_mps_check (void);  int acpi_numa_init (void); +int acpi_locate_initial_tables (void); +void acpi_reserve_initial_tables (void); +void acpi_table_init_complete (void);  int acpi_table_init (void);  int acpi_table_parse(char *id, acpi_tbl_table_handler handler);  int __init acpi_table_parse_entries(char *id, unsigned long table_size, @@ -814,9 +818,12 @@ static inline int acpi_boot_init(void)  	return 0;  } +static inline void acpi_boot_table_prepare(void) +{ +} +  static inline void acpi_boot_table_init(void)  { -	return;  }  static inline int acpi_mps_check(void) @@ -1079,19 +1086,25 @@ void __acpi_handle_debug(struct _ddebug *descriptor, acpi_handle handle, const c  #if defined(CONFIG_ACPI) && defined(CONFIG_GPIOLIB)  bool acpi_gpio_get_irq_resource(struct acpi_resource *ares,  				struct acpi_resource_gpio **agpio); -int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index); +int acpi_dev_gpio_irq_get_by(struct acpi_device *adev, const char *name, int index);  #else  static inline bool acpi_gpio_get_irq_resource(struct acpi_resource *ares,  					      struct acpi_resource_gpio **agpio)  {  	return false;  } -static inline int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index) +static inline int acpi_dev_gpio_irq_get_by(struct acpi_device *adev, +					   const char *name, int index)  {  	return -ENXIO;  }  #endif +static inline int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index) +{ +	return acpi_dev_gpio_irq_get_by(adev, NULL, index); +} +  /* Device properties */  #ifdef CONFIG_ACPI diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 6cc93ab5b809..c68d87b87283 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -105,8 +105,19 @@ extern struct bus_type amba_bustype;  #define amba_get_drvdata(d)	dev_get_drvdata(&d->dev)  #define amba_set_drvdata(d,p)	dev_set_drvdata(&d->dev, p) +#ifdef CONFIG_ARM_AMBA  int amba_driver_register(struct amba_driver *);  void amba_driver_unregister(struct amba_driver *); +#else +static inline int amba_driver_register(struct amba_driver *drv) +{ +	return -EINVAL; +} +static inline void amba_driver_unregister(struct amba_driver *drv) +{ +} +#endif +  struct amba_device *amba_device_alloc(const char *, resource_size_t, size_t);  void amba_device_put(struct amba_device *);  int amba_device_add(struct amba_device *, struct resource *); diff --git a/include/linux/armada-37xx-rwtm-mailbox.h b/include/linux/armada-37xx-rwtm-mailbox.h index 57bb54f6767a..ef4bd705eb65 100644 --- a/include/linux/armada-37xx-rwtm-mailbox.h +++ b/include/linux/armada-37xx-rwtm-mailbox.h @@ -2,7 +2,7 @@  /*   * rWTM BIU Mailbox driver for Armada 37xx   * - * Author: Marek Behun <[email protected]> + * Author: Marek BehĂșn <[email protected]>   */  #ifndef _LINUX_ARMADA_37XX_RWTM_MAILBOX_H_ diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 60cd25c0461b..9b02961d65ee 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h @@ -151,7 +151,7 @@ struct atm_dev {  	const char	*type;		/* device type name */  	int		number;		/* device index */  	void		*dev_data;	/* per-device data */ -	void		*phy_data;	/* private PHY date */ +	void		*phy_data;	/* private PHY data */  	unsigned long	flags;		/* device flags (ATM_DF_*) */  	struct list_head local;		/* local ATM addresses */  	struct list_head lecs;		/* LECS ATM addresses learned via ILMI */ diff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h index 40bad71865ea..532bcbfc4716 100644 --- a/include/linux/avf/virtchnl.h +++ b/include/linux/avf/virtchnl.h @@ -476,7 +476,6 @@ struct virtchnl_rss_key {  	u16 vsi_id;  	u16 key_len;  	u8 key[1];         /* RSS hash key, packed bytes */ -	u8 pad[1];  };  VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_rss_key); @@ -485,7 +484,6 @@ struct virtchnl_rss_lut {  	u16 vsi_id;  	u16 lut_entries;  	u8 lut[1];        /* RSS lookup table */ -	u8 pad[1];  };  VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_rss_lut); diff --git a/include/linux/bio.h b/include/linux/bio.h index 983ed2fe7c85..d0246c92a6e8 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -20,11 +20,11 @@  #define BIO_BUG_ON  #endif -#define BIO_MAX_PAGES		256U +#define BIO_MAX_VECS		256U  static inline unsigned int bio_max_segs(unsigned int nr_segs)  { -	return min(nr_segs, BIO_MAX_PAGES); +	return min(nr_segs, BIO_MAX_VECS);  }  #define bio_prio(bio)			(bio)->bi_ioprio diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index bc6bc8383b43..158aefae1030 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -85,8 +85,6 @@ typedef __u32 __bitwise req_flags_t;  #define RQF_ELVPRIV		((__force req_flags_t)(1 << 12))  /* account into disk and partition IO statistics */  #define RQF_IO_STAT		((__force req_flags_t)(1 << 13)) -/* request came from our alloc pool */ -#define RQF_ALLOCED		((__force req_flags_t)(1 << 14))  /* runtime pm request */  #define RQF_PM			((__force req_flags_t)(1 << 15))  /* on IO scheduler merge hash */ diff --git a/include/linux/bpf.h b/include/linux/bpf.h index cccaef1088ea..fdac0534ce79 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -21,6 +21,7 @@  #include <linux/capability.h>  #include <linux/sched/mm.h>  #include <linux/slab.h> +#include <linux/percpu-refcount.h>  struct bpf_verifier_env;  struct bpf_verifier_log; @@ -39,6 +40,7 @@ struct bpf_local_storage;  struct bpf_local_storage_map;  struct kobject;  struct mem_cgroup; +struct module;  extern struct idr btf_idr;  extern spinlock_t btf_idr_lock; @@ -556,7 +558,8 @@ struct bpf_tramp_progs {   *      fentry = a set of program to run before calling original function   *      fexit = a set of program to run after original function   */ -int arch_prepare_bpf_trampoline(void *image, void *image_end, +struct bpf_tramp_image; +int arch_prepare_bpf_trampoline(struct bpf_tramp_image *tr, void *image, void *image_end,  				const struct btf_func_model *m, u32 flags,  				struct bpf_tramp_progs *tprogs,  				void *orig_call); @@ -565,6 +568,8 @@ u64 notrace __bpf_prog_enter(struct bpf_prog *prog);  void notrace __bpf_prog_exit(struct bpf_prog *prog, u64 start);  u64 notrace __bpf_prog_enter_sleepable(struct bpf_prog *prog);  void notrace __bpf_prog_exit_sleepable(struct bpf_prog *prog, u64 start); +void notrace __bpf_tramp_enter(struct bpf_tramp_image *tr); +void notrace __bpf_tramp_exit(struct bpf_tramp_image *tr);  struct bpf_ksym {  	unsigned long		 start; @@ -583,6 +588,18 @@ enum bpf_tramp_prog_type {  	BPF_TRAMP_REPLACE, /* more than MAX */  }; +struct bpf_tramp_image { +	void *image; +	struct bpf_ksym ksym; +	struct percpu_ref pcref; +	void *ip_after_call; +	void *ip_epilogue; +	union { +		struct rcu_head rcu; +		struct work_struct work; +	}; +}; +  struct bpf_trampoline {  	/* hlist for trampoline_table */  	struct hlist_node hlist; @@ -605,9 +622,9 @@ struct bpf_trampoline {  	/* Number of attached programs. A counter per kind. */  	int progs_cnt[BPF_TRAMP_MAX];  	/* Executable image of trampoline */ -	void *image; +	struct bpf_tramp_image *cur_image;  	u64 selector; -	struct bpf_ksym ksym; +	struct module *mod;  };  struct bpf_attach_target_info { @@ -691,6 +708,8 @@ void bpf_image_ksym_add(void *data, struct bpf_ksym *ksym);  void bpf_image_ksym_del(struct bpf_ksym *ksym);  void bpf_ksym_add(struct bpf_ksym *ksym);  void bpf_ksym_del(struct bpf_ksym *ksym); +int bpf_jit_charge_modmem(u32 pages); +void bpf_jit_uncharge_modmem(u32 pages);  #else  static inline int bpf_trampoline_link_prog(struct bpf_prog *prog,  					   struct bpf_trampoline *tr) @@ -787,7 +806,6 @@ struct bpf_prog_aux {  	bool func_proto_unreliable;  	bool sleepable;  	bool tail_call_reachable; -	enum bpf_tramp_prog_type trampoline_prog_type;  	struct hlist_node tramp_hlist;  	/* BTF_KIND_FUNC_PROTO for valid attach_btf_id */  	const struct btf_type *attach_func_proto; @@ -1093,7 +1111,7 @@ int bpf_prog_array_copy(struct bpf_prog_array *old_array,  		_ret;							\  	 }) -#define __BPF_PROG_RUN_ARRAY(array, ctx, func, check_non_null)	\ +#define __BPF_PROG_RUN_ARRAY(array, ctx, func, check_non_null, set_cg_storage)	\  	({						\  		struct bpf_prog_array_item *_item;	\  		struct bpf_prog *_prog;			\ @@ -1106,7 +1124,8 @@ int bpf_prog_array_copy(struct bpf_prog_array *old_array,  			goto _out;			\  		_item = &_array->items[0];		\  		while ((_prog = READ_ONCE(_item->prog))) {		\ -			bpf_cgroup_storage_set(_item->cgroup_storage);	\ +			if (set_cg_storage)		\ +				bpf_cgroup_storage_set(_item->cgroup_storage);	\  			_ret &= func(_prog, ctx);	\  			_item++;			\  		}					\ @@ -1153,10 +1172,10 @@ _out:							\  	})  #define BPF_PROG_RUN_ARRAY(array, ctx, func)		\ -	__BPF_PROG_RUN_ARRAY(array, ctx, func, false) +	__BPF_PROG_RUN_ARRAY(array, ctx, func, false, true)  #define BPF_PROG_RUN_ARRAY_CHECK(array, ctx, func)	\ -	__BPF_PROG_RUN_ARRAY(array, ctx, func, true) +	__BPF_PROG_RUN_ARRAY(array, ctx, func, true, false)  #ifdef CONFIG_BPF_SYSCALL  DECLARE_PER_CPU(int, bpf_prog_active); diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h index 685f34cfba20..d438eb058069 100644 --- a/include/linux/can/skb.h +++ b/include/linux/can/skb.h @@ -65,8 +65,12 @@ static inline void can_skb_reserve(struct sk_buff *skb)  static inline void can_skb_set_owner(struct sk_buff *skb, struct sock *sk)  { -	if (sk) { -		sock_hold(sk); +	/* If the socket has already been closed by user space, the +	 * refcount may already be 0 (and the socket will be freed +	 * after the last TX skb has been freed). So only increase +	 * socket refcount if the refcount is > 0. +	 */ +	if (sk && refcount_inc_not_zero(&sk->sk_refcnt)) {  		skb->destructor = sock_efree;  		skb->sk = sk;  	} diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h index 04c0a5a717f7..d217c382b02d 100644 --- a/include/linux/compiler-clang.h +++ b/include/linux/compiler-clang.h @@ -31,6 +31,12 @@  #define __no_sanitize_thread  #endif +#if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) +#define __HAVE_BUILTIN_BSWAP32__ +#define __HAVE_BUILTIN_BSWAP64__ +#define __HAVE_BUILTIN_BSWAP16__ +#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ +  #if __has_feature(undefined_behavior_sanitizer)  /* GCC does not have __SANITIZE_UNDEFINED__ */  #define __no_sanitize_undefined \ diff --git a/include/linux/compiler-version.h b/include/linux/compiler-version.h new file mode 100644 index 000000000000..2b2972c77c62 --- /dev/null +++ b/include/linux/compiler-version.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifdef  __LINUX_COMPILER_VERSION_H +#error "Please do not include <linux/compiler-version.h>. This is done by the build system." +#endif +#define __LINUX_COMPILER_VERSION_H + +/* + * This header exists to force full rebuild when the compiler is upgraded. + * + * When fixdep scans this, it will find this string "CONFIG_CC_VERSION_TEXT" + * and add dependency on include/config/cc/version/text.h, which is touched + * by Kconfig when the version string from the compiler changes. + */ diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 3aaa0687e8df..94a578a96202 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -108,6 +108,8 @@ static inline void cpu_maps_update_done(void)  {  } +static inline int add_cpu(unsigned int cpu) { return 0;} +  #endif /* CONFIG_SMP */  extern struct bus_type cpu_subsys; @@ -137,6 +139,7 @@ static inline int  cpus_read_trylock(void) { return true; }  static inline void lockdep_assert_cpus_held(void) { }  static inline void cpu_hotplug_disable(void) { }  static inline void cpu_hotplug_enable(void) { } +static inline int remove_cpu(unsigned int cpu) { return -EPERM; }  static inline void smp_shutdown_nonboot_cpus(unsigned int primary_cpu) { }  #endif	/* !CONFIG_HOTPLUG_CPU */ diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 7f4ac87c0b32..5c641f930caf 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -253,7 +253,11 @@ struct target_type {  #define dm_target_passes_integrity(type) ((type)->features & DM_TARGET_PASSES_INTEGRITY)  /* - * Indicates that a target supports host-managed zoned block devices. + * Indicates support for zoned block devices: + * - DM_TARGET_ZONED_HM: the target also supports host-managed zoned + *   block devices but does not support combining different zoned models. + * - DM_TARGET_MIXED_ZONED_MODEL: the target supports combining multiple + *   devices with different zoned models.   */  #ifdef CONFIG_BLK_DEV_ZONED  #define DM_TARGET_ZONED_HM		0x00000040 @@ -275,6 +279,15 @@ struct target_type {  #define DM_TARGET_PASSES_CRYPTO		0x00000100  #define dm_target_passes_crypto(type) ((type)->features & DM_TARGET_PASSES_CRYPTO) +#ifdef CONFIG_BLK_DEV_ZONED +#define DM_TARGET_MIXED_ZONED_MODEL	0x00000200 +#define dm_target_supports_mixed_zoned_model(type) \ +	((type)->features & DM_TARGET_MIXED_ZONED_MODEL) +#else +#define DM_TARGET_MIXED_ZONED_MODEL	0x00000000 +#define dm_target_supports_mixed_zoned_model(type) (false) +#endif +  struct dm_target {  	struct dm_table *table;  	struct target_type *type; diff --git a/include/linux/efi.h b/include/linux/efi.h index 8710f5710c1d..6b5d36babfcc 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -72,8 +72,10 @@ typedef void *efi_handle_t;   */  typedef guid_t efi_guid_t __aligned(__alignof__(u32)); -#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ -	GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) +#define EFI_GUID(a, b, c, d...) (efi_guid_t){ {					\ +	(a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff,	\ +	(b) & 0xff, ((b) >> 8) & 0xff,						\ +	(c) & 0xff, ((c) >> 8) & 0xff, d } }  /*   * Generic EFI table header diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index ec4cd3921c67..cdca84e6dd6b 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -87,9 +87,7 @@ u32 ethtool_op_get_link(struct net_device *dev);  int ethtool_op_get_ts_info(struct net_device *dev, struct ethtool_ts_info *eti); -/** - * struct ethtool_link_ext_state_info - link extended state and substate. - */ +/* Link extended state and substate. */  struct ethtool_link_ext_state_info {  	enum ethtool_link_ext_state link_ext_state;  	union { @@ -129,7 +127,6 @@ struct ethtool_link_ksettings {  		__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising);  	} link_modes;  	u32	lanes; -	enum ethtool_link_mode_bit_indices link_mode;  };  /** @@ -292,6 +289,9 @@ struct ethtool_pause_stats {   *	do not attach ext_substate attribute to netlink message). If link_ext_state   *	and link_ext_substate are unknown, return -ENODATA. If not implemented,   *	link_ext_state and link_ext_substate will not be sent to userspace. + * @get_eeprom_len: Read range of EEPROM addresses for validation of + *	@get_eeprom and @set_eeprom requests. + *	Returns 0 if device does not support EEPROM access.   * @get_eeprom: Read data from the device EEPROM.   *	Should fill in the magic field.  Don't need to check len for zero   *	or wraparound.  Fill in the data argument with the eeprom values @@ -384,6 +384,8 @@ struct ethtool_pause_stats {   * @get_module_eeprom: Get the eeprom information from the plug-in module   * @get_eee: Get Energy-Efficient (EEE) supported and status.   * @set_eee: Set EEE status (enable/disable) as well as LPI timers. + * @get_tunable: Read the value of a driver / device tunable. + * @set_tunable: Set the value of a driver / device tunable.   * @get_per_queue_coalesce: Get interrupt coalescing parameters per queue.   *	It must check that the given queue number is valid. If neither a RX nor   *	a TX queue has this number, return -EINVAL. If only a RX queue or a TX @@ -547,8 +549,8 @@ struct phy_tdr_config;   * @get_sset_count: Get number of strings that @get_strings will write.   * @get_strings: Return a set of strings that describe the requested objects   * @get_stats: Return extended statistics about the PHY device. - * @start_cable_test - Start a cable test - * @start_cable_test_tdr - Start a Time Domain Reflectometry cable test + * @start_cable_test: Start a cable test + * @start_cable_test_tdr: Start a Time Domain Reflectometry cable test   *   * All operations are optional (i.e. the function pointer may be set to %NULL)   * and callers must take this into account. Callers must hold the RTNL lock. @@ -571,4 +573,12 @@ struct ethtool_phy_ops {   */  void ethtool_set_ethtool_phy_ops(const struct ethtool_phy_ops *ops); +/* + * ethtool_params_from_link_mode - Derive link parameters from a given link mode + * @link_ksettings: Link parameters to be derived from the link mode + * @link_mode: Link mode + */ +void +ethtool_params_from_link_mode(struct ethtool_link_ksettings *link_ksettings, +			      enum ethtool_link_mode_bit_indices link_mode);  #endif /* _LINUX_ETHTOOL_H */ diff --git a/include/linux/extcon.h b/include/linux/extcon.h index fd183fb9c20f..0c19010da77f 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h @@ -271,6 +271,29 @@ static inline  void devm_extcon_unregister_notifier(struct device *dev,  				struct extcon_dev *edev, unsigned int id,  				struct notifier_block *nb) { } +static inline int extcon_register_notifier_all(struct extcon_dev *edev, +					       struct notifier_block *nb) +{ +	return 0; +} + +static inline int extcon_unregister_notifier_all(struct extcon_dev *edev, +						 struct notifier_block *nb) +{ +	return 0; +} + +static inline int devm_extcon_register_notifier_all(struct device *dev, +						    struct extcon_dev *edev, +						    struct notifier_block *nb) +{ +	return 0; +} + +static inline void devm_extcon_unregister_notifier_all(struct device *dev, +						       struct extcon_dev *edev, +						       struct notifier_block *nb) { } +  static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name)  {  	return ERR_PTR(-ENODEV); diff --git a/include/linux/firmware/intel/stratix10-svc-client.h b/include/linux/firmware/intel/stratix10-svc-client.h index ebc295647581..19781b0f6429 100644 --- a/include/linux/firmware/intel/stratix10-svc-client.h +++ b/include/linux/firmware/intel/stratix10-svc-client.h @@ -56,7 +56,7 @@   * COMMAND_RECONFIG_FLAG_PARTIAL:   * Set to FPGA configuration type (full or partial).   */ -#define COMMAND_RECONFIG_FLAG_PARTIAL	1 +#define COMMAND_RECONFIG_FLAG_PARTIAL	0  /*   * Timeout settings for service clients: diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index ef49307611d2..c73b25bc9213 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -674,6 +674,8 @@ struct acpi_gpio_mapping {   * get GpioIo type explicitly, this quirk may be used.   */  #define ACPI_GPIO_QUIRK_ONLY_GPIOIO		BIT(1) +/* Use given pin as an absolute GPIO number in the system */ +#define ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER		BIT(2)  	unsigned int quirks;  }; diff --git a/include/linux/host1x.h b/include/linux/host1x.h index ce59a6a6a008..9eb77c87a83b 100644 --- a/include/linux/host1x.h +++ b/include/linux/host1x.h @@ -320,7 +320,14 @@ static inline struct host1x_device *to_host1x_device(struct device *dev)  int host1x_device_init(struct host1x_device *device);  int host1x_device_exit(struct host1x_device *device); -int host1x_client_register(struct host1x_client *client); +int __host1x_client_register(struct host1x_client *client, +			     struct lock_class_key *key); +#define host1x_client_register(class) \ +	({ \ +		static struct lock_class_key __key; \ +		__host1x_client_register(class, &__key); \ +	}) +  int host1x_client_unregister(struct host1x_client *client);  int host1x_client_suspend(struct host1x_client *client); diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h index 2ad6e92f124a..0bff345c4bc6 100644 --- a/include/linux/hugetlb_cgroup.h +++ b/include/linux/hugetlb_cgroup.h @@ -113,6 +113,11 @@ static inline bool hugetlb_cgroup_disabled(void)  	return !cgroup_subsys_enabled(hugetlb_cgrp_subsys);  } +static inline void hugetlb_cgroup_put_rsvd_cgroup(struct hugetlb_cgroup *h_cg) +{ +	css_put(&h_cg->css); +} +  extern int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,  					struct hugetlb_cgroup **ptr);  extern int hugetlb_cgroup_charge_cgroup_rsvd(int idx, unsigned long nr_pages, @@ -138,7 +143,8 @@ extern void hugetlb_cgroup_uncharge_counter(struct resv_map *resv,  extern void hugetlb_cgroup_uncharge_file_region(struct resv_map *resv,  						struct file_region *rg, -						unsigned long nr_pages); +						unsigned long nr_pages, +						bool region_del);  extern void hugetlb_cgroup_file_init(void) __init;  extern void hugetlb_cgroup_migrate(struct page *oldhpage, @@ -147,7 +153,8 @@ extern void hugetlb_cgroup_migrate(struct page *oldhpage,  #else  static inline void hugetlb_cgroup_uncharge_file_region(struct resv_map *resv,  						       struct file_region *rg, -						       unsigned long nr_pages) +						       unsigned long nr_pages, +						       bool region_del)  {  } @@ -185,6 +192,10 @@ static inline bool hugetlb_cgroup_disabled(void)  	return true;  } +static inline void hugetlb_cgroup_put_rsvd_cgroup(struct hugetlb_cgroup *h_cg) +{ +} +  static inline int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,  					       struct hugetlb_cgroup **ptr)  { diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 96556c64c95d..10c94a3936ca 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h @@ -43,13 +43,14 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,  	if (likely(success)) {  		struct vlan_pcpu_stats *pcpu_stats; -		pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); +		pcpu_stats = get_cpu_ptr(vlan->pcpu_stats);  		u64_stats_update_begin(&pcpu_stats->syncp);  		pcpu_stats->rx_packets++;  		pcpu_stats->rx_bytes += len;  		if (multicast)  			pcpu_stats->rx_multicast++;  		u64_stats_update_end(&pcpu_stats->syncp); +		put_cpu_ptr(vlan->pcpu_stats);  	} else {  		this_cpu_inc(vlan->pcpu_stats->rx_errors);  	} diff --git a/include/linux/io_uring.h b/include/linux/io_uring.h index 7cb7bd0e334c..79cde9906be0 100644 --- a/include/linux/io_uring.h +++ b/include/linux/io_uring.h @@ -5,31 +5,6 @@  #include <linux/sched.h>  #include <linux/xarray.h> -struct io_wq_work_node { -	struct io_wq_work_node *next; -}; - -struct io_wq_work_list { -	struct io_wq_work_node *first; -	struct io_wq_work_node *last; -}; - -struct io_uring_task { -	/* submission side */ -	struct xarray		xa; -	struct wait_queue_head	wait; -	struct file		*last; -	void			*io_wq; -	struct percpu_counter	inflight; -	atomic_t		in_idle; -	bool			sqpoll; - -	spinlock_t		task_lock; -	struct io_wq_work_list	task_list; -	unsigned long		task_state; -	struct callback_head	task_work; -}; -  #if defined(CONFIG_IO_URING)  struct sock *io_uring_get_socket(struct file *file);  void __io_uring_task_cancel(void); diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 42d196805f58..33cacc8af26d 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -150,7 +150,6 @@ struct irq_domain_chip_generic;   *      setting up one or more generic chips for interrupt controllers   *      drivers using the generic chip library which uses this pointer.   * @parent: Pointer to parent irq_domain to support hierarchy irq_domains - * @debugfs_file: dentry for the domain debugfs file   *   * Revmap data, used internally by irq_domain   * @revmap_direct_max_irq: The largest hwirq that can be set for controllers that @@ -174,9 +173,6 @@ struct irq_domain {  #ifdef	CONFIG_IRQ_DOMAIN_HIERARCHY  	struct irq_domain *parent;  #endif -#ifdef CONFIG_GENERIC_IRQ_DEBUGFS -	struct dentry		*debugfs_file; -#endif  	/* reverse map data. The linear map gets appended to the irq_domain */  	irq_hw_number_t hwirq_max; diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h index e78e17a76dc9..24a59cb06963 100644 --- a/include/linux/kconfig.h +++ b/include/linux/kconfig.h @@ -2,8 +2,6 @@  #ifndef __LINUX_KCONFIG_H  #define __LINUX_KCONFIG_H -/* CONFIG_CC_VERSION_TEXT (Do not delete this comment. See help in Kconfig) */ -  #include <generated/autoconf.h>  #ifdef CONFIG_CPU_BIG_ENDIAN diff --git a/include/linux/memblock.h b/include/linux/memblock.h index c88bc24e31aa..5984fff3f175 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -460,7 +460,7 @@ static inline void memblock_free_late(phys_addr_t base, phys_addr_t size)  /*   * Set the allocation direction to bottom-up or top-down.   */ -static inline void memblock_set_bottom_up(bool enable) +static inline __init_memblock void memblock_set_bottom_up(bool enable)  {  	memblock.bottom_up = enable;  } @@ -470,7 +470,7 @@ static inline void memblock_set_bottom_up(bool enable)   * if this is true, that said, memblock will allocate memory   * in bottom-up direction.   */ -static inline bool memblock_bottom_up(void) +static inline __init_memblock bool memblock_bottom_up(void)  {  	return memblock.bottom_up;  } diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index e6dc793d587d..0c04d39a7967 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1061,9 +1061,7 @@ static inline void memcg_memory_event_mm(struct mm_struct *mm,  	rcu_read_unlock();  } -#ifdef CONFIG_TRANSPARENT_HUGEPAGE -void mem_cgroup_split_huge_fixup(struct page *head); -#endif +void split_page_memcg(struct page *head, unsigned int nr);  #else /* CONFIG_MEMCG */ @@ -1400,7 +1398,7 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order,  	return 0;  } -static inline void mem_cgroup_split_huge_fixup(struct page *head) +static inline void split_page_memcg(struct page *head, unsigned int nr)  {  } diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index df5d91c8b2d4..9c68b2da14c6 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -437,11 +437,11 @@ struct mlx5_ifc_flow_table_prop_layout_bits {  	u8         reserved_at_60[0x18];  	u8         log_max_ft_num[0x8]; -	u8         reserved_at_80[0x18]; +	u8         reserved_at_80[0x10]; +	u8         log_max_flow_counter[0x8];  	u8         log_max_destination[0x8]; -	u8         log_max_flow_counter[0x8]; -	u8         reserved_at_a8[0x10]; +	u8         reserved_at_a0[0x18];  	u8         log_max_flow[0x8];  	u8         reserved_at_c0[0x40]; @@ -8835,6 +8835,8 @@ struct mlx5_ifc_pplm_reg_bits {  	u8         fec_override_admin_100g_2x[0x10];  	u8         fec_override_admin_50g_1x[0x10]; + +	u8         reserved_at_140[0x140];  };  struct mlx5_ifc_ppcnt_reg_bits { @@ -10198,7 +10200,7 @@ struct mlx5_ifc_pbmc_reg_bits {  	struct mlx5_ifc_bufferx_reg_bits buffer[10]; -	u8         reserved_at_2e0[0x40]; +	u8         reserved_at_2e0[0x80];  };  struct mlx5_ifc_qtct_reg_bits { diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h index d75ef8aa8fac..b7deb790f257 100644 --- a/include/linux/mlx5/qp.h +++ b/include/linux/mlx5/qp.h @@ -547,4 +547,11 @@ static inline const char *mlx5_qp_state_str(int state)  	}  } +static inline int mlx5_get_qp_default_ts(struct mlx5_core_dev *dev) +{ +	return !MLX5_CAP_ROCE(dev, qp_ts_format) ? +		       MLX5_QPC_TIMESTAMP_FORMAT_FREE_RUNNING : +		       MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT; +} +  #endif /* MLX5_QP_H */ diff --git a/include/linux/mm.h b/include/linux/mm.h index 77e64e3eac80..8ba434287387 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1300,6 +1300,27 @@ static inline bool page_maybe_dma_pinned(struct page *page)  		GUP_PIN_COUNTING_BIAS;  } +static inline bool is_cow_mapping(vm_flags_t flags) +{ +	return (flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE; +} + +/* + * This should most likely only be called during fork() to see whether we + * should break the cow immediately for a page on the src mm. + */ +static inline bool page_needs_cow_for_dma(struct vm_area_struct *vma, +					  struct page *page) +{ +	if (!is_cow_mapping(vma->vm_flags)) +		return false; + +	if (!atomic_read(&vma->vm_mm->has_pinned)) +		return false; + +	return page_maybe_dma_pinned(page); +} +  #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)  #define SECTION_IN_PAGE_FLAGS  #endif @@ -1440,16 +1461,28 @@ static inline bool cpupid_match_pid(struct task_struct *task, int cpupid)  #if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS) +/* + * KASAN per-page tags are stored xor'ed with 0xff. This allows to avoid + * setting tags for all pages to native kernel tag value 0xff, as the default + * value 0x00 maps to 0xff. + */ +  static inline u8 page_kasan_tag(const struct page *page)  { -	if (kasan_enabled()) -		return (page->flags >> KASAN_TAG_PGSHIFT) & KASAN_TAG_MASK; -	return 0xff; +	u8 tag = 0xff; + +	if (kasan_enabled()) { +		tag = (page->flags >> KASAN_TAG_PGSHIFT) & KASAN_TAG_MASK; +		tag ^= 0xff; +	} + +	return tag;  }  static inline void page_kasan_tag_set(struct page *page, u8 tag)  {  	if (kasan_enabled()) { +		tag ^= 0xff;  		page->flags &= ~(KASAN_TAG_MASK << KASAN_TAG_PGSHIFT);  		page->flags |= (tag & KASAN_TAG_MASK) << KASAN_TAG_PGSHIFT;  	} diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 0974ad501a47..6613b26a8894 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -23,6 +23,7 @@  #endif  #define AT_VECTOR_SIZE (2*(AT_VECTOR_SIZE_ARCH + AT_VECTOR_SIZE_BASE + 1)) +#define INIT_PASID	0  struct address_space;  struct mem_cgroup; diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index b8200782dede..1a6a9eb6d3fa 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -169,11 +169,11 @@ struct mmu_notifier_ops {  	 * the last refcount is dropped.  	 *  	 * If blockable argument is set to false then the callback cannot -	 * sleep and has to return with -EAGAIN. 0 should be returned -	 * otherwise. Please note that if invalidate_range_start approves -	 * a non-blocking behavior then the same applies to -	 * invalidate_range_end. -	 * +	 * sleep and has to return with -EAGAIN if sleeping would be required. +	 * 0 should be returned otherwise. Please note that notifiers that can +	 * fail invalidate_range_start are not allowed to implement +	 * invalidate_range_end, as there is no mechanism for informing the +	 * notifier that its start failed.  	 */  	int (*invalidate_range_start)(struct mmu_notifier *subscription,  				      const struct mmu_notifier_range *range); diff --git a/include/linux/module.h b/include/linux/module.h index 59f094fa6f74..da4b6fbe8ebe 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -30,9 +30,6 @@  #include <linux/percpu.h>  #include <asm/module.h> -/* Not Yet Implemented */ -#define MODULE_SUPPORTED_DEVICE(name) -  #define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN  struct modversion_info { diff --git a/include/linux/moxtet.h b/include/linux/moxtet.h index 490db6886dcc..79184948fab4 100644 --- a/include/linux/moxtet.h +++ b/include/linux/moxtet.h @@ -2,7 +2,7 @@  /*   * Turris Mox module configuration bus driver   * - * Copyright (C) 2019 Marek Behun <[email protected]> + * Copyright (C) 2019 Marek BehĂșn <[email protected]>   */  #ifndef __LINUX_MOXTET_H diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 0cd631a19727..515cff77a4f4 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -185,7 +185,7 @@ extern void mutex_lock_io(struct mutex *lock);  # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)  # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock)  # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock) -# define mutex_lock_io_nested(lock, subclass) mutex_lock(lock) +# define mutex_lock_io_nested(lock, subclass) mutex_lock_io(lock)  #endif  /* diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f06fbee8638e..87a5d186faff 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -360,6 +360,7 @@ enum {  	NAPI_STATE_IN_BUSY_POLL,	/* sk_busy_loop() owns this NAPI */  	NAPI_STATE_PREFER_BUSY_POLL,	/* prefer busy-polling over softirq processing*/  	NAPI_STATE_THREADED,		/* The poll is performed inside its own thread*/ +	NAPI_STATE_SCHED_THREADED,	/* Napi is currently scheduled in threaded mode */  };  enum { @@ -372,6 +373,7 @@ enum {  	NAPIF_STATE_IN_BUSY_POLL	= BIT(NAPI_STATE_IN_BUSY_POLL),  	NAPIF_STATE_PREFER_BUSY_POLL	= BIT(NAPI_STATE_PREFER_BUSY_POLL),  	NAPIF_STATE_THREADED		= BIT(NAPI_STATE_THREADED), +	NAPIF_STATE_SCHED_THREADED	= BIT(NAPI_STATE_SCHED_THREADED),  };  enum gro_result { @@ -3959,8 +3961,6 @@ int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,  int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);  u32 dev_xdp_prog_id(struct net_device *dev, enum bpf_xdp_mode mode); -int xdp_umem_query(struct net_device *dev, u16 queue_id); -  int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);  int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);  int dev_forward_skb_nomtu(struct net_device *dev, struct sk_buff *skb); diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 8ebb64193757..8ec48466410a 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -227,7 +227,7 @@ struct xt_table {  	unsigned int valid_hooks;  	/* Man behind the curtain... */ -	struct xt_table_info __rcu *private; +	struct xt_table_info *private;  	/* Set this to THIS_MODULE if you are a module, otherwise NULL */  	struct module *me; @@ -376,7 +376,7 @@ static inline unsigned int xt_write_recseq_begin(void)  	 * since addend is most likely 1  	 */  	__this_cpu_add(xt_recseq.sequence, addend); -	smp_wmb(); +	smp_mb();  	return addend;  } @@ -448,9 +448,6 @@ xt_get_per_cpu_counter(struct xt_counters *cnt, unsigned int cpu)  struct nf_hook_ops *xt_hook_ops_alloc(const struct xt_table *, nf_hookfn *); -struct xt_table_info -*xt_table_get_private_protected(const struct xt_table *table); -  #ifdef CONFIG_COMPAT  #include <net/compat.h> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 20225b067583..8c9947fd62f3 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -559,7 +559,6 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma,  	return pgoff;  } -/* This has the same layout as wait_bit_key - see fs/cachefiles/rdwr.c */  struct wait_page_key {  	struct page *page;  	int bit_nr; @@ -683,6 +682,7 @@ static inline int wait_on_page_locked_killable(struct page *page)  int put_and_wait_on_page_locked(struct page *page, int state);  void wait_on_page_writeback(struct page *page); +int wait_on_page_writeback_killable(struct page *page);  extern void end_page_writeback(struct page *page);  void wait_for_stable_page(struct page *page); diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index fab42cfbd350..3f7f89ea5e51 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -606,6 +606,7 @@ struct swevent_hlist {  #define PERF_ATTACH_TASK	0x04  #define PERF_ATTACH_TASK_DATA	0x08  #define PERF_ATTACH_ITRACE	0x10 +#define PERF_ATTACH_SCHED_CB	0x20  struct perf_cgroup;  struct perf_buffer; @@ -872,6 +873,7 @@ struct perf_cpu_context {  	struct list_head		cgrp_cpuctx_entry;  #endif +	struct list_head		sched_cb_entry;  	int				sched_cb_usage;  	int				online; diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index cdfc4e9f253e..5e772392a379 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -904,6 +904,10 @@ static inline void ptep_modify_prot_commit(struct vm_area_struct *vma,  #define pgprot_device pgprot_noncached  #endif +#ifndef pgprot_mhp +#define pgprot_mhp(prot)	(prot) +#endif +  #ifdef CONFIG_MMU  #ifndef pgprot_modify  #define pgprot_modify pgprot_modify diff --git a/include/linux/property.h b/include/linux/property.h index dafccfce0262..dd4687b56239 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -488,7 +488,7 @@ fwnode_create_software_node(const struct property_entry *properties,  			    const struct fwnode_handle *parent);  void fwnode_remove_software_node(struct fwnode_handle *fwnode); -int device_add_software_node(struct device *dev, const struct software_node *swnode); +int device_add_software_node(struct device *dev, const struct software_node *node);  void device_remove_software_node(struct device *dev);  int device_create_managed_software_node(struct device *dev, diff --git a/include/linux/qcom-geni-se.h b/include/linux/qcom-geni-se.h index ec2ad4b0fe14..c4fdb4463f7d 100644 --- a/include/linux/qcom-geni-se.h +++ b/include/linux/qcom-geni-se.h @@ -460,7 +460,5 @@ void geni_icc_set_tag(struct geni_se *se, u32 tag);  int geni_icc_enable(struct geni_se *se);  int geni_icc_disable(struct geni_se *se); - -void geni_remove_earlycon_icc_vote(void);  #endif  #endif diff --git a/include/linux/regulator/pca9450.h b/include/linux/regulator/pca9450.h index ccdb5320a240..71902f41c919 100644 --- a/include/linux/regulator/pca9450.h +++ b/include/linux/regulator/pca9450.h @@ -147,6 +147,9 @@ enum {  #define BUCK6_FPWM			0x04  #define BUCK6_ENMODE_MASK		0x03 +/* PCA9450_REG_BUCK123_PRESET_EN bit */ +#define BUCK123_PRESET_EN		0x80 +  /* PCA9450_BUCK1OUT_DVS0 bits */  #define BUCK1OUT_DVS0_MASK		0x7F  #define BUCK1OUT_DVS0_DEFAULT		0x14 diff --git a/include/linux/restart_block.h b/include/linux/restart_block.h index bba2920e9c05..980a65594412 100644 --- a/include/linux/restart_block.h +++ b/include/linux/restart_block.h @@ -23,6 +23,7 @@ enum timespec_type {   * System call restart block.   */  struct restart_block { +	unsigned long arch_data;  	long (*fn)(struct restart_block *);  	union {  		/* For futex_wait and futex_wait_requeue_pi */ diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index 1ae08b8462a4..90b2a0bce11c 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -140,7 +140,8 @@ static inline bool in_vfork(struct task_struct *tsk)  	 * another oom-unkillable task does this it should blame itself.  	 */  	rcu_read_lock(); -	ret = tsk->vfork_done && tsk->real_parent->mm == tsk->mm; +	ret = tsk->vfork_done && +			rcu_dereference(tsk->real_parent)->mm == tsk->mm;  	rcu_read_unlock();  	return ret; diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 2f7bb92b4c9e..f61e34fbaaea 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h @@ -664,10 +664,7 @@ typedef struct {   * seqcount_latch_init() - runtime initializer for seqcount_latch_t   * @s: Pointer to the seqcount_latch_t instance   */ -static inline void seqcount_latch_init(seqcount_latch_t *s) -{ -	seqcount_init(&s->seqcount); -} +#define seqcount_latch_init(s) seqcount_init(&(s)->seqcount)  /**   * raw_read_seqcount_latch() - pick even/odd latch data copy diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 6d0a33d1c0db..f2c9ee71cb2c 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -285,6 +285,7 @@ struct nf_bridge_info {  struct tc_skb_ext {  	__u32 chain;  	__u16 mru; +	bool post_ct;  };  #endif diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h index 8edbbf5f2f93..822c048934e3 100644 --- a/include/linux/skmsg.h +++ b/include/linux/skmsg.h @@ -349,8 +349,13 @@ static inline void sk_psock_update_proto(struct sock *sk,  static inline void sk_psock_restore_proto(struct sock *sk,  					  struct sk_psock *psock)  { -	sk->sk_prot->unhash = psock->saved_unhash;  	if (inet_csk_has_ulp(sk)) { +		/* TLS does not have an unhash proto in SW cases, but we need +		 * to ensure we stop using the sock_map unhash routine because +		 * the associated psock is being removed. So use the original +		 * unhash handler. +		 */ +		WRITE_ONCE(sk->sk_prot->unhash, psock->saved_unhash);  		tcp_update_ulp(sk, psock->sk_proto, psock->saved_write_space);  	} else {  		sk->sk_write_space = psock->saved_write_space; diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index 30577c3aecf8..46fb3ebdd16e 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h @@ -128,7 +128,7 @@ int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data,  				   const struct cpumask *cpus);  #else	/* CONFIG_SMP || CONFIG_HOTPLUG_CPU */ -static inline int stop_machine_cpuslocked(cpu_stop_fn_t fn, void *data, +static __always_inline int stop_machine_cpuslocked(cpu_stop_fn_t fn, void *data,  					  const struct cpumask *cpus)  {  	unsigned long flags; @@ -139,14 +139,15 @@ static inline int stop_machine_cpuslocked(cpu_stop_fn_t fn, void *data,  	return ret;  } -static inline int stop_machine(cpu_stop_fn_t fn, void *data, -			       const struct cpumask *cpus) +static __always_inline int +stop_machine(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus)  {  	return stop_machine_cpuslocked(fn, data, cpus);  } -static inline int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data, -						 const struct cpumask *cpus) +static __always_inline int +stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data, +			       const struct cpumask *cpus)  {  	return stop_machine(fn, data, cpus);  } diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index 7c693b31965e..1e76ed688044 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h @@ -104,7 +104,6 @@ struct svcxprt_rdma {  	wait_queue_head_t    sc_send_wait;	/* SQ exhaustion waitlist */  	unsigned long	     sc_flags; -	u32		     sc_pending_recvs;  	struct list_head     sc_read_complete_q;  	struct work_struct   sc_work; diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h index 13770cfe33ad..6673e4d4ac2e 100644 --- a/include/linux/textsearch.h +++ b/include/linux/textsearch.h @@ -23,7 +23,7 @@ struct ts_config;  struct ts_state  {  	unsigned int		offset; -	char			cb[40]; +	char			cb[48];  };  /** diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index 9b2158c69275..157762db9d4b 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -11,6 +11,7 @@  #include <linux/types.h>  #include <linux/bug.h>  #include <linux/restart_block.h> +#include <linux/errno.h>  #ifdef CONFIG_THREAD_INFO_IN_TASK  /* @@ -59,6 +60,18 @@ enum syscall_work_bit {  #ifdef __KERNEL__ +#ifndef arch_set_restart_data +#define arch_set_restart_data(restart) do { } while (0) +#endif + +static inline long set_restart_fn(struct restart_block *restart, +					long (*fn)(struct restart_block *)) +{ +	restart->fn = fn; +	arch_set_restart_data(restart); +	return -ERESTART_RESTARTBLOCK; +} +  #ifndef THREAD_ALIGN  #define THREAD_ALIGN	THREAD_SIZE  #endif diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h index c6abb79501b3..e81856c0ba13 100644 --- a/include/linux/u64_stats_sync.h +++ b/include/linux/u64_stats_sync.h @@ -115,12 +115,13 @@ static inline void u64_stats_inc(u64_stats_t *p)  }  #endif +#if BITS_PER_LONG == 32 && defined(CONFIG_SMP) +#define u64_stats_init(syncp)	seqcount_init(&(syncp)->seq) +#else  static inline void u64_stats_init(struct u64_stats_sync *syncp)  { -#if BITS_PER_LONG == 32 && defined(CONFIG_SMP) -	seqcount_init(&syncp->seq); -#endif  } +#endif  static inline void u64_stats_update_begin(struct u64_stats_sync *syncp)  { diff --git a/include/linux/usb.h b/include/linux/usb.h index 7d72c4e0713c..d6a41841b93e 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -746,6 +746,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,  extern int usb_reset_device(struct usb_device *dev);  extern void usb_queue_reset_device(struct usb_interface *dev); +extern struct device *usb_intf_get_dma_device(struct usb_interface *intf); +  #ifdef CONFIG_ACPI  extern int usb_acpi_set_power_state(struct usb_device *hdev, int index,  	bool enable); diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 6b03fdd69d27..712363c7a2e8 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h @@ -86,6 +86,8 @@  		/* lies about caching, so always sync */	\  	US_FLAG(NO_SAME, 0x40000000)				\  		/* Cannot handle WRITE_SAME */			\ +	US_FLAG(SENSE_AFTER_SYNC, 0x80000000)			\ +		/* Do REQUEST_SENSE after SYNCHRONIZE_CACHE */	\  #define US_FLAG(name, value)	US_FL_##name = value ,  enum { US_DO_ALL_FLAGS }; diff --git a/include/linux/usermode_driver.h b/include/linux/usermode_driver.h index 073a9e0ec07d..ad970416260d 100644 --- a/include/linux/usermode_driver.h +++ b/include/linux/usermode_driver.h @@ -14,5 +14,6 @@ struct umd_info {  int umd_load_blob(struct umd_info *info, const void *data, size_t len);  int umd_unload_blob(struct umd_info *info);  int fork_usermode_driver(struct umd_info *info); +void umd_cleanup_helper(struct umd_info *info);  #endif /* __LINUX_USERMODE_DRIVER_H__ */ diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 4ab5494503a8..15fa085fab05 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -250,20 +250,20 @@ struct vdpa_config_ops {  struct vdpa_device *__vdpa_alloc_device(struct device *parent,  					const struct vdpa_config_ops *config, -					int nvqs, size_t size, const char *name); +					size_t size, const char *name); -#define vdpa_alloc_device(dev_struct, member, parent, config, nvqs, name)   \ +#define vdpa_alloc_device(dev_struct, member, parent, config, name)   \  			  container_of(__vdpa_alloc_device( \ -				       parent, config, nvqs, \ +				       parent, config, \  				       sizeof(dev_struct) + \  				       BUILD_BUG_ON_ZERO(offsetof( \  				       dev_struct, member)), name), \  				       dev_struct, member) -int vdpa_register_device(struct vdpa_device *vdev); +int vdpa_register_device(struct vdpa_device *vdev, int nvqs);  void vdpa_unregister_device(struct vdpa_device *vdev); -int _vdpa_register_device(struct vdpa_device *vdev); +int _vdpa_register_device(struct vdpa_device *vdev, int nvqs);  void _vdpa_unregister_device(struct vdpa_device *vdev);  /** diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 55ea329fe72a..b1894e0323fa 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -132,8 +132,6 @@ bool is_virtio_device(struct device *dev);  void virtio_break_device(struct virtio_device *dev);  void virtio_config_changed(struct virtio_device *dev); -void virtio_config_disable(struct virtio_device *dev); -void virtio_config_enable(struct virtio_device *dev);  int virtio_finalize_features(struct virtio_device *dev);  #ifdef CONFIG_PM_SLEEP  int virtio_device_freeze(struct virtio_device *dev); diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index e8a924eeea3d..b465f8f3e554 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h @@ -62,15 +62,21 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,  			return -EINVAL;  	} +	skb_reset_mac_header(skb); +  	if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { -		u16 start = __virtio16_to_cpu(little_endian, hdr->csum_start); -		u16 off = __virtio16_to_cpu(little_endian, hdr->csum_offset); +		u32 start = __virtio16_to_cpu(little_endian, hdr->csum_start); +		u32 off = __virtio16_to_cpu(little_endian, hdr->csum_offset); +		u32 needed = start + max_t(u32, thlen, off + sizeof(__sum16)); + +		if (!pskb_may_pull(skb, needed)) +			return -EINVAL;  		if (!skb_partial_csum_set(skb, start, off))  			return -EINVAL;  		p_off = skb_transport_offset(skb) + thlen; -		if (p_off > skb_headlen(skb)) +		if (!pskb_may_pull(skb, p_off))  			return -EINVAL;  	} else {  		/* gso packets without NEEDS_CSUM do not set transport_offset. @@ -79,8 +85,13 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,  		if (gso_type && skb->network_header) {  			struct flow_keys_basic keys; -			if (!skb->protocol) +			if (!skb->protocol) { +				__be16 protocol = dev_parse_header_protocol(skb); +  				virtio_net_hdr_set_proto(skb, hdr); +				if (protocol && protocol != skb->protocol) +					return -EINVAL; +			}  retry:  			if (!skb_flow_dissect_flow_keys_basic(NULL, skb, &keys,  							      NULL, 0, 0, 0, @@ -95,14 +106,14 @@ retry:  			}  			p_off = keys.control.thoff + thlen; -			if (p_off > skb_headlen(skb) || +			if (!pskb_may_pull(skb, p_off) ||  			    keys.basic.ip_proto != ip_proto)  				return -EINVAL;  			skb_set_transport_header(skb, keys.control.thoff);  		} else if (gso_type) {  			p_off = thlen; -			if (p_off > skb_headlen(skb)) +			if (!pskb_may_pull(skb, p_off))  				return -EINVAL;  		}  	} diff --git a/include/linux/ww_mutex.h b/include/linux/ww_mutex.h index 850424e5d030..6ecf2a0220db 100644 --- a/include/linux/ww_mutex.h +++ b/include/linux/ww_mutex.h @@ -173,9 +173,10 @@ static inline void ww_acquire_done(struct ww_acquire_ctx *ctx)   */  static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx)  { -#ifdef CONFIG_DEBUG_MUTEXES +#ifdef CONFIG_DEBUG_LOCK_ALLOC  	mutex_release(&ctx->dep_map, _THIS_IP_); - +#endif +#ifdef CONFIG_DEBUG_MUTEXES  	DEBUG_LOCKS_WARN_ON(ctx->acquired);  	if (!IS_ENABLED(CONFIG_PROVE_LOCKING))  		/* diff --git a/include/linux/xarray.h b/include/linux/xarray.h index 92c0160b3352..a91e3d90df8a 100644 --- a/include/linux/xarray.h +++ b/include/linux/xarray.h @@ -229,9 +229,10 @@ static inline int xa_err(void *entry)   *   * This structure is used either directly or via the XA_LIMIT() macro   * to communicate the range of IDs that are valid for allocation. - * Two common ranges are predefined for you: + * Three common ranges are predefined for you:   * * xa_limit_32b	- [0 - UINT_MAX]   * * xa_limit_31b	- [0 - INT_MAX] + * * xa_limit_16b	- [0 - USHRT_MAX]   */  struct xa_limit {  	u32 max; @@ -242,6 +243,7 @@ struct xa_limit {  #define xa_limit_32b	XA_LIMIT(0, UINT_MAX)  #define xa_limit_31b	XA_LIMIT(0, INT_MAX) +#define xa_limit_16b	XA_LIMIT(0, USHRT_MAX)  typedef unsigned __bitwise xa_mark_t;  #define XA_MARK_0		((__force xa_mark_t)0U) |