From 43afe7ad6651cb5e2beff94ad943710bd17ab6d0 Mon Sep 17 00:00:00 2001 From: Kernel Build Daemon Date: May 05 2021 05:00:54 +0000 Subject: Merge branch 'SLE12-SP5' into SLE12-SP5-AZURE --- diff --git a/blacklist.conf b/blacklist.conf index b60a48e..0e81466 100644 --- a/blacklist.conf +++ b/blacklist.conf @@ -1833,3 +1833,5 @@ d09845e98a05850a8094ea8fd6dd09a8e6824fff # breaks kABI 5a35b040d0567f9dce6e801e6e3b575b9c463028 # breaks kABI d17d9227c332b7deca59b35fa9ff08e597666c2a # cosmetic fix 6840a150b9daf35e4d21ab9780d0a03b4ed74a5b # doesn't have 2bcf26528787 ("x86/platform/uv: Setup UV functions for Hubless UV Systems") +e81bf9793b1861d74953ef041b4f6c7faecc2dbd # optimization, KABI change, bsc#1185607 +fe6bdfc8e1e131720abbe77a2eb990c94c9024cb # not applicable, refactoring bsc#1185608 diff --git a/patches.suse/0001-btrfs-track-qgroup-released-data-in-own-variable-in-.patch b/patches.suse/0001-btrfs-track-qgroup-released-data-in-own-variable-in-.patch new file mode 100644 index 0000000..cb3d0d6 --- /dev/null +++ b/patches.suse/0001-btrfs-track-qgroup-released-data-in-own-variable-in-.patch @@ -0,0 +1,65 @@ +From fbf48bb0b197e6894a04c714728c952af7153bf3 Mon Sep 17 00:00:00 2001 +From: Qu Wenruo +Date: Wed, 3 Mar 2021 18:41:51 +0800 +Patch-mainline: v5.12-rc4 +Git-commit: fbf48bb0b197e6894a04c714728c952af7153bf3 +References: bsc#1185549 +Subject: [PATCH 1/2] btrfs: track qgroup released data in own variable in + insert_prealloc_file_extent + +There is a piece of weird code in insert_prealloc_file_extent(), which +looks like: + + ret = btrfs_qgroup_release_data(inode, file_offset, len); + if (ret < 0) + return ERR_PTR(ret); + if (trans) { + ret = insert_reserved_file_extent(trans, inode, + file_offset, &stack_fi, + true, ret); + ... + } + extent_info.is_new_extent = true; + extent_info.qgroup_reserved = ret; + ... + +Note how the variable @ret is abused here, and if anyone is adding code +just after btrfs_qgroup_release_data() call, it's super easy to +overwrite the @ret and cause tons of qgroup related bugs. + +Fix such abuse by introducing new variable @qgroup_released, so that we +won't reuse the existing variable @ret. + +Signed-off-by: Qu Wenruo +Reviewed-by: David Sterba +Signed-off-by: David Sterba +--- + fs/btrfs/inode.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/fs/btrfs/inode.c ++++ b/fs/btrfs/inode.c +@@ -10467,6 +10467,7 @@ static int insert_prealloc_file_extent(s + struct btrfs_file_extent_item stack_fi; + u64 start = ins->objectid; + u64 len = ins->offset; ++ int qgroup_released; + int ret; + + memset(&stack_fi, 0, sizeof(stack_fi)); +@@ -10479,11 +10480,11 @@ static int insert_prealloc_file_extent(s + btrfs_set_stack_file_extent_compression(&stack_fi, BTRFS_COMPRESS_NONE); + /* Encryption and other encoding is reserved and all 0 */ + +- ret = btrfs_qgroup_release_data(inode, file_offset, len); +- if (ret < 0) +- return ret; ++ qgroup_released = btrfs_qgroup_release_data(inode, file_offset, len); ++ if (qgroup_released < 0) ++ return qgroup_released; + return insert_reserved_file_extent(trans, inode, file_offset, +- &stack_fi, ret); ++ &stack_fi, qgroup_released); + } + static int __btrfs_prealloc_file_range(struct inode *inode, int mode, + u64 start, u64 num_bytes, u64 min_size, diff --git a/patches.suse/0002-btrfs-fix-qgroup-data-rsv-leak-caused-by-falloc-fail.patch b/patches.suse/0002-btrfs-fix-qgroup-data-rsv-leak-caused-by-falloc-fail.patch new file mode 100644 index 0000000..d200855 --- /dev/null +++ b/patches.suse/0002-btrfs-fix-qgroup-data-rsv-leak-caused-by-falloc-fail.patch @@ -0,0 +1,106 @@ +From a3ee79bd8fe17812d2305ccc4bf81bfeab395576 Mon Sep 17 00:00:00 2001 +From: Qu Wenruo +Date: Wed, 3 Mar 2021 18:41:52 +0800 +Patch-mainline: v5.12-rc4 +Git-commit: a3ee79bd8fe17812d2305ccc4bf81bfeab395576 +References: bsc#1185549 +Subject: [PATCH 2/2] btrfs: fix qgroup data rsv leak caused by falloc failure + +[BUG] +When running fsstress with only falloc workload, and a very low qgroup +limit set, we can get qgroup data rsv leak at unmount time. + + BTRFS warning (device dm-0): qgroup 0/5 has unreleased space, type 0 rsv 20480 + BTRFS error (device dm-0): qgroup reserved space leaked + +The minimal reproducer looks like: + + #!/bin/bash + dev=/dev/test/test + mnt="/mnt/btrfs" + fsstress=~/xfstests-dev/ltp/fsstress + runtime=8 + + workload() + { + umount $dev &> /dev/null + umount $mnt &> /dev/null + mkfs.btrfs -f $dev > /dev/null + mount $dev $mnt + + btrfs quota en $mnt + btrfs quota rescan -w $mnt + btrfs qgroup limit 16m 0/5 $mnt + + $fsstress -w -z -f creat=10 -f fallocate=10 -p 2 -n 100 \ + -d $mnt -v > /tmp/fsstress + + umount $mnt + if dmesg | grep leak ; then + echo "!!! FAILED !!!" + exit 1 + fi + } + + for (( i=0; i < $runtime; i++)); do + echo "=== $i/$runtime===" + workload + done + +Normally it would fail before round 4. + +[CAUSE] +In function insert_prealloc_file_extent(), we first call +btrfs_qgroup_release_data() to know how many bytes are reserved for +qgroup data rsv. + +Then use that @qgroup_released number to continue our work. + +But after we call btrfs_qgroup_release_data(), we should either queue +@qgroup_released to delayed ref or free them manually in error path. + +Unfortunately, we lack the error handling to free the released bytes, +leaking qgroup data rsv. + +All the error handling function outside won't help at all, as we have +released the range, meaning in inode io tree, the EXTENT_QGROUP_RESERVED +bit is already cleared, thus all btrfs_qgroup_free_data() call won't +free any data rsv. + +[FIX] +Add free_qgroup tag to manually free the released qgroup data rsv. + +Reported-by: Nikolay Borisov +Reported-by: David Sterba +Fixes: 9729f10a608f ("btrfs: inode: move qgroup reserved space release to the callers of insert_reserved_file_extent()") +CC: stable@vger.kernel.org # 5.10+ +Signed-off-by: Qu Wenruo +Signed-off-by: David Sterba +--- + fs/btrfs/inode.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +--- a/fs/btrfs/inode.c ++++ b/fs/btrfs/inode.c +@@ -10483,8 +10483,20 @@ static int insert_prealloc_file_extent(s + qgroup_released = btrfs_qgroup_release_data(inode, file_offset, len); + if (qgroup_released < 0) + return qgroup_released; +- return insert_reserved_file_extent(trans, inode, file_offset, ++ ret = insert_reserved_file_extent(trans, inode, file_offset, + &stack_fi, qgroup_released); ++ /* ++ * We have released qgroup data range at the beginning of the function, ++ * and normally qgroup_released bytes will be freed when committing ++ * transaction. ++ * But if we error out early, we have to free what we have released ++ * or we leak qgroup data reservation. ++ */ ++ if (ret < 0) ++ btrfs_qgroup_free_refroot(BTRFS_I(inode)->root->fs_info, ++ BTRFS_I(inode)->root->root_key.objectid, qgroup_released, ++ BTRFS_QGROUP_RSV_DATA); ++ return ret; + } + static int __btrfs_prealloc_file_range(struct inode *inode, int mode, + u64 start, u64 num_bytes, u64 min_size, diff --git a/patches.suse/ibmvnic-avoid-calling-napi_disable-twice.patch b/patches.suse/ibmvnic-avoid-calling-napi_disable-twice.patch new file mode 100644 index 0000000..3a676db --- /dev/null +++ b/patches.suse/ibmvnic-avoid-calling-napi_disable-twice.patch @@ -0,0 +1,46 @@ +From 0775ebc4cf8554bdcd2c212669a0868ab68df5c0 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Wed, 14 Apr 2021 02:46:14 -0500 +Subject: [PATCH] ibmvnic: avoid calling napi_disable() twice + +References: bsc#1065729 +Patch-mainline: v5.12-rc8 +Git-commit: 0775ebc4cf8554bdcd2c212669a0868ab68df5c0 + +__ibmvnic_open calls napi_disable without checking whether NAPI polling +has already been disabled or not. This could cause napi_disable +being called twice, which could generate deadlock. For example, +the first napi_disable will spin until NAPI_STATE_SCHED is cleared +by napi_complete_done, then set it again. +When napi_disable is called the second time, it will loop infinitely +because no dev->poll will be running to clear NAPI_STATE_SCHED. + +To prevent above scenario from happening, call ibmvnic_napi_disable() +which checks if napi is disabled or not before calling napi_disable. + +Fixes: bfc32f297337 ("ibmvnic: Move resource initialization to its own routine") +Suggested-by: Thomas Falcon +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 110a0d0eaabb..2d27f8aa0d4b 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -1149,8 +1149,7 @@ static int __ibmvnic_open(struct net_device *netdev) + + rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_UP); + if (rc) { +- for (i = 0; i < adapter->req_rx_queues; i++) +- napi_disable(&adapter->napi[i]); ++ ibmvnic_napi_disable(adapter); + release_resources(adapter); + return rc; + } +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-clean-up-the-remaining-debugfs-data-structur.patch b/patches.suse/ibmvnic-clean-up-the-remaining-debugfs-data-structur.patch new file mode 100644 index 0000000..47aea6f --- /dev/null +++ b/patches.suse/ibmvnic-clean-up-the-remaining-debugfs-data-structur.patch @@ -0,0 +1,143 @@ +From c82eaa4064f3c59f8b026a6b6e5f8693b5be92da Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Mon, 12 Apr 2021 02:40:59 -0500 +Subject: [PATCH] ibmvnic: clean up the remaining debugfs data structures + +References: bsc#1065729 +Patch-mainline: v5.13-rc1 +Git-commit: c82eaa4064f3c59f8b026a6b6e5f8693b5be92da + +Commit e704f0434ea6 ("ibmvnic: Remove debugfs support") did not +clean up everything. Remove the remaining code. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.h | 94 ------------------------------ + 1 file changed, 94 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h +index 806aa75a4e86..c1d39a748546 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.h ++++ b/drivers/net/ethernet/ibm/ibmvnic.h +@@ -412,77 +412,6 @@ struct ibmvnic_control_ip_offload { + struct ibmvnic_rc rc; + } __packed __aligned(8); + +-struct ibmvnic_request_dump_size { +- u8 first; +- u8 cmd; +- u8 reserved[6]; +- __be32 len; +- struct ibmvnic_rc rc; +-} __packed __aligned(8); +- +-struct ibmvnic_request_dump { +- u8 first; +- u8 cmd; +- u8 reserved1[2]; +- __be32 ioba; +- __be32 len; +- u8 reserved2[4]; +-} __packed __aligned(8); +- +-struct ibmvnic_request_dump_rsp { +- u8 first; +- u8 cmd; +- u8 reserved[6]; +- __be32 dumped_len; +- struct ibmvnic_rc rc; +-} __packed __aligned(8); +- +-struct ibmvnic_request_ras_comp_num { +- u8 first; +- u8 cmd; +- u8 reserved1[2]; +- __be32 num_components; +- u8 reserved2[4]; +- struct ibmvnic_rc rc; +-} __packed __aligned(8); +- +-struct ibmvnic_request_ras_comps { +- u8 first; +- u8 cmd; +- u8 reserved[2]; +- __be32 ioba; +- __be32 len; +- struct ibmvnic_rc rc; +-} __packed __aligned(8); +- +-struct ibmvnic_control_ras { +- u8 first; +- u8 cmd; +- u8 correlator; +- u8 level; +- u8 op; +-#define IBMVNIC_TRACE_LEVEL 1 +-#define IBMVNIC_ERROR_LEVEL 2 +-#define IBMVNIC_TRACE_PAUSE 3 +-#define IBMVNIC_TRACE_RESUME 4 +-#define IBMVNIC_TRACE_ON 5 +-#define IBMVNIC_TRACE_OFF 6 +-#define IBMVNIC_CHG_TRACE_BUFF_SZ 7 +- u8 trace_buff_sz[3]; +- u8 reserved[4]; +- struct ibmvnic_rc rc; +-} __packed __aligned(8); +- +-struct ibmvnic_collect_fw_trace { +- u8 first; +- u8 cmd; +- u8 correlator; +- u8 reserved; +- __be32 ioba; +- __be32 len; +- struct ibmvnic_rc rc; +-} __packed __aligned(8); +- + struct ibmvnic_request_statistics { + u8 first; + u8 cmd; +@@ -494,15 +423,6 @@ struct ibmvnic_request_statistics { + u8 reserved[4]; + } __packed __aligned(8); + +-struct ibmvnic_request_debug_stats { +- u8 first; +- u8 cmd; +- u8 reserved[2]; +- __be32 ioba; +- __be32 len; +- struct ibmvnic_rc rc; +-} __packed __aligned(8); +- + struct ibmvnic_error_indication { + u8 first; + u8 cmd; +@@ -677,22 +597,8 @@ union ibmvnic_crq { + struct ibmvnic_query_ip_offload query_ip_offload_rsp; + struct ibmvnic_control_ip_offload control_ip_offload; + struct ibmvnic_control_ip_offload control_ip_offload_rsp; +- struct ibmvnic_request_dump_size request_dump_size; +- struct ibmvnic_request_dump_size request_dump_size_rsp; +- struct ibmvnic_request_dump request_dump; +- struct ibmvnic_request_dump_rsp request_dump_rsp; +- struct ibmvnic_request_ras_comp_num request_ras_comp_num; +- struct ibmvnic_request_ras_comp_num request_ras_comp_num_rsp; +- struct ibmvnic_request_ras_comps request_ras_comps; +- struct ibmvnic_request_ras_comps request_ras_comps_rsp; +- struct ibmvnic_control_ras control_ras; +- struct ibmvnic_control_ras control_ras_rsp; +- struct ibmvnic_collect_fw_trace collect_fw_trace; +- struct ibmvnic_collect_fw_trace collect_fw_trace_rsp; + struct ibmvnic_request_statistics request_statistics; + struct ibmvnic_generic_crq request_statistics_rsp; +- struct ibmvnic_request_debug_stats request_debug_stats; +- struct ibmvnic_request_debug_stats request_debug_stats_rsp; + struct ibmvnic_error_indication error_indication; + struct ibmvnic_link_state_indication link_state_indication; + struct ibmvnic_change_mac_addr change_mac_addr; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-improve-failover-sysfs-entry.patch b/patches.suse/ibmvnic-improve-failover-sysfs-entry.patch new file mode 100644 index 0000000..99a83e5 --- /dev/null +++ b/patches.suse/ibmvnic-improve-failover-sysfs-entry.patch @@ -0,0 +1,62 @@ +From 334c4241472916851d97aae209aedf1927ec84e3 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Tue, 13 Apr 2021 03:31:44 -0500 +Subject: [PATCH] ibmvnic: improve failover sysfs entry + +References: bsc#1043990 ltc#155681 git-fixes +Patch-mainline: v5.13-rc1 +Git-commit: 334c4241472916851d97aae209aedf1927ec84e3 + +The current implementation relies on H_IOCTL call to issue a +H_SESSION_ERR_DETECTED command to let the hypervisor to send a failover +signal. However, it may not work if there is no backup device or if +the vnic is already in error state, +e.g., "ibmvnic 30000003 env3: rx buffer returned with rc 6". +Add a last resort, that is to schedule a failover reset via CRQ command. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index ee9bf18c597f..0961d36833d5 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -5503,7 +5503,7 @@ static ssize_t failover_store(struct device *dev, struct device_attribute *attr, + if (rc) { + netdev_err(netdev, "Couldn't retrieve session token, rc %ld\n", + rc); +- return -EINVAL; ++ goto last_resort; + } + + session_token = (__be64)retbuf[0]; +@@ -5511,15 +5511,17 @@ static ssize_t failover_store(struct device *dev, struct device_attribute *attr, + be64_to_cpu(session_token)); + rc = plpar_hcall_norets(H_VIOCTL, adapter->vdev->unit_address, + H_SESSION_ERR_DETECTED, session_token, 0, 0); +- if (rc) { +- netdev_err(netdev, "Client initiated failover failed, rc %ld\n", ++ if (rc) ++ netdev_err(netdev, ++ "H_VIOCTL initiated failover failed, rc %ld\n", + rc); +- return -EINVAL; +- } ++ ++last_resort: ++ netdev_dbg(netdev, "Trying to send CRQ_CMD, the last resort\n"); ++ ibmvnic_reset(adapter, VNIC_RESET_FAILOVER); + + return count; + } +- + static DEVICE_ATTR_WO(failover); + + static unsigned long ibmvnic_get_desired_dma(struct vio_dev *vdev) +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-print-adapter-state-as-a-string.patch b/patches.suse/ibmvnic-print-adapter-state-as-a-string.patch new file mode 100644 index 0000000..bb8512d --- /dev/null +++ b/patches.suse/ibmvnic-print-adapter-state-as-a-string.patch @@ -0,0 +1,162 @@ +From 0666ef7f61ca763897fdcd385d65555dd4764514 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Mon, 12 Apr 2021 02:41:28 -0500 +Subject: [PATCH] ibmvnic: print adapter state as a string + +References: bsc#1152457 ltc#174432 git-fixes +Patch-mainline: v5.13-rc1 +Git-commit: 0666ef7f61ca763897fdcd385d65555dd4764514 + +The adapter state can be added or deleted over different versions +of the source code. Print a string instead of a number. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 67 ++++++++++++++++++++++-------- + 1 file changed, 49 insertions(+), 18 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -827,6 +827,30 @@ static void release_napi(struct ibmvnic_adapter *adapter) + adapter->napi_enabled = false; + } + ++static const char *adapter_state_to_string(enum vnic_state state) ++{ ++ switch (state) { ++ case VNIC_PROBING: ++ return "PROBING"; ++ case VNIC_PROBED: ++ return "PROBED"; ++ case VNIC_OPENING: ++ return "OPENING"; ++ case VNIC_OPEN: ++ return "OPEN"; ++ case VNIC_CLOSING: ++ return "CLOSING"; ++ case VNIC_CLOSED: ++ return "CLOSED"; ++ case VNIC_REMOVING: ++ return "REMOVING"; ++ case VNIC_REMOVED: ++ return "REMOVED"; ++ default: ++ return "UNKNOWN"; ++ } ++} ++ + static int ibmvnic_login(struct net_device *netdev) + { + struct ibmvnic_adapter *adapter = netdev_priv(netdev); +@@ -905,7 +929,7 @@ static int ibmvnic_login(struct net_device *netdev) + + __ibmvnic_set_mac(netdev, adapter->mac_addr); + +- netdev_dbg(netdev, "[S:%d] Login succeeded\n", adapter->state); ++ netdev_dbg(netdev, "[S:%s] Login succeeded\n", adapter_state_to_string(adapter->state)); + return 0; + } + +@@ -1185,8 +1209,9 @@ static int ibmvnic_open(struct net_device *netdev) + * honor our setting below. + */ + if (adapter->failover_pending || (test_bit(0, &adapter->resetting))) { +- netdev_dbg(netdev, "[S:%d FOP:%d] Resetting, deferring open\n", +- adapter->state, adapter->failover_pending); ++ netdev_dbg(netdev, "[S:%s FOP:%d] Resetting, deferring open\n", ++ adapter_state_to_string(adapter->state), ++ adapter->failover_pending); + adapter->state = VNIC_OPEN; + rc = 0; + goto out; +@@ -1350,8 +1375,9 @@ static int ibmvnic_close(struct net_device *netdev) + struct ibmvnic_adapter *adapter = netdev_priv(netdev); + int rc; + +- netdev_dbg(netdev, "[S:%d FOP:%d FRR:%d] Closing\n", +- adapter->state, adapter->failover_pending, ++ netdev_dbg(netdev, "[S:%s FOP:%d FRR:%d] Closing\n", ++ adapter_state_to_string(adapter->state), ++ adapter->failover_pending, + adapter->force_reset_recovery); + + /* If device failover is pending, just set device state and return. +@@ -1944,9 +1970,11 @@ static int do_reset(struct ibmvnic_adapter *adapter, + int rc; + + netdev_dbg(adapter->netdev, +- "[S:%d FOP:%d] Reset reason: %s, reset_state %d\n", +- adapter->state, adapter->failover_pending, +- reset_reason_to_string(rwi->reset_reason), reset_state); ++ "[S:%s FOP:%d] Reset reason: %s, reset_state: %s\n", ++ adapter_state_to_string(adapter->state), ++ adapter->failover_pending, ++ reset_reason_to_string(rwi->reset_reason), ++ adapter_state_to_string(reset_state)); + + adapter->reset_reason = rwi->reset_reason; + /* requestor of VNIC_RESET_CHANGE_PARAM already has the rtnl lock */ +@@ -2006,8 +2034,8 @@ static int do_reset(struct ibmvnic_adapter *adapter, + * from VNIC_CLOSING state. + */ + netdev_dbg(netdev, +- "Open changed state from %d, updating.\n", +- reset_state); ++ "Open changed state from %s, updating.\n", ++ adapter_state_to_string(reset_state)); + reset_state = VNIC_OPEN; + adapter->state = VNIC_CLOSING; + } +@@ -2148,8 +2176,9 @@ static int do_reset(struct ibmvnic_adapter *adapter, + if (!(adapter->reset_reason == VNIC_RESET_CHANGE_PARAM)) + rtnl_unlock(); + +- netdev_dbg(adapter->netdev, "[S:%d FOP:%d] Reset done, rc %d\n", +- adapter->state, adapter->failover_pending, rc); ++ netdev_dbg(adapter->netdev, "[S:%s FOP:%d] Reset done, rc %d\n", ++ adapter_state_to_string(adapter->state), ++ adapter->failover_pending, rc); + return rc; + } + +@@ -2226,8 +2255,9 @@ static int do_hard_reset(struct ibmvnic_adapter *adapter, + /* restore adapter state if reset failed */ + if (rc) + adapter->state = reset_state; +- netdev_dbg(adapter->netdev, "[S:%d FOP:%d] Hard reset done, rc %d\n", +- adapter->state, adapter->failover_pending, rc); ++ netdev_dbg(adapter->netdev, "[S:%s FOP:%d] Hard reset done, rc %d\n", ++ adapter_state_to_string(adapter->state), ++ adapter->failover_pending, rc); + return rc; + } + +@@ -2306,8 +2336,8 @@ static void __ibmvnic_reset(struct work_struct *work) + if (rc) { + /* give backing device time to settle down */ + netdev_dbg(adapter->netdev, +- "[S:%d] Hard reset failed, waiting 60 secs\n", +- adapter->state); ++ "[S:%s] Hard reset failed, waiting 60 secs\n", ++ adapter_state_to_string(adapter->state)); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(60 * HZ); + } +@@ -2335,8 +2365,9 @@ static void __ibmvnic_reset(struct work_struct *work) + clear_bit_unlock(0, &adapter->resetting); + + netdev_dbg(adapter->netdev, +- "[S:%d FRR:%d WFR:%d] Done processing resets\n", +- adapter->state, adapter->force_reset_recovery, ++ "[S:%s FRR:%d WFR:%d] Done processing resets\n", ++ adapter_state_to_string(adapter->state), ++ adapter->force_reset_recovery, + adapter->wait_for_reset); + } + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-print-reset-reason-as-a-string.patch b/patches.suse/ibmvnic-print-reset-reason-as-a-string.patch new file mode 100644 index 0000000..4235e64 --- /dev/null +++ b/patches.suse/ibmvnic-print-reset-reason-as-a-string.patch @@ -0,0 +1,96 @@ +From caee7bf5b0a9a1b0956b5910f0c44278ec1a9bb4 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Mon, 12 Apr 2021 02:41:27 -0500 +Subject: [PATCH] ibmvnic: print reset reason as a string + +References: bsc#1152457 ltc#174432 git-fixes +Patch-mainline: v5.13-rc1 +Git-commit: caee7bf5b0a9a1b0956b5910f0c44278ec1a9bb4 + +The reset reason can be added or deleted over different versions +of the source code. Print a string instead of a number. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 35 ++++++++++++++++++++++++------ + 1 file changed, 28 insertions(+), 7 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -1911,6 +1911,26 @@ static int ibmvnic_set_mac(struct net_device *netdev, void *p) + return rc; + } + ++static const char *reset_reason_to_string(enum ibmvnic_reset_reason reason) ++{ ++ switch (reason) { ++ case VNIC_RESET_FAILOVER: ++ return "FAILOVER"; ++ case VNIC_RESET_MOBILITY: ++ return "MOBILITY"; ++ case VNIC_RESET_FATAL: ++ return "FATAL"; ++ case VNIC_RESET_NON_FATAL: ++ return "NON_FATAL"; ++ case VNIC_RESET_TIMEOUT: ++ return "TIMEOUT"; ++ case VNIC_RESET_CHANGE_PARAM: ++ return "CHANGE_PARAM"; ++ default: ++ return "UNKNOWN"; ++ } ++} ++ + /* + * do_reset returns zero if we are able to keep processing reset events, or + * non-zero if we hit a fatal error and must halt. +@@ -1924,9 +1944,9 @@ static int do_reset(struct ibmvnic_adapter *adapter, + int rc; + + netdev_dbg(adapter->netdev, +- "[S:%d FOP:%d] Reset reason %d, reset_state %d\n", ++ "[S:%d FOP:%d] Reset reason: %s, reset_state %d\n", + adapter->state, adapter->failover_pending, +- rwi->reset_reason, reset_state); ++ reset_reason_to_string(rwi->reset_reason), reset_state); + + adapter->reset_reason = rwi->reset_reason; + /* requestor of VNIC_RESET_CHANGE_PARAM already has the rtnl lock */ +@@ -2139,8 +2159,8 @@ static int do_hard_reset(struct ibmvnic_adapter *adapter, + struct net_device *netdev = adapter->netdev; + int rc; + +- netdev_dbg(adapter->netdev, "Hard resetting driver (%d)\n", +- rwi->reset_reason); ++ netdev_dbg(adapter->netdev, "Hard resetting driver (%s)\n", ++ reset_reason_to_string(rwi->reset_reason)); + + /* read the state and check (again) after getting rtnl */ + reset_state = adapter->state; +@@ -2363,8 +2383,8 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, + list_for_each(entry, &adapter->rwi_list) { + tmp = list_entry(entry, struct ibmvnic_rwi, list); + if (tmp->reset_reason == reason) { +- netdev_dbg(netdev, "Skipping matching reset, reason=%d\n", +- reason); ++ netdev_dbg(netdev, "Skipping matching reset, reason=%s\n", ++ reset_reason_to_string(reason)); + ret = EBUSY; + goto err; + } +@@ -2384,7 +2404,8 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, + } + rwi->reset_reason = reason; + list_add_tail(&rwi->list, &adapter->rwi_list); +- netdev_dbg(adapter->netdev, "Scheduling reset (reason %d)\n", reason); ++ netdev_dbg(adapter->netdev, "Scheduling reset (reason %s)\n", ++ reset_reason_to_string(reason)); + schedule_work(&adapter->ibmvnic_reset); + + ret = 0; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-queue-reset-work-in-system_long_wq.patch b/patches.suse/ibmvnic-queue-reset-work-in-system_long_wq.patch new file mode 100644 index 0000000..f4cb504 --- /dev/null +++ b/patches.suse/ibmvnic-queue-reset-work-in-system_long_wq.patch @@ -0,0 +1,52 @@ +From 870e04ae45ea2e569d1ca2780439b16e988da08d Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Tue, 13 Apr 2021 14:33:39 -0500 +Subject: [PATCH] ibmvnic: queue reset work in system_long_wq + +References: bsc#1152457 ltc#174432 git-fixes +Patch-mainline: v5.13-rc1 +Git-commit: 870e04ae45ea2e569d1ca2780439b16e988da08d + +The reset process for ibmvnic commonly takes multiple seconds, clearly +making it inappropriate for schedule_work/system_wq. The reason to make +this change is that ibmvnic's use of the default system-wide workqueue +for a relatively long-running work item can negatively affect other +workqueue users. So, queue the relatively slow reset job to the +system_long_wq. + +Suggested-by: Nathan Lynch +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 0961d36833d5..b72159ccca3a 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2292,8 +2292,9 @@ static void __ibmvnic_reset(struct work_struct *work) + adapter = container_of(work, struct ibmvnic_adapter, ibmvnic_reset); + + if (test_and_set_bit_lock(0, &adapter->resetting)) { +- schedule_delayed_work(&adapter->ibmvnic_delayed_reset, +- IBMVNIC_RESET_DELAY); ++ queue_delayed_work(system_long_wq, ++ &adapter->ibmvnic_delayed_reset, ++ IBMVNIC_RESET_DELAY); + return; + } + +@@ -2437,7 +2438,7 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, + list_add_tail(&rwi->list, &adapter->rwi_list); + netdev_dbg(adapter->netdev, "Scheduling reset (reason %s)\n", + reset_reason_to_string(reason)); +- schedule_work(&adapter->ibmvnic_reset); ++ queue_work(system_long_wq, &adapter->ibmvnic_reset); + + ret = 0; + err: +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-remove-duplicate-napi_schedule-call-in-do_re.patch b/patches.suse/ibmvnic-remove-duplicate-napi_schedule-call-in-do_re.patch new file mode 100644 index 0000000..566b0a8 --- /dev/null +++ b/patches.suse/ibmvnic-remove-duplicate-napi_schedule-call-in-do_re.patch @@ -0,0 +1,52 @@ +From d3a6abccbd272aea7dc2c6f984bb5a2c11278e44 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Wed, 14 Apr 2021 02:46:15 -0500 +Subject: [PATCH] ibmvnic: remove duplicate napi_schedule call in do_reset + function + +References: bsc#1065729 +Patch-mainline: v5.12-rc8 +Git-commit: d3a6abccbd272aea7dc2c6f984bb5a2c11278e44 + +During adapter reset, do_reset/do_hard_reset calls ibmvnic_open(), +which will calls napi_schedule if previous state is VNIC_CLOSED +(i.e, the reset case, and "ifconfig down" case). So there is no need +for do_reset to call napi_schedule again at the end of the function +though napi_schedule will neglect the request if napi is already +scheduled. + +Fixes: ed651a10875f ("ibmvnic: Updated reset handling") +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 2d27f8aa0d4b..f4bd63216672 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -1921,7 +1921,7 @@ static int do_reset(struct ibmvnic_adapter *adapter, + u64 old_num_rx_queues, old_num_tx_queues; + u64 old_num_rx_slots, old_num_tx_slots; + struct net_device *netdev = adapter->netdev; +- int i, rc; ++ int rc; + + netdev_dbg(adapter->netdev, + "[S:%d FOP:%d] Reset reason %d, reset_state %d\n", +@@ -2110,10 +2110,6 @@ static int do_reset(struct ibmvnic_adapter *adapter, + /* refresh device's multicast list */ + ibmvnic_set_multi(netdev); + +- /* kick napi */ +- for (i = 0; i < adapter->req_rx_queues; i++) +- napi_schedule(&adapter->napi[i]); +- + if (adapter->reset_reason == VNIC_RESET_FAILOVER || + adapter->reset_reason == VNIC_RESET_MOBILITY) + __netdev_notify_peers(netdev); +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-remove-duplicate-napi_schedule-call-in-open-.patch b/patches.suse/ibmvnic-remove-duplicate-napi_schedule-call-in-open-.patch new file mode 100644 index 0000000..fbd6333 --- /dev/null +++ b/patches.suse/ibmvnic-remove-duplicate-napi_schedule-call-in-open-.patch @@ -0,0 +1,40 @@ +From 7c451f3ef676c805a4b77a743a01a5c21a250a73 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Wed, 14 Apr 2021 02:46:16 -0500 +Subject: [PATCH] ibmvnic: remove duplicate napi_schedule call in open function + +References: bsc#1065729 +Patch-mainline: v5.12-rc8 +Git-commit: 7c451f3ef676c805a4b77a743a01a5c21a250a73 + +Remove the unnecessary napi_schedule() call in __ibmvnic_open() since +interrupt_rx() calls napi_schedule_prep/__napi_schedule during every +receive interrupt. + +Fixes: ed651a10875f ("ibmvnic: Updated reset handling") +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index f4bd63216672..ffb2a91750c7 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -1156,11 +1156,6 @@ static int __ibmvnic_open(struct net_device *netdev) + + netif_tx_start_all_queues(netdev); + +- if (prev_state == VNIC_CLOSED) { +- for (i = 0; i < adapter->req_rx_queues; i++) +- napi_schedule(&adapter->napi[i]); +- } +- + adapter->state = VNIC_OPEN; + return rc; + } +-- +2.26.2 + diff --git a/patches.suse/kvm-add-proper-lockdep-assertion-in-i-o-bus-unregister b/patches.suse/kvm-add-proper-lockdep-assertion-in-i-o-bus-unregister new file mode 100644 index 0000000..b4e3c3c --- /dev/null +++ b/patches.suse/kvm-add-proper-lockdep-assertion-in-i-o-bus-unregister @@ -0,0 +1,47 @@ +From: Sean Christopherson +Date: Mon, 12 Apr 2021 15:20:50 -0700 +Subject: KVM: Add proper lockdep assertion in I/O bus unregister +Git-commit: 7c896d375565a032705f64804f8c1189df1f7a89 +Patch-mainline: v5.13-rc1 +References: CVE-2020-36312 bsc#1184509 + +Convert a comment above kvm_io_bus_unregister_dev() into an actual +lockdep assertion, and opportunistically add curly braces to a multi-line +for-loop. + +Signed-off-by: Sean Christopherson +Message-Id: <20210412222050.876100-4-seanjc@google.com> +Signed-off-by: Paolo Bonzini +Acked-by: Joerg Roedel +--- + virt/kvm/kvm_main.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/virt/kvm/kvm_main.c ++++ b/virt/kvm/kvm_main.c +@@ -3705,21 +3705,23 @@ int kvm_io_bus_register_dev(struct kvm * + return 0; + } + +-/* Caller must hold slots_lock. */ + int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, + struct kvm_io_device *dev) + { + int i, j; + struct kvm_io_bus *new_bus, *bus; + ++ lockdep_assert_held(&kvm->slots_lock); ++ + bus = kvm_get_bus(kvm, bus_idx); + if (!bus) + return 0; + +- for (i = 0; i < bus->dev_count; i++) ++ for (i = 0; i < bus->dev_count; i++) { + if (bus->range[i].dev == dev) { + break; + } ++ } + + if (i == bus->dev_count) + return 0; diff --git a/patches.suse/kvm-destroy-i-o-bus-devices-on-unregister-failure-after_-sync-ing-srcu b/patches.suse/kvm-destroy-i-o-bus-devices-on-unregister-failure-after_-sync-ing-srcu new file mode 100644 index 0000000..a593e10 --- /dev/null +++ b/patches.suse/kvm-destroy-i-o-bus-devices-on-unregister-failure-after_-sync-ing-srcu @@ -0,0 +1,50 @@ +From: Sean Christopherson +Date: Mon, 12 Apr 2021 15:20:48 -0700 +Subject: KVM: Destroy I/O bus devices on unregister failure _after_ sync'ing + SRCU +Git-commit: 2ee3757424be7c1cd1d0bbfa6db29a7edd82a250 +Patch-mainline: v5.13-rc1 +References: CVE-2020-36312 bsc#1184509 + +If allocating a new instance of an I/O bus fails when unregistering a +device, wait to destroy the device until after all readers are guaranteed +to see the new null bus. Destroying devices before the bus is nullified +could lead to use-after-free since readers expect the devices on their +reference of the bus to remain valid. + +Fixes: f65886606c2d ("KVM: fix memory leak in kvm_io_bus_unregister_dev()") +Cc: stable@vger.kernel.org +Signed-off-by: Sean Christopherson +Message-Id: <20210412222050.876100-2-seanjc@google.com> +Signed-off-by: Paolo Bonzini +Acked-by: Joerg Roedel +--- + virt/kvm/kvm_main.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +--- a/virt/kvm/kvm_main.c ++++ b/virt/kvm/kvm_main.c +@@ -3731,7 +3731,13 @@ void kvm_io_bus_unregister_dev(struct kv + new_bus->dev_count--; + memcpy(new_bus->range + i, bus->range + i + 1, + (new_bus->dev_count - i) * sizeof(struct kvm_io_range)); +- } else { ++ } ++ ++ rcu_assign_pointer(kvm->buses[bus_idx], new_bus); ++ synchronize_srcu_expedited(&kvm->srcu); ++ ++ /* Destroy the old bus _after_ installing the (null) bus. */ ++ if (!new_bus) { + pr_err("kvm: failed to shrink bus, removing it completely\n"); + for (j = 0; j < bus->dev_count; j++) { + if (j == i) +@@ -3740,8 +3746,6 @@ void kvm_io_bus_unregister_dev(struct kv + } + } + +- rcu_assign_pointer(kvm->buses[bus_idx], new_bus); +- synchronize_srcu_expedited(&kvm->srcu); + kfree(bus); + return; + } diff --git a/patches.suse/kvm-stop-looking-for-coalesced-mmio-zones-if-the-bus-is-destroyed b/patches.suse/kvm-stop-looking-for-coalesced-mmio-zones-if-the-bus-is-destroyed new file mode 100644 index 0000000..927c70f --- /dev/null +++ b/patches.suse/kvm-stop-looking-for-coalesced-mmio-zones-if-the-bus-is-destroyed @@ -0,0 +1,121 @@ +From: Sean Christopherson +Date: Mon, 12 Apr 2021 15:20:49 -0700 +Subject: KVM: Stop looking for coalesced MMIO zones if the bus is destroyed +Git-commit: 5d3c4c79384af06e3c8e25b7770b6247496b4417 +Patch-mainline: v5.13-rc1 +References: CVE-2020-36312 bsc#1184509 + +Abort the walk of coalesced MMIO zones if kvm_io_bus_unregister_dev() +fails to allocate memory for the new instance of the bus. If it can't +instantiate a new bus, unregister_dev() destroys all devices _except_ the +target device. But, it doesn't tell the caller that it obliterated the +bus and invoked the destructor for all devices that were on the bus. In +the coalesced MMIO case, this can result in a deleted list entry +dereference due to attempting to continue iterating on coalesced_zones +after future entries (in the walk) have been deleted. + +Opportunistically add curly braces to the for-loop, which encompasses +many lines but sneaks by without braces due to the guts being a single +if statement. + +Fixes: f65886606c2d ("KVM: fix memory leak in kvm_io_bus_unregister_dev()") +Cc: stable@vger.kernel.org +Reported-by: Hao Sun +Signed-off-by: Sean Christopherson +Message-Id: <20210412222050.876100-3-seanjc@google.com> +Signed-off-by: Paolo Bonzini +Acked-by: Joerg Roedel +--- + include/linux/kvm_host.h | 4 ++-- + virt/kvm/coalesced_mmio.c | 19 +++++++++++++++++-- + virt/kvm/kvm_main.c | 10 +++++----- + 3 files changed, 24 insertions(+), 9 deletions(-) + +--- a/include/linux/kvm_host.h ++++ b/include/linux/kvm_host.h +@@ -174,8 +174,8 @@ int kvm_io_bus_read(struct kvm_vcpu *vcp + int len, void *val); + int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, + int len, struct kvm_io_device *dev); +-void kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, +- struct kvm_io_device *dev); ++int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, ++ struct kvm_io_device *dev); + struct kvm_io_device *kvm_io_bus_get_dev(struct kvm *kvm, enum kvm_bus bus_idx, + gpa_t addr); + +--- a/virt/kvm/coalesced_mmio.c ++++ b/virt/kvm/coalesced_mmio.c +@@ -171,16 +171,31 @@ int kvm_vm_ioctl_unregister_coalesced_mm + struct kvm_coalesced_mmio_zone *zone) + { + struct kvm_coalesced_mmio_dev *dev, *tmp; ++ int r; + + mutex_lock(&kvm->slots_lock); + +- list_for_each_entry_safe(dev, tmp, &kvm->coalesced_zones, list) ++ list_for_each_entry_safe(dev, tmp, &kvm->coalesced_zones, list) { + if (coalesced_mmio_in_range(dev, zone->addr, zone->size)) { +- kvm_io_bus_unregister_dev(kvm, KVM_MMIO_BUS, &dev->dev); ++ r = kvm_io_bus_unregister_dev(kvm, KVM_MMIO_BUS, &dev->dev); + kvm_iodevice_destructor(&dev->dev); ++ ++ /* ++ * On failure, unregister destroys all devices on the ++ * bus _except_ the target device, i.e. coalesced_zones ++ * has been modified. No need to restart the walk as ++ * there aren't any zones left. ++ */ ++ if (r) ++ break; + } ++ } + + mutex_unlock(&kvm->slots_lock); + ++ /* ++ * Ignore the result of kvm_io_bus_unregister_dev(), from userspace's ++ * perspective, the coalesced MMIO is most definitely unregistered. ++ */ + return 0; + } +--- a/virt/kvm/kvm_main.c ++++ b/virt/kvm/kvm_main.c +@@ -3706,15 +3706,15 @@ int kvm_io_bus_register_dev(struct kvm * + } + + /* Caller must hold slots_lock. */ +-void kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, +- struct kvm_io_device *dev) ++int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, ++ struct kvm_io_device *dev) + { + int i, j; + struct kvm_io_bus *new_bus, *bus; + + bus = kvm_get_bus(kvm, bus_idx); + if (!bus) +- return; ++ return 0; + + for (i = 0; i < bus->dev_count; i++) + if (bus->range[i].dev == dev) { +@@ -3722,7 +3722,7 @@ void kvm_io_bus_unregister_dev(struct kv + } + + if (i == bus->dev_count) +- return; ++ return 0; + + new_bus = kmalloc(sizeof(*bus) + ((bus->dev_count - 1) * + sizeof(struct kvm_io_range)), GFP_KERNEL); +@@ -3747,7 +3747,7 @@ void kvm_io_bus_unregister_dev(struct kv + } + + kfree(bus); +- return; ++ return new_bus ? 0 : -ENOMEM; + } + + struct kvm_io_device *kvm_io_bus_get_dev(struct kvm *kvm, enum kvm_bus bus_idx, diff --git a/patches.suse/net-bcmgenet-use-hardware-padding-of-runt-frames.patch b/patches.suse/net-bcmgenet-use-hardware-padding-of-runt-frames.patch new file mode 100644 index 0000000..09a2c01 --- /dev/null +++ b/patches.suse/net-bcmgenet-use-hardware-padding-of-runt-frames.patch @@ -0,0 +1,64 @@ +From 3cae45f6c0c1bd54aec08d14ab4d9272b1f433e5 Mon Sep 17 00:00:00 2001 +From: Doug Berger +Date: Wed, 24 Jun 2020 18:14:55 -0700 +Subject: [PATCH 1/4] net: bcmgenet: use hardware padding of runt frames +Patch-mainline: v5.8-rc3 +Git-commit: 20d1f2d1b024f6be199a3bedf1578a1d21592bc5 +References: git-fixes + +When commit 474ea9cafc45 ("net: bcmgenet: correctly pad short +packets") added the call to skb_padto() it should have been +located before the nr_frags parameter was read since that value +could be changed when padding packets with lengths between 55 +and 59 bytes (inclusive). + +The use of a stale nr_frags value can cause corruption of the +pad data when tx-scatter-gather is enabled. This corruption of +the pad can cause invalid checksum computation when hardware +offload of tx-checksum is also enabled. + +Since the original reason for the padding was corrected by +commit 7dd399130efb ("net: bcmgenet: fix skb_len in +bcmgenet_xmit_single()") we can remove the software padding all +together and make use of hardware padding of short frames as +long as the hardware also always appends the FCS value to the +frame. + +Fixes: 474ea9cafc45 ("net: bcmgenet: correctly pad short packets") +Signed-off-by: Doug Berger +Acked-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Denis Kirjanov +--- + drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +index db7c89c28fb0..18a0da74089d 100644 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +@@ -2057,11 +2057,6 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) + goto out; + } + +- if (skb_padto(skb, ETH_ZLEN)) { +- ret = NETDEV_TX_OK; +- goto out; +- } +- + /* Retain how many bytes will be sent on the wire, without TSB inserted + * by transmit checksum offload + */ +@@ -2110,6 +2105,9 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) + len_stat = (size << DMA_BUFLENGTH_SHIFT) | + (priv->hw_params->qtag_mask << DMA_TX_QTAG_SHIFT); + ++ /* Note: if we ever change from DMA_TX_APPEND_CRC below we ++ * will need to restore software padding of "runt" packets ++ */ + if (!i) { + len_stat |= DMA_TX_APPEND_CRC | DMA_SOP; + if (skb->ip_summed == CHECKSUM_PARTIAL) +-- +2.16.4 + diff --git a/patches.suse/net-cxgb4-fix-return-error-value-in-t4_prep_fw.patch b/patches.suse/net-cxgb4-fix-return-error-value-in-t4_prep_fw.patch new file mode 100644 index 0000000..7d3fee4 --- /dev/null +++ b/patches.suse/net-cxgb4-fix-return-error-value-in-t4_prep_fw.patch @@ -0,0 +1,57 @@ +From 7de206b87e7df9596df981d9ef010b0449949ee2 Mon Sep 17 00:00:00 2001 +From: Li Heng +Date: Mon, 29 Jun 2020 18:49:51 +0800 +Subject: [PATCH 2/4] net: cxgb4: fix return error value in t4_prep_fw +Patch-mainline: v5.8-rc5 +Git-commit: 8a259e6b73ad8181b0b2ef338b35043433db1075 +References: git-fixes + +t4_prep_fw goto bye tag with positive return value when something +bad happened and which can not free resource in adap_init0. +so fix it to return negative value. + +Fixes: 16e47624e76b ("cxgb4: Add new scheme to update T4/T5 firmware") +Reported-by: Hulk Robot +Signed-off-by: Li Heng +Signed-off-by: David S. Miller +Signed-off-by: Denis Kirjanov +--- + drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +index 3289627f03eb..270098ca17a7 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +@@ -3500,7 +3500,7 @@ int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info, + drv_fw = &fw_info->fw_hdr; + + /* Read the header of the firmware on the card */ +- ret = -t4_read_flash(adap, FLASH_FW_START, ++ ret = t4_read_flash(adap, FLASH_FW_START, + sizeof(*card_fw) / sizeof(uint32_t), + (uint32_t *)card_fw, 1); + if (ret == 0) { +@@ -3529,8 +3529,8 @@ int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info, + should_install_fs_fw(adap, card_fw_usable, + be32_to_cpu(fs_fw->fw_ver), + be32_to_cpu(card_fw->fw_ver))) { +- ret = -t4_fw_upgrade(adap, adap->mbox, fw_data, +- fw_size, 0); ++ ret = t4_fw_upgrade(adap, adap->mbox, fw_data, ++ fw_size, 0); + if (ret != 0) { + dev_err(adap->pdev_dev, + "failed to install firmware: %d\n", ret); +@@ -3561,7 +3561,7 @@ int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info, + FW_HDR_FW_VER_MICRO_G(c), FW_HDR_FW_VER_BUILD_G(c), + FW_HDR_FW_VER_MAJOR_G(k), FW_HDR_FW_VER_MINOR_G(k), + FW_HDR_FW_VER_MICRO_G(k), FW_HDR_FW_VER_BUILD_G(k)); +- ret = EINVAL; ++ ret = -EINVAL; + goto bye; + } + +-- +2.16.4 + diff --git a/patches.suse/net-fix-race-condition-in-__inet_lookup_established.patch b/patches.suse/net-fix-race-condition-in-__inet_lookup_established.patch index d85ebb4..c758848 100644 --- a/patches.suse/net-fix-race-condition-in-__inet_lookup_established.patch +++ b/patches.suse/net-fix-race-condition-in-__inet_lookup_established.patch @@ -2,7 +2,7 @@ From: Firo Yang Date: Mon, 20 Apr 2020 17:10:01 +0200 Subject: net: fix race condition in __inet_lookup_established() Patch-mainline: Never, mainline solution (v5.5-rc3) too intrusive -References: bsc#1151794 +References: bsc#1151794 bsc#1180624 Listening and established sockets share the same slab cache which has SLAB_TYPESAFE_BY_RCU flag set but this only protects from a slab page being @@ -14,7 +14,9 @@ a listening one. Since commit 3b24d854cb35 ("tcp/dccp: do not touch listener sk_refcnt under synflood"), listener hashtable no longer uses "nulls" lists so that after such switch, sk_nulls_for_each_rcu() loop in __inet_lookup_established() -would hit NULL as end marker which it would fail to recognize. +would hit NULL as end marker which it would fail to recognize. Analogously, +__inet_lookup_listener() and inet_diag_dump_icsk() may hit an opposite +switch from a listener socket to an established one. The upstream solution, commit 8dbd76e79a16 ("tcp/dccp: fix possible race __inet_lookup_established()"), is rather intrusive and would break kABI @@ -22,21 +24,69 @@ in a way which would be impossible to work around reliably. Therefore we use a simpler patch which is safer at the expense of a minor performance penalty. +For testing purpose, add a temporary debugging message whenever a race +resulting in a switch from an established socket to a listener or vice +versa is detected. + Fixes: 3b24d854cb35 ("tcp/dccp: do not touch listener sk_refcnt under synflood") Signed-off-by: Firo Yang Signed-off-by: Michal Kubecek --- - net/ipv4/inet_hashtables.c | 2 ++ - 1 file changed, 2 insertions(+) + net/ipv4/inet_diag.c | 5 +++++ + net/ipv4/inet_hashtables.c | 21 ++++++++++++++++++--- + 2 files changed, 23 insertions(+), 3 deletions(-) +--- a/net/ipv4/inet_diag.c ++++ b/net/ipv4/inet_diag.c +@@ -884,6 +884,11 @@ void inet_diag_dump_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *skb, + sk_for_each(sk, &ilb->head) { + struct inet_sock *inet = inet_sk(sk); + ++ if (unlikely(is_a_nulls(&sk->sk_nulls_node))) { ++ pr_info("%s: bsc#1180624 race encountered\n", ++ __func__); ++ break; ++ } + if (!net_eq(sock_net(sk), net)) + continue; + --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c -@@ -283,6 +283,8 @@ struct sock *__inet_lookup_established(struct net *net, +@@ -212,12 +212,23 @@ struct sock *__inet_lookup_listener(struct net *net, + { + unsigned int hash = inet_lhashfn(net, hnum); + struct inet_listen_hashbucket *ilb = &hashinfo->listening_hash[hash]; +- int score, hiscore = 0, matches = 0, reuseport = 0; ++ int score, hiscore, matches, reuseport; + bool exact_dif = inet_exact_dif_match(net, skb); +- struct sock *sk, *result = NULL; +- u32 phash = 0; ++ struct sock *sk, *result; ++ u32 phash; ++ ++begin: ++ hiscore = 0; ++ matches = 0; ++ reuseport = 0; ++ result = NULL; ++ phash = 0; + + sk_for_each_rcu(sk, &ilb->head) { ++ if (unlikely(is_a_nulls(&sk->sk_nulls_node))) { ++ pr_info("%s: bsc#1180624 race encountered\n", __func__); ++ goto begin; ++ } + score = compute_score(sk, net, hnum, daddr, dif, exact_dif); + if (score > hiscore) { + reuseport = sk->sk_reuseport; +@@ -283,6 +294,10 @@ struct sock *__inet_lookup_established(struct net *net, begin: sk_nulls_for_each_rcu(sk, node, &head->chain) { -+ if (unlikely(!node)) ++ if (unlikely(!node)) { ++ pr_info("%s: bsc#1151794 race encountered\n", __func__); + goto begin; ++ } if (sk->sk_hash != hash) continue; if (likely(INET_MATCH(sk, net, acookie, diff --git a/patches.suse/powerpc-64s-Fix-pte-update-for-kernel-memory-on-radi.patch b/patches.suse/powerpc-64s-Fix-pte-update-for-kernel-memory-on-radi.patch new file mode 100644 index 0000000..8822470 --- /dev/null +++ b/patches.suse/powerpc-64s-Fix-pte-update-for-kernel-memory-on-radi.patch @@ -0,0 +1,140 @@ +From b8b2f37cf632434456182e9002d63cbc4cccc50c Mon Sep 17 00:00:00 2001 +From: Jordan Niethe +Date: Mon, 8 Feb 2021 14:29:56 +1100 +Subject: [PATCH] powerpc/64s: Fix pte update for kernel memory on radix + +References: bsc#1055117 git-fixes +Patch-mainline: v5.13-rc1 +Git-commit: b8b2f37cf632434456182e9002d63cbc4cccc50c + +When adding a PTE a ptesync is needed to order the update of the PTE +with subsequent accesses otherwise a spurious fault may be raised. + +radix__set_pte_at() does not do this for performance gains. For +non-kernel memory this is not an issue as any faults of this kind are +corrected by the page fault handler. For kernel memory these faults +are not handled. The current solution is that there is a ptesync in +flush_cache_vmap() which should be called when mapping from the +vmalloc region. + +However, map_kernel_page() does not call flush_cache_vmap(). This is +troublesome in particular for code patching with Strict RWX on radix. +In do_patch_instruction() the page frame that contains the instruction +to be patched is mapped and then immediately patched. With no ordering +or synchronization between setting up the PTE and writing to the page +it is possible for faults. + +As the code patching is done using __put_user_asm_goto() the resulting +fault is obscured - but using a normal store instead it can be seen: + + BUG: Unable to handle kernel data access on write at 0xc008000008f24a3c + Faulting instruction address: 0xc00000000008bd74 + Oops: Kernel access of bad area, sig: 11 [#1] + LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA PowerNV + Modules linked in: nop_module(PO+) [last unloaded: nop_module] + CPU: 4 PID: 757 Comm: sh Tainted: P O 5.10.0-rc5-01361-ge3c1b78c8440-dirty #43 + NIP: c00000000008bd74 LR: c00000000008bd50 CTR: c000000000025810 + REGS: c000000016f634a0 TRAP: 0300 Tainted: P O (5.10.0-rc5-01361-ge3c1b78c8440-dirty) + MSR: 9000000000009033 CR: 44002884 XER: 00000000 + CFAR: c00000000007c68c DAR: c008000008f24a3c DSISR: 42000000 IRQMASK: 1 + +This results in the kind of issue reported here: + https://lore.kernel.org/linuxppc-dev/15AC5B0E-A221-4B8C-9039-FA96B8EF7C88@lca.pw/ + +Chris Riedl suggested a reliable way to reproduce the issue: + $ mount -t debugfs none /sys/kernel/debug + $ (while true; do echo function > /sys/kernel/debug/tracing/current_tracer ; echo nop > /sys/kernel/debug/tracing/current_tracer ; done) & + +Turning ftrace on and off does a large amount of code patching which +in usually less then 5min will crash giving a trace like: + + ftrace-powerpc: (____ptrval____): replaced (4b473b11) != old (60000000) + ------------[ ftrace bug ]------------ + ftrace failed to modify + [] napi_busy_loop+0xc/0x390 + actual: 11:3b:47:4b + Setting ftrace call site to call ftrace function + ftrace record flags: 80000001 + (1) + expected tramp: c00000000006c96c + ------------[ cut here ]------------ + WARNING: CPU: 4 PID: 809 at kernel/trace/ftrace.c:2065 ftrace_bug+0x28c/0x2e8 + Modules linked in: nop_module(PO-) [last unloaded: nop_module] + CPU: 4 PID: 809 Comm: sh Tainted: P O 5.10.0-rc5-01360-gf878ccaf250a #1 + NIP: c00000000024f334 LR: c00000000024f330 CTR: c0000000001a5af0 + REGS: c000000004c8b760 TRAP: 0700 Tainted: P O (5.10.0-rc5-01360-gf878ccaf250a) + MSR: 900000000282b033 CR: 28008848 XER: 20040000 + CFAR: c0000000001a9c98 IRQMASK: 0 + GPR00: c00000000024f330 c000000004c8b9f0 c000000002770600 0000000000000022 + GPR04: 00000000ffff7fff c000000004c8b6d0 0000000000000027 c0000007fe9bcdd8 + GPR08: 0000000000000023 ffffffffffffffd8 0000000000000027 c000000002613118 + GPR12: 0000000000008000 c0000007fffdca00 0000000000000000 0000000000000000 + GPR16: 0000000023ec37c5 0000000000000000 0000000000000000 0000000000000008 + GPR20: c000000004c8bc90 c0000000027a2d20 c000000004c8bcd0 c000000002612fe8 + GPR24: 0000000000000038 0000000000000030 0000000000000028 0000000000000020 + GPR28: c000000000ff1b68 c000000000bf8e5c c00000000312f700 c000000000fbb9b0 + NIP ftrace_bug+0x28c/0x2e8 + LR ftrace_bug+0x288/0x2e8 + Call Trace: + ftrace_bug+0x288/0x2e8 (unreliable) + ftrace_modify_all_code+0x168/0x210 + arch_ftrace_update_code+0x18/0x30 + ftrace_run_update_code+0x44/0xc0 + ftrace_startup+0xf8/0x1c0 + register_ftrace_function+0x4c/0xc0 + function_trace_init+0x80/0xb0 + tracing_set_tracer+0x2a4/0x4f0 + tracing_set_trace_write+0xd4/0x130 + vfs_write+0xf0/0x330 + ksys_write+0x84/0x140 + system_call_exception+0x14c/0x230 + system_call_common+0xf0/0x27c + +To fix this when updating kernel memory PTEs using ptesync. + +Fixes: f1cb8f9beba8 ("powerpc/64s/radix: avoid ptesync after set_pte and ptep_set_access_flags") +Signed-off-by: Jordan Niethe +Reviewed-by: Nicholas Piggin +[mpe: Tidy up change log slightly] +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20210208032957.1232102-1-jniethe5@gmail.com +[Don't have early_map_kernel_page on 4.12] +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/book3s/64/radix.h | 6 ++++-- + arch/powerpc/mm/pgtable-radix.c | 4 ++-- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/arch/powerpc/include/asm/book3s/64/radix.h b/arch/powerpc/include/asm/book3s/64/radix.h +index c7813dc628fc..59cab558e2f0 100644 +--- a/arch/powerpc/include/asm/book3s/64/radix.h ++++ b/arch/powerpc/include/asm/book3s/64/radix.h +@@ -222,8 +222,10 @@ static inline void radix__set_pte_at(struct mm_struct *mm, unsigned long addr, + * from ptesync, it should probably go into update_mmu_cache, rather + * than set_pte_at (which is used to set ptes unrelated to faults). + * +- * Spurious faults to vmalloc region are not tolerated, so there is +- * a ptesync in flush_cache_vmap. ++ * Spurious faults from the kernel memory are not tolerated, so there ++ * is a ptesync in flush_cache_vmap, and __map_kernel_page() follows ++ * the pte update sequence from ISA Book III 6.10 Translation Table ++ * Update Synchronization Requirements. + */ + } + +diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c +index 8b8f1451e944..55f26c0e389e 100644 +--- a/arch/powerpc/mm/pgtable-radix.c ++++ b/arch/powerpc/mm/pgtable-radix.c +@@ -168,7 +168,7 @@ static int __map_kernel_page(unsigned long ea, unsigned long pa, + + set_the_pte: + set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT, flags)); +- smp_wmb(); ++ asm volatile("ptesync": : :"memory"); + return 0; + } + +-- +2.26.2 + diff --git a/patches.suse/powerpc-asm-offsets-GPR14-is-not-needed-either.patch b/patches.suse/powerpc-asm-offsets-GPR14-is-not-needed-either.patch new file mode 100644 index 0000000..eebb6c6 --- /dev/null +++ b/patches.suse/powerpc-asm-offsets-GPR14-is-not-needed-either.patch @@ -0,0 +1,42 @@ +From 6eeca7a11379e9dd05493bbdba57515b36a2e3cf Mon Sep 17 00:00:00 2001 +From: Christophe Leroy +Date: Mon, 15 Mar 2021 11:01:26 +0000 +Subject: [PATCH] powerpc/asm-offsets: GPR14 is not needed either + +References: bsc#1065729 +Patch-mainline: v5.13-rc1 +Git-commit: 6eeca7a11379e9dd05493bbdba57515b36a2e3cf + +Commit aac6a91fea93 ("powerpc/asm: Remove unused symbols in +asm-offsets.c") removed GPR15 to GPR31 but kept GPR14, +probably because it pops up in a couple of comments when doing +a grep. + +However, it was never used either, so remove it as well. + +Fixes: aac6a91fea93 ("powerpc/asm: Remove unused symbols in asm-offsets.c") +Signed-off-by: Christophe Leroy +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/9881c68fbca004f9ea18fc9473f630e11ccd6417.1615806071.git.christophe.leroy@csgroup.eu +Acked-by: Michal Suchanek +--- + arch/powerpc/kernel/asm-offsets.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c +index 85ba2b0bc8d8..d2f1b94e944d 100644 +--- a/arch/powerpc/kernel/asm-offsets.c ++++ b/arch/powerpc/kernel/asm-offsets.c +@@ -320,9 +320,6 @@ int main(void) + STACK_PT_REGS_OFFSET(GPR11, gpr[11]); + STACK_PT_REGS_OFFSET(GPR12, gpr[12]); + STACK_PT_REGS_OFFSET(GPR13, gpr[13]); +-#ifndef CONFIG_PPC64 +- STACK_PT_REGS_OFFSET(GPR14, gpr[14]); +-#endif /* CONFIG_PPC64 */ + /* + * Note: these symbols include _ because they overlap with special + * register names +-- +2.26.2 + diff --git a/patches.suse/powerpc-fadump-Mark-fadump_calculate_reserve_size-as.patch b/patches.suse/powerpc-fadump-Mark-fadump_calculate_reserve_size-as.patch new file mode 100644 index 0000000..01d5d5b --- /dev/null +++ b/patches.suse/powerpc-fadump-Mark-fadump_calculate_reserve_size-as.patch @@ -0,0 +1,55 @@ +From fbced1546eaaab57a32e56c974ea8acf10c6abd8 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Tue, 2 Mar 2021 12:50:14 -0700 +Subject: [PATCH] powerpc/fadump: Mark fadump_calculate_reserve_size as __init + +References: bsc#1065729 +Patch-mainline: v5.13-rc1 +Git-commit: fbced1546eaaab57a32e56c974ea8acf10c6abd8 + +If fadump_calculate_reserve_size() is not inlined, there is a modpost +warning: + +WARNING: modpost: vmlinux.o(.text+0x5196c): Section mismatch in +reference from the function fadump_calculate_reserve_size() to the +function .init.text:parse_crashkernel() +The function fadump_calculate_reserve_size() references +the function __init parse_crashkernel(). +This is often because fadump_calculate_reserve_size lacks a __init +annotation or the annotation of parse_crashkernel is wrong. + +fadump_calculate_reserve_size() calls parse_crashkernel(), which is +marked as __init and fadump_calculate_reserve_size() is called from +within fadump_reserve_mem(), which is also marked as __init. + +Mark fadump_calculate_reserve_size() as __init to fix the section +mismatch. Additionally, remove the inline keyword as it is not necessary +to inline this function; the compiler is still free to do so if it feels +it is worthwhile since commit 889b3c1245de ("compiler: remove +CONFIG_OPTIMIZE_INLINING entirely"). + +Fixes: 11550dc0a00b ("powerpc/fadump: reuse crashkernel parameter for fadump memory reservation") +Signed-off-by: Nathan Chancellor +Signed-off-by: Michael Ellerman +Link: https://github.com/ClangBuiltLinux/linux/issues/1300 +Link: https://lore.kernel.org/r/20210302195013.2626335-1-nathan@kernel.org +Acked-by: Michal Suchanek +--- + arch/powerpc/kernel/fadump.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c +--- a/arch/powerpc/kernel/fadump.c ++++ b/arch/powerpc/kernel/fadump.c +@@ -292,7 +292,7 @@ static void fadump_show_config(void) + * that is required for a kernel to boot successfully. + * + */ +-static inline unsigned long fadump_calculate_reserve_size(void) ++static __init unsigned long fadump_calculate_reserve_size(void) + { + int ret; + unsigned long long base, size; +-- +2.26.2 + diff --git a/patches.suse/powerpc-mm-Add-cond_resched-while-removing-hpte-mapp.patch b/patches.suse/powerpc-mm-Add-cond_resched-while-removing-hpte-mapp.patch index eb8a275..9eec117 100644 --- a/patches.suse/powerpc-mm-Add-cond_resched-while-removing-hpte-mapp.patch +++ b/patches.suse/powerpc-mm-Add-cond_resched-while-removing-hpte-mapp.patch @@ -4,8 +4,7 @@ Date: Sun, 4 Apr 2021 22:01:48 +0530 Subject: [PATCH] powerpc/mm: Add cond_resched() while removing hpte mappings References: bsc#1183289 ltc#191637 -Patch-mainline: queued -Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git +Patch-mainline: v5.13-rc1 Git-commit: a5d6a3e73acbd619dd5b7b831762b755f9e2db80 While removing large number of mappings from hash page tables for diff --git a/patches.suse/powerpc-perf-Fix-PMU-constraint-check-for-EBB-events.patch b/patches.suse/powerpc-perf-Fix-PMU-constraint-check-for-EBB-events.patch new file mode 100644 index 0000000..36e3ce6 --- /dev/null +++ b/patches.suse/powerpc-perf-Fix-PMU-constraint-check-for-EBB-events.patch @@ -0,0 +1,66 @@ +From 10f8f96179ecc7f69c927f6d231f6d02736cea83 Mon Sep 17 00:00:00 2001 +From: Athira Rajeev +Date: Tue, 6 Apr 2021 12:16:01 -0400 +Subject: [PATCH] powerpc/perf: Fix PMU constraint check for EBB events + +References: bsc#1065729 +Patch-mainline: v5.13-rc1 +Git-commit: 10f8f96179ecc7f69c927f6d231f6d02736cea83 + +The power PMU group constraints includes check for EBB events to make +sure all events in a group must agree on EBB. This will prevent +scheduling EBB and non-EBB events together. But in the existing check, +settings for constraint mask and value is interchanged. Patch fixes the +same. + +Before the patch, PMU selftest "cpu_event_pinned_vs_ebb_test" fails with +below in dmesg logs. This happens because EBB event gets enabled along +with a non-EBB cpu event. + + [35600.453346] cpu_event_pinne[41326]: illegal instruction (4) + at 10004a18 nip 10004a18 lr 100049f8 code 1 in + cpu_event_pinned_vs_ebb_test[10000000+10000] + +Test results after the patch: + + $ ./pmu/ebb/cpu_event_pinned_vs_ebb_test + test: cpu_event_pinned_vs_ebb + tags: git_version:v5.12-rc5-93-gf28c3125acd3-dirty + Binding to cpu 8 + EBB Handler is at 0x100050c8 + read error on event 0x7fffe6bd4040! + PM_RUN_INST_CMPL: result 9872 running/enabled 37930432 + success: cpu_event_pinned_vs_ebb + +This bug was hidden by other logic until commit 1908dc911792 (perf: +Tweak perf_event_attr::exclusive semantics). + +Fixes: 4df489991182 ("powerpc/perf: Add power8 EBB support") +Reported-by: Thadeu Lima de Souza Cascardo +Signed-off-by: Athira Rajeev +[mpe: Mention commit 1908dc911792] +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/1617725761-1464-1-git-send-email-atrajeev@linux.vnet.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/perf/isa207-common.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/powerpc/perf/isa207-common.c b/arch/powerpc/perf/isa207-common.c +index e4f577da33d8..8b5eeb6fb2fb 100644 +--- a/arch/powerpc/perf/isa207-common.c ++++ b/arch/powerpc/perf/isa207-common.c +@@ -447,8 +447,8 @@ int isa207_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp, + * EBB events are pinned & exclusive, so this should never actually + * hit, but we leave it as a fallback in case. + */ +- mask |= CNST_EBB_VAL(ebb); +- value |= CNST_EBB_MASK; ++ mask |= CNST_EBB_MASK; ++ value |= CNST_EBB_VAL(ebb); + + *maskp = mask; + *valp = value; +-- +2.26.2 + diff --git a/patches.suse/powerpc-prom-Mark-identical_pvr_fixup-as-__init.patch b/patches.suse/powerpc-prom-Mark-identical_pvr_fixup-as-__init.patch new file mode 100644 index 0000000..f4cbe03 --- /dev/null +++ b/patches.suse/powerpc-prom-Mark-identical_pvr_fixup-as-__init.patch @@ -0,0 +1,60 @@ +From 1ef1dd9c7ed27b080445e1576e8a05957e0e4dfc Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Tue, 2 Mar 2021 13:08:29 -0700 +Subject: [PATCH] powerpc/prom: Mark identical_pvr_fixup as __init + +References: bsc#1065729 +Patch-mainline: v5.13-rc1 +Git-commit: 1ef1dd9c7ed27b080445e1576e8a05957e0e4dfc + +If identical_pvr_fixup() is not inlined, there are two modpost warnings: + +WARNING: modpost: vmlinux.o(.text+0x54e8): Section mismatch in reference +from the function identical_pvr_fixup() to the function +.init.text:of_get_flat_dt_prop() +The function identical_pvr_fixup() references +the function __init of_get_flat_dt_prop(). +This is often because identical_pvr_fixup lacks a __init +annotation or the annotation of of_get_flat_dt_prop is wrong. + +WARNING: modpost: vmlinux.o(.text+0x551c): Section mismatch in reference +from the function identical_pvr_fixup() to the function +.init.text:identify_cpu() +The function identical_pvr_fixup() references +the function __init identify_cpu(). +This is often because identical_pvr_fixup lacks a __init +annotation or the annotation of identify_cpu is wrong. + +identical_pvr_fixup() calls two functions marked as __init and is only +called by a function marked as __init so it should be marked as __init +as well. At the same time, remove the inline keywork as it is not +necessary to inline this function. The compiler is still free to do so +if it feels it is worthwhile since commit 889b3c1245de ("compiler: +remove CONFIG_OPTIMIZE_INLINING entirely"). + +Fixes: 14b3d926a22b ("[POWERPC] 4xx: update 440EP(x)/440GR(x) identical PVR issue workaround") +Signed-off-by: Nathan Chancellor +Signed-off-by: Michael Ellerman +Link: https://github.com/ClangBuiltLinux/linux/issues/1316 +Link: https://lore.kernel.org/r/20210302200829.2680663-1-nathan@kernel.org +Acked-by: Michal Suchanek +--- + arch/powerpc/kernel/prom.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c +index 9a4797d1d40d..a8b2d6bfc1ca 100644 +--- a/arch/powerpc/kernel/prom.c ++++ b/arch/powerpc/kernel/prom.c +@@ -267,7 +267,7 @@ static struct feature_property { + }; + + #if defined(CONFIG_44x) && defined(CONFIG_PPC_FPU) +-static inline void identical_pvr_fixup(unsigned long node) ++static __init void identical_pvr_fixup(unsigned long node) + { + unsigned int pvr; + const char *model = of_get_flat_dt_prop(node, "model", NULL); +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-Add-shutdown-to-vio_driver-and-vio_b.patch b/patches.suse/powerpc-pseries-Add-shutdown-to-vio_driver-and-vio_b.patch index a94aa2a..5b9086e 100644 --- a/patches.suse/powerpc-pseries-Add-shutdown-to-vio_driver-and-vio_b.patch +++ b/patches.suse/powerpc-pseries-Add-shutdown-to-vio_driver-and-vio_b.patch @@ -4,8 +4,7 @@ Date: Thu, 1 Apr 2021 18:13:25 -0600 Subject: [PATCH] powerpc/pseries: Add shutdown() to vio_driver and vio_bus References: bsc#1184209 ltc#190917 -Patch-mainline: queued -Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git +Patch-mainline: v5.13-rc1 Git-commit: 39d0099f94390eb7a677e1a5c9bb56a4daa242a1 Currently, neither the vio_bus or vio_driver structures provide support diff --git a/patches.suse/powerpc-pseries-extract-host-bridge-from-pci_bus-pri.patch b/patches.suse/powerpc-pseries-extract-host-bridge-from-pci_bus-pri.patch index 46c7e53..352c058 100644 --- a/patches.suse/powerpc-pseries-extract-host-bridge-from-pci_bus-pri.patch +++ b/patches.suse/powerpc-pseries-extract-host-bridge-from-pci_bus-pri.patch @@ -5,8 +5,7 @@ Subject: [PATCH] powerpc/pseries: extract host bridge from pci_bus prior to bus removal References: bsc#1182171 ltc#190900 -Patch-mainline: queued -Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git +Patch-mainline: v5.13-rc1 Git-commit: 38d0b1c9cec71e6d0f3bddef0bbce41d05a3e796 The pci_bus->bridge reference may no longer be valid after diff --git a/patches.suse/smsc95xx-avoid-memory-leak-in-smsc95xx_bind.patch b/patches.suse/smsc95xx-avoid-memory-leak-in-smsc95xx_bind.patch new file mode 100644 index 0000000..94785e5 --- /dev/null +++ b/patches.suse/smsc95xx-avoid-memory-leak-in-smsc95xx_bind.patch @@ -0,0 +1,38 @@ +From 542124af17aa5a2aca11e8c047d55cdd682e1b66 Mon Sep 17 00:00:00 2001 +From: Andre Edich +Date: Mon, 6 Jul 2020 10:39:35 +0200 +Subject: [PATCH 4/4] smsc95xx: avoid memory leak in smsc95xx_bind +Patch-mainline: v5.8-rc5 +Git-commit: 3ed58f96a70b85ef646d5427258f677f1395b62f +References: git-fixes + +In a case where the ID_REV register read is failed, the memory for a +private data structure has to be freed before returning error from the +function smsc95xx_bind. + +Fixes: bbd9f9ee69242 ("smsc95xx: add wol support for more frame types") +Signed-off-by: Andre Edich +Signed-off-by: Parthiban Veerasooran +Signed-off-by: David S. Miller +Signed-off-by: Denis Kirjanov +--- + drivers/net/usb/smsc95xx.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index d760bdd96d94..564fbe3c8c32 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -1306,7 +1306,8 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + /* detect device revision as different features may be available */ + ret = smsc95xx_read_reg(dev, ID_REV, &val); + if (ret < 0) +- return ret; ++ goto free_pdata; ++ + val >>= 16; + pdata->chip_id = val; + pdata->mdix_ctrl = get_mdix_status(dev->net); +-- +2.16.4 + diff --git a/patches.suse/smsc95xx-check-return-value-of-smsc95xx_reset.patch b/patches.suse/smsc95xx-check-return-value-of-smsc95xx_reset.patch new file mode 100644 index 0000000..16c4f87 --- /dev/null +++ b/patches.suse/smsc95xx-check-return-value-of-smsc95xx_reset.patch @@ -0,0 +1,47 @@ +From 25de6a64cc93294f84d1f9616bd903b5c071e139 Mon Sep 17 00:00:00 2001 +From: Andre Edich +Date: Mon, 6 Jul 2020 10:39:34 +0200 +Subject: [PATCH 3/4] smsc95xx: check return value of smsc95xx_reset +Patch-mainline: v5.8-rc5 +Git-commit: 7c8b1e855f94f88a0c569be6309fc8d5c8844cd1 +References: git-fixes + +The return value of the function smsc95xx_reset() must be checked +to avoid returning false success from the function smsc95xx_bind(). + +Fixes: 2f7ca802bdae2 ("net: Add SMSC LAN9500 USB2.0 10/100 ethernet adapter driver") +Signed-off-by: Andre Edich +Signed-off-by: Parthiban Veerasooran +Signed-off-by: David S. Miller +Signed-off-by: Denis Kirjanov +--- + drivers/net/usb/smsc95xx.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index 43670e9fb03e..d760bdd96d94 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -1300,6 +1300,8 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + + /* Init all registers */ + ret = smsc95xx_reset(dev); ++ if (ret) ++ goto free_pdata; + + /* detect device revision as different features may be available */ + ret = smsc95xx_read_reg(dev, ID_REV, &val); +@@ -1330,6 +1332,10 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + schedule_delayed_work(&pdata->carrier_check, CARRIER_CHECK_DELAY); + + return 0; ++ ++free_pdata: ++ kfree(pdata); ++ return ret; + } + + static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf) +-- +2.16.4 + diff --git a/patches.suse/stop_machine-mark-helpers-__always_inline.patch b/patches.suse/stop_machine-mark-helpers-__always_inline.patch new file mode 100644 index 0000000..2e71149 --- /dev/null +++ b/patches.suse/stop_machine-mark-helpers-__always_inline.patch @@ -0,0 +1,83 @@ +From cbf78d85079cee662c45749ef4f744d41be85d48 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 12 Mar 2021 21:07:04 -0800 +Subject: [PATCH] stop_machine: mark helpers __always_inline + +References: bsc#1087405 git-fixes +Patch-mainline: v5.12-rc3 +Git-commit: cbf78d85079cee662c45749ef4f744d41be85d48 + +With clang-13, some functions only get partially inlined, with a +specialized version referring to a global variable. This triggers a +harmless build-time check for the intel-rng driver: + +WARNING: modpost: drivers/char/hw_random/intel-rng.o(.text+0xe): Section mismatch in reference from the function stop_machine() to the function .init.text:intel_rng_hw_init() +The function stop_machine() references +the function __init intel_rng_hw_init(). +This is often because stop_machine lacks a __init +annotation or the annotation of intel_rng_hw_init is wrong. + +In this instance, an easy workaround is to force the stop_machine() +function to be inline, along with related interfaces that did not show the +same behavior at the moment, but theoretically could. + +The combination of the two patches listed below triggers the behavior in +clang-13, but individually these commits are correct. + +Link: https://lkml.kernel.org/r/20210225130153.1956990-1-arnd@kernel.org +Fixes: fe5595c07400 ("stop_machine: Provide stop_machine_cpuslocked()") +Fixes: ee527cd3a20c ("Use stop_machine_run in the Intel RNG driver") +Signed-off-by: Arnd Bergmann +Cc: Nathan Chancellor +Cc: Nick Desaulniers +Cc: Thomas Gleixner +Cc: Sebastian Andrzej Siewior +Cc: "Paul E. McKenney" +Cc: Ingo Molnar +Cc: Prarit Bhargava +Cc: Daniel Bristot de Oliveira +Cc: Peter Zijlstra +Cc: Valentin Schneider +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Acked-by: Michal Suchanek +--- + include/linux/stop_machine.h | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +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); + } +-- +2.26.2 + diff --git a/series.conf b/series.conf index f5742c7..192a939 100644 --- a/series.conf +++ b/series.conf @@ -56105,6 +56105,7 @@ patches.suse/net-Do-not-clear-the-sock-TX-queue-in-sk_set_socket.patch patches.suse/0003-net-bcmgenet-re-remove-bcmgenet_hfb_add_filter.patch patches.suse/0001-net-bcmgenet-use-__be16-for-htons-ETH_P_IP.patch + patches.suse/net-bcmgenet-use-hardware-padding-of-runt-frames.patch patches.suse/net-bridge-enfore-alignment-for-ethernet-address.patch patches.suse/tcp_cubic-fix-spurious-HYSTART_DELAY-exit-upon-drop-.patch patches.suse/sctp-Don-t-advertise-IPv4-addresses-if-ipv6only-is-s.patch @@ -56194,11 +56195,14 @@ patches.suse/IB-hfi1-Do-not-destroy-link_wq-when-the-device-is-sh.patch patches.suse/llc-make-sure-applications-use-ARPHRD_ETHER.patch patches.suse/mac80211-allow-rx-of-mesh-eapol-frames-with-default-.patch + patches.suse/net-cxgb4-fix-return-error-value-in-t4_prep_fw.patch patches.suse/tcp-md5-add-missing-memory-barriers-in-tcp_md5_do_ad.patch patches.suse/genetlink-remove-genl_bind.patch patches.suse/tcp-md5-refine-tcp_md5_do_add-tcp_md5_hash_key-barri.patch patches.suse/tcp-md5-do-not-send-silly-options-in-SYNCOOKIES.patch patches.suse/sched-consistently-handle-layer3-header-accesses-in-.patch + patches.suse/smsc95xx-check-return-value-of-smsc95xx_reset.patch + patches.suse/smsc95xx-avoid-memory-leak-in-smsc95xx_bind.patch patches.suse/net-hns3-add-a-missing-uninit-debugfs-when-unload-dr.patch patches.suse/net-hns3-fix-use-after-free-when-doing-self-test.patch patches.suse/net-usb-qmi_wwan-add-support-for-Quectel-EG95-LTE-mo.patch @@ -58443,8 +58447,11 @@ patches.suse/staging-comedi-pcl818-Fix-endian-problem-for-AI-comm.patch patches.suse/staging-rtl8192u-fix-ssid-overflow-in-r8192_wx_set_s.patch patches.suse/staging-rtl8188eu-prevent-ssid-overflow-in-rtw_wx_se.patch + patches.suse/stop_machine-mark-helpers-__always_inline.patch patches.suse/powerpc-64s-Fix-instruction-encoding-for-lis-in-ppc_.patch patches.suse/fuse-fix-live-lock-in-fuse_iget.patch + patches.suse/0001-btrfs-track-qgroup-released-data-in-own-variable-in-.patch + patches.suse/0002-btrfs-fix-qgroup-data-rsv-leak-caused-by-falloc-fail.patch patches.suse/btrfs-fix-race-when-cloning-extent-buffer-during-rew.patch patches.suse/Revert-PM-runtime-Update-device-status-before-lettin.patch patches.suse/s390-vtime-fix-increased-steal-time-accounting.patch @@ -58521,6 +58528,9 @@ patches.suse/usbip-add-sysfs_lock-to-synchronize-sysfs-code-paths.patch patches.suse/usbip-stub-dev-synchronize-sysfs-code-paths.patch patches.suse/usbip-synchronize-event-handler-with-sysfs-code-path.patch + patches.suse/ibmvnic-avoid-calling-napi_disable-twice.patch + patches.suse/ibmvnic-remove-duplicate-napi_schedule-call-in-do_re.patch + patches.suse/ibmvnic-remove-duplicate-napi_schedule-call-in-open-.patch patches.suse/bpf-Move-off_reg-into-sanitize_ptr_alu.patch patches.suse/bpf-Ensure-off_reg-has-no-mixed-signed-bounds-for-al.patch patches.suse/bpf-Rework-ptr_limit-into-alu_limit-and-add-common-e.patch @@ -58610,11 +58620,22 @@ patches.suse/scsi-ibmvfc-Fix-invalid-state-machine-BUG_ON.patch patches.suse/scsi-qla2xxx-Reserve-extra-IRQ-vectors.patch patches.suse/ibmvnic-Use-skb_frag_address-instead-of-hand-coding-.patch - - # powerpc/linux next + patches.suse/ibmvnic-clean-up-the-remaining-debugfs-data-structur.patch + patches.suse/ibmvnic-print-reset-reason-as-a-string.patch + patches.suse/ibmvnic-print-adapter-state-as-a-string.patch + patches.suse/ibmvnic-improve-failover-sysfs-entry.patch + patches.suse/ibmvnic-queue-reset-work-in-system_long_wq.patch + patches.suse/powerpc-fadump-Mark-fadump_calculate_reserve_size-as.patch + patches.suse/powerpc-prom-Mark-identical_pvr_fixup-as-__init.patch + patches.suse/powerpc-asm-offsets-GPR14-is-not-needed-either.patch + patches.suse/powerpc-64s-Fix-pte-update-for-kernel-memory-on-radi.patch + patches.suse/powerpc-perf-Fix-PMU-constraint-check-for-EBB-events.patch patches.suse/powerpc-mm-Add-cond_resched-while-removing-hpte-mapp.patch patches.suse/powerpc-pseries-extract-host-bridge-from-pci_bus-pri.patch patches.suse/powerpc-pseries-Add-shutdown-to-vio_driver-and-vio_b.patch + patches.suse/kvm-destroy-i-o-bus-devices-on-unregister-failure-after_-sync-ing-srcu + patches.suse/kvm-stop-looking-for-coalesced-mmio-zones-if-the-bus-is-destroyed + patches.suse/kvm-add-proper-lockdep-assertion-in-i-o-bus-unregister # dhowells/linux-fs keys-uefi patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch