Merge branch 'android11-5.4' into 'android11-5.4-lts'

Sync up with android11-5.4 for the following commits:

0821bcfb48 UPSTREAM: mm/cma.c: remove redundant cma_mutex lock
2d5e3ef632 ANDROID: ABI: update allowed list for galaxy
e3e60153a4 BACKPORT: remoteproc: core: Remove casting to rproc_handle_resource_t
046c52c95b UPSTREAM: scsi: ufs: ufs-mediatek: Correct operator & -> &&
0475956802 UPSTREAM: kbuild: do not include include/config/auto.conf from adjust_autoksyms.sh
24797c44c3 UPSTREAM: udp: ipv4: manipulate network header of NATed UDP GRO fraglist
550b2c0dce UPSTREAM: net: fix use-after-free when UDP GRO with shared fraglist
e7e2f8329c UPSTREAM: scsi: ufs: Fix possible power drain during system suspend
2e09274b7c UPSTREAM: scsi: ufs: Re-enable WriteBooster after device reset
b55ed54016 UPSTREAM: driver: core: Fix list corruption after device_del()
d9d13f4b76 UPSTREAM: f2fs: fix double free of unicode map
be192b51bf UPSTREAM: sched/fair: Prefer prev cpu in asymmetric wakeup path
3f54d632a6 UPSTREAM: scsi: ufshcd: Fix missing destroy_workqueue()
e6d3c97bac UPSTREAM: xfrm/compat: Translate by copying XFRMA_UNSPEC attribute
957e971ed9 UPSTREAM: xfrm/compat: memset(0) 64-bit padding at right place
ee97d20c7e UPSTREAM: xfrm/compat: Don't allocate memory with __GFP_ZERO
a9cedd3032 BACKPORT: scsi: ufs: Fix missing brace warning for old compilers
dee5558ec9 UPSTREAM: net: xfrm: fix memory leak in xfrm_user_policy()
7db1c96c2d BACKPORT: net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string
305c5f5486 UPSTREAM: mac80211_hwsim: use GFP_ATOMIC under spin lock
48ffcbf0b9 FROMGIT: kbuild: update config_data.gz only when the content of .config is changed
c8cd528e75 ANDROID: ABI: add pm_system_cancel_wakeup symbol
ff320df3e0 ANDROID: power: export pm_system_cancel_wakeup
dd2e0a80f1 ANDROID: ABI: Update allowed list for QCOM
fad2655cb7 ANDROID: Incremental fs: Set credentials before reading/writing
a035201d12 Revert "ANDROID: Incremental fs: Fix memory leak on closing file"
dbee4e7bc4 Revert "ANDROID: Incremental fs: Set credentials before reading/writing"
b6221e3495 Revert "ANDROID: Incremental fs: Fix selinux issues"
0ade8c4105 ANDROID: ABI: update allowed list for QCOM
ccdcd307cf ANDROID: Update the KMI for virtual platform modules
b3f4130630 ANDROID: ABI: Update symbol list for imx
67e9dbddb5 ANDROID: clang: update to 12.0.5
91d8a13f43 FROMGIT: virt_wifi: Return micros for BSS TSF values

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I30c2b4a86d0dfc93b4db35b9c135d0c25c4b5acb
This commit is contained in:
Greg Kroah-Hartman 2021-05-11 09:34:28 +02:00
commit f240fdcff5
28 changed files with 3313 additions and 3226 deletions

File diff suppressed because it is too large Load diff

View file

@ -614,8 +614,8 @@
kmalloc_order_trace
kvfree
kvmalloc_node
memdup_user
mutex_trylock
sg_alloc_table
__sg_alloc_table_from_pages
sg_free_table
sg_next
@ -644,6 +644,8 @@
ttm_eu_fence_buffer_objects
ttm_eu_reserve_buffers
ttm_tt_init
vmalloc_to_page
vmemdup_user
vmemmap
ww_mutex_lock_interruptible
ww_mutex_unlock

View file

@ -1103,9 +1103,11 @@
gpiochip_generic_free
gpiochip_generic_request
gpiochip_get_data
gpiochip_irqchip_add_key
gpiochip_line_is_valid
gpiochip_lock_as_irq
gpiochip_remove
gpiochip_set_nested_irqchip
gpiochip_unlock_as_irq
gpiod_direction_input
gpiod_direction_output

View file

@ -255,12 +255,14 @@
fwnode_graph_get_next_endpoint
fwnode_handle_put
fwnode_property_read_u32_array
gcd
generic_handle_irq
get_cpu_device
__get_free_pages
get_random_bytes
get_unused_fd_flags
gpiod_direction_output_raw
gpiod_set_raw_value
gpiod_set_raw_value_cansleep
gpiod_set_value_cansleep
gpio_request
@ -272,6 +274,7 @@
i2c_add_adapter
i2c_del_adapter
i2c_del_driver
i2c_put_adapter
i2c_register_driver
i2c_transfer
i2c_transfer_buffer_flags
@ -306,9 +309,9 @@
kmalloc_caches
kmalloc_order_trace
kmem_cache_alloc_trace
kmemdup
kobject_create_and_add
kobject_put
kstrtoull
kthread_create_on_node
kthread_should_stop
ktime_get
@ -323,6 +326,7 @@
media_entity_remote_pad
memcpy
memset
__memset_io
mipi_dsi_attach
mipi_dsi_detach
mipi_dsi_driver_register_full
@ -359,7 +363,6 @@
of_clk_get
of_clk_get_by_name
of_clk_src_onecell_get
of_count_phandle_with_args
of_device_get_match_data
of_device_is_available
of_device_is_compatible
@ -394,6 +397,7 @@
of_property_read_string
of_property_read_u32_index
of_property_read_variable_u32_array
of_reserved_mem_device_init_by_idx
of_reset_control_array_get
param_array_ops
param_ops_bool
@ -478,6 +482,7 @@
__register_chrdev
register_netdev
__register_rpmsg_driver
register_virtio_device
register_virtio_driver
regmap_attach_dev
regmap_read
@ -547,7 +552,9 @@
snd_soc_info_volsw
snd_soc_jack_add_gpios
snd_soc_of_parse_audio_routing
snd_soc_of_parse_audio_simple_widgets
snd_soc_of_parse_card_name
snd_soc_of_parse_daifmt
snd_soc_params_to_bclk
snd_soc_pm_ops
snd_soc_put_enum_double
@ -665,6 +672,9 @@
vmalloc
vmalloc_to_page
vmemmap
vring_del_virtqueue
vring_interrupt
vring_new_virtqueue
vsnprintf
wait_for_completion_interruptible_timeout
wait_for_completion_timeout
@ -777,7 +787,6 @@
drm_scdc_set_high_tmds_clock_ratio
drm_scdc_set_scrambling
drm_scdc_write
i2c_put_adapter
of_get_i2c_adapter_by_node
# required by dw_hdmi-imx.ko
@ -794,6 +803,7 @@
# required by dwc3-qcom.ko
devm_extcon_register_notifier
kmemdup
of_clk_get_parent_count
# required by dwc3.ko
@ -845,7 +855,6 @@
of_mdiobus_register
of_phy_connect
of_phy_deregister_fixed_link
of_phy_find_device
of_phy_is_fixed_link
of_phy_register_fixed_link
param_ops_byte
@ -977,7 +986,6 @@
clk_notifier_register
clk_notifier_unregister
dma_request_chan
gpiod_set_raw_value
i2c_add_numbered_adapter
i2c_generic_scl_recovery
i2c_recover_bus
@ -1117,6 +1125,13 @@
# required by imx8mp-ldb.ko
devm_of_phy_get
# required by imx_rpmsg.ko
mbox_free_channel
mbox_request_channel_byname
mbox_send_message
of_reserved_mem_device_release
vring_transport_features
# required by imx_rpmsg_tty.ko
print_hex_dump
put_tty_driver
@ -1132,30 +1147,6 @@
tty_std_termios
tty_unregister_driver
# required by imx_rproc.ko
mbox_free_channel
mbox_request_channel_byname
mbox_send_message
of_phandle_iterator_init
of_phandle_iterator_next
of_reserved_mem_lookup
reset_control_status
rproc_add
rproc_add_carveout
rproc_alloc
rproc_coredump_add_segment
rproc_da_to_va
rproc_del
rproc_elf_find_loaded_rsc_table
rproc_elf_get_boot_addr
rproc_elf_load_rsc_table
rproc_elf_load_segments
rproc_elf_sanity_check
rproc_free
rproc_mem_entry_init
rproc_of_resm_mem_entry_init
rproc_vq_interrupt
# required by imxdrm.ko
component_bind_all
component_master_add_with_match
@ -1225,13 +1216,11 @@
match_token
mutex_is_locked
notify_change
override_creds
pagecache_get_page
path_get
path_put
__put_cred
register_filesystem
revert_creds
set_anon_super
sget
simple_getattr
@ -1276,6 +1265,9 @@
i2c_new_dummy
regmap_bulk_read
# required by lpa_ctrl.ko
sysfs_create_groups
# required by moal.ko
alloc_netdev_mqs
__alloc_skb
@ -1626,7 +1618,7 @@
# required by snd-soc-fsl-dsp.ko
dev_pm_domain_attach_by_id
__memset_io
of_count_phandle_with_args
of_irq_get
pm_system_wakeup
sysfs_streq
@ -1634,7 +1626,6 @@
# required by snd-soc-fsl-easrc.ko
completion_done
gcd
snd_pcm_format_big_endian
snd_pcm_format_linear
snd_pcm_format_unsigned
@ -1643,7 +1634,6 @@
# required by snd-soc-fsl-micfil.ko
kobject_uevent_env
kstrtoull
snd_soc_get_volsw_sx
snd_soc_info_volsw_sx
snd_soc_put_volsw_sx
@ -1666,9 +1656,6 @@
snd_pcm_hw_constraint_eld
snd_soc_jack_report
# required by snd-soc-imx-rpmsg.ko
of_reserved_mem_device_init_by_idx
# required by snd-soc-imx-wm8960.ko
gpiod_get_raw_value_cansleep
of_parse_phandle_with_fixed_args
@ -1684,6 +1671,22 @@
# required by snd-soc-rpmsg-cs42xx8.ko
regcache_cache_bypass
# required by snd-soc-rpmsg-imx-pcm512x.ko
i2c_get_adapter
i2c_smbus_read_byte
snd_soc_dai_set_bclk_ratio
snd_soc_get_pcm_runtime
snd_soc_limit_volume
snd_soc_unregister_card
# required by snd-soc-rpmsg-pcm512x.ko
devm_regulator_register_notifier
snd_ctl_boolean_stereo_info
snd_interval_ranges
snd_pcm_hw_constraint_ratnums
snd_pcm_hw_rule_add
snd_soc_params_to_frame_size
# required by snd-soc-simple-card-utils.ko
devm_get_clk_from_child
devm_kasprintf
@ -1692,14 +1695,15 @@
snd_soc_dapm_get_pin_switch
snd_soc_dapm_info_pin_switch
snd_soc_dapm_put_pin_switch
snd_soc_of_parse_audio_simple_widgets
snd_soc_of_parse_daifmt
# required by snd-soc-simple-card.ko
snd_soc_of_get_dai_name
snd_soc_of_parse_node_prefix
snd_soc_of_parse_tdm_slot
# required by snd-soc-tpa6130a2.ko
devm_gpio_request
# required by snvs_pwrkey.ko
devm_input_allocate_device
pm_relax
@ -1763,11 +1767,7 @@
panic_notifier_list
# required by trusty-virtio.ko
register_virtio_device
unregister_virtio_device
vring_del_virtqueue
vring_interrupt
vring_new_virtqueue
# required by trusty.ko
atomic_notifier_call_chain

View file

@ -45,10 +45,12 @@
backlight_device_unregister
bin2hex
__bitmap_clear
bitmap_find_free_region
bitmap_find_next_zero_area_off
bitmap_free
bitmap_parselist
bitmap_print_to_pagebuf
bitmap_release_region
__bitmap_set
__bitmap_subset
bitmap_zalloc
@ -1802,6 +1804,7 @@
__pm_runtime_use_autosuspend
__pm_stay_awake
pm_stay_awake
pm_system_cancel_wakeup
pm_system_wakeup
pm_wakeup_dev_event
pm_wakeup_ws_event
@ -2022,6 +2025,7 @@
rpmsg_set_signals
rpmsg_trysend
rpmsg_unregister_device
rtc_add_group
rtc_class_close
rtc_class_open
rtc_read_time

View file

@ -1388,7 +1388,7 @@ static void device_links_purge(struct device *dev)
return;
mutex_lock(&wfs_lock);
list_del(&dev->links.needs_suppliers);
list_del_init(&dev->links.needs_suppliers);
mutex_unlock(&wfs_lock);
/*

View file

@ -922,6 +922,7 @@ void pm_system_cancel_wakeup(void)
{
atomic_dec_if_positive(&pm_abort_suspend);
}
EXPORT_SYMBOL_GPL(pm_system_cancel_wakeup);
void pm_wakeup_clear(bool reset)
{

View file

@ -4041,7 +4041,7 @@ static void hwsim_virtio_rx_work(struct work_struct *work)
}
vq = hwsim_vqs[HWSIM_VQ_RX];
sg_init_one(sg, skb->head, skb_end_offset(skb));
err = virtqueue_add_inbuf(vq, sg, 1, skb, GFP_KERNEL);
err = virtqueue_add_inbuf(vq, sg, 1, skb, GFP_ATOMIC);
if (WARN(err, "virtqueue_add_inbuf returned %d\n", err))
nlmsg_free(skb);
else

View file

@ -445,7 +445,7 @@ static void rproc_rvdev_release(struct device *dev)
/**
* rproc_handle_vdev() - handle a vdev fw resource
* @rproc: the remote processor
* @rsc: the vring resource descriptor
* ptr: the vring resource descriptor
* @avail: size of available data (for sanity checking the image)
*
* This resource entry requests the host to statically register a virtio
@ -469,9 +469,10 @@ static void rproc_rvdev_release(struct device *dev)
*
* Returns 0 on success, or an appropriate error code otherwise
*/
static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
static int rproc_handle_vdev(struct rproc *rproc, void *ptr,
int offset, int avail)
{
struct fw_rsc_vdev *rsc = ptr;
struct device *dev = &rproc->dev;
struct rproc_vdev *rvdev;
int i, ret;
@ -587,7 +588,7 @@ void rproc_vdev_release(struct kref *ref)
/**
* rproc_handle_trace() - handle a shared trace buffer resource
* @rproc: the remote processor
* @rsc: the trace resource descriptor
* @ptr: the trace resource descriptor
* @avail: size of available data (for sanity checking the image)
*
* In case the remote processor dumps trace logs into memory,
@ -600,9 +601,10 @@ void rproc_vdev_release(struct kref *ref)
*
* Returns 0 on success, or an appropriate error code otherwise
*/
static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc,
static int rproc_handle_trace(struct rproc *rproc, void *ptr,
int offset, int avail)
{
struct fw_rsc_trace *rsc = ptr;
struct rproc_debug_trace *trace;
struct device *dev = &rproc->dev;
char name[15];
@ -652,7 +654,7 @@ static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc,
/**
* rproc_handle_devmem() - handle devmem resource entry
* @rproc: remote processor handle
* @rsc: the devmem resource entry
* @ptr: the devmem resource entry
* @avail: size of available data (for sanity checking the image)
*
* Remote processors commonly need to access certain on-chip peripherals.
@ -674,9 +676,10 @@ static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc,
* and not allow firmwares to request access to physical addresses that
* are outside those ranges.
*/
static int rproc_handle_devmem(struct rproc *rproc, struct fw_rsc_devmem *rsc,
static int rproc_handle_devmem(struct rproc *rproc, void *ptr,
int offset, int avail)
{
struct fw_rsc_devmem *rsc = ptr;
struct rproc_mem_entry *mapping;
struct device *dev = &rproc->dev;
int ret;
@ -853,7 +856,7 @@ static int rproc_release_carveout(struct rproc *rproc,
/**
* rproc_handle_carveout() - handle phys contig memory allocation requests
* @rproc: rproc handle
* @rsc: the resource entry
* @ptr: the resource entry
* @avail: size of available data (for image validation)
*
* This function will handle firmware requests for allocation of physically
@ -869,9 +872,9 @@ static int rproc_release_carveout(struct rproc *rproc,
* pressure is important; it may have a substantial impact on performance.
*/
static int rproc_handle_carveout(struct rproc *rproc,
struct fw_rsc_carveout *rsc,
int offset, int avail)
void *ptr, int offset, int avail)
{
struct fw_rsc_carveout *rsc = ptr;
struct rproc_mem_entry *carveout;
struct device *dev = &rproc->dev;
@ -1028,10 +1031,10 @@ EXPORT_SYMBOL(rproc_of_resm_mem_entry_init);
* enum fw_resource_type.
*/
static rproc_handle_resource_t rproc_loading_handlers[RSC_LAST] = {
[RSC_CARVEOUT] = (rproc_handle_resource_t)rproc_handle_carveout,
[RSC_DEVMEM] = (rproc_handle_resource_t)rproc_handle_devmem,
[RSC_TRACE] = (rproc_handle_resource_t)rproc_handle_trace,
[RSC_VDEV] = (rproc_handle_resource_t)rproc_handle_vdev,
[RSC_CARVEOUT] = rproc_handle_carveout,
[RSC_DEVMEM] = rproc_handle_devmem,
[RSC_TRACE] = rproc_handle_trace,
[RSC_VDEV] = rproc_handle_vdev,
};
/* handle firmware resource entries before booting the remote processor */

View file

@ -582,7 +582,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba *hba, bool lpm)
if (!hba->vreg_info.vccq2 || !hba->vreg_info.vcc)
return;
if (lpm & !hba->vreg_info.vcc->enabled)
if (lpm && !hba->vreg_info.vcc->enabled)
regulator_set_mode(hba->vreg_info.vccq2->reg,
REGULATOR_MODE_IDLE);
else if (!lpm)

View file

@ -159,7 +159,7 @@ out:
static void ufshcd_clear_keyslot(struct ufs_hba *hba, int slot)
{
union ufs_crypto_cfg_entry cfg = { 0 };
union ufs_crypto_cfg_entry cfg = {};
int err;
err = ufshcd_program_key(hba, &cfg, slot);

View file

@ -8847,7 +8847,8 @@ int ufshcd_system_suspend(struct ufs_hba *hba)
if ((ufs_get_pm_lvl_to_dev_pwr_mode(hba->spm_lvl) ==
hba->curr_dev_pwr_mode) &&
(ufs_get_pm_lvl_to_link_pwr_state(hba->spm_lvl) ==
hba->uic_link_state))
hba->uic_link_state) &&
!hba->dev_info.b_rpm_dev_flush_capable)
goto out;
if (pm_runtime_suspended(hba->dev)) {
@ -9022,6 +9023,7 @@ void ufshcd_remove(struct ufs_hba *hba)
ufs_bsg_remove(hba);
ufs_sysfs_remove_nodes(hba->dev);
scsi_remove_host(hba->host);
destroy_workqueue(hba->eh_wq);
/* disable interrupts */
ufshcd_disable_intr(hba, hba->intr_mask);
ufshcd_hba_stop(hba, true);
@ -9293,6 +9295,7 @@ out_remove_scsi_host:
exit_gating:
ufshcd_exit_clk_scaling(hba);
ufshcd_exit_clk_gating(hba);
destroy_workqueue(hba->eh_wq);
out_disable:
hba->is_irq_enabled = false;
ufshcd_hba_exit(hba);

View file

@ -1266,6 +1266,10 @@ static inline void ufshcd_vops_device_reset(struct ufs_hba *hba)
if (hba->vops && hba->vops->device_reset) {
hba->vops->device_reset(hba);
ufshcd_set_ufs_dev_active(hba);
if (ufshcd_is_wb_allowed(hba)) {
hba->wb_enabled = false;
hba->wb_buf_flush_enabled = false;
}
ufshcd_update_reg_hist(&hba->ufs_stats.dev_reset, 0);
}
}

View file

@ -3843,6 +3843,7 @@ free_bio_info:
#ifdef CONFIG_UNICODE
utf8_unload(sb->s_encoding);
sb->s_encoding = NULL;
#endif
free_options:
#ifdef CONFIG_QUOTA

View file

@ -549,7 +549,6 @@ int incfs_read_file_header(struct backing_file_context *bfc,
if (!bfc || !first_md_off)
return -EFAULT;
LOCK_REQUIRED(bfc->bc_mutex);
bytes_read = incfs_kread(bfc, &fh, sizeof(fh), 0);
if (bytes_read < 0)
return bytes_read;

View file

@ -30,8 +30,18 @@ static ssize_t corefs_show(struct kobject *kobj,
static struct kobj_attribute corefs_attr = __ATTR_RO(corefs);
static ssize_t mounter_context_for_backing_rw_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buff)
{
return snprintf(buff, PAGE_SIZE, "supported\n");
}
static struct kobj_attribute mounter_context_for_backing_rw_attr =
__ATTR_RO(mounter_context_for_backing_rw);
static struct attribute *attributes[] = {
&corefs_attr.attr,
&mounter_context_for_backing_rw_attr.attr,
NULL,
};

View file

@ -171,7 +171,7 @@ struct sk_buff *udp_gro_receive(struct list_head *head, struct sk_buff *skb,
int udp_gro_complete(struct sk_buff *skb, int nhoff, udp_lookup_t lookup);
struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
netdev_features_t features);
netdev_features_t features, bool is_ipv6);
static inline struct udphdr *udp_gro_udphdr(struct sk_buff *skb)
{

1
kernel/.gitignore vendored
View file

@ -1,6 +1,7 @@
#
# Generated files
#
config_data
kheaders.md5
timeconst.h
hz.bc

View file

@ -127,10 +127,15 @@ KCOV_INSTRUMENT_stackleak.o := n
$(obj)/configs.o: $(obj)/config_data.gz
targets += config_data.gz
$(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE
targets += config_data config_data.gz
$(obj)/config_data.gz: $(obj)/config_data FORCE
$(call if_changed,gzip)
filechk_cat = cat $<
$(obj)/config_data: $(KCONFIG_CONFIG) FORCE
$(call filechk,cat)
$(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz
quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz

View file

@ -6085,21 +6085,21 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t
static int
select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target)
{
unsigned long best_cap = 0;
unsigned long task_util, best_cap = 0;
int cpu, best_cpu = -1;
struct cpumask *cpus;
sync_entity_load_avg(&p->se);
cpus = this_cpu_cpumask_var_ptr(select_idle_mask);
cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr);
task_util = uclamp_task_util(p);
for_each_cpu_wrap(cpu, cpus, target) {
unsigned long cpu_cap = capacity_of(cpu);
if (!available_idle_cpu(cpu) && !sched_idle_cpu(cpu))
continue;
if (task_fits_capacity(p, cpu_cap))
if (fits_capacity(task_util, cpu_cap))
return cpu;
if (cpu_cap > best_cap) {
@ -6111,14 +6111,60 @@ select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target)
return best_cpu;
}
static inline bool asym_fits_capacity(int task_util, int cpu)
{
if (static_branch_unlikely(&sched_asym_cpucapacity))
return fits_capacity(task_util, capacity_of(cpu));
return true;
}
/*
* Try and locate an idle core/thread in the LLC cache domain.
*/
static int select_idle_sibling(struct task_struct *p, int prev, int target)
{
struct sched_domain *sd;
unsigned long task_util;
int i, recent_used_cpu;
/*
* On asymmetric system, update task utilization because we will check
* that the task fits with cpu's capacity.
*/
if (static_branch_unlikely(&sched_asym_cpucapacity)) {
sync_entity_load_avg(&p->se);
task_util = uclamp_task_util(p);
}
if ((available_idle_cpu(target) || sched_idle_cpu(target)) &&
asym_fits_capacity(task_util, target))
return target;
/*
* If the previous CPU is cache affine and idle, don't be stupid:
*/
if (prev != target && cpus_share_cache(prev, target) &&
(available_idle_cpu(prev) || sched_idle_cpu(prev)) &&
asym_fits_capacity(task_util, prev))
return prev;
/* Check a recently used CPU as a potential idle candidate: */
recent_used_cpu = p->recent_used_cpu;
if (recent_used_cpu != prev &&
recent_used_cpu != target &&
cpus_share_cache(recent_used_cpu, target) &&
(available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) &&
cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr) &&
asym_fits_capacity(task_util, recent_used_cpu)) {
/*
* Replace recent_used_cpu with prev as it is a potential
* candidate for the next wake:
*/
p->recent_used_cpu = prev;
return recent_used_cpu;
}
/*
* For asymmetric CPU capacity systems, our domain of interest is
* sd_asym_cpucapacity rather than sd_llc.
@ -6133,37 +6179,10 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
* SD_ASYM_CPUCAPACITY. These should follow the usual symmetric
* capacity path.
*/
if (!sd)
goto symmetric;
i = select_idle_capacity(p, sd, target);
return ((unsigned)i < nr_cpumask_bits) ? i : target;
}
symmetric:
if (available_idle_cpu(target) || sched_idle_cpu(target))
return target;
/*
* If the previous CPU is cache affine and idle, don't be stupid:
*/
if (prev != target && cpus_share_cache(prev, target) &&
(available_idle_cpu(prev) || sched_idle_cpu(prev)))
return prev;
/* Check a recently used CPU as a potential idle candidate: */
recent_used_cpu = p->recent_used_cpu;
if (recent_used_cpu != prev &&
recent_used_cpu != target &&
cpus_share_cache(recent_used_cpu, target) &&
(available_idle_cpu(recent_used_cpu) || sched_idle_cpu(recent_used_cpu)) &&
cpumask_test_cpu(p->recent_used_cpu, p->cpus_ptr)) {
/*
* Replace recent_used_cpu with prev as it is a potential
* candidate for the next wake:
*/
p->recent_used_cpu = prev;
return recent_used_cpu;
if (sd) {
i = select_idle_capacity(p, sd, target);
return ((unsigned)i < nr_cpumask_bits) ? i : target;
}
}
sd = rcu_dereference(per_cpu(sd_llc, target));

View file

@ -39,7 +39,6 @@
struct cma cma_areas[MAX_CMA_AREAS];
unsigned cma_area_count;
static DEFINE_MUTEX(cma_mutex);
phys_addr_t cma_get_base(const struct cma *cma)
{
@ -455,10 +454,9 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align,
mutex_unlock(&cma->lock);
pfn = cma->base_pfn + (bitmap_no << cma->order_per_bit);
mutex_lock(&cma_mutex);
ret = alloc_contig_range(pfn, pfn + count, MIGRATE_CMA,
GFP_KERNEL | (no_warn ? __GFP_NOWARN : 0));
mutex_unlock(&cma_mutex);
if (ret == 0) {
page = pfn_to_page(pfn);
break;

View file

@ -92,6 +92,7 @@ static const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN]
[NETIF_F_GSO_SCTP_BIT] = "tx-sctp-segmentation",
[NETIF_F_GSO_ESP_BIT] = "tx-esp-segmentation",
[NETIF_F_GSO_UDP_L4_BIT] = "tx-udp-segmentation",
[NETIF_F_GSO_FRAGLIST_BIT] = "tx-gso-list",
[NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
[NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",

View file

@ -3676,7 +3676,8 @@ struct sk_buff *skb_segment_list(struct sk_buff *skb,
unsigned int delta_truesize = 0;
unsigned int delta_len = 0;
struct sk_buff *tail = NULL;
struct sk_buff *nskb;
struct sk_buff *nskb, *tmp;
int err;
skb_push(skb, -skb_network_offset(skb) + offset);
@ -3686,11 +3687,28 @@ struct sk_buff *skb_segment_list(struct sk_buff *skb,
nskb = list_skb;
list_skb = list_skb->next;
err = 0;
if (skb_shared(nskb)) {
tmp = skb_clone(nskb, GFP_ATOMIC);
if (tmp) {
consume_skb(nskb);
nskb = tmp;
err = skb_unclone(nskb, GFP_ATOMIC);
} else {
err = -ENOMEM;
}
}
if (!tail)
skb->next = nskb;
else
tail->next = nskb;
if (unlikely(err)) {
nskb->next = list_skb;
goto err_linearize;
}
tail = nskb;
delta_len += nskb->len;

View file

@ -184,8 +184,67 @@ out_unlock:
}
EXPORT_SYMBOL(skb_udp_tunnel_segment);
static void __udpv4_gso_segment_csum(struct sk_buff *seg,
__be32 *oldip, __be32 *newip,
__be16 *oldport, __be16 *newport)
{
struct udphdr *uh;
struct iphdr *iph;
if (*oldip == *newip && *oldport == *newport)
return;
uh = udp_hdr(seg);
iph = ip_hdr(seg);
if (uh->check) {
inet_proto_csum_replace4(&uh->check, seg, *oldip, *newip,
true);
inet_proto_csum_replace2(&uh->check, seg, *oldport, *newport,
false);
if (!uh->check)
uh->check = CSUM_MANGLED_0;
}
*oldport = *newport;
csum_replace4(&iph->check, *oldip, *newip);
*oldip = *newip;
}
static struct sk_buff *__udpv4_gso_segment_list_csum(struct sk_buff *segs)
{
struct sk_buff *seg;
struct udphdr *uh, *uh2;
struct iphdr *iph, *iph2;
seg = segs;
uh = udp_hdr(seg);
iph = ip_hdr(seg);
if ((udp_hdr(seg)->dest == udp_hdr(seg->next)->dest) &&
(udp_hdr(seg)->source == udp_hdr(seg->next)->source) &&
(ip_hdr(seg)->daddr == ip_hdr(seg->next)->daddr) &&
(ip_hdr(seg)->saddr == ip_hdr(seg->next)->saddr))
return segs;
while ((seg = seg->next)) {
uh2 = udp_hdr(seg);
iph2 = ip_hdr(seg);
__udpv4_gso_segment_csum(seg,
&iph2->saddr, &iph->saddr,
&uh2->source, &uh->source);
__udpv4_gso_segment_csum(seg,
&iph2->daddr, &iph->daddr,
&uh2->dest, &uh->dest);
}
return segs;
}
static struct sk_buff *__udp_gso_segment_list(struct sk_buff *skb,
netdev_features_t features)
netdev_features_t features,
bool is_ipv6)
{
unsigned int mss = skb_shinfo(skb)->gso_size;
@ -195,11 +254,11 @@ static struct sk_buff *__udp_gso_segment_list(struct sk_buff *skb,
udp_hdr(skb)->len = htons(sizeof(struct udphdr) + mss);
return skb;
return is_ipv6 ? skb : __udpv4_gso_segment_list_csum(skb);
}
struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
netdev_features_t features)
netdev_features_t features, bool is_ipv6)
{
struct sock *sk = gso_skb->sk;
unsigned int sum_truesize = 0;
@ -211,7 +270,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
__be16 newlen;
if (skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST)
return __udp_gso_segment_list(gso_skb, features);
return __udp_gso_segment_list(gso_skb, features, is_ipv6);
mss = skb_shinfo(gso_skb)->gso_size;
if (gso_skb->len <= sizeof(*uh) + mss)
@ -325,7 +384,7 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb,
goto out;
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4)
return __udp_gso_segment(skb, features);
return __udp_gso_segment(skb, features, false);
mss = skb_shinfo(skb)->gso_size;
if (unlikely(skb->len <= mss))

View file

@ -46,7 +46,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
goto out;
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4)
return __udp_gso_segment(skb, features);
return __udp_gso_segment(skb, features, true);
/* Do software UFO. Complete and fill in the UDP checksum as HW cannot
* do checksum of UDP packets sent as multiple IP fragments.

View file

@ -234,6 +234,7 @@ static int xfrm_xlate64_attr(struct sk_buff *dst, const struct nlattr *src)
case XFRMA_PAD:
/* Ignore */
return 0;
case XFRMA_UNSPEC:
case XFRMA_ALG_AUTH:
case XFRMA_ALG_CRYPT:
case XFRMA_ALG_COMP:
@ -387,7 +388,7 @@ static int xfrm_attr_cpy32(void *dst, size_t *pos, const struct nlattr *src,
memcpy(nla, src, nla_attr_size(copy_len));
nla->nla_len = nla_attr_size(payload);
*pos += nla_attr_size(payload);
*pos += nla_attr_size(copy_len);
nlmsg->nlmsg_len += nla->nla_len;
memset(dst + *pos, 0, payload - copy_len);
@ -563,7 +564,7 @@ static struct nlmsghdr *xfrm_user_rcv_msg_compat(const struct nlmsghdr *h32,
return NULL;
len += NLMSG_HDRLEN;
h64 = kvmalloc(len, GFP_KERNEL | __GFP_ZERO);
h64 = kvmalloc(len, GFP_KERNEL);
if (!h64)
return ERR_PTR(-ENOMEM);

View file

@ -2381,8 +2381,10 @@ int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen
if (in_compat_syscall()) {
struct xfrm_translator *xtr = xfrm_get_translator();
if (!xtr)
if (!xtr) {
kfree(data);
return -EOPNOTSUPP;
}
err = xtr->xlate_user_policy_sockptr(&data, optlen);
xfrm_put_translator(xtr);

View file

@ -34,9 +34,6 @@ case "$KBUILD_VERBOSE" in
;;
esac
# We need access to CONFIG_ symbols
. include/config/auto.conf
# Generate a new symbol list file
$CONFIG_SHELL $srctree/scripts/gen_autoksyms.sh "$new_ksyms_file"