diff --git a/blacklist.conf b/blacklist.conf index 87159e2..881b2da 100644 --- a/blacklist.conf +++ b/blacklist.conf @@ -333,7 +333,6 @@ c9bfb2f0031a2de664147ebbfb90f95bb12fdf79 # input: no stmfts present ce7c47d60bda6c7f09ccf16e978d971c8fa16ff0 # fujitsu-laptop: v4.13+ 3b95206110a2c13076c3a7fa8ddeae36c2dbcf42 # peaq-wmi: not present d6fa71f1c003fb2bc824276bb424a4171f9a717f # peaq-wmi: not present -c1e150ceb61e4a585bad156da15c33bfe89f5858 # build fix for NUMA=n dc24b7b49a53c7ee5502c877b133558acec0b3f8 # arch/s390 CFI macros: v4.16+ 42f46148217865a545e129612075f3d828a2c4e4 # later reverted 5d38f049cee1e1c4a7ac55aa79d37d01ddcc3860 # revert of above @@ -1384,7 +1383,6 @@ e672f8bf71c66253197e503f75c771dd28ada4a0 # ditto 6e88559470f581741bcd0f2794f9054814ac9740 # ditto 314eed30ede02fa925990f535652254b5bad6b65 # x86 32bit is not supported e4f8e513c3d353c134ad4eef9fd0bba12406c7c8 # Fix is for SLUB which is not enabled in the kernel configuration -ae2e953fdca791270e80c08d6a830d9aa472a111 # Unexporting breaks kABI 502523fd1d2ac559b41d8302dc9f826f578ec54d # Unexporting breaks kABI b9ee5e04fd77898208c51b1395fa0b5e8536f9b6 # ppc64e not supported ff6d27823f619892ab96f7461764840e0d786b15 # should not remove installed files in MU @@ -1808,3 +1806,10 @@ a4a251f8c23518899d2078c320cf9ce2fa459c9f # misattributed, SP5 does not have f8f8 3b0c2d3eaa83da259d7726192cf55a137769012f # capabilities: reverting the above 5ae5fbd2107959b68ac69a8b75412208663aea88 # only required with da97e18458fb42d7c00fac5fd1c56a3896ec666e da97e18458fb42d7c00fac5fd1c56a3896ec666e # requires 5ae5fbd2107959b68ac69a8b75412208663aea88 +4610ba7ad877fafc0a25a30c6c82015304120426 # part of rejected series, see bsc#1161555#c6 +f24f22435dcc11389acc87e5586239c1819d217c # part of rejected series, see bsc#1161555#c6 +a983b5ebee57209c99f68c8327072f25e0e6e3da # performance optimization, kABI change, see bsc#1181515 +284542656e22c43fdada8c8cc0ca9ede8453eed7 # prereq for a983b5ebee57209c99f68c8327072f25e0e6e3da +c9019e9bf42e66d028d70d2da6206cad4dd9250d # prereq for a983b5ebee57209c99f68c8327072f25e0e6e3da +60fc35f327e0a9e60b955c0f3c3ed623608d1baa # unavoidably breaks kABI +c915ef890d5dc79f483e1ca3b3a5b5f1a170690c # Affected code does not exist: drm/amdgpu: Prevent shift wrapping in amdgpu_read_mask() diff --git a/kabi/severities b/kabi/severities index eaec80f..b22543b 100644 --- a/kabi/severities +++ b/kabi/severities @@ -71,6 +71,9 @@ radix__* PASS # bsc#1157480 ltc#181028 power-specific devicetree hotplug handling # With support for new devicetree format the old function does not make sense rpaphp_get_drc_props PASS +# POWER rtas internal symbols never intended to be exported - see ae2e953fdca791270e80c08d6a830d9aa472a111 +rtas_online_cpus_mask PASS +rtas_offline_cpus_mask PASS # IBM Z internal symbols # Cf. bsc#894391 / LTC#115441 and bsc#1134730 / LTC#173388 diff --git a/patches.kabi/powerpc-kABI-add-back-suspend_disable_cpu-in-machdep.patch b/patches.kabi/powerpc-kABI-add-back-suspend_disable_cpu-in-machdep.patch new file mode 100644 index 0000000..e9be82b --- /dev/null +++ b/patches.kabi/powerpc-kABI-add-back-suspend_disable_cpu-in-machdep.patch @@ -0,0 +1,28 @@ +From c92178eaae95bc5e45c26791927e9e442dae368b Mon Sep 17 00:00:00 2001 +From: Michal Suchanek +Date: Tue, 2 Feb 2021 23:22:24 +0100 +Subject: [PATCH] powerpc: kABI: add back suspend_disable_cpu in machdep_calls + +References: bsc#1181674 ltc#189159 +Patch-mainline: never, kABI + +Signed-off-by: Michal Suchanek +--- + arch/powerpc/include/asm/machdep.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h +index da8e1cafedf9..c43d6eca9edd 100644 +--- a/arch/powerpc/include/asm/machdep.h ++++ b/arch/powerpc/include/asm/machdep.h +@@ -215,6 +215,7 @@ struct machdep_calls { + void (*suspend_disable_irqs)(void); + void (*suspend_enable_irqs)(void); + #endif ++ int (*suspend_disable_cpu)(void); + + #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE + ssize_t (*cpu_probe)(const char *, size_t); +-- +2.26.2 + diff --git a/patches.suse/0001-drm-bridge-dw-hdmi-Avoid-resetting-force-in-the-dete.patch b/patches.suse/0001-drm-bridge-dw-hdmi-Avoid-resetting-force-in-the-dete.patch new file mode 100644 index 0000000..cdfbf77 --- /dev/null +++ b/patches.suse/0001-drm-bridge-dw-hdmi-Avoid-resetting-force-in-the-dete.patch @@ -0,0 +1,56 @@ +From bc551d776b691022f49b5bb5379bd58f7c4eb76a Mon Sep 17 00:00:00 2001 +From: Jonathan Liu +Date: Sat, 31 Oct 2020 19:17:47 +1100 +Subject: drm: bridge: dw-hdmi: Avoid resetting force in the detect function +Git-commit: bc551d776b691022f49b5bb5379bd58f7c4eb76a +Patch-mainline: v5.10-rc5 +References: bsc#1129770 + +It has been observed that resetting force in the detect function can +result in the PHY being powered down in response to hot-plug detect +being asserted, even when the HDMI connector is forced on. + +Enabling debug messages and adding a call to dump_stack() in +dw_hdmi_phy_power_off() shows the following in dmesg: +[ 160.637413] dwhdmi-rockchip ff940000.hdmi: EVENT=plugin +[ 160.637433] dwhdmi-rockchip ff940000.hdmi: PHY powered down in 0 iterations + +Call trace: +dw_hdmi_phy_power_off +dw_hdmi_phy_disable +dw_hdmi_update_power +dw_hdmi_detect +dw_hdmi_connector_detect +drm_helper_probe_detect_ctx +drm_helper_hpd_irq_event +dw_hdmi_irq +irq_thread_fn +irq_thread +kthread +ret_from_fork + +Fixes: 381f05a7a842 ("drm: bridge/dw_hdmi: add connector mode forcing") +Signed-off-by: Jonathan Liu +Reviewed-by: Sam Ravnborg +Signed-off-by: Sam Ravnborg +Link: https://patchwork.freedesktop.org/patch/msgid/20201031081747.372599-1-net147@gmail.com +Acked-by: Thomas Zimmermann +--- + drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 ------ + 1 file changed, 6 deletions(-) + +--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c ++++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +@@ -1906,12 +1906,6 @@ dw_hdmi_connector_detect(struct drm_conn + struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, + connector); + +- mutex_lock(&hdmi->mutex); +- hdmi->force = DRM_FORCE_UNSPECIFIED; +- dw_hdmi_update_power(hdmi); +- dw_hdmi_update_phy_mask(hdmi); +- mutex_unlock(&hdmi->mutex); +- + return hdmi->phy.ops->read_hpd(hdmi, hdmi->phy.data); + } + diff --git a/patches.suse/0002-drm-amdgpu-Fix-macro-name-_AMDGPU_TRACE_H_-in-prepro.patch b/patches.suse/0002-drm-amdgpu-Fix-macro-name-_AMDGPU_TRACE_H_-in-prepro.patch new file mode 100644 index 0000000..ca62488 --- /dev/null +++ b/patches.suse/0002-drm-amdgpu-Fix-macro-name-_AMDGPU_TRACE_H_-in-prepro.patch @@ -0,0 +1,29 @@ +From 956e20eb0fbb206e5e795539db5469db099715c8 Mon Sep 17 00:00:00 2001 +From: Chenyang Li +Date: Sat, 26 Dec 2020 16:56:07 +0800 +Subject: drm/amdgpu: Fix macro name _AMDGPU_TRACE_H_ in preprocessor if + condition +Git-commit: 956e20eb0fbb206e5e795539db5469db099715c8 +Patch-mainline: v5.12-rc1 +References: bsc#1129770 + +Add an underscore in amdgpu_trace.h line 24 "_AMDGPU_TRACE_H". + +Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") +Reviewed-by: Guchun Chen +Reviewed-by: Paul Menzel +Signed-off-by: Chenyang Li +Signed-off-by: Alex Deucher +Acked-by: Thomas Zimmermann +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +@@ -1,4 +1,4 @@ +-#if !defined(_AMDGPU_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) ++#if !defined(_AMDGPU_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) + #define _AMDGPU_TRACE_H_ + + #include diff --git a/patches.suse/0003-drm-mediatek-Fix-aal-size-config.patch b/patches.suse/0003-drm-mediatek-Fix-aal-size-config.patch new file mode 100644 index 0000000..0ad0284 --- /dev/null +++ b/patches.suse/0003-drm-mediatek-Fix-aal-size-config.patch @@ -0,0 +1,32 @@ +From 71dcadba34203d8dd35152e368720f977e9cdb81 Mon Sep 17 00:00:00 2001 +From: Yongqiang Niu +Date: Mon, 11 Jan 2021 15:43:47 +0800 +Subject: drm/mediatek: Fix aal size config +Git-commit: 71dcadba34203d8dd35152e368720f977e9cdb81 +Patch-mainline: v5.12-rc1 +References: bsc#1129770 + +The orginal setting is not correct, fix it to follow hardware data sheet. +If keep this error setting, mt8173/mt8183 display ok +but mt8192 display abnormal. + +Fixes: 0664d1392c26 ("drm/mediatek: Add AAL engine basic function") + +Signed-off-by: Yongqiang Niu +Signed-off-by: Chun-Kuang Hu +Acked-by: Thomas Zimmermann +--- + drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c ++++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c +@@ -118,7 +118,7 @@ static void mtk_aal_config(struct mtk_dd + unsigned int h, unsigned int vrefresh, + unsigned int bpc) + { +- writel(h << 16 | w, comp->regs + DISP_AAL_SIZE); ++ writel(w << 16 | w, comp->regs + DISP_AAL_SIZE); + } + + static void mtk_aal_start(struct mtk_ddp_comp *comp) diff --git a/patches.suse/0005-drm-compat-Clear-bounce-structures.patch b/patches.suse/0005-drm-compat-Clear-bounce-structures.patch new file mode 100644 index 0000000..e93705a --- /dev/null +++ b/patches.suse/0005-drm-compat-Clear-bounce-structures.patch @@ -0,0 +1,78 @@ +From de066e116306baf3a6a62691ac63cfc0b1dabddb Mon Sep 17 00:00:00 2001 +From: Daniel Vetter +Date: Mon, 22 Feb 2021 11:06:43 +0100 +Subject: drm/compat: Clear bounce structures +Git-commit: de066e116306baf3a6a62691ac63cfc0b1dabddb +Patch-mainline: v5.12-rc3 +References: bsc#1129770 + +Some of them have gaps, or fields we don't clear. Native ioctl code +does full copies plus zero-extends on size mismatch, so nothing can +leak. But compat is more hand-rolled so need to be careful. + +None of these matter for performance, so just memset. + +Also I didn't fix up the CONFIG_DRM_LEGACY or CONFIG_DRM_AGP ioctl, those +are security holes anyway. + +Acked-by: Maxime Ripard +Reported-by: syzbot+620cf21140fc7e772a5d@syzkaller.appspotmail.com # vblank ioctl +Cc: syzbot+620cf21140fc7e772a5d@syzkaller.appspotmail.com +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20210222100643.400935-1-daniel.vetter@ffwll.ch +(cherry picked from commit e926c474ebee404441c838d18224cd6f246a71b7) +Signed-off-by: Maarten Lankhorst +Acked-by: Thomas Zimmermann +--- + drivers/gpu/drm/drm_ioc32.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/gpu/drm/drm_ioc32.c ++++ b/drivers/gpu/drm/drm_ioc32.c +@@ -96,6 +96,8 @@ static int compat_drm_version(struct fil + if (copy_from_user(&v32, (void __user *)arg, sizeof(v32))) + return -EFAULT; + ++ memset(&v, 0, sizeof(v)); ++ + v = (struct drm_version) { + .name_len = v32.name_len, + .name = compat_ptr(v32.name), +@@ -134,6 +136,9 @@ static int compat_drm_getunique(struct f + + if (copy_from_user(&uq32, (void __user *)arg, sizeof(uq32))) + return -EFAULT; ++ ++ memset(&uq, 0, sizeof(uq)); ++ + uq = (struct drm_unique){ + .unique_len = uq32.unique_len, + .unique = compat_ptr(uq32.unique), +@@ -260,6 +265,8 @@ static int compat_drm_getclient(struct f + if (copy_from_user(&c32, argp, sizeof(c32))) + return -EFAULT; + ++ memset(&client, 0, sizeof(client)); ++ + client.idx = c32.idx; + + err = drm_ioctl_kernel(file, drm_getclient, &client, DRM_UNLOCKED); +@@ -842,6 +849,8 @@ static int compat_drm_wait_vblank(struct + if (copy_from_user(&req32, argp, sizeof(req32))) + return -EFAULT; + ++ memset(&req, 0, sizeof(req)); ++ + req.request.type = req32.request.type; + req.request.sequence = req32.request.sequence; + req.request.signal = req32.request.signal; +@@ -879,6 +888,8 @@ static int compat_drm_mode_addfb2(struct + struct drm_mode_fb_cmd2 req64; + int err; + ++ memset(&req64, 0, sizeof(req64)); ++ + if (copy_from_user(&req64, argp, + offsetof(drm_mode_fb_cmd232_t, modifier))) + return -EFAULT; diff --git a/patches.suse/ACPI-scan-Rearrange-memory-allocation-in-acpi_device.patch b/patches.suse/ACPI-scan-Rearrange-memory-allocation-in-acpi_device.patch new file mode 100644 index 0000000..7b011f1 --- /dev/null +++ b/patches.suse/ACPI-scan-Rearrange-memory-allocation-in-acpi_device.patch @@ -0,0 +1,127 @@ +From c1013ff7a5472db637c56bb6237f8343398c03a7 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Thu, 14 Jan 2021 19:46:47 +0100 +Subject: [PATCH] ACPI: scan: Rearrange memory allocation in acpi_device_add() +Git-commit: c1013ff7a5472db637c56bb6237f8343398c03a7 +Patch-mainline: v5.12-rc1 +References: git-fixes + +The upfront allocation of new_bus_id is done to avoid allocating +memory under acpi_device_lock, but it doesn't really help, +because (1) it leads to many unnecessary memory allocations for +_ADR devices, (2) kstrdup_const() is run under that lock anyway and +(3) it complicates the code. + +Rearrange acpi_device_add() to allocate memory for a new struct +acpi_device_bus_id instance only when necessary, eliminate a redundant +local variable from it and reduce the number of labels in there. + +No intentional functional impact. + +Signed-off-by: Rafael J. Wysocki +Reviewed-by: Hans de Goede +Acked-by: Takashi Iwai + +--- + drivers/acpi/scan.c | 57 +++++++++++++++++++++------------------------ + 1 file changed, 26 insertions(+), 31 deletions(-) + +diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c +index 1db063b02f63..0fb1811772b5 100644 +--- a/drivers/acpi/scan.c ++++ b/drivers/acpi/scan.c +@@ -623,12 +623,23 @@ void acpi_bus_put_acpi_device(struct acpi_device *adev) + put_device(&adev->dev); + } + ++static struct acpi_device_bus_id *acpi_device_bus_id_match(const char *dev_id) ++{ ++ struct acpi_device_bus_id *acpi_device_bus_id; ++ ++ /* Find suitable bus_id and instance number in acpi_bus_id_list. */ ++ list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) { ++ if (!strcmp(acpi_device_bus_id->bus_id, dev_id)) ++ return acpi_device_bus_id; ++ } ++ return NULL; ++} ++ + int acpi_device_add(struct acpi_device *device, + void (*release)(struct device *)) + { ++ struct acpi_device_bus_id *acpi_device_bus_id; + int result; +- struct acpi_device_bus_id *acpi_device_bus_id, *new_bus_id; +- int found = 0; + + if (device->handle) { + acpi_status status; +@@ -654,38 +665,26 @@ int acpi_device_add(struct acpi_device *device, + INIT_LIST_HEAD(&device->del_list); + mutex_init(&device->physical_node_lock); + +- new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL); +- if (!new_bus_id) { +- pr_err(PREFIX "Memory allocation error\n"); +- result = -ENOMEM; +- goto err_detach; +- } +- + mutex_lock(&acpi_device_lock); +- /* +- * Find suitable bus_id and instance number in acpi_bus_id_list +- * If failed, create one and link it into acpi_bus_id_list +- */ +- list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) { +- if (!strcmp(acpi_device_bus_id->bus_id, +- acpi_device_hid(device))) { +- acpi_device_bus_id->instance_no++; +- found = 1; +- kfree(new_bus_id); +- break; ++ ++ acpi_device_bus_id = acpi_device_bus_id_match(acpi_device_hid(device)); ++ if (acpi_device_bus_id) { ++ acpi_device_bus_id->instance_no++; ++ } else { ++ acpi_device_bus_id = kzalloc(sizeof(*acpi_device_bus_id), ++ GFP_KERNEL); ++ if (!acpi_device_bus_id) { ++ result = -ENOMEM; ++ goto err_unlock; + } +- } +- if (!found) { +- acpi_device_bus_id = new_bus_id; + acpi_device_bus_id->bus_id = + kstrdup_const(acpi_device_hid(device), GFP_KERNEL); + if (!acpi_device_bus_id->bus_id) { +- pr_err(PREFIX "Memory allocation error for bus id\n"); ++ kfree(acpi_device_bus_id); + result = -ENOMEM; +- goto err_free_new_bus_id; ++ goto err_unlock; + } + +- acpi_device_bus_id->instance_no = 0; + list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); + } + dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no); +@@ -720,13 +719,9 @@ int acpi_device_add(struct acpi_device *device, + list_del(&device->node); + list_del(&device->wakeup_list); + +- err_free_new_bus_id: +- if (!found) +- kfree(new_bus_id); +- ++ err_unlock: + mutex_unlock(&acpi_device_lock); + +- err_detach: + acpi_detach_data(device->handle, acpi_scan_drop_device); + return result; + } +-- +2.26.2 + diff --git a/patches.suse/Revert-ibmvnic-remove-never-executed-if-statement.patch b/patches.suse/Revert-ibmvnic-remove-never-executed-if-statement.patch new file mode 100644 index 0000000..0a2be79 --- /dev/null +++ b/patches.suse/Revert-ibmvnic-remove-never-executed-if-statement.patch @@ -0,0 +1,42 @@ +From 785a2b1036273f6b7f78740cc4b0f32ffc9846f5 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Thu, 17 Sep 2020 21:12:46 -0500 +Subject: [PATCH] Revert "ibmvnic: remove never executed if statement" + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: 785a2b1036273f6b7f78740cc4b0f32ffc9846f5 + +This reverts commit 550f4d46aff6fe57c9b1c6719c3c9de2237d7ac2. + +adapter->from_passive_init may be changed in ibmvnic_handle_crq +while ibmvnic_reset_init is waiting for the completion of +adapter->init_done. + +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, 6 insertions(+) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index e2a3c4bf00c9..6d320be47e60 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -5047,6 +5047,12 @@ static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter, bool reset) + return adapter->init_done_rc; + } + ++ if (adapter->from_passive_init) { ++ adapter->state = VNIC_OPEN; ++ adapter->from_passive_init = false; ++ return -1; ++ } ++ + if (reset && + test_bit(0, &adapter->resetting) && !adapter->wait_for_reset && + adapter->reset_reason != VNIC_RESET_MOBILITY) { +-- +2.26.2 + diff --git a/patches.suse/bpf-Add-sanity-check-for-upper-ptr_limit.patch b/patches.suse/bpf-Add-sanity-check-for-upper-ptr_limit.patch new file mode 100644 index 0000000..661f8f7 --- /dev/null +++ b/patches.suse/bpf-Add-sanity-check-for-upper-ptr_limit.patch @@ -0,0 +1,59 @@ +From: Piotr Krysiuk +Date: Tue, 16 Mar 2021 09:47:02 +0100 +Subject: bpf: Add sanity check for upper ptr_limit +Patch-mainline: v5.12-rc5 +Git-commit: 1b1597e64e1a610c7a96710fc4717158e98a08b3 +References: bsc#1183686 bsc#1183775 + +Given we know the max possible value of ptr_limit at the time of retrieving +the latter, add basic assertions, so that the verifier can bail out if +anything looks odd and reject the program. Nothing triggered this so far, +but it also does not hurt to have these. + +Signed-off-by: Piotr Krysiuk +Co-developed-by: Daniel Borkmann +Signed-off-by: Daniel Borkmann +Acked-by: Alexei Starovoitov +Acked-by: Gary Lin +--- + kernel/bpf/verifier.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -2721,27 +2721,32 @@ static int retrieve_ptr_limit(const stru + { + bool mask_to_left = (opcode == BPF_ADD && off_is_neg) || + (opcode == BPF_SUB && !off_is_neg); +- u32 off; ++ u32 off, max; + + switch (ptr_reg->type) { + case PTR_TO_STACK: + /* Indirect variable offset stack access is prohibited in + * unprivileged mode so it's not handled here. ++ * ++ * Offset 0 is out-of-bounds, but acceptable start for the ++ * left direction, see BPF_REG_FP. + */ ++ max = MAX_BPF_STACK + mask_to_left; + off = ptr_reg->off + ptr_reg->var_off.value; + if (mask_to_left) + *ptr_limit = MAX_BPF_STACK + off; + else + *ptr_limit = -off - 1; +- return 0; ++ return *ptr_limit >= max ? -ERANGE : 0; + case PTR_TO_MAP_VALUE: ++ max = ptr_reg->map_ptr->value_size; + if (mask_to_left) { + *ptr_limit = ptr_reg->umax_value + ptr_reg->off; + } else { + off = ptr_reg->smin_value + ptr_reg->off; + *ptr_limit = ptr_reg->map_ptr->value_size - off - 1; + } +- return 0; ++ return *ptr_limit >= max ? -ERANGE : 0; + default: + return -EINVAL; + } diff --git a/patches.suse/bpf-Fix-32-bit-src-register-truncation-on-div-mod.patch b/patches.suse/bpf-Fix-32-bit-src-register-truncation-on-div-mod.patch new file mode 100644 index 0000000..29f451a --- /dev/null +++ b/patches.suse/bpf-Fix-32-bit-src-register-truncation-on-div-mod.patch @@ -0,0 +1,134 @@ +From: Daniel Borkmann +Date: Tue, 9 Feb 2021 18:46:10 +0000 +Subject: bpf: Fix 32 bit src register truncation on div/mod +Patch-mainline: v5.11 +Git-commit: e88b2c6e5a4d9ce30d75391e4d950da74bb2bd90 +References: bsc#1184170 + +While reviewing a different fix, John and I noticed an oddity in one of the +BPF program dumps that stood out, for example: + + # bpftool p d x i 13 + 0: (b7) r0 = 808464450 + 1: (b4) w4 = 808464432 + 2: (bc) w0 = w0 + 3: (15) if r0 == 0x0 goto pc+1 + 4: (9c) w4 %= w0 + [...] + +In line 2 we noticed that the mov32 would 32 bit truncate the original src +register for the div/mod operation. While for the two operations the dst +register is typically marked unknown e.g. from adjust_scalar_min_max_vals() +the src register is not, and thus verifier keeps tracking original bounds, +simplified: + + 0: R1=ctx(id=0,off=0,imm=0) R10=fp0 + 0: (b7) r0 = -1 + 1: R0_w=invP-1 R1=ctx(id=0,off=0,imm=0) R10=fp0 + 1: (b7) r1 = -1 + 2: R0_w=invP-1 R1_w=invP-1 R10=fp0 + 2: (3c) w0 /= w1 + 3: R0_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R1_w=invP-1 R10=fp0 + 3: (77) r1 >>= 32 + 4: R0_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R1_w=invP4294967295 R10=fp0 + 4: (bf) r0 = r1 + 5: R0_w=invP4294967295 R1_w=invP4294967295 R10=fp0 + 5: (95) exit + processed 6 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0 + +Runtime result of r0 at exit is 0 instead of expected -1. Remove the +verifier mov32 src rewrite in div/mod and replace it with a jmp32 test +instead. After the fix, we result in the following code generation when +having dividend r1 and divisor r6: + + div, 64 bit: div, 32 bit: + + 0: (b7) r6 = 8 0: (b7) r6 = 8 + 1: (b7) r1 = 8 1: (b7) r1 = 8 + 2: (55) if r6 != 0x0 goto pc+2 2: (56) if w6 != 0x0 goto pc+2 + 3: (ac) w1 ^= w1 3: (ac) w1 ^= w1 + 4: (05) goto pc+1 4: (05) goto pc+1 + 5: (3f) r1 /= r6 5: (3c) w1 /= w6 + 6: (b7) r0 = 0 6: (b7) r0 = 0 + 7: (95) exit 7: (95) exit + + mod, 64 bit: mod, 32 bit: + + 0: (b7) r6 = 8 0: (b7) r6 = 8 + 1: (b7) r1 = 8 1: (b7) r1 = 8 + 2: (15) if r6 == 0x0 goto pc+1 2: (16) if w6 == 0x0 goto pc+1 + 3: (9f) r1 %= r6 3: (9c) w1 %= w6 + 4: (b7) r0 = 0 4: (b7) r0 = 0 + 5: (95) exit 5: (95) exit + +x86 in particular can throw a 'divide error' exception for div +instruction not only for divisor being zero, but also for the case +when the quotient is too large for the designated register. For the +edx:eax and rdx:rax dividend pair it is not an issue in x86 BPF JIT +since we always zero edx (rdx). Hence really the only protection +needed is against divisor being zero. + +Fixes: 68fda450a7df ("bpf: fix 32-bit divide by zero") +Co-developed-by: John Fastabend +Signed-off-by: John Fastabend +Signed-off-by: Daniel Borkmann +Acked-by: Alexei Starovoitov +Acked-by: Gary Lin + +NOTE from Gary: + * 'BPF_JMP32' in the original commit is removed since the instruction is + not defined in this branch. + * 'is64' is removed since there is no user of the variable after removing + the diff for 'BPF_JMP32'. + +--- + kernel/bpf/verifier.c | 29 +++++++++++++---------------- + 1 file changed, 13 insertions(+), 16 deletions(-) + +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -4628,31 +4628,28 @@ static int fixup_bpf_calls(struct bpf_ve + insn->code == (BPF_ALU64 | BPF_DIV | BPF_X) || + insn->code == (BPF_ALU | BPF_MOD | BPF_X) || + insn->code == (BPF_ALU | BPF_DIV | BPF_X)) { +- bool is64 = BPF_CLASS(insn->code) == BPF_ALU64; +- struct bpf_insn mask_and_div[] = { +- BPF_MOV32_REG(insn->src_reg, insn->src_reg), ++ bool isdiv = BPF_OP(insn->code) == BPF_DIV; ++ struct bpf_insn *patchlet; ++ struct bpf_insn chk_and_div[] = { + /* Rx div 0 -> 0 */ +- BPF_JMP_IMM(BPF_JNE, insn->src_reg, 0, 2), ++ BPF_RAW_INSN(BPF_JMP | ++ BPF_JNE | BPF_K, insn->src_reg, ++ 0, 2, 0), + BPF_ALU32_REG(BPF_XOR, insn->dst_reg, insn->dst_reg), + BPF_JMP_IMM(BPF_JA, 0, 0, 1), + *insn, + }; +- struct bpf_insn mask_and_mod[] = { +- BPF_MOV32_REG(insn->src_reg, insn->src_reg), ++ struct bpf_insn chk_and_mod[] = { + /* Rx mod 0 -> Rx */ +- BPF_JMP_IMM(BPF_JEQ, insn->src_reg, 0, 1), ++ BPF_RAW_INSN(BPF_JMP | ++ BPF_JEQ | BPF_K, insn->src_reg, ++ 0, 1, 0), + *insn, + }; +- struct bpf_insn *patchlet; + +- if (insn->code == (BPF_ALU64 | BPF_DIV | BPF_X) || +- insn->code == (BPF_ALU | BPF_DIV | BPF_X)) { +- patchlet = mask_and_div + (is64 ? 1 : 0); +- cnt = ARRAY_SIZE(mask_and_div) - (is64 ? 1 : 0); +- } else { +- patchlet = mask_and_mod + (is64 ? 1 : 0); +- cnt = ARRAY_SIZE(mask_and_mod) - (is64 ? 1 : 0); +- } ++ patchlet = isdiv ? chk_and_div : chk_and_mod; ++ cnt = isdiv ? ARRAY_SIZE(chk_and_div) : ++ ARRAY_SIZE(chk_and_mod); + + new_prog = bpf_patch_insn_data(env, i + delta, patchlet, cnt); + if (!new_prog) diff --git a/patches.suse/bpf-Fix-off-by-one-for-area-size-in-creating-mask-to.patch b/patches.suse/bpf-Fix-off-by-one-for-area-size-in-creating-mask-to.patch new file mode 100644 index 0000000..20a967c --- /dev/null +++ b/patches.suse/bpf-Fix-off-by-one-for-area-size-in-creating-mask-to.patch @@ -0,0 +1,52 @@ +From: Piotr Krysiuk +Date: Tue, 16 Mar 2021 08:20:16 +0100 +Subject: bpf: Fix off-by-one for area size in creating mask to left +Patch-mainline: v5.12-rc5 +Git-commit: 10d2bb2e6b1d8c4576c56a748f697dbeb8388899 +References: bsc#1183775 CVE-2020-27171 + +retrieve_ptr_limit() computes the ptr_limit for registers with stack and +map_value type. ptr_limit is the size of the memory area that is still +valid / in-bounds from the point of the current position and direction +of the operation (add / sub). This size will later be used for masking +the operation such that attempting out-of-bounds access in the speculative +domain is redirected to remain within the bounds of the current map value. + +When masking to the right the size is correct, however, when masking to +the left, the size is off-by-one which would lead to an incorrect mask +and thus incorrect arithmetic operation in the non-speculative domain. +Piotr found that if the resulting alu_limit value is zero, then the +BPF_MOV32_IMM() from the fixup_bpf_calls() rewrite will end up loading +0xffffffff into AX instead of sign-extending to the full 64 bit range, +and as a result, this allows abuse for executing speculatively out-of- +bounds loads against 4GB window of address space and thus extracting the +contents of kernel memory via side-channel. + +Fixes: 979d63d50c0c ("bpf: prevent out of bounds speculation on pointer arithmetic") +Signed-off-by: Piotr Krysiuk +Co-developed-by: Daniel Borkmann +Signed-off-by: Daniel Borkmann +Acked-by: Alexei Starovoitov +Acked-by: Gary Lin +--- + kernel/bpf/verifier.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -2730,13 +2730,13 @@ static int retrieve_ptr_limit(const stru + */ + off = ptr_reg->off + ptr_reg->var_off.value; + if (mask_to_left) +- *ptr_limit = MAX_BPF_STACK + off; ++ *ptr_limit = MAX_BPF_STACK + off + 1; + else + *ptr_limit = -off; + return 0; + case PTR_TO_MAP_VALUE: + if (mask_to_left) { +- *ptr_limit = ptr_reg->umax_value + ptr_reg->off; ++ *ptr_limit = ptr_reg->umax_value + ptr_reg->off + 1; + } else { + off = ptr_reg->smin_value + ptr_reg->off; + *ptr_limit = ptr_reg->map_ptr->value_size - off; diff --git a/patches.suse/bpf-Fix-truncation-handling-for-mod32-dst-reg-wrt-ze.patch b/patches.suse/bpf-Fix-truncation-handling-for-mod32-dst-reg-wrt-ze.patch new file mode 100644 index 0000000..74dafc5 --- /dev/null +++ b/patches.suse/bpf-Fix-truncation-handling-for-mod32-dst-reg-wrt-ze.patch @@ -0,0 +1,126 @@ +From: Daniel Borkmann +Date: Wed, 10 Feb 2021 14:14:42 +0100 +Subject: bpf: Fix truncation handling for mod32 dst reg wrt zero +Patch-mainline: v5.12-rc1 +Git-commit: 9b00f1b78809309163dda2d044d9e94a3c0248a3 +References: bsc#1184170 CVE-2021-3444 + +Recently noticed that when mod32 with a known src reg of 0 is performed, +then the dst register is 32-bit truncated in verifier: + + 0: R1=ctx(id=0,off=0,imm=0) R10=fp0 + 0: (b7) r0 = 0 + 1: R0_w=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0 + 1: (b7) r1 = -1 + 2: R0_w=inv0 R1_w=inv-1 R10=fp0 + 2: (b4) w2 = -1 + 3: R0_w=inv0 R1_w=inv-1 R2_w=inv4294967295 R10=fp0 + 3: (9c) w1 %= w0 + 4: R0_w=inv0 R1_w=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R2_w=inv4294967295 R10=fp0 + 4: (b7) r0 = 1 + 5: R0_w=inv1 R1_w=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R2_w=inv4294967295 R10=fp0 + 5: (1d) if r1 == r2 goto pc+1 + R0_w=inv1 R1_w=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R2_w=inv4294967295 R10=fp0 + 6: R0_w=inv1 R1_w=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R2_w=inv4294967295 R10=fp0 + 6: (b7) r0 = 2 + 7: R0_w=inv2 R1_w=inv(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R2_w=inv4294967295 R10=fp0 + 7: (95) exit + 7: R0=inv1 R1=inv(id=0,umin_value=4294967295,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R2=inv4294967295 R10=fp0 + 7: (95) exit + +However, as a runtime result, we get 2 instead of 1, meaning the dst +register does not contain (u32)-1 in this case. The reason is fairly +straight forward given the 0 test leaves the dst register as-is: + + # ./bpftool p d x i 23 + 0: (b7) r0 = 0 + 1: (b7) r1 = -1 + 2: (b4) w2 = -1 + 3: (16) if w0 == 0x0 goto pc+1 + 4: (9c) w1 %= w0 + 5: (b7) r0 = 1 + 6: (1d) if r1 == r2 goto pc+1 + 7: (b7) r0 = 2 + 8: (95) exit + +This was originally not an issue given the dst register was marked as +completely unknown (aka 64 bit unknown). However, after 468f6eafa6c4 +("bpf: fix 32-bit ALU op verification") the verifier casts the register +output to 32 bit, and hence it becomes 32 bit unknown. Note that for +the case where the src register is unknown, the dst register is marked +64 bit unknown. After the fix, the register is truncated by the runtime +and the test passes: + + # ./bpftool p d x i 23 + 0: (b7) r0 = 0 + 1: (b7) r1 = -1 + 2: (b4) w2 = -1 + 3: (16) if w0 == 0x0 goto pc+2 + 4: (9c) w1 %= w0 + 5: (05) goto pc+1 + 6: (bc) w1 = w1 + 7: (b7) r0 = 1 + 8: (1d) if r1 == r2 goto pc+1 + 9: (b7) r0 = 2 + 10: (95) exit + +Semantics also match with {R,W}x mod{64,32} 0 -> {R,W}x. Invalid div +has always been {R,W}x div{64,32} 0 -> 0. Rewrites are as follows: + + mod32: mod64: + + (16) if w0 == 0x0 goto pc+2 (15) if r0 == 0x0 goto pc+1 + (9c) w1 %= w0 (9f) r1 %= r0 + (05) goto pc+1 + (bc) w1 = w1 + +Fixes: 468f6eafa6c4 ("bpf: fix 32-bit ALU op verification") +Signed-off-by: Daniel Borkmann +Reviewed-by: John Fastabend +Acked-by: Alexei Starovoitov +Acked-by: Gary Lin + +NOTE from Gary: + * 'is64' is added back since this commit really needs it. + +--- + kernel/bpf/verifier.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -4628,10 +4628,11 @@ static int fixup_bpf_calls(struct bpf_ve + insn->code == (BPF_ALU64 | BPF_DIV | BPF_X) || + insn->code == (BPF_ALU | BPF_MOD | BPF_X) || + insn->code == (BPF_ALU | BPF_DIV | BPF_X)) { ++ bool is64 = BPF_CLASS(insn->code) == BPF_ALU64; + bool isdiv = BPF_OP(insn->code) == BPF_DIV; + struct bpf_insn *patchlet; + struct bpf_insn chk_and_div[] = { +- /* Rx div 0 -> 0 */ ++ /* [R,W]x div 0 -> 0 */ + BPF_RAW_INSN(BPF_JMP | + BPF_JNE | BPF_K, insn->src_reg, + 0, 2, 0), +@@ -4640,16 +4641,18 @@ static int fixup_bpf_calls(struct bpf_ve + *insn, + }; + struct bpf_insn chk_and_mod[] = { +- /* Rx mod 0 -> Rx */ ++ /* [R,W]x mod 0 -> [R,W]x */ + BPF_RAW_INSN(BPF_JMP | + BPF_JEQ | BPF_K, insn->src_reg, +- 0, 1, 0), ++ 0, 1 + (is64 ? 0 : 1), 0), + *insn, ++ BPF_JMP_IMM(BPF_JA, 0, 0, 1), ++ BPF_MOV32_REG(insn->dst_reg, insn->dst_reg), + }; + + patchlet = isdiv ? chk_and_div : chk_and_mod; + cnt = isdiv ? ARRAY_SIZE(chk_and_div) : +- ARRAY_SIZE(chk_and_mod); ++ ARRAY_SIZE(chk_and_mod) - (is64 ? 2 : 0); + + new_prog = bpf_patch_insn_data(env, i + delta, patchlet, cnt); + if (!new_prog) diff --git a/patches.suse/bpf-Prohibit-alu-ops-for-pointer-types-not-defining-.patch b/patches.suse/bpf-Prohibit-alu-ops-for-pointer-types-not-defining-.patch new file mode 100644 index 0000000..fe60f1f --- /dev/null +++ b/patches.suse/bpf-Prohibit-alu-ops-for-pointer-types-not-defining-.patch @@ -0,0 +1,81 @@ +From: Piotr Krysiuk +Date: Tue, 16 Mar 2021 09:47:02 +0100 +Subject: bpf: Prohibit alu ops for pointer types not defining ptr_limit +Patch-mainline: v5.12-rc5 +Git-commit: f232326f6966cf2a1d1db7bc917a4ce5f9f55f76 +References: bsc#1183686 CVE-2020-27170 + +The purpose of this patch is to streamline error propagation and in particular +to propagate retrieve_ptr_limit() errors for pointer types that are not defining +a ptr_limit such that register-based alu ops against these types can be rejected. + +The main rationale is that a gap has been identified by Piotr in the existing +protection against speculatively out-of-bounds loads, for example, in case of +ctx pointers, unprivileged programs can still perform pointer arithmetic. This +can be abused to execute speculatively out-of-bounds loads without restrictions +and thus extract contents of kernel memory. + +Fix this by rejecting unprivileged programs that attempt any pointer arithmetic +on unprotected pointer types. The two affected ones are pointer to ctx as well +as pointer to map. Field access to a modified ctx' pointer is rejected at a +later point in time in the verifier, and 7c6967326267 ("bpf: Permit map_ptr +arithmetic with opcode add and offset 0") only relevant for root-only use cases. +Risk of unprivileged program breakage is considered very low. + +Fixes: 7c6967326267 ("bpf: Permit map_ptr arithmetic with opcode add and offset 0") +Fixes: b2157399cc98 ("bpf: prevent out-of-bounds speculation") +Signed-off-by: Piotr Krysiuk +Co-developed-by: Daniel Borkmann +Signed-off-by: Daniel Borkmann +Acked-by: Alexei Starovoitov +Acked-by: Gary Lin +--- + kernel/bpf/verifier.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -1988,6 +1988,7 @@ static int sanitize_ptr_alu(struct bpf_v + u32 alu_state, alu_limit; + struct bpf_reg_state tmp; + bool ret; ++ int err; + + if (can_skip_alu_sanitation(env, insn)) + return 0; +@@ -2003,10 +2004,13 @@ static int sanitize_ptr_alu(struct bpf_v + alu_state |= ptr_is_dst_reg ? + BPF_ALU_SANITIZE_SRC : BPF_ALU_SANITIZE_DST; + +- if (retrieve_ptr_limit(ptr_reg, &alu_limit, opcode, off_is_neg)) +- return 0; +- if (update_alu_sanitation_state(aux, alu_state, alu_limit)) +- return -EACCES; ++ err = retrieve_ptr_limit(ptr_reg, &alu_limit, opcode, off_is_neg); ++ if (err < 0) ++ return err; ++ ++ err = update_alu_sanitation_state(aux, alu_state, alu_limit); ++ if (err < 0) ++ return err; + do_sim: + /* Simulate and find potential out-of-bounds access under + * speculative execution from truncation as a result of +@@ -2096,7 +2100,7 @@ static int adjust_ptr_min_max_vals(struc + case BPF_ADD: + ret = sanitize_ptr_alu(env, insn, ptr_reg, dst_reg, smin_val < 0); + if (ret < 0) { +- verbose(env, "R%d tried to add from different maps or paths\n", dst); ++ verbose(env, "R%d tried to add from different maps, paths, or prohibited types\n", dst); + return ret; + } + /* We can take a fixed offset as long as it doesn't overflow +@@ -2151,7 +2155,7 @@ static int adjust_ptr_min_max_vals(struc + case BPF_SUB: + ret = sanitize_ptr_alu(env, insn, ptr_reg, dst_reg, smin_val < 0); + if (ret < 0) { +- verbose(env, "R%d tried to sub from different maps or paths\n", dst); ++ verbose(env, "R%d tried to sub from different maps, paths, or prohibited types\n", dst); + return ret; + } + if (dst_reg == off_reg) { diff --git a/patches.suse/bpf-Simplify-alu_limit-masking-for-pointer-arithmeti.patch b/patches.suse/bpf-Simplify-alu_limit-masking-for-pointer-arithmeti.patch new file mode 100644 index 0000000..cafebe8 --- /dev/null +++ b/patches.suse/bpf-Simplify-alu_limit-masking-for-pointer-arithmeti.patch @@ -0,0 +1,55 @@ +From: Piotr Krysiuk +Date: Tue, 16 Mar 2021 08:26:25 +0100 +Subject: bpf: Simplify alu_limit masking for pointer arithmetic +Patch-mainline: v5.12-rc5 +Git-commit: b5871dca250cd391885218b99cc015aca1a51aea +References: bsc#1183686 bsc#1183775 + +Instead of having the mov32 with aux->alu_limit - 1 immediate, move this +operation to retrieve_ptr_limit() instead to simplify the logic and to +allow for subsequent sanity boundary checks inside retrieve_ptr_limit(). +This avoids in future that at the time of the verifier masking rewrite +we'd run into an underflow which would not sign extend due to the nature +of mov32 instruction. + +Signed-off-by: Piotr Krysiuk +Co-developed-by: Daniel Borkmann +Signed-off-by: Daniel Borkmann +Acked-by: Alexei Starovoitov +Acked-by: Gary Lin +--- + kernel/bpf/verifier.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/kernel/bpf/verifier.c ++++ b/kernel/bpf/verifier.c +@@ -2730,16 +2730,16 @@ static int retrieve_ptr_limit(const stru + */ + off = ptr_reg->off + ptr_reg->var_off.value; + if (mask_to_left) +- *ptr_limit = MAX_BPF_STACK + off + 1; ++ *ptr_limit = MAX_BPF_STACK + off; + else +- *ptr_limit = -off; ++ *ptr_limit = -off - 1; + return 0; + case PTR_TO_MAP_VALUE: + if (mask_to_left) { +- *ptr_limit = ptr_reg->umax_value + ptr_reg->off + 1; ++ *ptr_limit = ptr_reg->umax_value + ptr_reg->off; + } else { + off = ptr_reg->smin_value + ptr_reg->off; +- *ptr_limit = ptr_reg->map_ptr->value_size - off; ++ *ptr_limit = ptr_reg->map_ptr->value_size - off - 1; + } + return 0; + default: +@@ -4667,7 +4667,7 @@ static int fixup_bpf_calls(struct bpf_ve + off_reg = issrc ? insn->src_reg : insn->dst_reg; + if (isneg) + *patch++ = BPF_ALU64_IMM(BPF_MUL, off_reg, -1); +- *patch++ = BPF_MOV32_IMM(BPF_REG_AX, aux->alu_limit - 1); ++ *patch++ = BPF_MOV32_IMM(BPF_REG_AX, aux->alu_limit); + *patch++ = BPF_ALU64_REG(BPF_SUB, BPF_REG_AX, off_reg); + *patch++ = BPF_ALU64_REG(BPF_OR, BPF_REG_AX, off_reg); + *patch++ = BPF_ALU64_IMM(BPF_NEG, BPF_REG_AX, 0); diff --git a/patches.suse/btrfs-fix-race-when-cloning-extent-buffer-during-rew.patch b/patches.suse/btrfs-fix-race-when-cloning-extent-buffer-during-rew.patch new file mode 100644 index 0000000..3309f38 --- /dev/null +++ b/patches.suse/btrfs-fix-race-when-cloning-extent-buffer-during-rew.patch @@ -0,0 +1,285 @@ +From: Filipe Manana +Date: Thu, 11 Mar 2021 14:31:05 +0000 +Git-commit: dbcc7d57bffc0c8cac9dac11bec548597d59a6a5 +Patch-mainline: v5.12-rc4 +References: bsc#1184193 CVE-2021-28964 +Subject: [PATCH] btrfs: fix race when cloning extent buffer during rewind of + an old root + +While resolving backreferences, as part of a logical ino ioctl call or +fiemap, we can end up hitting a BUG_ON() when replaying tree mod log +operations of a root, triggering a stack trace like the following: + + ------------[ cut here ]------------ + kernel BUG at fs/btrfs/ctree.c:1210! + invalid opcode: 0000 [#1] SMP KASAN PTI + CPU: 1 PID: 19054 Comm: crawl_335 Tainted: G W 5.11.0-2d11c0084b02-misc-next+ #89 + Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 + RIP: 0010:__tree_mod_log_rewind+0x3b1/0x3c0 + Code: 05 48 8d 74 10 (...) + RSP: 0018:ffffc90001eb70b8 EFLAGS: 00010297 + RAX: 0000000000000000 RBX: ffff88812344e400 RCX: ffffffffb28933b6 + RDX: 0000000000000007 RSI: dffffc0000000000 RDI: ffff88812344e42c + RBP: ffffc90001eb7108 R08: 1ffff11020b60a20 R09: ffffed1020b60a20 + R10: ffff888105b050f9 R11: ffffed1020b60a1f R12: 00000000000000ee + R13: ffff8880195520c0 R14: ffff8881bc958500 R15: ffff88812344e42c + FS: 00007fd1955e8700(0000) GS:ffff8881f5600000(0000) knlGS:0000000000000000 + CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + CR2: 00007efdb7928718 CR3: 000000010103a006 CR4: 0000000000170ee0 + Call Trace: + btrfs_search_old_slot+0x265/0x10d0 + ? lock_acquired+0xbb/0x600 + ? btrfs_search_slot+0x1090/0x1090 + ? free_extent_buffer.part.61+0xd7/0x140 + ? free_extent_buffer+0x13/0x20 + resolve_indirect_refs+0x3e9/0xfc0 + ? lock_downgrade+0x3d0/0x3d0 + ? __kasan_check_read+0x11/0x20 + ? add_prelim_ref.part.11+0x150/0x150 + ? lock_downgrade+0x3d0/0x3d0 + ? __kasan_check_read+0x11/0x20 + ? lock_acquired+0xbb/0x600 + ? __kasan_check_write+0x14/0x20 + ? do_raw_spin_unlock+0xa8/0x140 + ? rb_insert_color+0x30/0x360 + ? prelim_ref_insert+0x12d/0x430 + find_parent_nodes+0x5c3/0x1830 + ? resolve_indirect_refs+0xfc0/0xfc0 + ? lock_release+0xc8/0x620 + ? fs_reclaim_acquire+0x67/0xf0 + ? lock_acquire+0xc7/0x510 + ? lock_downgrade+0x3d0/0x3d0 + ? lockdep_hardirqs_on_prepare+0x160/0x210 + ? lock_release+0xc8/0x620 + ? fs_reclaim_acquire+0x67/0xf0 + ? lock_acquire+0xc7/0x510 + ? poison_range+0x38/0x40 + ? unpoison_range+0x14/0x40 + ? trace_hardirqs_on+0x55/0x120 + btrfs_find_all_roots_safe+0x142/0x1e0 + ? find_parent_nodes+0x1830/0x1830 + ? btrfs_inode_flags_to_xflags+0x50/0x50 + iterate_extent_inodes+0x20e/0x580 + ? tree_backref_for_extent+0x230/0x230 + ? lock_downgrade+0x3d0/0x3d0 + ? read_extent_buffer+0xdd/0x110 + ? lock_downgrade+0x3d0/0x3d0 + ? __kasan_check_read+0x11/0x20 + ? lock_acquired+0xbb/0x600 + ? __kasan_check_write+0x14/0x20 + ? _raw_spin_unlock+0x22/0x30 + ? __kasan_check_write+0x14/0x20 + iterate_inodes_from_logical+0x129/0x170 + ? iterate_inodes_from_logical+0x129/0x170 + ? btrfs_inode_flags_to_xflags+0x50/0x50 + ? iterate_extent_inodes+0x580/0x580 + ? __vmalloc_node+0x92/0xb0 + ? init_data_container+0x34/0xb0 + ? init_data_container+0x34/0xb0 + ? kvmalloc_node+0x60/0x80 + btrfs_ioctl_logical_to_ino+0x158/0x230 + btrfs_ioctl+0x205e/0x4040 + ? __might_sleep+0x71/0xe0 + ? btrfs_ioctl_get_supported_features+0x30/0x30 + ? getrusage+0x4b6/0x9c0 + ? __kasan_check_read+0x11/0x20 + ? lock_release+0xc8/0x620 + ? __might_fault+0x64/0xd0 + ? lock_acquire+0xc7/0x510 + ? lock_downgrade+0x3d0/0x3d0 + ? lockdep_hardirqs_on_prepare+0x210/0x210 + ? lockdep_hardirqs_on_prepare+0x210/0x210 + ? __kasan_check_read+0x11/0x20 + ? do_vfs_ioctl+0xfc/0x9d0 + ? ioctl_file_clone+0xe0/0xe0 + ? lock_downgrade+0x3d0/0x3d0 + ? lockdep_hardirqs_on_prepare+0x210/0x210 + ? __kasan_check_read+0x11/0x20 + ? lock_release+0xc8/0x620 + ? __task_pid_nr_ns+0xd3/0x250 + ? lock_acquire+0xc7/0x510 + ? __fget_files+0x160/0x230 + ? __fget_light+0xf2/0x110 + __x64_sys_ioctl+0xc3/0x100 + do_syscall_64+0x37/0x80 + entry_SYSCALL_64_after_hwframe+0x44/0xa9 + RIP: 0033:0x7fd1976e2427 + Code: 00 00 90 48 8b 05 (...) + RSP: 002b:00007fd1955e5cf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 + RAX: ffffffffffffffda RBX: 00007fd1955e5f40 RCX: 00007fd1976e2427 + RDX: 00007fd1955e5f48 RSI: 00000000c038943b RDI: 0000000000000004 + RBP: 0000000001000000 R08: 0000000000000000 R09: 00007fd1955e6120 + R10: 0000557835366b00 R11: 0000000000000246 R12: 0000000000000004 + R13: 00007fd1955e5f48 R14: 00007fd1955e5f40 R15: 00007fd1955e5ef8 + Modules linked in: + ---[ end trace ec8931a1c36e57be ]--- + + (gdb) l *(__tree_mod_log_rewind+0x3b1) + 0xffffffff81893521 is in __tree_mod_log_rewind (fs/btrfs/ctree.c:1210). + 1205 * the modification. as we're going backwards, we do the + 1206 * opposite of each operation here. + 1207 */ + 1208 switch (tm->op) { + 1209 case MOD_LOG_KEY_REMOVE_WHILE_FREEING: + 1210 BUG_ON(tm->slot < n); + 1211 fallthrough; + 1212 case MOD_LOG_KEY_REMOVE_WHILE_MOVING: + 1213 case MOD_LOG_KEY_REMOVE: + 1214 btrfs_set_node_key(eb, &tm->key, tm->slot); + +Here's what happens to hit that BUG_ON(): + +1) We have one tree mod log user (through fiemap or the logical ino ioctl), + with a sequence number of 1, so we have fs_info->tree_mod_seq == 1; + +2) Another task is at ctree.c:balance_level() and we have eb X currently as + the root of the tree, and we promote its single child, eb Y, as the new + root. + + Then, at ctree.c:balance_level(), we call: + + tree_mod_log_insert_root(eb X, eb Y, 1); + +3) At tree_mod_log_insert_root() we create tree mod log elements for each + slot of eb X, of operation type MOD_LOG_KEY_REMOVE_WHILE_FREEING each + with a ->logical pointing to ebX->start. These are placed in an array + named tm_list. + Lets assume there are N elements (N pointers in eb X); + +4) Then, still at tree_mod_log_insert_root(), we create a tree mod log + element of operation type MOD_LOG_ROOT_REPLACE, ->logical set to + ebY->start, ->old_root.logical set to ebX->start, ->old_root.level set + to the level of eb X and ->generation set to the generation of eb X; + +5) Then tree_mod_log_insert_root() calls tree_mod_log_free_eb() with + tm_list as argument. After that, tree_mod_log_free_eb() calls + __tree_mod_log_insert() for each member of tm_list in reverse order, + from highest slot in eb X, slot N - 1, to slot 0 of eb X; + +6) __tree_mod_log_insert() sets the sequence number of each given tree mod + log operation - it increments fs_info->tree_mod_seq and sets + fs_info->tree_mod_seq as the sequence number of the given tree mod log + operation. + + This means that for the tm_list created at tree_mod_log_insert_root(), + the element corresponding to slot 0 of eb X has the highest sequence + number (1 + N), and the element corresponding to the last slot has the + lowest sequence number (2); + +7) Then, after inserting tm_list's elements into the tree mod log rbtree, + the MOD_LOG_ROOT_REPLACE element is inserted, which gets the highest + sequence number, which is N + 2; + +8) Back to ctree.c:balance_level(), we free eb X by calling + btrfs_free_tree_block() on it. Because eb X was created in the current + transaction, has no other references and writeback did not happen for + it, we add it back to the free space cache/tree; + +9) Later some other task T allocates the metadata extent from eb X, since + it is marked as free space in the space cache/tree, and uses it as a + node for some other btree; + +10) The tree mod log user task calls btrfs_search_old_slot(), which calls + get_old_root(), and finally that calls __tree_mod_log_oldest_root() + with time_seq == 1 and eb_root == eb Y; + +11) First iteration of the while loop finds the tree mod log element with + sequence number N + 2, for the logical address of eb Y and of type + MOD_LOG_ROOT_REPLACE; + +12) Because the operation type is MOD_LOG_ROOT_REPLACE, we don't break out + of the loop, and set root_logical to point to tm->old_root.logical + which corresponds to the logical address of eb X; + +13) On the next iteration of the while loop, the call to + tree_mod_log_search_oldest() returns the smallest tree mod log element + for the logical address of eb X, which has a sequence number of 2, an + operation type of MOD_LOG_KEY_REMOVE_WHILE_FREEING and corresponds to + the old slot N - 1 of eb X (eb X had N items in it before being freed); + +14) We then break out of the while loop and return the tree mod log operation + of type MOD_LOG_ROOT_REPLACE (eb Y), and not the one for slot N - 1 of + eb X, to get_old_root(); + +15) At get_old_root(), we process the MOD_LOG_ROOT_REPLACE operation + and set "logical" to the logical address of eb X, which was the old + root. We then call tree_mod_log_search() passing it the logical + address of eb X and time_seq == 1; + +16) Then before calling tree_mod_log_search(), task T adds a key to eb X, + which results in adding a tree mod log operation of type + MOD_LOG_KEY_ADD to the tree mod log - this is done at + ctree.c:insert_ptr() - but after adding the tree mod log operation + and before updating the number of items in eb X from 0 to 1... + +17) The task at get_old_root() calls tree_mod_log_search() and gets the + tree mod log operation of type MOD_LOG_KEY_ADD just added by task T. + Then it enters the following if branch: + + if (old_root && tm && tm->op != MOD_LOG_KEY_REMOVE_WHILE_FREEING) { + (...) + } (...) + + Calls read_tree_block() for eb X, which gets a reference on eb X but + does not lock it - task T has it locked. + Then it clones eb X while it has nritems set to 0 in its header, before + task T sets nritems to 1 in eb X's header. From hereupon we use the + clone of eb X which no other task has access to; + +18) Then we call __tree_mod_log_rewind(), passing it the MOD_LOG_KEY_ADD + mod log operation we just got from tree_mod_log_search() in the + previous step and the cloned version of eb X; + +19) At __tree_mod_log_rewind(), we set the local variable "n" to the number + of items set in eb X's clone, which is 0. Then we enter the while loop, + and in its first iteration we process the MOD_LOG_KEY_ADD operation, + which just decrements "n" from 0 to (u32)-1, since "n" is declared with + a type of u32. At the end of this iteration we call rb_next() to find the + next tree mod log operation for eb X, that gives us the mod log operation + of type MOD_LOG_KEY_REMOVE_WHILE_FREEING, for slot 0, with a sequence + number of N + 1 (steps 3 to 6); + +20) Then we go back to the top of the while loop and trigger the following + BUG_ON(): + + (...) + switch (tm->op) { + case MOD_LOG_KEY_REMOVE_WHILE_FREEING: + BUG_ON(tm->slot < n); + fallthrough; + (...) + + Because "n" has a value of (u32)-1 (4294967295) and tm->slot is 0. + +Fix this by taking a read lock on the extent buffer before cloning it at +ctree.c:get_old_root(). This should be done regardless of the extent +buffer having been freed and reused, as a concurrent task might be +modifying it (while holding a write lock on it). + +Reported-by: Zygo Blaxell +Link: https://lore.kernel.org/linux-btrfs/20210227155037.GN28049@hungrycats.org/ +Fixes: 834328a8493079 ("Btrfs: tree mod log's old roots could still be part of the tree") +CC: stable@vger.kernel.org # 4.4+ +Signed-off-by: Filipe Manana +Signed-off-by: David Sterba +--- + fs/btrfs/ctree.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c +index d56730a67885..34b929bd5c1a 100644 +--- a/fs/btrfs/ctree.c ++++ b/fs/btrfs/ctree.c +@@ -1365,7 +1365,9 @@ get_old_root(struct btrfs_root *root, u64 time_seq) + "failed to read tree block %llu from get_old_root", + logical); + } else { ++ btrfs_tree_read_lock(old); + eb = btrfs_clone_extent_buffer(old); ++ btrfs_tree_read_unlock(old); + free_extent_buffer(old); + } + } else if (old_root) { +-- +2.26.2 + diff --git a/patches.suse/bus-omap_l3_noc-mark-l3-irqs-as-IRQF_NO_THREAD.patch b/patches.suse/bus-omap_l3_noc-mark-l3-irqs-as-IRQF_NO_THREAD.patch new file mode 100644 index 0000000..9d8620b --- /dev/null +++ b/patches.suse/bus-omap_l3_noc-mark-l3-irqs-as-IRQF_NO_THREAD.patch @@ -0,0 +1,51 @@ +From 7d7275b3e866cf8092bd12553ec53ba26864f7bb Mon Sep 17 00:00:00 2001 +From: Grygorii Strashko +Date: Thu, 28 Jan 2021 21:15:48 +0200 +Subject: [PATCH] bus: omap_l3_noc: mark l3 irqs as IRQF_NO_THREAD +Git-commit: 7d7275b3e866cf8092bd12553ec53ba26864f7bb +Patch-mainline: v5.12-rc5 +References: git-fixes + +The main purpose of l3 IRQs is to catch OCP bus access errors and identify +corresponding code places by showing call stack, so it's important to +handle L3 interconnect errors as fast as possible. On RT these IRQs will +became threaded and will be scheduled much more late from the moment actual +error occurred so showing completely useless information. + +Hence, mark l3 IRQs as IRQF_NO_THREAD so they will not be forced threaded +on RT or if force_irqthreads = true. + +Fixes: 0ee7261c9212 ("drivers: bus: Move the OMAP interconnect driver to drivers/bus/") +Signed-off-by: Grygorii Strashko +Signed-off-by: Tony Lindgren +Acked-by: Takashi Iwai + +--- + drivers/bus/omap_l3_noc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c +index b040447575ad..dcfb32ee5cb6 100644 +--- a/drivers/bus/omap_l3_noc.c ++++ b/drivers/bus/omap_l3_noc.c +@@ -285,7 +285,7 @@ static int omap_l3_probe(struct platform_device *pdev) + */ + l3->debug_irq = platform_get_irq(pdev, 0); + ret = devm_request_irq(l3->dev, l3->debug_irq, l3_interrupt_handler, +- 0x0, "l3-dbg-irq", l3); ++ IRQF_NO_THREAD, "l3-dbg-irq", l3); + if (ret) { + dev_err(l3->dev, "request_irq failed for %d\n", + l3->debug_irq); +@@ -294,7 +294,7 @@ static int omap_l3_probe(struct platform_device *pdev) + + l3->app_irq = platform_get_irq(pdev, 1); + ret = devm_request_irq(l3->dev, l3->app_irq, l3_interrupt_handler, +- 0x0, "l3-app-irq", l3); ++ IRQF_NO_THREAD, "l3-app-irq", l3); + if (ret) + dev_err(l3->dev, "request_irq failed for %d\n", l3->app_irq); + +-- +2.26.2 + diff --git a/patches.suse/can-c_can-move-runtime-PM-enable-disable-to-c_can_pl.patch b/patches.suse/can-c_can-move-runtime-PM-enable-disable-to-c_can_pl.patch new file mode 100644 index 0000000..a6da63e --- /dev/null +++ b/patches.suse/can-c_can-move-runtime-PM-enable-disable-to-c_can_pl.patch @@ -0,0 +1,136 @@ +From 6e2fe01dd6f98da6cae8b07cd5cfa67abc70d97d Mon Sep 17 00:00:00 2001 +From: Tong Zhang +Date: Mon, 1 Mar 2021 21:55:40 -0500 +Subject: [PATCH] can: c_can: move runtime PM enable/disable to c_can_platform +Mime-version: 1.0 +Content-type: text/plain; charset=UTF-8 +Content-transfer-encoding: 8bit +Git-commit: 6e2fe01dd6f98da6cae8b07cd5cfa67abc70d97d +Patch-mainline: v5.12-rc5 +References: git-fixes + +Currently doing modprobe c_can_pci will make the kernel complain: + + Unbalanced pm_runtime_enable! + +this is caused by pm_runtime_enable() called before pm is initialized. + +This fix is similar to 227619c3ff7c, move those pm_enable/disable code +to c_can_platform. + +Fixes: 4cdd34b26826 ("can: c_can: Add runtime PM support to Bosch C_CAN/D_CAN controller") +Link: http://lore.kernel.org/r/20210302025542.987600-1-ztong0001@gmail.com +Signed-off-by: Tong Zhang +Tested-by: Uwe Kleine-König +Signed-off-by: Marc Kleine-Budde +Acked-by: Takashi Iwai + +--- + drivers/net/can/c_can/c_can.c | 24 +----------------------- + drivers/net/can/c_can/c_can_platform.c | 6 +++++- + 2 files changed, 6 insertions(+), 24 deletions(-) + +diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c +index ef474bae47a1..6958830cb983 100644 +--- a/drivers/net/can/c_can/c_can.c ++++ b/drivers/net/can/c_can/c_can.c +@@ -212,18 +212,6 @@ static const struct can_bittiming_const c_can_bittiming_const = { + .brp_inc = 1, + }; + +-static inline void c_can_pm_runtime_enable(const struct c_can_priv *priv) +-{ +- if (priv->device) +- pm_runtime_enable(priv->device); +-} +- +-static inline void c_can_pm_runtime_disable(const struct c_can_priv *priv) +-{ +- if (priv->device) +- pm_runtime_disable(priv->device); +-} +- + static inline void c_can_pm_runtime_get_sync(const struct c_can_priv *priv) + { + if (priv->device) +@@ -1335,7 +1323,6 @@ static const struct net_device_ops c_can_netdev_ops = { + + int register_c_can_dev(struct net_device *dev) + { +- struct c_can_priv *priv = netdev_priv(dev); + int err; + + /* Deactivate pins to prevent DRA7 DCAN IP from being +@@ -1345,28 +1332,19 @@ int register_c_can_dev(struct net_device *dev) + */ + pinctrl_pm_select_sleep_state(dev->dev.parent); + +- c_can_pm_runtime_enable(priv); +- + dev->flags |= IFF_ECHO; /* we support local echo */ + dev->netdev_ops = &c_can_netdev_ops; + + err = register_candev(dev); +- if (err) +- c_can_pm_runtime_disable(priv); +- else ++ if (!err) + devm_can_led_init(dev); +- + return err; + } + EXPORT_SYMBOL_GPL(register_c_can_dev); + + void unregister_c_can_dev(struct net_device *dev) + { +- struct c_can_priv *priv = netdev_priv(dev); +- + unregister_candev(dev); +- +- c_can_pm_runtime_disable(priv); + } + EXPORT_SYMBOL_GPL(unregister_c_can_dev); + +diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c +index 05f425ceb53a..47b251b1607c 100644 +--- a/drivers/net/can/c_can/c_can_platform.c ++++ b/drivers/net/can/c_can/c_can_platform.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -386,6 +387,7 @@ static int c_can_plat_probe(struct platform_device *pdev) + platform_set_drvdata(pdev, dev); + SET_NETDEV_DEV(dev, &pdev->dev); + ++ pm_runtime_enable(priv->device); + ret = register_c_can_dev(dev); + if (ret) { + dev_err(&pdev->dev, "registering %s failed (err=%d)\n", +@@ -398,6 +400,7 @@ static int c_can_plat_probe(struct platform_device *pdev) + return 0; + + exit_free_device: ++ pm_runtime_disable(priv->device); + free_c_can_dev(dev); + exit: + dev_err(&pdev->dev, "probe failed\n"); +@@ -408,9 +411,10 @@ static int c_can_plat_probe(struct platform_device *pdev) + static int c_can_plat_remove(struct platform_device *pdev) + { + struct net_device *dev = platform_get_drvdata(pdev); ++ struct c_can_priv *priv = netdev_priv(dev); + + unregister_c_can_dev(dev); +- ++ pm_runtime_disable(priv->device); + free_c_can_dev(dev); + + return 0; +-- +2.26.2 + diff --git a/patches.suse/can-c_can_pci-c_can_pci_remove-fix-use-after-free.patch b/patches.suse/can-c_can_pci-c_can_pci_remove-fix-use-after-free.patch new file mode 100644 index 0000000..e8e22a1 --- /dev/null +++ b/patches.suse/can-c_can_pci-c_can_pci_remove-fix-use-after-free.patch @@ -0,0 +1,44 @@ +From 0429d6d89f97ebff4f17f13f5b5069c66bde8138 Mon Sep 17 00:00:00 2001 +From: Tong Zhang +Date: Sun, 28 Feb 2021 21:45:11 -0500 +Subject: [PATCH] can: c_can_pci: c_can_pci_remove(): fix use-after-free +Git-commit: 0429d6d89f97ebff4f17f13f5b5069c66bde8138 +Patch-mainline: v5.12-rc5 +References: git-fixes + +There is a UAF in c_can_pci_remove(). dev is released by +free_c_can_dev() and is used by pci_iounmap(pdev, priv->base) later. +To fix this issue, save the mmio address before releasing dev. + +Fixes: 5b92da0443c2 ("c_can_pci: generic module for C_CAN/D_CAN on PCI") +Link: https://lore.kernel.org/r/20210301024512.539039-1-ztong0001@gmail.com +Signed-off-by: Tong Zhang +Signed-off-by: Marc Kleine-Budde +Acked-by: Takashi Iwai + +--- + drivers/net/can/c_can/c_can_pci.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c +index 406b4847e5dc..7efb60b50876 100644 +--- a/drivers/net/can/c_can/c_can_pci.c ++++ b/drivers/net/can/c_can/c_can_pci.c +@@ -239,12 +239,13 @@ static void c_can_pci_remove(struct pci_dev *pdev) + { + struct net_device *dev = pci_get_drvdata(pdev); + struct c_can_priv *priv = netdev_priv(dev); ++ void __iomem *addr = priv->base; + + unregister_c_can_dev(dev); + + free_c_can_dev(dev); + +- pci_iounmap(pdev, priv->base); ++ pci_iounmap(pdev, addr); + pci_disable_msi(pdev); + pci_clear_master(pdev); + pci_release_regions(pdev); +-- +2.26.2 + diff --git a/patches.suse/can-m_can-m_can_do_rx_poll-fix-extraneous-msg-loss-w.patch b/patches.suse/can-m_can-m_can_do_rx_poll-fix-extraneous-msg-loss-w.patch new file mode 100644 index 0000000..83a708d --- /dev/null +++ b/patches.suse/can-m_can-m_can_do_rx_poll-fix-extraneous-msg-loss-w.patch @@ -0,0 +1,44 @@ +From c0e399f3baf42279f48991554240af8c457535d1 Mon Sep 17 00:00:00 2001 +From: Torin Cooper-Bennun +Date: Wed, 3 Mar 2021 10:31:52 +0000 +Subject: [PATCH] can: m_can: m_can_do_rx_poll(): fix extraneous msg loss warning +Git-commit: c0e399f3baf42279f48991554240af8c457535d1 +Patch-mainline: v5.12-rc5 +References: git-fixes + +Message loss from RX FIFO 0 is already handled in +m_can_handle_lost_msg(), with netdev output included. + +Removing this warning also improves driver performance under heavy +load, where m_can_do_rx_poll() may be called many times before this +interrupt is cleared, causing this message to be output many +times (thanks Mariusz Madej for this report). + +Fixes: e0d1f4816f2a ("can: m_can: add Bosch M_CAN controller support") +Link: https://lore.kernel.org/r/20210303103151.3760532-1-torin@maxiluxsystems.com +Reported-by: Mariusz Madej +Signed-off-by: Torin Cooper-Bennun +Signed-off-by: Marc Kleine-Budde +Acked-by: Takashi Iwai + +--- + drivers/net/can/m_can/m_can.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c +index 3752520a7d4b..d783c46cac16 100644 +--- a/drivers/net/can/m_can/m_can.c ++++ b/drivers/net/can/m_can/m_can.c +@@ -501,9 +501,6 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota) + } + + while ((rxfs & RXFS_FFL_MASK) && (quota > 0)) { +- if (rxfs & RXFS_RFL) +- netdev_warn(dev, "Rx FIFO 0 Message Lost\n"); +- + m_can_read_fifo(dev, rxfs); + + quota--; +-- +2.26.2 + diff --git a/patches.suse/can-peak_usb-Revert-can-peak_usb-add-forgotten-suppo.patch b/patches.suse/can-peak_usb-Revert-can-peak_usb-add-forgotten-suppo.patch new file mode 100644 index 0000000..a6109bf --- /dev/null +++ b/patches.suse/can-peak_usb-Revert-can-peak_usb-add-forgotten-suppo.patch @@ -0,0 +1,42 @@ +From 5d7047ed6b7214fbabc16d8712a822e256b1aa44 Mon Sep 17 00:00:00 2001 +From: Marc Kleine-Budde +Date: Sat, 20 Mar 2021 20:21:54 +0100 +Subject: [PATCH] can: peak_usb: Revert "can: peak_usb: add forgotten supported devices" +Git-commit: 5d7047ed6b7214fbabc16d8712a822e256b1aa44 +Patch-mainline: v5.12-rc5 +References: git-fixes + +In commit 6417f03132a6 ("module: remove never implemented +MODULE_SUPPORTED_DEVICE") the MODULE_SUPPORTED_DEVICE macro was +removed from the kerne entirely. Shortly before this patch was applied +mainline the commit 59ec7b89ed3e ("can: peak_usb: add forgotten +supported devices") was added to net/master. As this would result in a +merge conflict, let's revert this patch. + +Fixes: 59ec7b89ed3e ("can: peak_usb: add forgotten supported devices") +Link: https://lore.kernel.org/r/20210320192649.341832-1-mkl@pengutronix.de +Suggested-by: Leon Romanovsky +Cc: Stephane Grosjean +Signed-off-by: Marc Kleine-Budde +Acked-by: Takashi Iwai + +--- + drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c +index f1d018218c93..f347ecc79aef 100644 +--- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c ++++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c +@@ -18,8 +18,6 @@ + + MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB FD adapter"); + MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro FD adapter"); +-MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-Chip USB"); +-MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB X6 adapter"); + + #define PCAN_USBPROFD_CHANNEL_COUNT 2 + #define PCAN_USBFD_CHANNEL_COUNT 1 +-- +2.26.2 + diff --git a/patches.suse/can-peak_usb-add-forgotten-supported-devices.patch b/patches.suse/can-peak_usb-add-forgotten-supported-devices.patch new file mode 100644 index 0000000..e3d0a14 --- /dev/null +++ b/patches.suse/can-peak_usb-add-forgotten-supported-devices.patch @@ -0,0 +1,39 @@ +From 59ec7b89ed3e921cd0625a8c83f31a30d485fdf8 Mon Sep 17 00:00:00 2001 +From: Stephane Grosjean +Date: Tue, 9 Mar 2021 09:21:27 +0100 +Subject: [PATCH] can: peak_usb: add forgotten supported devices +Git-commit: 59ec7b89ed3e921cd0625a8c83f31a30d485fdf8 +Patch-mainline: v5.12-rc5 +References: git-fixes + +Since the peak_usb driver also supports the CAN-USB interfaces +"PCAN-USB X6" and "PCAN-Chip USB" from PEAK-System GmbH, this patch adds +their names to the list of explicitly supported devices. + +Fixes: ea8b65b596d7 ("can: usb: Add support of PCAN-Chip USB stamp module") +Fixes: f00b534ded60 ("can: peak: Add support for PCAN-USB X6 USB interface") +Link: https://lore.kernel.org/r/20210309082128.23125-3-s.grosjean@peak-system.com +Signed-off-by: Stephane Grosjean +Signed-off-by: Marc Kleine-Budde +Acked-by: Takashi Iwai + +--- + drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c +index f347ecc79aef..f1d018218c93 100644 +--- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c ++++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c +@@ -18,6 +18,8 @@ + + MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB FD adapter"); + MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro FD adapter"); ++MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-Chip USB"); ++MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB X6 adapter"); + + #define PCAN_USBPROFD_CHANNEL_COUNT 2 + #define PCAN_USBFD_CHANNEL_COUNT 1 +-- +2.26.2 + diff --git a/patches.suse/drm-msm-fix-shutdown-hook-in-case-GPU-components-fai.patch b/patches.suse/drm-msm-fix-shutdown-hook-in-case-GPU-components-fai.patch new file mode 100644 index 0000000..d55e702 --- /dev/null +++ b/patches.suse/drm-msm-fix-shutdown-hook-in-case-GPU-components-fai.patch @@ -0,0 +1,95 @@ +From 623f279c77811475ac8fd5635cc4e4451aa71291 Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov +Date: Sat, 20 Mar 2021 08:56:02 -0300 +Subject: [PATCH] drm/msm: fix shutdown hook in case GPU components failed to bind +Git-commit: 623f279c77811475ac8fd5635cc4e4451aa71291 +Patch-mainline: v5.12-rc5 +References: git-fixes + +If GPU components have failed to bind, shutdown callback would fail with +the following backtrace. Add safeguard check to stop that oops from +happening and allow the board to reboot. + +[ 66.617046] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 +[ 66.626066] Mem abort info: +[ 66.628939] ESR = 0x96000006 +[ 66.632088] EC = 0x25: DABT (current EL), IL = 32 bits +[ 66.637542] SET = 0, FnV = 0 +[ 66.640688] EA = 0, S1PTW = 0 +[ 66.643924] Data abort info: +[ 66.646889] ISV = 0, ISS = 0x00000006 +[ 66.650832] CM = 0, WnR = 0 +[ 66.653890] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000107f81000 +[ 66.660505] [0000000000000000] pgd=0000000100bb2003, p4d=0000000100bb2003, pud=0000000100897003, pmd=0000000000000000 +[ 66.671398] Internal error: Oops: 96000006 [#1] PREEMPT SMP +[ 66.677115] Modules linked in: +[ 66.680261] CPU: 6 PID: 352 Comm: reboot Not tainted 5.11.0-rc2-00309-g79e3faa756b2 #38 +[ 66.688473] Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT) +[ 66.695347] pstate: 60400005 (nZCv daif +PAN -UAO -TCO BTYPE=--) +[ 66.701507] pc : msm_atomic_commit_tail+0x78/0x4e0 +[ 66.706437] lr : commit_tail+0xa4/0x184 +[ 66.710381] sp : ffff8000108f3af0 +[ 66.713791] x29: ffff8000108f3af0 x28: ffff418c44337000 +[ 66.719242] x27: 0000000000000000 x26: ffff418c40a24490 +[ 66.724693] x25: ffffd3a842a4f1a0 x24: 0000000000000008 +[ 66.730146] x23: ffffd3a84313f030 x22: ffff418c444ce000 +[ 66.735598] x21: ffff418c408a4980 x20: 0000000000000000 +[ 66.741049] x19: 0000000000000000 x18: ffff800010710fbc +[ 66.746500] x17: 000000000000000c x16: 0000000000000001 +[ 66.751954] x15: 0000000000010008 x14: 0000000000000068 +[ 66.757405] x13: 0000000000000001 x12: 0000000000000000 +[ 66.762855] x11: 0000000000000001 x10: 00000000000009b0 +[ 66.768306] x9 : ffffd3a843192000 x8 : ffff418c44337000 +[ 66.773757] x7 : 0000000000000000 x6 : 00000000a401b34e +[ 66.779210] x5 : 00ffffffffffffff x4 : 0000000000000000 +[ 66.784660] x3 : 0000000000000000 x2 : ffff418c444ce000 +[ 66.790111] x1 : ffffd3a841dce530 x0 : ffff418c444cf000 +[ 66.795563] Call trace: +[ 66.798075] msm_atomic_commit_tail+0x78/0x4e0 +[ 66.802633] commit_tail+0xa4/0x184 +[ 66.806217] drm_atomic_helper_commit+0x160/0x390 +[ 66.811051] drm_atomic_commit+0x4c/0x60 +[ 66.815082] drm_atomic_helper_disable_all+0x1f4/0x210 +[ 66.820355] drm_atomic_helper_shutdown+0x80/0x130 +[ 66.825276] msm_pdev_shutdown+0x14/0x20 +[ 66.829303] platform_shutdown+0x28/0x40 +[ 66.833330] device_shutdown+0x158/0x330 +[ 66.837357] kernel_restart+0x40/0xa0 +[ 66.841122] __do_sys_reboot+0x228/0x250 +[ 66.845148] __arm64_sys_reboot+0x28/0x34 +[ 66.849264] el0_svc_common.constprop.0+0x74/0x190 +[ 66.854187] do_el0_svc+0x24/0x90 +[ 66.857595] el0_svc+0x14/0x20 +[ 66.860739] el0_sync_handler+0x1a4/0x1b0 +[ 66.864858] el0_sync+0x174/0x180 +[ 66.868269] Code: 1ac020a0 2a000273 eb02007f 54ffff01 (f9400285) +[ 66.874525] ---[ end trace 20dedb2a3229fec8 ]--- + +Fixes: 9d5cbf5fe46e ("drm/msm: add shutdown support for display platform_driver") +Signed-off-by: Dmitry Baryshkov +Signed-off-by: Fabio Estevam +Signed-off-by: Rob Clark +Acked-by: Takashi Iwai + +--- + drivers/gpu/drm/msm/msm_drv.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c +index 94525ac76d4e..fd2ac54caf9f 100644 +--- a/drivers/gpu/drm/msm/msm_drv.c ++++ b/drivers/gpu/drm/msm/msm_drv.c +@@ -1311,6 +1311,10 @@ static int msm_pdev_remove(struct platform_device *pdev) + static void msm_pdev_shutdown(struct platform_device *pdev) + { + struct drm_device *drm = platform_get_drvdata(pdev); ++ struct msm_drm_private *priv = drm ? drm->dev_private : NULL; ++ ++ if (!priv || !priv->kms) ++ return; + + drm_atomic_helper_shutdown(drm); + } +-- +2.26.2 + diff --git a/patches.suse/drm-radeon-fix-AGP-dependency.patch b/patches.suse/drm-radeon-fix-AGP-dependency.patch new file mode 100644 index 0000000..a404ac2 --- /dev/null +++ b/patches.suse/drm-radeon-fix-AGP-dependency.patch @@ -0,0 +1,38 @@ +From cba2afb65cb05c3d197d17323fee4e3c9edef9cd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20K=C3=B6nig?= +Date: Mon, 8 Mar 2021 19:22:13 +0100 +Subject: [PATCH] drm/radeon: fix AGP dependency +Mime-version: 1.0 +Content-type: text/plain; charset=UTF-8 +Content-transfer-encoding: 8bit +Git-commit: cba2afb65cb05c3d197d17323fee4e3c9edef9cd +Patch-mainline: v5.12-rc3 +References: git-fixes + +When AGP is compiled as module radeon must be compiled as module as +well. + +Signed-off-by: Christian König +Reviewed-by: Alex Deucher +Signed-off-by: Alex Deucher +Acked-by: Takashi Iwai + +--- + drivers/gpu/drm/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig +index 8bf103de1594..19fc4ce62a94 100644 +--- a/drivers/gpu/drm/Kconfig ++++ b/drivers/gpu/drm/Kconfig +@@ -225,6 +225,7 @@ source "drivers/gpu/drm/arm/Kconfig" + config DRM_RADEON + tristate "ATI Radeon" + depends on DRM && PCI && MMU ++ depends on AGP || !AGP + select FW_LOADER + select DRM_KMS_HELPER + select DRM_TTM +-- +2.26.2 + diff --git a/patches.suse/gianfar-fix-jumbo-packets-napi-rx-overrun-crash.patch b/patches.suse/gianfar-fix-jumbo-packets-napi-rx-overrun-crash.patch new file mode 100644 index 0000000..989bef3 --- /dev/null +++ b/patches.suse/gianfar-fix-jumbo-packets-napi-rx-overrun-crash.patch @@ -0,0 +1,89 @@ +From d8861bab48b6c1fc3cdbcab8ff9d1eaea43afe7f Mon Sep 17 00:00:00 2001 +From: Michael Braun +Date: Thu, 4 Mar 2021 20:52:52 +0100 +Subject: [PATCH] gianfar: fix jumbo packets+napi+rx overrun crash +Git-commit: d8861bab48b6c1fc3cdbcab8ff9d1eaea43afe7f +Patch-mainline: v5.12-rc3 +References: CVE-2021-29264 bsc#1184168 + +[ backport note: dropped the first chunk in the original patch as the + old kernel code already has the size check -- tiwai ] + +When using jumbo packets and overrunning rx queue with napi enabled, +the following sequence is observed in gfar_add_rx_frag: + + | lstatus | | skb | +t | lstatus, size, flags | first | len, data_len, *ptr | + +Acked-by: Takashi Iwai + +---+--------------------------------------+-------+-----------------------+ +13 | 18002348, 9032, INTERRUPT LAST | 0 | 9600, 8000, f554c12e | +12 | 10000640, 1600, INTERRUPT | 0 | 8000, 6400, f554c12e | +11 | 10000640, 1600, INTERRUPT | 0 | 6400, 4800, f554c12e | +10 | 10000640, 1600, INTERRUPT | 0 | 4800, 3200, f554c12e | +09 | 10000640, 1600, INTERRUPT | 0 | 3200, 1600, f554c12e | +08 | 14000640, 1600, INTERRUPT FIRST | 0 | 1600, 0, f554c12e | +07 | 14000640, 1600, INTERRUPT FIRST | 1 | 0, 0, f554c12e | +06 | 1c000080, 128, INTERRUPT LAST FIRST | 1 | 0, 0, abf3bd6e | +05 | 18002348, 9032, INTERRUPT LAST | 0 | 8000, 6400, c5a57780 | +04 | 10000640, 1600, INTERRUPT | 0 | 6400, 4800, c5a57780 | +03 | 10000640, 1600, INTERRUPT | 0 | 4800, 3200, c5a57780 | +02 | 10000640, 1600, INTERRUPT | 0 | 3200, 1600, c5a57780 | +01 | 10000640, 1600, INTERRUPT | 0 | 1600, 0, c5a57780 | +00 | 14000640, 1600, INTERRUPT FIRST | 1 | 0, 0, c5a57780 | + +So at t=7 a new packets is started but not finished, probably due to rx +overrun - but rx overrun is not indicated in the flags. Instead a new +packets starts at t=8. This results in skb->len to exceed size for the LAST +fragment at t=13 and thus a negative fragment size added to the skb. + +This then crashes: + +kernel BUG at include/linux/skbuff.h:2277! +Oops: Exception in kernel mode, sig: 5 [#1] +... +NIP [c04689f4] skb_pull+0x2c/0x48 +LR [c03f62ac] gfar_clean_rx_ring+0x2e4/0x844 +Call Trace: +[ec4bfd38] [c06a84c4] _raw_spin_unlock_irqrestore+0x60/0x7c (unreliable) +[ec4bfda8] [c03f6a44] gfar_poll_rx_sq+0x48/0xe4 +[ec4bfdc8] [c048d504] __napi_poll+0x54/0x26c +[ec4bfdf8] [c048d908] net_rx_action+0x138/0x2c0 +[ec4bfe68] [c06a8f34] __do_softirq+0x3a4/0x4fc +[ec4bfed8] [c0040150] run_ksoftirqd+0x58/0x70 +[ec4bfee8] [c0066ecc] smpboot_thread_fn+0x184/0x1cc +[ec4bff08] [c0062718] kthread+0x140/0x144 +[ec4bff38] [c0012350] ret_from_kernel_thread+0x14/0x1c + +This patch fixes this by checking for computed LAST fragment size, so a +negative sized fragment is never added. +In order to prevent the newer rx frame from getting corrupted, the FIRST +flag is checked to discard the incomplete older frame. + +Signed-off-by: Michael Braun +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/freescale/gianfar.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/net/ethernet/freescale/gianfar.c ++++ b/drivers/net/ethernet/freescale/gianfar.c +@@ -3107,6 +3107,17 @@ int gfar_clean_rx_ring(struct gfar_priv_ + if (lstatus & BD_LFLAG(RXBD_EMPTY)) + break; + ++ /* lost RXBD_LAST descriptor due to overrun */ ++ if (skb && ++ (lstatus & BD_LFLAG(RXBD_FIRST))) { ++ /* discard faulty buffer */ ++ dev_kfree_skb(skb); ++ skb = NULL; ++ rx_queue->stats.rx_dropped++; ++ ++ /* can continue normally */ ++ } ++ + /* order rx buffer descriptor reads */ + rmb(); + diff --git a/patches.suse/gpiolib-acpi-Add-missing-IRQF_ONESHOT.patch b/patches.suse/gpiolib-acpi-Add-missing-IRQF_ONESHOT.patch new file mode 100644 index 0000000..8908ea7 --- /dev/null +++ b/patches.suse/gpiolib-acpi-Add-missing-IRQF_ONESHOT.patch @@ -0,0 +1,41 @@ +From 6e5d5791730b55a1f987e1db84b078b91eb49e99 Mon Sep 17 00:00:00 2001 +From: Yang Li +Date: Tue, 23 Feb 2021 16:35:58 +0800 +Subject: [PATCH] gpiolib: acpi: Add missing IRQF_ONESHOT +Git-commit: 6e5d5791730b55a1f987e1db84b078b91eb49e99 +Patch-mainline: v5.12-rc3 +References: git-fixes + +fixed the following coccicheck: +./drivers/gpio/gpiolib-acpi.c:176:7-27: ERROR: Threaded IRQ with no +primary handler requested without IRQF_ONESHOT + +Make sure threaded IRQs without a primary handler are always request +with IRQF_ONESHOT + +Reported-by: Abaci Robot +Signed-off-by: Yang Li +Acked-by: Andy Shevchenko +Signed-off-by: Andy Shevchenko +Acked-by: Takashi Iwai + +--- + drivers/gpio/gpiolib-acpi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c +index e37a57d0a2f0..86efa2d9bf7f 100644 +--- a/drivers/gpio/gpiolib-acpi.c ++++ b/drivers/gpio/gpiolib-acpi.c +@@ -174,7 +174,7 @@ static void acpi_gpiochip_request_irq(struct acpi_gpio_chip *acpi_gpio, + int ret, value; + + ret = request_threaded_irq(event->irq, NULL, event->handler, +- event->irqflags, "ACPI:Event", event); ++ event->irqflags | IRQF_ONESHOT, "ACPI:Event", event); + if (ret) { + dev_err(acpi_gpio->chip->parent, + "Failed to setup interrupt handler for %d\n", +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-Correctly-re-enable-interrupts-in-NAPI-polli.patch b/patches.suse/ibmvnic-Correctly-re-enable-interrupts-in-NAPI-polli.patch new file mode 100644 index 0000000..5da60e2 --- /dev/null +++ b/patches.suse/ibmvnic-Correctly-re-enable-interrupts-in-NAPI-polli.patch @@ -0,0 +1,98 @@ +From ec20f36bb41aec786407b525ac1c2ba982c925fd Mon Sep 17 00:00:00 2001 +From: "Dwip N. Banerjee" +Date: Wed, 18 Nov 2020 19:12:23 -0600 +Subject: [PATCH] ibmvnic: Correctly re-enable interrupts in NAPI polling + routine + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.11-rc1 +Git-commit: ec20f36bb41aec786407b525ac1c2ba982c925fd + +If the current NAPI polling loop exits without completing it's +budget, only re-enable interrupts if there are no entries remaining +in the queue and napi_complete_done is successful. If there are entries +remaining on the queue that were missed, restart the polling loop. + +Signed-off-by: Dwip N. Banerjee +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 37 +++++++++++++++++++----------- + 1 file changed, 23 insertions(+), 14 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 +@@ -2463,10 +2463,17 @@ static void remove_buff_from_pool(struct + + static int ibmvnic_poll(struct napi_struct *napi, int budget) + { +- struct net_device *netdev = napi->dev; +- struct ibmvnic_adapter *adapter = netdev_priv(netdev); +- int scrq_num = (int)(napi - adapter->napi); +- int frames_processed = 0; ++ struct ibmvnic_sub_crq_queue *rx_scrq; ++ struct ibmvnic_adapter *adapter; ++ struct net_device *netdev; ++ int frames_processed; ++ int scrq_num; ++ ++ netdev = napi->dev; ++ adapter = netdev_priv(netdev); ++ scrq_num = (int)(napi - adapter->napi); ++ frames_processed = 0; ++ rx_scrq = adapter->rx_scrq[scrq_num]; + + restart_poll: + while (frames_processed < budget) { +@@ -2479,12 +2486,12 @@ restart_poll: + + if (unlikely(test_bit(0, &adapter->resetting) && + adapter->reset_reason != VNIC_RESET_NON_FATAL)) { +- enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]); ++ enable_scrq_irq(adapter, rx_scrq); + napi_complete_done(napi, frames_processed); + return frames_processed; + } + +- if (!pending_scrq(adapter, adapter->rx_scrq[scrq_num])) ++ if (!pending_scrq(adapter, rx_scrq)) + break; + /* The queue entry at the current index is peeked at above + * to determine that there is a valid descriptor awaiting +@@ -2492,7 +2499,7 @@ restart_poll: + * holds a valid descriptor before reading its contents. + */ + dma_rmb(); +- next = ibmvnic_next_scrq(adapter, adapter->rx_scrq[scrq_num]); ++ next = ibmvnic_next_scrq(adapter, rx_scrq); + rx_buff = + (struct ibmvnic_rx_buff *)be64_to_cpu(next-> + rx_comp.correlator); +@@ -2551,14 +2558,16 @@ restart_poll: + + if (adapter->state != VNIC_CLOSING) + replenish_rx_pool(adapter, &adapter->rx_pool[scrq_num]); +- + if (frames_processed < budget) { +- enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]); +- napi_complete_done(napi, frames_processed); +- if (pending_scrq(adapter, adapter->rx_scrq[scrq_num]) && +- napi_reschedule(napi)) { +- disable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]); +- goto restart_poll; ++ if (napi_complete_done(napi, frames_processed)) { ++ enable_scrq_irq(adapter, rx_scrq); ++ if (pending_scrq(adapter, rx_scrq)) { ++ rmb(); ++ if (napi_reschedule(napi)) { ++ disable_scrq_irq(adapter, rx_scrq); ++ goto restart_poll; ++ } ++ } + } + } + return frames_processed; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-Do-not-replenish-RX-buffers-after-every-poll.patch b/patches.suse/ibmvnic-Do-not-replenish-RX-buffers-after-every-poll.patch new file mode 100644 index 0000000..46fa0dc --- /dev/null +++ b/patches.suse/ibmvnic-Do-not-replenish-RX-buffers-after-every-poll.patch @@ -0,0 +1,42 @@ +From 41ed0a00ffcd903ece4304a4a65d95706115ffcb Mon Sep 17 00:00:00 2001 +From: "Dwip N. Banerjee" +Date: Wed, 18 Nov 2020 19:12:25 -0600 +Subject: [PATCH] ibmvnic: Do not replenish RX buffers after every polling loop + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.11-rc1 +Git-commit: 41ed0a00ffcd903ece4304a4a65d95706115ffcb + +Reduce the amount of time spent replenishing RX buffers by only doing +so once available buffers has fallen under a certain threshold, in this +case half of the total number of buffers, or if the polling loop exits +before the packets processed is less than its budget. Non-exhaustion of +NAPI budget implies lower incoming packet pressure, allowing the leeway +to refill the buffers in preparation for any impending burst. + +Signed-off-by: Dwip N. Banerjee +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 96df6d8fa277..9fe43ab0496d 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2537,7 +2537,10 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget) + frames_processed++; + } + +- if (adapter->state != VNIC_CLOSING) ++ if (adapter->state != VNIC_CLOSING && ++ ((atomic_read(&adapter->rx_pool[scrq_num].available) < ++ adapter->req_rx_add_entries_per_subcrq / 2) || ++ frames_processed < budget)) + replenish_rx_pool(adapter, &adapter->rx_pool[scrq_num]); + if (frames_processed < budget) { + if (napi_complete_done(napi, frames_processed)) { +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-Ensure-that-CRQ-entry-read-are-correctly-ord.patch b/patches.suse/ibmvnic-Ensure-that-CRQ-entry-read-are-correctly-ord.patch new file mode 100644 index 0000000..1d299a4 --- /dev/null +++ b/patches.suse/ibmvnic-Ensure-that-CRQ-entry-read-are-correctly-ord.patch @@ -0,0 +1,43 @@ +From e41aec79e62fa50f940cf222d1e9577f14e149dc Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Wed, 27 Jan 2021 19:34:42 -0600 +Subject: [PATCH] ibmvnic: Ensure that CRQ entry read are correctly ordered + +References: bsc#1184114 ltc#192237 bsc#1182485 ltc#191591 +Patch-mainline: v5.11-rc6 +Git-commit: e41aec79e62fa50f940cf222d1e9577f14e149dc + +Ensure that received Command-Response Queue (CRQ) entries are +properly read in order by the driver. dma_rmb barrier has +been added before accessing the CRQ descriptor to ensure +the entire descriptor is read before processing. + +Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") +Signed-off-by: Lijun Pan +Link: https://lore.kernel.org/r/20210128013442.88319-1-ljp@linux.ibm.com +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 9778c83150f1..8820c98ea891 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -5084,6 +5084,12 @@ static void ibmvnic_tasklet(struct tasklet_struct *t) + while (!done) { + /* Pull all the valid messages off the CRQ */ + while ((crq = ibmvnic_next_crq(adapter)) != NULL) { ++ /* This barrier makes sure ibmvnic_next_crq()'s ++ * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded ++ * before ibmvnic_handle_crq()'s ++ * switch(gen_crq->first) and switch(gen_crq->cmd). ++ */ ++ dma_rmb(); + ibmvnic_handle_crq(crq, adapter); + crq->generic.first = 0; + } +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-Ensure-that-SCRQ-entry-reads-are-correctly-o.patch b/patches.suse/ibmvnic-Ensure-that-SCRQ-entry-reads-are-correctly-o.patch new file mode 100644 index 0000000..e61d62d --- /dev/null +++ b/patches.suse/ibmvnic-Ensure-that-SCRQ-entry-reads-are-correctly-o.patch @@ -0,0 +1,71 @@ +From b71ec952234610b4f90ef17a2fdcb124d5320070 Mon Sep 17 00:00:00 2001 +From: Thomas Falcon +Date: Tue, 1 Dec 2020 09:52:10 -0600 +Subject: [PATCH] ibmvnic: Ensure that SCRQ entry reads are correctly ordered + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc7 +Git-commit: b71ec952234610b4f90ef17a2fdcb124d5320070 + +Ensure that received Subordinate Command-Response Queue (SCRQ) +entries are properly read in order by the driver. These queues +are used in the ibmvnic device to process RX buffer and TX completion +descriptors. dma_rmb barriers have been added after checking for a +pending descriptor to ensure the correct descriptor entry is checked +and after reading the SCRQ descriptor to ensure the entire +descriptor is read before processing. + +Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") +Signed-off-by: Thomas Falcon +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index bca1becd33f0..0e34c36c3e86 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2404,6 +2404,12 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget) + + if (!pending_scrq(adapter, adapter->rx_scrq[scrq_num])) + break; ++ /* The queue entry at the current index is peeked at above ++ * to determine that there is a valid descriptor awaiting ++ * processing. We want to be sure that the current slot ++ * holds a valid descriptor before reading its contents. ++ */ ++ dma_rmb(); + next = ibmvnic_next_scrq(adapter, adapter->rx_scrq[scrq_num]); + rx_buff = + (struct ibmvnic_rx_buff *)be64_to_cpu(next-> +@@ -3113,6 +3119,13 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter, + unsigned int pool = scrq->pool_index; + int num_entries = 0; + ++ /* The queue entry at the current index is peeked at above ++ * to determine that there is a valid descriptor awaiting ++ * processing. We want to be sure that the current slot ++ * holds a valid descriptor before reading its contents. ++ */ ++ dma_rmb(); ++ + next = ibmvnic_next_scrq(adapter, scrq); + for (i = 0; i < next->tx_comp.num_comps; i++) { + if (next->tx_comp.rcs[i]) { +@@ -3513,6 +3526,11 @@ static union sub_crq *ibmvnic_next_scrq(struct ibmvnic_adapter *adapter, + } + spin_unlock_irqrestore(&scrq->lock, flags); + ++ /* Ensure that the entire buffer descriptor has been ++ * loaded before reading its contents ++ */ ++ dma_rmb(); ++ + return entry; + } + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-Ensure-that-device-queue-memory-is-cache-lin.patch b/patches.suse/ibmvnic-Ensure-that-device-queue-memory-is-cache-lin.patch new file mode 100644 index 0000000..06e1fbd --- /dev/null +++ b/patches.suse/ibmvnic-Ensure-that-device-queue-memory-is-cache-lin.patch @@ -0,0 +1,111 @@ +From 9a87c3fca2372af3177cb454c7aa381c7080307f Mon Sep 17 00:00:00 2001 +From: "Dwip N. Banerjee" +Date: Wed, 18 Nov 2020 19:12:22 -0600 +Subject: [PATCH] ibmvnic: Ensure that device queue memory is cache-line + aligned + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.11-rc1 +Git-commit: 9a87c3fca2372af3177cb454c7aa381c7080307f + +PCI bus slowdowns were observed on IBM VNIC devices as a result +of partial cache line writes and non-cache aligned full cache line writes. +Ensure that packet data buffers are cache-line aligned to avoid these +slowdowns. + +Signed-off-by: Dwip N. Banerjee +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 9 ++++++--- + drivers/net/ethernet/ibm/ibmvnic.h | 10 +++++----- + 2 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index e9b0cb6dfd9d..85df91c9861b 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -498,7 +498,7 @@ static int reset_rx_pools(struct ibmvnic_adapter *adapter) + + if (rx_pool->buff_size != buff_size) { + free_long_term_buff(adapter, &rx_pool->long_term_buff); +- rx_pool->buff_size = buff_size; ++ rx_pool->buff_size = ALIGN(buff_size, L1_CACHE_BYTES); + rc = alloc_long_term_buff(adapter, + &rx_pool->long_term_buff, + rx_pool->size * +@@ -592,7 +592,7 @@ static int init_rx_pools(struct net_device *netdev) + + rx_pool->size = adapter->req_rx_add_entries_per_subcrq; + rx_pool->index = i; +- rx_pool->buff_size = buff_size; ++ rx_pool->buff_size = ALIGN(buff_size, L1_CACHE_BYTES); + rx_pool->active = 1; + + rx_pool->free_map = kcalloc(rx_pool->size, sizeof(int), +@@ -745,6 +745,7 @@ static int init_tx_pools(struct net_device *netdev) + { + struct ibmvnic_adapter *adapter = netdev_priv(netdev); + int tx_subcrqs; ++ u64 buff_size; + int i, rc; + + tx_subcrqs = adapter->num_active_tx_scrqs; +@@ -761,9 +762,11 @@ static int init_tx_pools(struct net_device *netdev) + adapter->num_active_tx_pools = tx_subcrqs; + + for (i = 0; i < tx_subcrqs; i++) { ++ buff_size = adapter->req_mtu + VLAN_HLEN; ++ buff_size = ALIGN(buff_size, L1_CACHE_BYTES); + rc = init_one_tx_pool(netdev, &adapter->tx_pool[i], + adapter->req_tx_entries_per_subcrq, +- adapter->req_mtu + VLAN_HLEN); ++ buff_size); + if (rc) { + release_tx_pools(adapter); + return rc; +diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h +index 16d892c3db0f..9911d926dd7f 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.h ++++ b/drivers/net/ethernet/ibm/ibmvnic.h +@@ -883,7 +883,7 @@ struct ibmvnic_sub_crq_queue { + atomic_t used; + char name[32]; + u64 handle; +-}; ++} ____cacheline_aligned; + + struct ibmvnic_long_term_buff { + unsigned char *buff; +@@ -907,7 +907,7 @@ struct ibmvnic_tx_pool { + struct ibmvnic_long_term_buff long_term_buff; + int num_buffers; + int buf_size; +-}; ++} ____cacheline_aligned; + + struct ibmvnic_rx_buff { + struct sk_buff *skb; +@@ -928,7 +928,7 @@ struct ibmvnic_rx_pool { + int next_alloc; + int active; + struct ibmvnic_long_term_buff long_term_buff; +-}; ++} ____cacheline_aligned; + + struct ibmvnic_vpd { + unsigned char *buff; +@@ -1015,8 +1015,8 @@ struct ibmvnic_adapter { + atomic_t running_cap_crqs; + bool wait_capability; + +- struct ibmvnic_sub_crq_queue **tx_scrq; +- struct ibmvnic_sub_crq_queue **rx_scrq; ++ struct ibmvnic_sub_crq_queue **tx_scrq ____cacheline_aligned; ++ struct ibmvnic_sub_crq_queue **rx_scrq ____cacheline_aligned; + + /* rx structs */ + struct napi_struct *napi; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-Fix-TX-completion-error-handling.patch b/patches.suse/ibmvnic-Fix-TX-completion-error-handling.patch new file mode 100644 index 0000000..12650a1 --- /dev/null +++ b/patches.suse/ibmvnic-Fix-TX-completion-error-handling.patch @@ -0,0 +1,42 @@ +From ba246c175116e2e8fa4fdfa5f8e958e086a9a818 Mon Sep 17 00:00:00 2001 +From: Thomas Falcon +Date: Tue, 1 Dec 2020 09:52:11 -0600 +Subject: [PATCH] ibmvnic: Fix TX completion error handling + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc7 +Git-commit: ba246c175116e2e8fa4fdfa5f8e958e086a9a818 + +TX completions received with an error return code are not +being processed properly. When an error code is seen, do not +proceed to the next completion before cleaning up the existing +entry's data structures. + +Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") +Signed-off-by: Thomas Falcon +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 0e34c36c3e86..da9450f18717 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -3128,11 +3128,9 @@ static int ibmvnic_complete_tx(struct ibmvnic_adapter *adapter, + + next = ibmvnic_next_scrq(adapter, scrq); + for (i = 0; i < next->tx_comp.num_comps; i++) { +- if (next->tx_comp.rcs[i]) { ++ if (next->tx_comp.rcs[i]) + dev_err(dev, "tx error %x\n", + next->tx_comp.rcs[i]); +- continue; +- } + index = be32_to_cpu(next->tx_comp.correlators[i]); + if (index & IBMVNIC_TSO_POOL_MASK) { + tx_pool = &adapter->tso_pool[pool]; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-Fix-possibly-uninitialized-old_num_tx_queues.patch b/patches.suse/ibmvnic-Fix-possibly-uninitialized-old_num_tx_queues.patch new file mode 100644 index 0000000..21a7498 --- /dev/null +++ b/patches.suse/ibmvnic-Fix-possibly-uninitialized-old_num_tx_queues.patch @@ -0,0 +1,54 @@ +From 6881b07fdd24850def1f03761c66042b983ff86e Mon Sep 17 00:00:00 2001 +From: Michal Suchanek +Date: Tue, 2 Mar 2021 20:47:47 +0100 +Subject: [PATCH] ibmvnic: Fix possibly uninitialized old_num_tx_queues + variable warning. + +References: bsc#1184114 ltc#192237 +Patch-mainline: v5.12-rc3 +Git-commit: 6881b07fdd24850def1f03761c66042b983ff86e + +GCC 7.5 reports: +../drivers/net/ethernet/ibm/ibmvnic.c: In function 'ibmvnic_reset_init': +../drivers/net/ethernet/ibm/ibmvnic.c:5373:51: warning: 'old_num_tx_queues' may be used uninitialized in this function [-Wmaybe-uninitialized] +../drivers/net/ethernet/ibm/ibmvnic.c:5373:6: warning: 'old_num_rx_queues' may be used uninitialized in this function [-Wmaybe-uninitialized] + +The variable is initialized only if(reset) and used only if(reset && +something) so this is a false positive. However, there is no reason to +not initialize the variables unconditionally avoiding the warning. + +Fixes: 635e442f4a48 ("ibmvnic: merge ibmvnic_reset_init and ibmvnic_init") +Signed-off-by: Michal Suchanek +Reviewed-by: Sukadev Bhattiprolu +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/ibm/ibmvnic.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 118a4bd3f877..3bad762083c5 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -5219,16 +5219,14 @@ static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter, bool reset) + { + struct device *dev = &adapter->vdev->dev; + unsigned long timeout = msecs_to_jiffies(20000); +- u64 old_num_rx_queues, old_num_tx_queues; ++ u64 old_num_rx_queues = adapter->req_rx_queues; ++ u64 old_num_tx_queues = adapter->req_tx_queues; + int rc; + + adapter->from_passive_init = false; + +- if (reset) { +- old_num_rx_queues = adapter->req_rx_queues; +- old_num_tx_queues = adapter->req_tx_queues; ++ if (reset) + reinit_completion(&adapter->init_done); +- } + + adapter->init_done_rc = 0; + rc = ibmvnic_send_crq_init(adapter); +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-Fix-use-after-free-of-VNIC-login-response-bu.patch b/patches.suse/ibmvnic-Fix-use-after-free-of-VNIC-login-response-bu.patch new file mode 100644 index 0000000..6a40222 --- /dev/null +++ b/patches.suse/ibmvnic-Fix-use-after-free-of-VNIC-login-response-bu.patch @@ -0,0 +1,226 @@ +From 507ebe6444a44d9b7676a36f24b4d5360ef79327 Mon Sep 17 00:00:00 2001 +From: Thomas Falcon +Date: Fri, 21 Aug 2020 13:39:01 -0500 +Subject: [PATCH] ibmvnic: Fix use-after-free of VNIC login response buffer + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: 507ebe6444a44d9b7676a36f24b4d5360ef79327 + +The login response buffer is freed after it is received +and parsed, but other functions in the driver still attempt +to read it, such as when the device is opened, causing the +Oops below. Store relevant information in the driver's +private data structures and use those instead. + +BUG: Kernel NULL pointer dereference on read at 0x00000010 +Faulting instruction address: 0xc00800000050a900 +Oops: Kernel access of bad area, sig: 11 [#1] +LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries +Modules linked in: pseries_rng rng_core vmx_crypto gf128mul binfmt_misc ip_tables x_tables ibmvnic ibmveth crc32c_vpmsum autofs4 +CPU: 7 PID: 759 Comm: NetworkManager Not tainted 5.9.0-rc1-00124-gd0a84e1f38d9 #14 +NIP: c00800000050a900 LR: c00800000050a8f0 CTR: 00000000005b1904 +REGS: c0000001ed746d20 TRAP: 0300 Not tainted (5.9.0-rc1-00124-gd0a84e1f38d9) +MSR: 800000000280b033 CR: 24428484 XER: 00000001 +CFAR: c0000000000101b0 DAR: 0000000000000010 DSISR: 40000000 IRQMASK: 0 +GPR00: c00800000050a8f0 c0000001ed746fb0 c008000000518e00 0000000000000000 +GPR04: 00000000000000c0 0000000000000080 0003c366c60c4501 0000000000000352 +GPR08: 000000000001f400 0000000000000010 0000000000000000 0000000000000000 +GPR12: 0001cf0000000019 c00000001ec97680 00000001003dfd40 0000010008dbb22c +GPR16: 0000000000000000 0000000000000000 0000000000000000 c000000000edb6c8 +GPR20: c000000004e73e00 c000000004fd2448 c000000004e6d700 c000000004fd2448 +GPR24: c000000004fd2400 c000000004a0cd20 c0000001ed961860 c0080000005029d8 +GPR28: 0000000000000000 0000000000000003 c000000004a0c000 0000000000000000 +NIP [c00800000050a900] init_resources+0x338/0xa00 [ibmvnic] +LR [c00800000050a8f0] init_resources+0x328/0xa00 [ibmvnic] +Call Trace: +[c0000001ed746fb0] [c00800000050a8f0] init_resources+0x328/0xa00 [ibmvnic] (unreliable) +[c0000001ed747090] [c00800000050b024] ibmvnic_open+0x5c/0x100 [ibmvnic] +[c0000001ed747110] [c000000000bdcc0c] __dev_open+0x17c/0x250 +[c0000001ed7471b0] [c000000000bdd1ec] __dev_change_flags+0x1dc/0x270 +[c0000001ed747260] [c000000000bdd2bc] dev_change_flags+0x3c/0x90 +[c0000001ed7472a0] [c000000000bf24b8] do_setlink+0x3b8/0x1280 +[c0000001ed747450] [c000000000bf8cc8] __rtnl_newlink+0x5a8/0x980 +[c0000001ed7478b0] [c000000000bf9110] rtnl_newlink+0x70/0xb0 +[c0000001ed7478f0] [c000000000bf07c4] rtnetlink_rcv_msg+0x364/0x460 +[c0000001ed747990] [c000000000c68b94] netlink_rcv_skb+0x84/0x1a0 +[c0000001ed747a00] [c000000000bef758] rtnetlink_rcv+0x28/0x40 +[c0000001ed747a20] [c000000000c68188] netlink_unicast+0x218/0x310 +[c0000001ed747a80] [c000000000c6848c] netlink_sendmsg+0x20c/0x4e0 +[c0000001ed747b20] [c000000000b9dc88] ____sys_sendmsg+0x158/0x360 +[c0000001ed747bb0] [c000000000ba1c88] ___sys_sendmsg+0x98/0xf0 +[c0000001ed747d10] [c000000000ba1db8] __sys_sendmsg+0x78/0x100 +[c0000001ed747dc0] [c000000000033820] system_call_exception+0x160/0x280 +[c0000001ed747e20] [c00000000000d740] system_call_common+0xf0/0x27c +Instruction dump: +3be00000 38810068 b1410076 3941006a 93e10072 fbea0000 b1210068 4bff9915 +eb9e0ca0 eabe0900 393c0010 3ab50048 <7fa04c2c> 7fba07b4 7b431764 7b4917a0 +---[ end trace fbc5949a28e103bd ]--- + +Fixes: f3ae59c0c015 ("ibmvnic: store RX and TX subCRQ handle array in ibmvnic_adapter struct") +Signed-off-by: Thomas Falcon +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 46 ++++++++++++++++-------------- + drivers/net/ethernet/ibm/ibmvnic.h | 1 + + 2 files changed, 25 insertions(+), 22 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 +@@ -297,8 +297,7 @@ static void deactivate_rx_pools(struct i + { + int i; + +- for (i = 0; i < be32_to_cpu(adapter->login_rsp_buf->num_rxadd_subcrqs); +- i++) ++ for (i = 0; i < adapter->num_active_rx_pools; i++) + adapter->rx_pool[i].active = 0; + } + +@@ -402,8 +401,7 @@ static void replenish_pools(struct ibmvn + int i; + + adapter->replenish_task_cycles++; +- for (i = 0; i < be32_to_cpu(adapter->login_rsp_buf->num_rxadd_subcrqs); +- i++) { ++ for (i = 0; i < adapter->num_active_rx_pools; i++) { + if (adapter->rx_pool[i].active) + replenish_rx_pool(adapter, &adapter->rx_pool[i]); + } +@@ -470,25 +468,23 @@ static int init_stats_token(struct ibmvn + static int reset_rx_pools(struct ibmvnic_adapter *adapter) + { + struct ibmvnic_rx_pool *rx_pool; ++ u64 buff_size; + int rx_scrqs; + int i, j, rc; +- u64 *size_array; + + if (!adapter->rx_pool) + return -1; + +- size_array = (u64 *)((u8 *)(adapter->login_rsp_buf) + +- be32_to_cpu(adapter->login_rsp_buf->off_rxadd_buff_size)); +- +- rx_scrqs = be32_to_cpu(adapter->login_rsp_buf->num_rxadd_subcrqs); ++ buff_size = adapter->cur_rx_buf_sz; ++ rx_scrqs = adapter->num_active_rx_pools; + for (i = 0; i < rx_scrqs; i++) { + rx_pool = &adapter->rx_pool[i]; + + netdev_dbg(adapter->netdev, "Re-setting rx_pool[%d]\n", i); + +- if (rx_pool->buff_size != be64_to_cpu(size_array[i])) { ++ if (rx_pool->buff_size != buff_size) { + free_long_term_buff(adapter, &rx_pool->long_term_buff); +- rx_pool->buff_size = be64_to_cpu(size_array[i]); ++ rx_pool->buff_size = buff_size; + rc = alloc_long_term_buff(adapter, + &rx_pool->long_term_buff, + rx_pool->size * +@@ -556,13 +552,11 @@ static int init_rx_pools(struct net_devi + struct device *dev = &adapter->vdev->dev; + struct ibmvnic_rx_pool *rx_pool; + int rxadd_subcrqs; +- u64 *size_array; ++ u64 buff_size; + int i, j; + +- rxadd_subcrqs = +- be32_to_cpu(adapter->login_rsp_buf->num_rxadd_subcrqs); +- size_array = (u64 *)((u8 *)(adapter->login_rsp_buf) + +- be32_to_cpu(adapter->login_rsp_buf->off_rxadd_buff_size)); ++ rxadd_subcrqs = adapter->num_active_rx_scrqs; ++ buff_size = adapter->cur_rx_buf_sz; + + adapter->rx_pool = kcalloc(rxadd_subcrqs, + sizeof(struct ibmvnic_rx_pool), +@@ -580,11 +574,11 @@ static int init_rx_pools(struct net_devi + netdev_dbg(adapter->netdev, + "Initializing rx_pool[%d], %lld buffs, %lld bytes each\n", + i, adapter->req_rx_add_entries_per_subcrq, +- be64_to_cpu(size_array[i])); ++ buff_size); + + rx_pool->size = adapter->req_rx_add_entries_per_subcrq; + rx_pool->index = i; +- rx_pool->buff_size = be64_to_cpu(size_array[i]); ++ rx_pool->buff_size = buff_size; + rx_pool->active = 1; + + rx_pool->free_map = kcalloc(rx_pool->size, sizeof(int), +@@ -650,7 +644,7 @@ static int reset_tx_pools(struct ibmvnic + if (!adapter->tx_pool) + return -1; + +- tx_scrqs = be32_to_cpu(adapter->login_rsp_buf->num_txsubm_subcrqs); ++ tx_scrqs = adapter->num_active_tx_pools; + for (i = 0; i < tx_scrqs; i++) { + rc = reset_one_tx_pool(adapter, &adapter->tso_pool[i]); + if (rc) +@@ -739,7 +733,7 @@ static int init_tx_pools(struct net_devi + int tx_subcrqs; + int i, rc; + +- tx_subcrqs = be32_to_cpu(adapter->login_rsp_buf->num_txsubm_subcrqs); ++ tx_subcrqs = adapter->num_active_tx_scrqs; + adapter->tx_pool = kcalloc(tx_subcrqs, + sizeof(struct ibmvnic_tx_pool), GFP_KERNEL); + if (!adapter->tx_pool) +@@ -4305,6 +4299,7 @@ static int handle_login_rsp(union ibmvni + u64 *rx_handle_array; + int num_tx_pools; + int num_rx_pools; ++ u64 *size_array; + int i; + + dma_unmap_single(dev, adapter->login_buf_token, adapter->login_buf_sz, +@@ -4339,6 +4334,12 @@ static int handle_login_rsp(union ibmvni + ibmvnic_remove(adapter->vdev); + return -EIO; + } ++ size_array = (u64 *)((u8 *)(adapter->login_rsp_buf) + ++ be32_to_cpu(adapter->login_rsp_buf->off_rxadd_buff_size)); ++ /* variable buffer sizes are not supported, so just read the ++ * first entry. ++ */ ++ adapter->cur_rx_buf_sz = be64_to_cpu(size_array[0]); + + num_tx_pools = be32_to_cpu(adapter->login_rsp_buf->num_txsubm_subcrqs); + num_rx_pools = be32_to_cpu(adapter->login_rsp_buf->num_rxadd_subcrqs); +@@ -4354,6 +4355,8 @@ static int handle_login_rsp(union ibmvni + for (i = 0; i < num_rx_pools; i++) + adapter->rx_scrq[i]->handle = rx_handle_array[i]; + ++ adapter->num_active_tx_scrqs = num_tx_pools; ++ adapter->num_active_rx_scrqs = num_rx_pools; + release_login_rsp_buffer(adapter); + release_login_buffer(adapter); + complete(&adapter->init_done); +@@ -5313,8 +5316,7 @@ static unsigned long ibmvnic_get_desired + for (i = 0; i < adapter->req_tx_queues + adapter->req_rx_queues; i++) + ret += 4 * PAGE_SIZE; /* the scrq message queue */ + +- for (i = 0; i < be32_to_cpu(adapter->login_rsp_buf->num_rxadd_subcrqs); +- i++) ++ for (i = 0; i < adapter->num_active_rx_pools; i++) + ret += adapter->rx_pool[i].size * + IOMMU_PAGE_ALIGN(adapter->rx_pool[i].buff_size, tbl); + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h +index d99820212edd..8da98794eda9 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.h ++++ b/drivers/net/ethernet/ibm/ibmvnic.h +@@ -1076,6 +1076,7 @@ struct ibmvnic_adapter { + u32 num_active_rx_napi; + u32 num_active_tx_scrqs; + u32 num_active_tx_pools; ++ u32 cur_rx_buf_sz; + + struct tasklet_struct tasklet; + enum vnic_state state; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-Harden-device-Command-Response-Queue-handsha.patch b/patches.suse/ibmvnic-Harden-device-Command-Response-Queue-handsha.patch new file mode 100644 index 0000000..f8f817c --- /dev/null +++ b/patches.suse/ibmvnic-Harden-device-Command-Response-Queue-handsha.patch @@ -0,0 +1,65 @@ +From 36a782fdcc2bfe39265ac4640f29404493b52a55 Mon Sep 17 00:00:00 2001 +From: Thomas Falcon +Date: Mon, 31 Aug 2020 11:59:57 -0500 +Subject: [PATCH] ibmvnic: Harden device Command Response Queue handshake + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: 36a782fdcc2bfe39265ac4640f29404493b52a55 + +In some cases, the device or firmware may be busy when the +driver attempts to perform the CRQ initialization handshake. +If the partner is busy, the hypervisor will return the H_CLOSED +return code. The aim of this patch is that, if the device is not +ready, to query the device a number of times, with a small wait +time in between queries. If all initialization requests fail, +the driver will remain in a dormant state, awaiting a signal +from the device that it is ready for operation. + +Signed-off-by: Thomas Falcon +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 86a83e53dce5..994358689de9 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -3566,14 +3566,31 @@ static int ibmvnic_send_crq(struct ibmvnic_adapter *adapter, + + static int ibmvnic_send_crq_init(struct ibmvnic_adapter *adapter) + { ++ struct device *dev = &adapter->vdev->dev; + union ibmvnic_crq crq; ++ int retries = 100; ++ int rc; + + memset(&crq, 0, sizeof(crq)); + crq.generic.first = IBMVNIC_CRQ_INIT_CMD; + crq.generic.cmd = IBMVNIC_CRQ_INIT; + netdev_dbg(adapter->netdev, "Sending CRQ init\n"); + +- return ibmvnic_send_crq(adapter, &crq); ++ do { ++ rc = ibmvnic_send_crq(adapter, &crq); ++ if (rc != H_CLOSED) ++ break; ++ retries--; ++ msleep(50); ++ ++ } while (retries > 0); ++ ++ if (rc) { ++ dev_err(dev, "Failed to send init request, rc = %d\n", rc); ++ return rc; ++ } ++ ++ return 0; + } + + static int send_version_xchg(struct ibmvnic_adapter *adapter) +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-Report-actual-backing-device-speed-and-duple.patch b/patches.suse/ibmvnic-Report-actual-backing-device-speed-and-duple.patch index ddb42f7..90823bf 100644 --- a/patches.suse/ibmvnic-Report-actual-backing-device-speed-and-duple.patch +++ b/patches.suse/ibmvnic-Report-actual-backing-device-speed-and-duple.patch @@ -17,6 +17,7 @@ Reported-by: Abdul Haleem Signed-off-by: Murilo Fossa Vicentini Reviewed-by: Mauro S. M. Rodrigues Signed-off-by: David S. Miller +[Fix 10GBP -> 10GBPS typo - fixed upstream with introducing 200GBPS] Acked-by: Michal Suchanek --- drivers/net/ethernet/ibm/ibmvnic.c | 93 ++++++++++++++++++++++++++---- @@ -24,7 +25,6 @@ Acked-by: Michal Suchanek 2 files changed, 94 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c -index 5ecbb1adcf3b..25b8e04ef11a 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -120,6 +120,7 @@ static int ibmvnic_reset_init(struct ibmvnic_adapter *); @@ -109,7 +109,7 @@ index 5ecbb1adcf3b..25b8e04ef11a 100644 + case IBMVNIC_1GBPS: + adapter->speed = SPEED_1000; + break; -+ case IBMVNIC_10GBP: ++ case IBMVNIC_10GBPS: + adapter->speed = SPEED_10000; + break; + case IBMVNIC_25GBPS: @@ -154,7 +154,6 @@ index 5ecbb1adcf3b..25b8e04ef11a 100644 netdev_err(netdev, "Got an invalid cmd type 0x%02x\n", gen_crq->cmd); diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h -index f2018dbebfa5..d5260a206708 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.h +++ b/drivers/net/ethernet/ibm/ibmvnic.h @@ -377,11 +377,16 @@ struct ibmvnic_phys_parms { @@ -170,7 +169,7 @@ index f2018dbebfa5..d5260a206708 100644 +#define IBMVNIC_10MBPS 0x40000000 +#define IBMVNIC_100MBPS 0x20000000 +#define IBMVNIC_1GBPS 0x10000000 -+#define IBMVNIC_10GBP 0x08000000 ++#define IBMVNIC_10GBPS 0x08000000 +#define IBMVNIC_40GBPS 0x04000000 +#define IBMVNIC_100GBPS 0x02000000 +#define IBMVNIC_25GBPS 0x01000000 diff --git a/patches.suse/ibmvnic-Use-netdev_alloc_skb-instead-of-alloc_skb-to.patch b/patches.suse/ibmvnic-Use-netdev_alloc_skb-instead-of-alloc_skb-to.patch new file mode 100644 index 0000000..4a0d2a1 --- /dev/null +++ b/patches.suse/ibmvnic-Use-netdev_alloc_skb-instead-of-alloc_skb-to.patch @@ -0,0 +1,36 @@ +From e552aa313bbaf118b5f7b7f7fba7e28593f8d90d Mon Sep 17 00:00:00 2001 +From: "Dwip N. Banerjee" +Date: Wed, 18 Nov 2020 19:12:24 -0600 +Subject: [PATCH] ibmvnic: Use netdev_alloc_skb instead of alloc_skb to + replenish RX buffers + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.11-rc1 +Git-commit: e552aa313bbaf118b5f7b7f7fba7e28593f8d90d + +Take advantage of the additional optimizations in netdev_alloc_skb when +allocating socket buffers to be used for packet reception. + +Signed-off-by: Dwip N. Banerjee +Acked-by: Lijun Pan +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +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 +@@ -332,7 +332,7 @@ static void replenish_rx_pool(struct ibm + return; + + for (i = 0; i < count; ++i) { +- skb = alloc_skb(pool->buff_size, GFP_ATOMIC); ++ skb = netdev_alloc_skb(adapter->netdev, pool->buff_size); + if (!skb) { + dev_err(dev, "Couldn't replenish rx buff\n"); + adapter->replenish_no_mem++; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-add-comments-for-spinlock_t-definitions.patch b/patches.suse/ibmvnic-add-comments-for-spinlock_t-definitions.patch new file mode 100644 index 0000000..cd5637e --- /dev/null +++ b/patches.suse/ibmvnic-add-comments-for-spinlock_t-definitions.patch @@ -0,0 +1,65 @@ +From a369d96ca55401c29ca05a41c3aa15d65948c599 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Thu, 11 Feb 2021 00:43:23 -0600 +Subject: [PATCH] ibmvnic: add comments for spinlock_t definitions + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: a369d96ca55401c29ca05a41c3aa15d65948c599 + +There are several spinlock_t definitions without comments. +Add them. + +Signed-off-by: Lijun Pan +Reviewed-by: Saeed Mahameed +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.h | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h +index c09c3f6bba9f..8f73a30a7593 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.h ++++ b/drivers/net/ethernet/ibm/ibmvnic.h +@@ -845,6 +845,7 @@ struct ibmvnic_crq_queue { + union ibmvnic_crq *msgs; + int size, cur; + dma_addr_t msg_token; ++ /* Used for serialization of msgs, cur */ + spinlock_t lock; + bool active; + char name[32]; +@@ -876,6 +877,7 @@ struct ibmvnic_sub_crq_queue { + unsigned int irq; + unsigned int pool_index; + int scrq_num; ++ /* Used for serialization of msgs, cur */ + spinlock_t lock; + struct sk_buff *rx_skb_top; + struct ibmvnic_adapter *adapter; +@@ -1080,9 +1082,12 @@ struct ibmvnic_adapter { + + struct tasklet_struct tasklet; + enum vnic_state state; ++ /* Used for serializatin of state field */ ++ spinlock_t state_lock; + enum ibmvnic_reset_reason reset_reason; +- spinlock_t rwi_lock; + struct list_head rwi_list; ++ /* Used for serialization of rwi_list */ ++ spinlock_t rwi_lock; + struct work_struct ibmvnic_reset; + struct delayed_work ibmvnic_delayed_reset; + unsigned long resetting; +@@ -1096,7 +1101,4 @@ struct ibmvnic_adapter { + + struct ibmvnic_tunables desired; + struct ibmvnic_tunables fallback; +- +- /* Used for serializatin of state field */ +- spinlock_t state_lock; + }; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-add-memory-barrier-to-protect-long-term-buff.patch b/patches.suse/ibmvnic-add-memory-barrier-to-protect-long-term-buff.patch new file mode 100644 index 0000000..c743835 --- /dev/null +++ b/patches.suse/ibmvnic-add-memory-barrier-to-protect-long-term-buff.patch @@ -0,0 +1,48 @@ +From 42557dab78edc8235aba5b441f2eb35f725a0ede Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Fri, 12 Feb 2021 20:48:40 -0600 +Subject: [PATCH] ibmvnic: add memory barrier to protect long term buffer + +References: bsc#1184114 ltc#192237 bsc#1182485 ltc#191591 +Patch-mainline: v5.12-rc1 +Git-commit: 42557dab78edc8235aba5b441f2eb35f725a0ede + +dma_rmb() barrier is added to load the long term buffer before copying +it to socket buffer; and dma_wmb() barrier is added to update the +long term buffer before it being accessed by VIOS (virtual i/o server). + +Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") +Signed-off-by: Lijun Pan +Acked-by: Thomas Falcon +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 621be6d2da97..f6402a20ba32 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -1700,6 +1700,9 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) + skb_copy_from_linear_data(skb, dst, skb->len); + } + ++ /* post changes to long_term_buff *dst before VIOS accessing it */ ++ dma_wmb(); ++ + tx_pool->consumer_index = + (tx_pool->consumer_index + 1) % tx_pool->num_buffers; + +@@ -2539,6 +2542,8 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget) + offset = be16_to_cpu(next->rx_comp.off_frame_data); + flags = next->rx_comp.flags; + skb = rx_buff->skb; ++ /* load long_term_buff before copying to skb */ ++ dma_rmb(); + skb_copy_to_linear_data(skb, rx_buff->data + offset, + length); + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-avoid-multiple-line-dereference.patch b/patches.suse/ibmvnic-avoid-multiple-line-dereference.patch new file mode 100644 index 0000000..980b76e --- /dev/null +++ b/patches.suse/ibmvnic-avoid-multiple-line-dereference.patch @@ -0,0 +1,70 @@ +From 914789acaaae890b930ebae37bcc6d8d76ea7166 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Thu, 11 Feb 2021 00:43:21 -0600 +Subject: [PATCH] ibmvnic: avoid multiple line dereference + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: 914789acaaae890b930ebae37bcc6d8d76ea7166 + +Fix the following checkpatch warning: +WARNING: Avoid multiple line dereference + +Signed-off-by: Lijun Pan +Reviewed-by: Saeed Mahameed +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 6c1fc73d66dc..67b09a53d7ac 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2440,9 +2440,8 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget) + if (!pending_scrq(adapter, rx_scrq)) + break; + next = ibmvnic_next_scrq(adapter, rx_scrq); +- rx_buff = +- (struct ibmvnic_rx_buff *)be64_to_cpu(next-> +- rx_comp.correlator); ++ rx_buff = (struct ibmvnic_rx_buff *) ++ be64_to_cpu(next->rx_comp.correlator); + /* do error checking */ + if (next->rx_comp.rc) { + netdev_dbg(netdev, "rx buffer returned with rc %x\n", +@@ -3855,15 +3854,15 @@ static int send_login(struct ibmvnic_adapter *adapter) + + for (i = 0; i < adapter->req_tx_queues; i++) { + if (adapter->tx_scrq[i]) { +- tx_list_p[i] = cpu_to_be64(adapter->tx_scrq[i]-> +- crq_num); ++ tx_list_p[i] = ++ cpu_to_be64(adapter->tx_scrq[i]->crq_num); + } + } + + for (i = 0; i < adapter->req_rx_queues; i++) { + if (adapter->rx_scrq[i]) { +- rx_list_p[i] = cpu_to_be64(adapter->rx_scrq[i]-> +- crq_num); ++ rx_list_p[i] = ++ cpu_to_be64(adapter->rx_scrq[i]->crq_num); + } + } + +@@ -4406,8 +4405,8 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq, + case PARTIALSUCCESS: + dev_info(dev, "req=%lld, rsp=%ld in %s queue, retrying.\n", + *req_value, +- (long)be64_to_cpu(crq->request_capability_rsp. +- number), name); ++ (long)be64_to_cpu(crq->request_capability_rsp.number), ++ name); + + if (be16_to_cpu(crq->request_capability_rsp.capability) == + REQ_MTU) { +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-compare-adapter-init_done_rc-with-more-reada.patch b/patches.suse/ibmvnic-compare-adapter-init_done_rc-with-more-reada.patch new file mode 100644 index 0000000..55c656c --- /dev/null +++ b/patches.suse/ibmvnic-compare-adapter-init_done_rc-with-more-reada.patch @@ -0,0 +1,36 @@ +From 4c5f6af051ccf1d9b8bccb0f887170594f6cb0cb Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Wed, 19 Aug 2020 17:52:23 -0500 +Subject: [PATCH] ibmvnic: compare adapter->init_done_rc with more readable + ibmvnic_rc_codes + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: 4c5f6af051ccf1d9b8bccb0f887170594f6cb0cb + +Instead of comparing (adapter->init_done_rc == 1), let it +be (adapter->init_done_rc == PARTIALSUCCESS). + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 589b411617e9..4b07eb5a3958 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -963,7 +963,7 @@ static int set_link_state(struct ibmvnic_adapter *adapter, u8 link_state) + return -1; + } + +- if (adapter->init_done_rc == 1) { ++ if (adapter->init_done_rc == PARTIALSUCCESS) { + /* Partuial success, delay and re-send */ + mdelay(1000); + resend = true; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-create-send_control_ip_offload.patch b/patches.suse/ibmvnic-create-send_control_ip_offload.patch new file mode 100644 index 0000000..260df06 --- /dev/null +++ b/patches.suse/ibmvnic-create-send_control_ip_offload.patch @@ -0,0 +1,196 @@ +From 46899bde9f42a965158bb9434672fc66834fb8e6 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Sun, 27 Sep 2020 20:13:30 -0500 +Subject: [PATCH] ibmvnic: create send_control_ip_offload + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: 46899bde9f42a965158bb9434672fc66834fb8e6 + +Factor send_control_ip_offload out of handle_query_ip_offload_rsp. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 150 +++++++++++++++-------------- + 1 file changed, 80 insertions(+), 70 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 7fba4860a2c2..1f7fe6b3dd5a 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -3981,6 +3981,85 @@ static void send_query_ip_offload(struct ibmvnic_adapter *adapter) + ibmvnic_send_crq(adapter, &crq); + } + ++static void send_control_ip_offload(struct ibmvnic_adapter *adapter) ++{ ++ struct ibmvnic_control_ip_offload_buffer *ctrl_buf = &adapter->ip_offload_ctrl; ++ struct ibmvnic_query_ip_offload_buffer *buf = &adapter->ip_offload_buf; ++ struct device *dev = &adapter->vdev->dev; ++ netdev_features_t old_hw_features = 0; ++ union ibmvnic_crq crq; ++ ++ adapter->ip_offload_ctrl_tok = ++ dma_map_single(dev, ++ ctrl_buf, ++ sizeof(adapter->ip_offload_ctrl), ++ DMA_TO_DEVICE); ++ ++ if (dma_mapping_error(dev, adapter->ip_offload_ctrl_tok)) { ++ dev_err(dev, "Couldn't map ip offload control buffer\n"); ++ return; ++ } ++ ++ ctrl_buf->len = cpu_to_be32(sizeof(adapter->ip_offload_ctrl)); ++ ctrl_buf->version = cpu_to_be32(INITIAL_VERSION_IOB); ++ ctrl_buf->ipv4_chksum = buf->ipv4_chksum; ++ ctrl_buf->ipv6_chksum = buf->ipv6_chksum; ++ ctrl_buf->tcp_ipv4_chksum = buf->tcp_ipv4_chksum; ++ ctrl_buf->udp_ipv4_chksum = buf->udp_ipv4_chksum; ++ ctrl_buf->tcp_ipv6_chksum = buf->tcp_ipv6_chksum; ++ ctrl_buf->udp_ipv6_chksum = buf->udp_ipv6_chksum; ++ ctrl_buf->large_tx_ipv4 = buf->large_tx_ipv4; ++ ctrl_buf->large_tx_ipv6 = buf->large_tx_ipv6; ++ ++ /* large_rx disabled for now, additional features needed */ ++ ctrl_buf->large_rx_ipv4 = 0; ++ ctrl_buf->large_rx_ipv6 = 0; ++ ++ if (adapter->state != VNIC_PROBING) { ++ old_hw_features = adapter->netdev->hw_features; ++ adapter->netdev->hw_features = 0; ++ } ++ ++ adapter->netdev->hw_features = NETIF_F_SG | NETIF_F_GSO | NETIF_F_GRO; ++ ++ if (buf->tcp_ipv4_chksum || buf->udp_ipv4_chksum) ++ adapter->netdev->hw_features |= NETIF_F_IP_CSUM; ++ ++ if (buf->tcp_ipv6_chksum || buf->udp_ipv6_chksum) ++ adapter->netdev->hw_features |= NETIF_F_IPV6_CSUM; ++ ++ if ((adapter->netdev->features & ++ (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM))) ++ adapter->netdev->hw_features |= NETIF_F_RXCSUM; ++ ++ if (buf->large_tx_ipv4) ++ adapter->netdev->hw_features |= NETIF_F_TSO; ++ if (buf->large_tx_ipv6) ++ adapter->netdev->hw_features |= NETIF_F_TSO6; ++ ++ if (adapter->state == VNIC_PROBING) { ++ adapter->netdev->features |= adapter->netdev->hw_features; ++ } else if (old_hw_features != adapter->netdev->hw_features) { ++ netdev_features_t tmp = 0; ++ ++ /* disable features no longer supported */ ++ adapter->netdev->features &= adapter->netdev->hw_features; ++ /* turn on features now supported if previously enabled */ ++ tmp = (old_hw_features ^ adapter->netdev->hw_features) & ++ adapter->netdev->hw_features; ++ adapter->netdev->features |= ++ tmp & adapter->netdev->wanted_features; ++ } ++ ++ memset(&crq, 0, sizeof(crq)); ++ crq.control_ip_offload.first = IBMVNIC_CRQ_CMD; ++ crq.control_ip_offload.cmd = CONTROL_IP_OFFLOAD; ++ crq.control_ip_offload.len = ++ cpu_to_be32(sizeof(adapter->ip_offload_ctrl)); ++ crq.control_ip_offload.ioba = cpu_to_be32(adapter->ip_offload_ctrl_tok); ++ ibmvnic_send_crq(adapter, &crq); ++} ++ + static void handle_vpd_size_rsp(union ibmvnic_crq *crq, + struct ibmvnic_adapter *adapter) + { +@@ -4050,8 +4129,6 @@ static void handle_query_ip_offload_rsp(struct ibmvnic_adapter *adapter) + { + struct device *dev = &adapter->vdev->dev; + struct ibmvnic_query_ip_offload_buffer *buf = &adapter->ip_offload_buf; +- netdev_features_t old_hw_features = 0; +- union ibmvnic_crq crq; + int i; + + dma_unmap_single(dev, adapter->ip_offload_tok, +@@ -4101,74 +4178,7 @@ static void handle_query_ip_offload_rsp(struct ibmvnic_adapter *adapter) + netdev_dbg(adapter->netdev, "off_ipv6_ext_hd = %d\n", + buf->off_ipv6_ext_headers); + +- adapter->ip_offload_ctrl_tok = +- dma_map_single(dev, &adapter->ip_offload_ctrl, +- sizeof(adapter->ip_offload_ctrl), DMA_TO_DEVICE); +- +- if (dma_mapping_error(dev, adapter->ip_offload_ctrl_tok)) { +- dev_err(dev, "Couldn't map ip offload control buffer\n"); +- return; +- } +- +- adapter->ip_offload_ctrl.len = +- cpu_to_be32(sizeof(adapter->ip_offload_ctrl)); +- adapter->ip_offload_ctrl.version = cpu_to_be32(INITIAL_VERSION_IOB); +- adapter->ip_offload_ctrl.ipv4_chksum = buf->ipv4_chksum; +- adapter->ip_offload_ctrl.ipv6_chksum = buf->ipv6_chksum; +- adapter->ip_offload_ctrl.tcp_ipv4_chksum = buf->tcp_ipv4_chksum; +- adapter->ip_offload_ctrl.udp_ipv4_chksum = buf->udp_ipv4_chksum; +- adapter->ip_offload_ctrl.tcp_ipv6_chksum = buf->tcp_ipv6_chksum; +- adapter->ip_offload_ctrl.udp_ipv6_chksum = buf->udp_ipv6_chksum; +- adapter->ip_offload_ctrl.large_tx_ipv4 = buf->large_tx_ipv4; +- adapter->ip_offload_ctrl.large_tx_ipv6 = buf->large_tx_ipv6; +- +- /* large_rx disabled for now, additional features needed */ +- adapter->ip_offload_ctrl.large_rx_ipv4 = 0; +- adapter->ip_offload_ctrl.large_rx_ipv6 = 0; +- +- if (adapter->state != VNIC_PROBING) { +- old_hw_features = adapter->netdev->hw_features; +- adapter->netdev->hw_features = 0; +- } +- +- adapter->netdev->hw_features = NETIF_F_SG | NETIF_F_GSO | NETIF_F_GRO; +- +- if (buf->tcp_ipv4_chksum || buf->udp_ipv4_chksum) +- adapter->netdev->hw_features |= NETIF_F_IP_CSUM; +- +- if (buf->tcp_ipv6_chksum || buf->udp_ipv6_chksum) +- adapter->netdev->hw_features |= NETIF_F_IPV6_CSUM; +- +- if ((adapter->netdev->features & +- (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM))) +- adapter->netdev->hw_features |= NETIF_F_RXCSUM; +- +- if (buf->large_tx_ipv4) +- adapter->netdev->hw_features |= NETIF_F_TSO; +- if (buf->large_tx_ipv6) +- adapter->netdev->hw_features |= NETIF_F_TSO6; +- +- if (adapter->state == VNIC_PROBING) { +- adapter->netdev->features |= adapter->netdev->hw_features; +- } else if (old_hw_features != adapter->netdev->hw_features) { +- netdev_features_t tmp = 0; +- +- /* disable features no longer supported */ +- adapter->netdev->features &= adapter->netdev->hw_features; +- /* turn on features now supported if previously enabled */ +- tmp = (old_hw_features ^ adapter->netdev->hw_features) & +- adapter->netdev->hw_features; +- adapter->netdev->features |= +- tmp & adapter->netdev->wanted_features; +- } +- +- memset(&crq, 0, sizeof(crq)); +- crq.control_ip_offload.first = IBMVNIC_CRQ_CMD; +- crq.control_ip_offload.cmd = CONTROL_IP_OFFLOAD; +- crq.control_ip_offload.len = +- cpu_to_be32(sizeof(adapter->ip_offload_ctrl)); +- crq.control_ip_offload.ioba = cpu_to_be32(adapter->ip_offload_ctrl_tok); +- ibmvnic_send_crq(adapter, &crq); ++ send_control_ip_offload(adapter); + } + + static const char *ibmvnic_fw_err_cause(u16 cause) +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-create-send_query_ip_offload.patch b/patches.suse/ibmvnic-create-send_query_ip_offload.patch new file mode 100644 index 0000000..eec75d9 --- /dev/null +++ b/patches.suse/ibmvnic-create-send_query_ip_offload.patch @@ -0,0 +1,93 @@ +From 16e811fe0fc6b8344785feb2ab8c927685dca08e Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Sun, 27 Sep 2020 20:13:29 -0500 +Subject: [PATCH] ibmvnic: create send_query_ip_offload + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: 16e811fe0fc6b8344785feb2ab8c927685dca08e + +Factor send_query_ip_offload out of handle_request_cap_rsp to +pair with handle_query_ip_offload_rsp. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 52 +++++++++++++++++------------- + 1 file changed, 29 insertions(+), 23 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index b6a9b7e00920..7fba4860a2c2 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -3953,6 +3953,34 @@ static void send_query_cap(struct ibmvnic_adapter *adapter) + ibmvnic_send_crq(adapter, &crq); + } + ++static void send_query_ip_offload(struct ibmvnic_adapter *adapter) ++{ ++ int buf_sz = sizeof(struct ibmvnic_query_ip_offload_buffer); ++ struct device *dev = &adapter->vdev->dev; ++ union ibmvnic_crq crq; ++ ++ adapter->ip_offload_tok = ++ dma_map_single(dev, ++ &adapter->ip_offload_buf, ++ buf_sz, ++ DMA_FROM_DEVICE); ++ ++ if (dma_mapping_error(dev, adapter->ip_offload_tok)) { ++ if (!firmware_has_feature(FW_FEATURE_CMO)) ++ dev_err(dev, "Couldn't map offload buffer\n"); ++ return; ++ } ++ ++ memset(&crq, 0, sizeof(crq)); ++ crq.query_ip_offload.first = IBMVNIC_CRQ_CMD; ++ crq.query_ip_offload.cmd = QUERY_IP_OFFLOAD; ++ crq.query_ip_offload.len = cpu_to_be32(buf_sz); ++ crq.query_ip_offload.ioba = ++ cpu_to_be32(adapter->ip_offload_tok); ++ ++ ibmvnic_send_crq(adapter, &crq); ++} ++ + static void handle_vpd_size_rsp(union ibmvnic_crq *crq, + struct ibmvnic_adapter *adapter) + { +@@ -4276,30 +4304,8 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq, + + /* Done receiving requested capabilities, query IP offload support */ + if (atomic_read(&adapter->running_cap_crqs) == 0) { +- union ibmvnic_crq newcrq; +- int buf_sz = sizeof(struct ibmvnic_query_ip_offload_buffer); +- struct ibmvnic_query_ip_offload_buffer *ip_offload_buf = +- &adapter->ip_offload_buf; +- + adapter->wait_capability = false; +- adapter->ip_offload_tok = dma_map_single(dev, ip_offload_buf, +- buf_sz, +- DMA_FROM_DEVICE); +- +- if (dma_mapping_error(dev, adapter->ip_offload_tok)) { +- if (!firmware_has_feature(FW_FEATURE_CMO)) +- dev_err(dev, "Couldn't map offload buffer\n"); +- return; +- } +- +- memset(&newcrq, 0, sizeof(newcrq)); +- newcrq.query_ip_offload.first = IBMVNIC_CRQ_CMD; +- newcrq.query_ip_offload.cmd = QUERY_IP_OFFLOAD; +- newcrq.query_ip_offload.len = cpu_to_be32(buf_sz); +- newcrq.query_ip_offload.ioba = +- cpu_to_be32(adapter->ip_offload_tok); +- +- ibmvnic_send_crq(adapter, &newcrq); ++ send_query_ip_offload(adapter); + } + } + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-fix-NULL-pointer-dereference-in-ibmvic_reset.patch b/patches.suse/ibmvnic-fix-NULL-pointer-dereference-in-ibmvic_reset.patch new file mode 100644 index 0000000..956cd20 --- /dev/null +++ b/patches.suse/ibmvnic-fix-NULL-pointer-dereference-in-ibmvic_reset.patch @@ -0,0 +1,71 @@ +From 0e435befaea45f7ea58682eecab5e37e05b2ce65 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Mon, 23 Nov 2020 13:35:46 -0600 +Subject: [PATCH] ibmvnic: fix NULL pointer dereference in ibmvic_reset_crq + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc6 +Git-commit: 0e435befaea45f7ea58682eecab5e37e05b2ce65 + +crq->msgs could be NULL if the previous reset did not complete after +freeing crq->msgs. Check for NULL before dereferencing them. + +Snippet of call trace: +... +ibmvnic 30000003 env3 (unregistering): Releasing sub-CRQ +ibmvnic 30000003 env3 (unregistering): Releasing CRQ +BUG: Kernel NULL pointer dereference on read at 0x00000000 +Faulting instruction address: 0xc0000000000c1a30 +Oops: Kernel access of bad area, sig: 11 [#1] +LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries +Modules linked in: ibmvnic(E-) rpadlpar_io rpaphp xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 nft_compat nft_counter nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables xsk_diag tcp_diag udp_diag tun raw_diag inet_diag unix_diag bridge af_packet_diag netlink_diag stp llc rfkill sunrpc pseries_rng xts vmx_crypto uio_pdrv_genirq uio binfmt_misc ip_tables xfs libcrc32c sd_mod t10_pi sg ibmvscsi ibmveth scsi_transport_srp dm_mirror dm_region_hash dm_log dm_mod [last unloaded: ibmvnic] +CPU: 20 PID: 8426 Comm: kworker/20:0 Tainted: G E 5.10.0-rc1+ #12 +Workqueue: events __ibmvnic_reset [ibmvnic] +NIP: c0000000000c1a30 LR: c008000001b00c18 CTR: 0000000000000400 +REGS: c00000000d05b7a0 TRAP: 0380 Tainted: G E (5.10.0-rc1+) +MSR: 800000000280b033 CR: 44002480 XER: 20040000 +CFAR: c0000000000c19ec IRQMASK: 0 +GPR00: 0000000000000400 c00000000d05ba30 c008000001b17c00 0000000000000000 +GPR04: 0000000000000000 0000000000000000 0000000000000000 00000000000001e2 +GPR08: 000000000001f400 ffffffffffffd950 0000000000000000 c008000001b0b280 +GPR12: c0000000000c19c8 c00000001ec72e00 c00000000019a778 c00000002647b440 +GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 +GPR20: 0000000000000006 0000000000000001 0000000000000003 0000000000000002 +GPR24: 0000000000001000 c008000001b0d570 0000000000000005 c00000007ab5d550 +GPR28: c00000007ab5c000 c000000032fcf848 c00000007ab5cc00 c000000032fcf800 +NIP [c0000000000c1a30] memset+0x68/0x104 +LR [c008000001b00c18] ibmvnic_reset_crq+0x70/0x110 [ibmvnic] +Call Trace: +[c00000000d05ba30] [0000000000000800] 0x800 (unreliable) +[c00000000d05bab0] [c008000001b0a930] do_reset.isra.40+0x224/0x634 [ibmvnic] +[c00000000d05bb80] [c008000001b08574] __ibmvnic_reset+0x17c/0x3c0 [ibmvnic] +[c00000000d05bc50] [c00000000018d9ac] process_one_work+0x2cc/0x800 +[c00000000d05bd20] [c00000000018df58] worker_thread+0x78/0x520 +[c00000000d05bdb0] [c00000000019a934] kthread+0x1c4/0x1d0 +[c00000000d05be20] [c00000000000d5d0] ret_from_kernel_thread+0x5c/0x6c + +Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") +Signed-off-by: Lijun Pan +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index db4a8e17477c..26ba07df404e 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -4973,6 +4973,9 @@ static int ibmvnic_reset_crq(struct ibmvnic_adapter *adapter) + } while (rc == H_BUSY || H_IS_LONG_BUSY(rc)); + + /* Clean out the queue */ ++ if (!crq->msgs) ++ return -EINVAL; ++ + memset(crq->msgs, 0, PAGE_SIZE); + crq->cur = 0; + crq->active = false; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-fix-a-race-between-open-and-reset.patch b/patches.suse/ibmvnic-fix-a-race-between-open-and-reset.patch index 766aa80..3906e66 100644 --- a/patches.suse/ibmvnic-fix-a-race-between-open-and-reset.patch +++ b/patches.suse/ibmvnic-fix-a-race-between-open-and-reset.patch @@ -43,9 +43,10 @@ Acked-by: Michal Suchanek drivers/net/ethernet/ibm/ibmvnic.c | 63 ++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 8 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 -@@ -1202,12 +1202,25 @@ static int ibmvnic_open(struct net_devic +@@ -1172,12 +1172,25 @@ static int ibmvnic_open(struct net_device *netdev) struct ibmvnic_adapter *adapter = netdev_priv(netdev); int rc; @@ -75,13 +76,13 @@ Acked-by: Michal Suchanek } if (adapter->state != VNIC_CLOSED) { -@@ -1227,10 +1240,12 @@ static int ibmvnic_open(struct net_devic +@@ -1196,10 +1209,12 @@ static int ibmvnic_open(struct net_device *netdev) + rc = __ibmvnic_open(netdev); out: - /* -- * If open fails due to a pending failover, set device state and +- /* If open fails due to a pending failover, set device state and - * return. Device operation will be handled by reset routine. -+ * If open failed and there is a pending failover or in-progress reset, ++ /* If open failed and there is a pending failover or in-progress reset, + * set device state and return. Device operation will be handled by + * reset routine. See also comments above regarding rtnl. */ @@ -91,7 +92,7 @@ Acked-by: Michal Suchanek adapter->state = VNIC_OPEN; rc = 0; } -@@ -2043,6 +2058,14 @@ static int do_reset(struct ibmvnic_adapt +@@ -1928,6 +1943,14 @@ static int do_reset(struct ibmvnic_adapter *adapter, if (rwi->reset_reason == VNIC_RESET_FAILOVER) adapter->failover_pending = false; @@ -104,34 +105,38 @@ Acked-by: Michal Suchanek + } + netif_carrier_off(netdev); - adapter->reset_reason = rwi->reset_reason; -@@ -2069,7 +2092,24 @@ static int do_reset(struct ibmvnic_adapt - if (rc) - goto out; + old_num_rx_queues = adapter->req_rx_queues; +@@ -1958,11 +1981,27 @@ static int do_reset(struct ibmvnic_adapter *adapter, + if (rc) + goto out; -+ if (adapter->state == VNIC_OPEN) { -+ /* When we dropped rtnl, ibmvnic_open() got -+ * it and noticed that we are resetting and -+ * set the adapter state to OPEN. Update our -+ * new "target" state, and resume the reset -+ * from VNIC_CLOSING state. -+ */ -+ netdev_dbg(netdev, -+ "Open changed state from %d, updating.\n", -+ reset_state); -+ reset_state = VNIC_OPEN; -+ adapter->state = VNIC_CLOSING; -+ } ++ if (adapter->state == VNIC_OPEN) { ++ /* When we dropped rtnl, ibmvnic_open() got ++ * it and noticed that we are resetting and ++ * set the adapter state to OPEN. Update our ++ * new "target" state, and resume the reset ++ * from VNIC_CLOSING state. ++ */ ++ netdev_dbg(netdev, ++ "Open changed state from %d, updating.\n", ++ reset_state); ++ reset_state = VNIC_OPEN; ++ adapter->state = VNIC_CLOSING; ++ } + - if (adapter->state != VNIC_CLOSING) { -+ /* If someone else changed the adapter state -+ * when we dropped the rtnl, fail the reset -+ */ - rc = -1; - goto out; + if (adapter->state != VNIC_CLOSING) { ++ /* If someone else changed the adapter state ++ * when we dropped the rtnl, fail the reset ++ */ + rc = -1; + goto out; + } +- + adapter->state = VNIC_CLOSED; } -@@ -2205,6 +2245,14 @@ static int do_hard_reset(struct ibmvnic_ + } +@@ -2106,6 +2145,14 @@ static int do_hard_reset(struct ibmvnic_adapter *adapter, netdev_dbg(adapter->netdev, "Hard resetting driver (%d)\n", rwi->reset_reason); @@ -146,3 +151,6 @@ Acked-by: Michal Suchanek netif_carrier_off(netdev); adapter->reset_reason = rwi->reset_reason; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-fix-block-comments.patch b/patches.suse/ibmvnic-fix-block-comments.patch new file mode 100644 index 0000000..a942136 --- /dev/null +++ b/patches.suse/ibmvnic-fix-block-comments.patch @@ -0,0 +1,67 @@ +From bab08bedcdc33a644682197f3c88a6e56c325fcf Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Thu, 11 Feb 2021 00:43:19 -0600 +Subject: [PATCH] ibmvnic: fix block comments + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: bab08bedcdc33a644682197f3c88a6e56c325fcf + +Fix the following checkpatch warning: +WARNING: networking block comments don't use an empty /* line, use /* Comment... + +Signed-off-by: Lijun Pan +Reviewed-by: Saeed Mahameed +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 55970f02d9da..5c6f6a7b2e3f 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -1221,8 +1221,7 @@ static int ibmvnic_open(struct net_device *netdev) + rc = __ibmvnic_open(netdev); + + out: +- /* +- * If open fails due to a pending failover, set device state and ++ /* If open fails due to a pending failover, set device state and + * return. Device operation will be handled by reset routine. + */ + if (rc && adapter->failover_pending) { +@@ -1946,8 +1945,7 @@ static int do_reset(struct ibmvnic_adapter *adapter, + if (!(adapter->reset_reason == VNIC_RESET_CHANGE_PARAM)) + rtnl_lock(); + +- /* +- * Now that we have the rtnl lock, clear any pending failover. ++ /* Now that we have the rtnl lock, clear any pending failover. + * This will ensure ibmvnic_open() has either completed or will + * block until failover is complete. + */ +@@ -2249,8 +2247,7 @@ static void __ibmvnic_reset(struct work_struct *work) + spin_unlock_irqrestore(&adapter->state_lock, flags); + + if (adapter->force_reset_recovery) { +- /* +- * Since we are doing a hard reset now, clear the ++ /* Since we are doing a hard reset now, clear the + * failover_pending flag so we don't ignore any + * future MOBILITY or other resets. + */ +@@ -2322,8 +2319,7 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, + unsigned long flags; + int ret; + +- /* +- * If failover is pending don't schedule any other reset. ++ /* If failover is pending don't schedule any other reset. + * Instead let the failover complete. If there is already a + * a failover reset scheduled, we will detect and drop the + * duplicate reset when walking the ->rwi_list below. +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-fix-braces.patch b/patches.suse/ibmvnic-fix-braces.patch new file mode 100644 index 0000000..99db5fe --- /dev/null +++ b/patches.suse/ibmvnic-fix-braces.patch @@ -0,0 +1,38 @@ +From f78afaace636dfa89501be99fc5b431d85a0f639 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Thu, 11 Feb 2021 00:43:20 -0600 +Subject: [PATCH] ibmvnic: fix braces + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: f78afaace636dfa89501be99fc5b431d85a0f639 + +Fix the following checkpatch warning: +WARNING: braces {} are not necessary for single statement blocks + +Signed-off-by: Lijun Pan +Reviewed-by: Saeed Mahameed +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 5c6f6a7b2e3f..6c1fc73d66dc 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2040,9 +2040,8 @@ static int do_reset(struct ibmvnic_adapter *adapter, + } + + rc = ibmvnic_login(netdev); +- if (rc) { ++ if (rc) + goto out; +- } + + if (adapter->reset_reason == VNIC_RESET_CHANGE_PARAM) { + rc = init_resources(adapter); +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-fix-miscellaneous-checks.patch b/patches.suse/ibmvnic-fix-miscellaneous-checks.patch new file mode 100644 index 0000000..5aeba94 --- /dev/null +++ b/patches.suse/ibmvnic-fix-miscellaneous-checks.patch @@ -0,0 +1,106 @@ +From 91dc5d2553fbf20e2e8384ac997f278a50c70561 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Thu, 11 Feb 2021 00:43:22 -0600 +Subject: [PATCH] ibmvnic: fix miscellaneous checks + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: 91dc5d2553fbf20e2e8384ac997f278a50c70561 + +Fix the following checkpatch checks: +CHECK: Macro argument 'off' may be better as '(off)' to +avoid precedence issues +CHECK: Alignment should match open parenthesis +CHECK: multiple assignments should be avoided +CHECK: Blank lines aren't necessary before a close brace '}' +CHECK: Please use a blank line after function/struct/union/enum +declarations +CHECK: Unnecessary parentheses around 'rc != H_FUNCTION' + +Signed-off-by: Lijun Pan +Reviewed-by: Saeed Mahameed +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 67b09a53d7ac..0c27a1f9663a 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -115,7 +115,7 @@ struct ibmvnic_stat { + + #define IBMVNIC_STAT_OFF(stat) (offsetof(struct ibmvnic_adapter, stats) + \ + offsetof(struct ibmvnic_statistics, stat)) +-#define IBMVNIC_GET_STAT(a, off) (*((u64 *)(((unsigned long)(a)) + off))) ++#define IBMVNIC_GET_STAT(a, off) (*((u64 *)(((unsigned long)(a)) + (off)))) + + static const struct ibmvnic_stat ibmvnic_stats[] = { + {"rx_packets", IBMVNIC_STAT_OFF(rx_packets)}, +@@ -2069,14 +2069,14 @@ static int do_reset(struct ibmvnic_adapter *adapter, + rc = reset_tx_pools(adapter); + if (rc) { + netdev_dbg(adapter->netdev, "reset tx pools failed (%d)\n", +- rc); ++ rc); + goto out; + } + + rc = reset_rx_pools(adapter); + if (rc) { + netdev_dbg(adapter->netdev, "reset rx pools failed (%d)\n", +- rc); ++ rc); + goto out; + } + } +@@ -2333,7 +2333,8 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, + + if (adapter->state == VNIC_PROBING) { + netdev_warn(netdev, "Adapter reset during probe\n"); +- ret = adapter->init_done_rc = EAGAIN; ++ adapter->init_done_rc = EAGAIN; ++ ret = EAGAIN; + goto err; + } + +@@ -2746,7 +2747,6 @@ static int ibmvnic_set_channels(struct net_device *netdev, + channels->rx_count, channels->tx_count, + adapter->req_rx_queues, adapter->req_tx_queues); + return ret; +- + } + + static void ibmvnic_get_strings(struct net_device *dev, u32 stringset, u8 *data) +@@ -2835,8 +2835,8 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev, + return; + + for (i = 0; i < ARRAY_SIZE(ibmvnic_stats); i++) +- data[i] = be64_to_cpu(IBMVNIC_GET_STAT(adapter, +- ibmvnic_stats[i].offset)); ++ data[i] = be64_to_cpu(IBMVNIC_GET_STAT ++ (adapter, ibmvnic_stats[i].offset)); + + for (j = 0; j < adapter->req_tx_queues; j++) { + data[i] = adapter->tx_stats_buffers[j].packets; +@@ -2876,6 +2876,7 @@ static int ibmvnic_set_priv_flags(struct net_device *netdev, u32 flags) + + return 0; + } ++ + static const struct ethtool_ops ibmvnic_ethtool_ops = { + .get_drvinfo = ibmvnic_get_drvinfo, + .get_msglevel = ibmvnic_get_msglevel, +@@ -3145,7 +3146,7 @@ static int enable_scrq_irq(struct ibmvnic_adapter *adapter, + /* H_EOI would fail with rc = H_FUNCTION when running + * in XIVE mode which is expected, but not an error. + */ +- if (rc && (rc != H_FUNCTION)) ++ if (rc && rc != H_FUNCTION) + dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n", + val, rc); + } +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-handle-inconsistent-login-with-reset.patch b/patches.suse/ibmvnic-handle-inconsistent-login-with-reset.patch new file mode 100644 index 0000000..c8eb2b5 --- /dev/null +++ b/patches.suse/ibmvnic-handle-inconsistent-login-with-reset.patch @@ -0,0 +1,39 @@ +From 31d6b4036098f6b59bcfa20375626b500c7d7417 Mon Sep 17 00:00:00 2001 +From: Dany Madden +Date: Wed, 25 Nov 2020 18:04:24 -0600 +Subject: [PATCH] ibmvnic: handle inconsistent login with reset + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc7 +Git-commit: 31d6b4036098f6b59bcfa20375626b500c7d7417 + +Inconsistent login with the vnicserver is causing the device to be +removed. This does not give the device a chance to recover from error +state. This patch schedules a FATAL reset instead to bring the adapter +up. + +Fixes: 032c5e82847a2 ("Driver for IBM System i/p VNIC protocol") +Signed-off-by: Dany Madden +Signed-off-by: Lijun Pan +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 2491ebc97871..b28a979061dc 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -4414,7 +4414,7 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq, + adapter->req_rx_add_queues != + be32_to_cpu(login_rsp->num_rxadd_subcrqs))) { + dev_err(dev, "FATAL: Inconsistent login and login rsp\n"); +- ibmvnic_remove(adapter->vdev); ++ ibmvnic_reset(adapter, VNIC_RESET_FATAL); + return -EIO; + } + size_array = (u64 *)((u8 *)(adapter->login_rsp_buf) + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-improve-ibmvnic_init-and-ibmvnic_reset_init.patch b/patches.suse/ibmvnic-improve-ibmvnic_init-and-ibmvnic_reset_init.patch new file mode 100644 index 0000000..8471623 --- /dev/null +++ b/patches.suse/ibmvnic-improve-ibmvnic_init-and-ibmvnic_reset_init.patch @@ -0,0 +1,67 @@ +From fa68bfab1e716ee15a08d0e1ec284d6340736451 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Wed, 19 Aug 2020 17:52:24 -0500 +Subject: [PATCH] ibmvnic: improve ibmvnic_init and ibmvnic_reset_init + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: fa68bfab1e716ee15a08d0e1ec284d6340736451 + +When H_SEND_CRQ command returns with H_CLOSED, it means the +server's CRQ is not ready yet. Instead of resetting immediately, +we wait for the server to launch passive init. +ibmvnic_init() and ibmvnic_reset_init() should also return the +error code from ibmvnic_send_crq_init() call. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 4b07eb5a3958..4e0a6cbd1488 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -3556,8 +3556,7 @@ static int ibmvnic_send_crq(struct ibmvnic_adapter *adapter, + if (rc) { + if (rc == H_CLOSED) { + dev_warn(dev, "CRQ Queue closed\n"); +- if (test_bit(0, &adapter->resetting)) +- ibmvnic_reset(adapter, VNIC_RESET_FATAL); ++ /* do not reset, report the fail, wait for passive init from server */ + } + + dev_warn(dev, "Send error (rc=%d)\n", rc); +@@ -5002,7 +5001,12 @@ static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter) + + reinit_completion(&adapter->init_done); + adapter->init_done_rc = 0; +- ibmvnic_send_crq_init(adapter); ++ rc = ibmvnic_send_crq_init(adapter); ++ if (rc) { ++ dev_err(dev, "Send crq init failed with error %d\n", rc); ++ return rc; ++ } ++ + if (!wait_for_completion_timeout(&adapter->init_done, timeout)) { + dev_err(dev, "Initialization sequence timed out\n"); + return -1; +@@ -5056,7 +5060,12 @@ static int ibmvnic_init(struct ibmvnic_adapter *adapter) + adapter->from_passive_init = false; + + adapter->init_done_rc = 0; +- ibmvnic_send_crq_init(adapter); ++ rc = ibmvnic_send_crq_init(adapter); ++ if (rc) { ++ dev_err(dev, "Send crq init failed with error %d\n", rc); ++ return rc; ++ } ++ + if (!wait_for_completion_timeout(&adapter->init_done, timeout)) { + dev_err(dev, "Initialization sequence timed out\n"); + return -1; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-merge-do_change_param_reset-into-do_reset.patch b/patches.suse/ibmvnic-merge-do_change_param_reset-into-do_reset.patch new file mode 100644 index 0000000..8e1e470 --- /dev/null +++ b/patches.suse/ibmvnic-merge-do_change_param_reset-into-do_reset.patch @@ -0,0 +1,245 @@ +From 3f5ec374ae3f3d5381622e29319a22c4ecd09413 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Wed, 6 Jan 2021 15:35:14 -0600 +Subject: [PATCH] ibmvnic: merge do_change_param_reset into do_reset + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: 3f5ec374ae3f3d5381622e29319a22c4ecd09413 + +Commit b27507bb59ed ("net/ibmvnic: unlock rtnl_lock in reset so +linkwatch_event can run") introduced do_change_param_reset function to +solve the rtnl lock issue. Majority of the code in do_change_param_reset +duplicates do_reset. Also, we can handle the rtnl lock issue in do_reset +itself. Hence merge do_change_param_reset back into do_reset to clean up +the code. + +Signed-off-by: Lijun Pan +Link: https://lore.kernel.org/r/20210106213514.76027-1-ljp@linux.ibm.com +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 154 +++++++++-------------------- + 1 file changed, 44 insertions(+), 110 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 9778c83150f1..aed985e08e8a 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -1925,92 +1925,6 @@ static int ibmvnic_set_mac(struct net_device *netdev, void *p) + return rc; + } + +-/** +- * do_change_param_reset returns zero if we are able to keep processing reset +- * events, or non-zero if we hit a fatal error and must halt. +- */ +-static int do_change_param_reset(struct ibmvnic_adapter *adapter, +- struct ibmvnic_rwi *rwi, +- u32 reset_state) +-{ +- struct net_device *netdev = adapter->netdev; +- int i, rc; +- +- netdev_dbg(adapter->netdev, "Change param resetting driver (%d)\n", +- rwi->reset_reason); +- +- netif_carrier_off(netdev); +- adapter->reset_reason = rwi->reset_reason; +- +- ibmvnic_cleanup(netdev); +- +- if (reset_state == VNIC_OPEN) { +- rc = __ibmvnic_close(netdev); +- if (rc) +- goto out; +- } +- +- release_resources(adapter); +- release_sub_crqs(adapter, 1); +- release_crq_queue(adapter); +- +- adapter->state = VNIC_PROBED; +- +- rc = init_crq_queue(adapter); +- +- if (rc) { +- netdev_err(adapter->netdev, +- "Couldn't initialize crq. rc=%d\n", rc); +- return rc; +- } +- +- rc = ibmvnic_reset_init(adapter, true); +- if (rc) { +- rc = IBMVNIC_INIT_FAILED; +- goto out; +- } +- +- /* If the adapter was in PROBE state prior to the reset, +- * exit here. +- */ +- if (reset_state == VNIC_PROBED) +- goto out; +- +- rc = ibmvnic_login(netdev); +- if (rc) { +- goto out; +- } +- +- rc = init_resources(adapter); +- if (rc) +- goto out; +- +- ibmvnic_disable_irqs(adapter); +- +- adapter->state = VNIC_CLOSED; +- +- if (reset_state == VNIC_CLOSED) +- return 0; +- +- rc = __ibmvnic_open(netdev); +- if (rc) { +- rc = IBMVNIC_OPEN_FAILED; +- goto out; +- } +- +- /* 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]); +- +-out: +- if (rc) +- adapter->state = reset_state; +- return rc; +-} +- + /** + * 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. +@@ -2028,7 +1942,11 @@ static int do_reset(struct ibmvnic_adapter *adapter, + adapter->state, adapter->failover_pending, + rwi->reset_reason, reset_state); + +- rtnl_lock(); ++ adapter->reset_reason = rwi->reset_reason; ++ /* requestor of VNIC_RESET_CHANGE_PARAM already has the rtnl lock */ ++ if (!(adapter->reset_reason == VNIC_RESET_CHANGE_PARAM)) ++ rtnl_lock(); ++ + /* + * Now that we have the rtnl lock, clear any pending failover. + * This will ensure ibmvnic_open() has either completed or will +@@ -2038,7 +1956,6 @@ static int do_reset(struct ibmvnic_adapter *adapter, + adapter->failover_pending = false; + + netif_carrier_off(netdev); +- adapter->reset_reason = rwi->reset_reason; + + old_num_rx_queues = adapter->req_rx_queues; + old_num_tx_queues = adapter->req_tx_queues; +@@ -2050,25 +1967,37 @@ static int do_reset(struct ibmvnic_adapter *adapter, + if (reset_state == VNIC_OPEN && + adapter->reset_reason != VNIC_RESET_MOBILITY && + adapter->reset_reason != VNIC_RESET_FAILOVER) { +- adapter->state = VNIC_CLOSING; ++ if (adapter->reset_reason == VNIC_RESET_CHANGE_PARAM) { ++ rc = __ibmvnic_close(netdev); ++ if (rc) ++ goto out; ++ } else { ++ adapter->state = VNIC_CLOSING; + +- /* Release the RTNL lock before link state change and +- * re-acquire after the link state change to allow +- * linkwatch_event to grab the RTNL lock and run during +- * a reset. +- */ +- rtnl_unlock(); +- rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_DN); +- rtnl_lock(); +- if (rc) +- goto out; ++ /* Release the RTNL lock before link state change and ++ * re-acquire after the link state change to allow ++ * linkwatch_event to grab the RTNL lock and run during ++ * a reset. ++ */ ++ rtnl_unlock(); ++ rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_DN); ++ rtnl_lock(); ++ if (rc) ++ goto out; + +- if (adapter->state != VNIC_CLOSING) { +- rc = -1; +- goto out; ++ if (adapter->state != VNIC_CLOSING) { ++ rc = -1; ++ goto out; ++ } ++ ++ adapter->state = VNIC_CLOSED; + } ++ } + +- adapter->state = VNIC_CLOSED; ++ if (adapter->reset_reason == VNIC_RESET_CHANGE_PARAM) { ++ release_resources(adapter); ++ release_sub_crqs(adapter, 1); ++ release_crq_queue(adapter); + } + + if (adapter->reset_reason != VNIC_RESET_NON_FATAL) { +@@ -2077,7 +2006,9 @@ static int do_reset(struct ibmvnic_adapter *adapter, + */ + adapter->state = VNIC_PROBED; + +- if (adapter->reset_reason == VNIC_RESET_MOBILITY) { ++ if (adapter->reset_reason == VNIC_RESET_CHANGE_PARAM) { ++ rc = init_crq_queue(adapter); ++ } else if (adapter->reset_reason == VNIC_RESET_MOBILITY) { + rc = ibmvnic_reenable_crq_queue(adapter); + release_sub_crqs(adapter, 1); + } else { +@@ -2116,7 +2047,11 @@ static int do_reset(struct ibmvnic_adapter *adapter, + goto out; + } + +- if (adapter->req_rx_queues != old_num_rx_queues || ++ if (adapter->reset_reason == VNIC_RESET_CHANGE_PARAM) { ++ rc = init_resources(adapter); ++ if (rc) ++ goto out; ++ } else if (adapter->req_rx_queues != old_num_rx_queues || + adapter->req_tx_queues != old_num_tx_queues || + adapter->req_rx_add_entries_per_subcrq != + old_num_rx_slots || +@@ -2181,7 +2116,9 @@ static int do_reset(struct ibmvnic_adapter *adapter, + /* restore the adapter state if reset failed */ + if (rc) + adapter->state = reset_state; +- rtnl_unlock(); ++ /* requestor of VNIC_RESET_CHANGE_PARAM should still hold the rtnl lock */ ++ 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); +@@ -2312,10 +2249,7 @@ static void __ibmvnic_reset(struct work_struct *work) + } + spin_unlock_irqrestore(&adapter->state_lock, flags); + +- if (rwi->reset_reason == VNIC_RESET_CHANGE_PARAM) { +- /* CHANGE_PARAM requestor holds rtnl_lock */ +- rc = do_change_param_reset(adapter, rwi, reset_state); +- } else if (adapter->force_reset_recovery) { ++ if (adapter->force_reset_recovery) { + /* + * Since we are doing a hard reset now, clear the + * failover_pending flag so we don't ignore any +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-merge-ibmvnic_reset_init-and-ibmvnic_init.patch b/patches.suse/ibmvnic-merge-ibmvnic_reset_init-and-ibmvnic_init.patch new file mode 100644 index 0000000..8710407 --- /dev/null +++ b/patches.suse/ibmvnic-merge-ibmvnic_reset_init-and-ibmvnic_init.patch @@ -0,0 +1,157 @@ +From 635e442f4a48620d3d57e3b837e30375ddc35040 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Wed, 19 Aug 2020 17:52:26 -0500 +Subject: [PATCH] ibmvnic: merge ibmvnic_reset_init and ibmvnic_init + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: 635e442f4a48620d3d57e3b837e30375ddc35040 + +These two functions share the majority of the code, hence merge +them together. In the meanwhile, add a reset pass-in parameter +to differentiate them. Thus, the code is easier to read and to tell +the difference between reset_init and regular init. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 65 ++++++------------------------ + 1 file changed, 13 insertions(+), 52 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 15e5b26933fe..86a83e53dce5 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -104,8 +104,7 @@ static int send_login(struct ibmvnic_adapter *adapter); + static void send_cap_queries(struct ibmvnic_adapter *adapter); + static int init_sub_crqs(struct ibmvnic_adapter *); + static int init_sub_crq_irqs(struct ibmvnic_adapter *adapter); +-static int ibmvnic_init(struct ibmvnic_adapter *); +-static int ibmvnic_reset_init(struct ibmvnic_adapter *); ++static int ibmvnic_reset_init(struct ibmvnic_adapter *, bool reset); + static void release_crq_queue(struct ibmvnic_adapter *); + static int __ibmvnic_set_mac(struct net_device *, u8 *); + static int init_crq_queue(struct ibmvnic_adapter *adapter); +@@ -1856,7 +1855,7 @@ static int do_change_param_reset(struct ibmvnic_adapter *adapter, + return rc; + } + +- rc = ibmvnic_reset_init(adapter); ++ rc = ibmvnic_reset_init(adapter, true); + if (rc) + return IBMVNIC_INIT_FAILED; + +@@ -1974,7 +1973,7 @@ static int do_reset(struct ibmvnic_adapter *adapter, + goto out; + } + +- rc = ibmvnic_reset_init(adapter); ++ rc = ibmvnic_reset_init(adapter, true); + if (rc) { + rc = IBMVNIC_INIT_FAILED; + goto out; +@@ -2081,7 +2080,7 @@ static int do_hard_reset(struct ibmvnic_adapter *adapter, + return rc; + } + +- rc = ibmvnic_init(adapter); ++ rc = ibmvnic_reset_init(adapter, false); + if (rc) + return rc; + +@@ -4987,7 +4986,7 @@ static int init_crq_queue(struct ibmvnic_adapter *adapter) + return retrc; + } + +-static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter) ++static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter, bool reset) + { + struct device *dev = &adapter->vdev->dev; + unsigned long timeout = msecs_to_jiffies(30000); +@@ -4996,10 +4995,12 @@ static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter) + + adapter->from_passive_init = false; + +- old_num_rx_queues = adapter->req_rx_queues; +- old_num_tx_queues = adapter->req_tx_queues; ++ if (reset) { ++ old_num_rx_queues = adapter->req_rx_queues; ++ old_num_tx_queues = adapter->req_tx_queues; ++ reinit_completion(&adapter->init_done); ++ } + +- reinit_completion(&adapter->init_done); + adapter->init_done_rc = 0; + rc = ibmvnic_send_crq_init(adapter); + if (rc) { +@@ -5017,7 +5018,8 @@ static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter) + return adapter->init_done_rc; + } + +- if (test_bit(0, &adapter->resetting) && !adapter->wait_for_reset && ++ if (reset && ++ test_bit(0, &adapter->resetting) && !adapter->wait_for_reset && + adapter->reset_reason != VNIC_RESET_MOBILITY) { + if (adapter->req_rx_queues != old_num_rx_queues || + adapter->req_tx_queues != old_num_tx_queues) { +@@ -5045,47 +5047,6 @@ static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter) + return rc; + } + +-static int ibmvnic_init(struct ibmvnic_adapter *adapter) +-{ +- struct device *dev = &adapter->vdev->dev; +- unsigned long timeout = msecs_to_jiffies(30000); +- int rc; +- +- adapter->from_passive_init = false; +- +- adapter->init_done_rc = 0; +- rc = ibmvnic_send_crq_init(adapter); +- if (rc) { +- dev_err(dev, "Send crq init failed with error %d\n", rc); +- return rc; +- } +- +- if (!wait_for_completion_timeout(&adapter->init_done, timeout)) { +- dev_err(dev, "Initialization sequence timed out\n"); +- return -1; +- } +- +- if (adapter->init_done_rc) { +- release_crq_queue(adapter); +- return adapter->init_done_rc; +- } +- +- rc = init_sub_crqs(adapter); +- if (rc) { +- dev_err(dev, "Initialization of sub crqs failed\n"); +- release_crq_queue(adapter); +- return rc; +- } +- +- rc = init_sub_crq_irqs(adapter); +- if (rc) { +- dev_err(dev, "Failed to initialize sub crq irqs\n"); +- release_crq_queue(adapter); +- } +- +- return rc; +-} +- + static struct device_attribute dev_attr_failover; + + static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) +@@ -5148,7 +5109,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) + goto ibmvnic_init_fail; + } + +- rc = ibmvnic_init(adapter); ++ rc = ibmvnic_reset_init(adapter, false); + if (rc && rc != EAGAIN) + goto ibmvnic_init_fail; + } while (rc == EAGAIN); +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-no-reset-timeout-for-5-seconds-after-reset.patch b/patches.suse/ibmvnic-no-reset-timeout-for-5-seconds-after-reset.patch new file mode 100644 index 0000000..087bfbb --- /dev/null +++ b/patches.suse/ibmvnic-no-reset-timeout-for-5-seconds-after-reset.patch @@ -0,0 +1,74 @@ +From a86d5c682b798b2dadaa4171c1d124cf3c45a17c Mon Sep 17 00:00:00 2001 +From: Dany Madden +Date: Wed, 25 Nov 2020 18:04:31 -0600 +Subject: [PATCH] ibmvnic: no reset timeout for 5 seconds after reset + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc7 +Git-commit: a86d5c682b798b2dadaa4171c1d124cf3c45a17c + +Reset timeout is going off right after adapter reset. This patch ensures +that timeout is scheduled if it has been 5 seconds since the last reset. +5 seconds is the default watchdog timeout. + +Fixes: ed651a10875f1 ("ibmvnic: Updated reset handling") +Signed-off-by: Dany Madden +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 11 +++++++++-- + drivers/net/ethernet/ibm/ibmvnic.h | 2 ++ + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 5154e0421175..d48a694b92c9 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2252,6 +2252,7 @@ static void __ibmvnic_reset(struct work_struct *work) + rc = do_reset(adapter, rwi, reset_state); + } + kfree(rwi); ++ adapter->last_reset_time = jiffies; + + if (rc) + netdev_dbg(adapter->netdev, "Reset failed, rc=%d\n", rc); +@@ -2355,7 +2356,13 @@ static void ibmvnic_tx_timeout(struct net_device *dev, unsigned int txqueue) + "Adapter is resetting, skip timeout reset\n"); + return; + } +- ++ /* No queuing up reset until at least 5 seconds (default watchdog val) ++ * after last reset ++ */ ++ if (time_before(jiffies, (adapter->last_reset_time + dev->watchdog_timeo))) { ++ netdev_dbg(dev, "Not yet time to tx timeout.\n"); ++ return; ++ } + ibmvnic_reset(adapter, VNIC_RESET_TIMEOUT); + } + +@@ -5282,7 +5289,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) + adapter->state = VNIC_PROBED; + + adapter->wait_for_reset = false; +- ++ adapter->last_reset_time = jiffies; + return 0; + + ibmvnic_register_fail: +diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h +index bffa7f939ee1..21e7ea858cda 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.h ++++ b/drivers/net/ethernet/ibm/ibmvnic.h +@@ -1087,6 +1087,8 @@ struct ibmvnic_adapter { + unsigned long resetting; + bool napi_enabled, from_passive_init; + bool login_pending; ++ /* last device reset time */ ++ unsigned long last_reset_time; + + bool failover_pending; + bool force_reset_recovery; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-prefer-strscpy-over-strlcpy.patch b/patches.suse/ibmvnic-prefer-strscpy-over-strlcpy.patch new file mode 100644 index 0000000..baece71 --- /dev/null +++ b/patches.suse/ibmvnic-prefer-strscpy-over-strlcpy.patch @@ -0,0 +1,39 @@ +From 8a96c80e2774172c6a091b5d40579fe957228393 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Thu, 11 Feb 2021 00:43:25 -0600 +Subject: [PATCH] ibmvnic: prefer strscpy over strlcpy + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: 8a96c80e2774172c6a091b5d40579fe957228393 + +Fix this warning: +WARNING: Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ + +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, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 778e56e05cd7..1774fbaab146 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2633,9 +2633,9 @@ static void ibmvnic_get_drvinfo(struct net_device *netdev, + { + struct ibmvnic_adapter *adapter = netdev_priv(netdev); + +- strlcpy(info->driver, ibmvnic_driver_name, sizeof(info->driver)); +- strlcpy(info->version, IBMVNIC_DRIVER_VERSION, sizeof(info->version)); +- strlcpy(info->fw_version, adapter->fw_version, ++ strscpy(info->driver, ibmvnic_driver_name, sizeof(info->driver)); ++ strscpy(info->version, IBMVNIC_DRIVER_VERSION, sizeof(info->version)); ++ strscpy(info->fw_version, adapter->fw_version, + sizeof(info->fw_version)); + } + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-prefer-unsigned-long-over-unsigned-long-int.patch b/patches.suse/ibmvnic-prefer-unsigned-long-over-unsigned-long-int.patch new file mode 100644 index 0000000..6ba6bda --- /dev/null +++ b/patches.suse/ibmvnic-prefer-unsigned-long-over-unsigned-long-int.patch @@ -0,0 +1,86 @@ +From 429aa36469f95b0e389b512dcbd1065225e9d0a2 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Thu, 11 Feb 2021 00:43:18 -0600 +Subject: [PATCH] ibmvnic: prefer 'unsigned long' over 'unsigned long int' + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: 429aa36469f95b0e389b512dcbd1065225e9d0a2 + +Fix the following checkpatch warnings: +WARNING: Prefer 'unsigned long' over 'unsigned long int' as the int is unnecessary +WARNING: Prefer 'long' over 'long int' as the int is unnecessary + +Signed-off-by: Lijun Pan +Reviewed-by: Saeed Mahameed +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index a1579cd4bfe1..55970f02d9da 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -3654,8 +3654,8 @@ static int ibmvnic_send_crq(struct ibmvnic_adapter *adapter, + int rc; + + netdev_dbg(adapter->netdev, "Sending CRQ: %016lx %016lx\n", +- (unsigned long int)cpu_to_be64(u64_crq[0]), +- (unsigned long int)cpu_to_be64(u64_crq[1])); ++ (unsigned long)cpu_to_be64(u64_crq[0]), ++ (unsigned long)cpu_to_be64(u64_crq[1])); + + if (!adapter->crq.active && + crq->generic.first != IBMVNIC_CRQ_INIT_CMD) { +@@ -3884,7 +3884,7 @@ static int send_login(struct ibmvnic_adapter *adapter) + netdev_dbg(adapter->netdev, "Login Buffer:\n"); + for (i = 0; i < (adapter->login_buf_sz - 1) / 8 + 1; i++) { + netdev_dbg(adapter->netdev, "%016lx\n", +- ((unsigned long int *)(adapter->login_buf))[i]); ++ ((unsigned long *)(adapter->login_buf))[i]); + } + + memset(&crq, 0, sizeof(crq)); +@@ -4252,7 +4252,7 @@ static void handle_query_ip_offload_rsp(struct ibmvnic_adapter *adapter) + netdev_dbg(adapter->netdev, "Query IP Offload Buffer:\n"); + for (i = 0; i < (sizeof(adapter->ip_offload_buf) - 1) / 8 + 1; i++) + netdev_dbg(adapter->netdev, "%016lx\n", +- ((unsigned long int *)(buf))[i]); ++ ((unsigned long *)(buf))[i]); + + netdev_dbg(adapter->netdev, "ipv4_chksum = %d\n", buf->ipv4_chksum); + netdev_dbg(adapter->netdev, "ipv6_chksum = %d\n", buf->ipv6_chksum); +@@ -4411,7 +4411,7 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq, + case PARTIALSUCCESS: + dev_info(dev, "req=%lld, rsp=%ld in %s queue, retrying.\n", + *req_value, +- (long int)be64_to_cpu(crq->request_capability_rsp. ++ (long)be64_to_cpu(crq->request_capability_rsp. + number), name); + + if (be16_to_cpu(crq->request_capability_rsp.capability) == +@@ -4482,7 +4482,7 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq, + netdev_dbg(adapter->netdev, "Login Response Buffer:\n"); + for (i = 0; i < (adapter->login_rsp_buf_sz - 1) / 8 + 1; i++) { + netdev_dbg(adapter->netdev, "%016lx\n", +- ((unsigned long int *)(adapter->login_rsp_buf))[i]); ++ ((unsigned long *)(adapter->login_rsp_buf))[i]); + } + + /* Sanity checks */ +@@ -4825,8 +4825,8 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq, + long rc; + + netdev_dbg(netdev, "Handling CRQ: %016lx %016lx\n", +- (unsigned long int)cpu_to_be64(u64_crq[0]), +- (unsigned long int)cpu_to_be64(u64_crq[1])); ++ (unsigned long)cpu_to_be64(u64_crq[0]), ++ (unsigned long)cpu_to_be64(u64_crq[1])); + switch (gen_crq->first) { + case IBMVNIC_CRQ_INIT_RSP: + switch (gen_crq->cmd) { +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-reduce-wait-for-completion-time.patch b/patches.suse/ibmvnic-reduce-wait-for-completion-time.patch new file mode 100644 index 0000000..93ab88d --- /dev/null +++ b/patches.suse/ibmvnic-reduce-wait-for-completion-time.patch @@ -0,0 +1,55 @@ +From 98c41f04a67abf5e7f7191d55d286e905d1430ef Mon Sep 17 00:00:00 2001 +From: Dany Madden +Date: Wed, 25 Nov 2020 18:04:32 -0600 +Subject: [PATCH] ibmvnic: reduce wait for completion time + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc7 +Git-commit: 98c41f04a67abf5e7f7191d55d286e905d1430ef + +Reduce the wait time for Command Response Queue response from 30 seconds +to 20 seconds, as recommended by VIOS and Power Hypervisor teams. + +Fixes: bd0b672313941 ("ibmvnic: Move login and queue negotiation into ibmvnic_open") +Fixes: 53da09e92910f ("ibmvnic: Add set_link_state routine for setting adapter link state") +Signed-off-by: Dany Madden +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index d48a694b92c9..bca1becd33f0 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -834,7 +834,7 @@ static void release_napi(struct ibmvnic_adapter *adapter) + static int ibmvnic_login(struct net_device *netdev) + { + struct ibmvnic_adapter *adapter = netdev_priv(netdev); +- unsigned long timeout = msecs_to_jiffies(30000); ++ unsigned long timeout = msecs_to_jiffies(20000); + int retry_count = 0; + int retries = 10; + bool retry; +@@ -938,7 +938,7 @@ static void release_resources(struct ibmvnic_adapter *adapter) + static int set_link_state(struct ibmvnic_adapter *adapter, u8 link_state) + { + struct net_device *netdev = adapter->netdev; +- unsigned long timeout = msecs_to_jiffies(30000); ++ unsigned long timeout = msecs_to_jiffies(20000); + union ibmvnic_crq crq; + bool resend; + int rc; +@@ -5130,7 +5130,7 @@ static int init_crq_queue(struct ibmvnic_adapter *adapter) + static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter, bool reset) + { + struct device *dev = &adapter->vdev->dev; +- unsigned long timeout = msecs_to_jiffies(30000); ++ unsigned long timeout = msecs_to_jiffies(20000); + u64 old_num_rx_queues, old_num_tx_queues; + int rc; + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-remove-never-executed-if-statement.patch b/patches.suse/ibmvnic-remove-never-executed-if-statement.patch new file mode 100644 index 0000000..05589db --- /dev/null +++ b/patches.suse/ibmvnic-remove-never-executed-if-statement.patch @@ -0,0 +1,53 @@ +From 550f4d46aff6fe57c9b1c6719c3c9de2237d7ac2 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Wed, 19 Aug 2020 17:52:25 -0500 +Subject: [PATCH] ibmvnic: remove never executed if statement + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: 550f4d46aff6fe57c9b1c6719c3c9de2237d7ac2 + +At the beginning of the function, from_passive_init is set false by +"adapter->from_passive_init = false;", +hence the if statement will never run. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 4e0a6cbd1488..15e5b26933fe 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -5017,12 +5017,6 @@ static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter) + return adapter->init_done_rc; + } + +- if (adapter->from_passive_init) { +- adapter->state = VNIC_OPEN; +- adapter->from_passive_init = false; +- return -1; +- } +- + if (test_bit(0, &adapter->resetting) && !adapter->wait_for_reset && + adapter->reset_reason != VNIC_RESET_MOBILITY) { + if (adapter->req_rx_queues != old_num_rx_queues || +@@ -5076,12 +5070,6 @@ static int ibmvnic_init(struct ibmvnic_adapter *adapter) + return adapter->init_done_rc; + } + +- if (adapter->from_passive_init) { +- adapter->state = VNIC_OPEN; +- adapter->from_passive_init = false; +- return -1; +- } +- + rc = init_sub_crqs(adapter); + if (rc) { + dev_err(dev, "Initialization of sub crqs failed\n"); +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-remove-unnecessary-rmb-inside-ibmvnic_poll.patch b/patches.suse/ibmvnic-remove-unnecessary-rmb-inside-ibmvnic_poll.patch new file mode 100644 index 0000000..d421c60 --- /dev/null +++ b/patches.suse/ibmvnic-remove-unnecessary-rmb-inside-ibmvnic_poll.patch @@ -0,0 +1,38 @@ +From 2719cb445da5fec698e961abdf75cf9e4d61fba4 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Fri, 29 Jan 2021 19:19:05 -0600 +Subject: [PATCH] ibmvnic: remove unnecessary rmb() inside ibmvnic_poll + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: 2719cb445da5fec698e961abdf75cf9e4d61fba4 + +rmb() can be removed since: +1. pending_scrq() has dma_rmb() at the function end; +2. dma_rmb(), though weaker, is enough here. + +Signed-off-by: Lijun Pan +Acked-by: Dwip Banerjee +Acked-by: Thomas Falcon +Reviewed-by: Brian King +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 331ebca2f57a..0ed169ef1cfc 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2510,7 +2510,6 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget) + if (napi_complete_done(napi, frames_processed)) { + enable_scrq_irq(adapter, rx_scrq); + if (pending_scrq(adapter, rx_scrq)) { +- rmb(); + if (napi_reschedule(napi)) { + disable_scrq_irq(adapter, rx_scrq); + goto restart_poll; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-remove-unused-spinlock_t-stats_lock-definiti.patch b/patches.suse/ibmvnic-remove-unused-spinlock_t-stats_lock-definiti.patch new file mode 100644 index 0000000..892caf7 --- /dev/null +++ b/patches.suse/ibmvnic-remove-unused-spinlock_t-stats_lock-definiti.patch @@ -0,0 +1,48 @@ +From 4bb9f2e48299d068a704f490c1be4b1fb6d278ce Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Thu, 11 Feb 2021 00:43:24 -0600 +Subject: [PATCH] ibmvnic: remove unused spinlock_t stats_lock definition + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: 4bb9f2e48299d068a704f490c1be4b1fb6d278ce + +stats_lock is no longer used. So remove it. + +Signed-off-by: Lijun Pan +Reviewed-by: Saeed Mahameed +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 2 -- + drivers/net/ethernet/ibm/ibmvnic.h | 1 - + 2 files changed, 3 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 0c27a1f9663a..778e56e05cd7 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -5295,8 +5295,6 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) + netdev->ethtool_ops = &ibmvnic_ethtool_ops; + SET_NETDEV_DEV(netdev, &dev->dev); + +- spin_lock_init(&adapter->stats_lock); +- + INIT_WORK(&adapter->ibmvnic_reset, __ibmvnic_reset); + INIT_DELAYED_WORK(&adapter->ibmvnic_delayed_reset, + __ibmvnic_delayed_reset); +diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h +index 8f73a30a7593..270d1cac86a4 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.h ++++ b/drivers/net/ethernet/ibm/ibmvnic.h +@@ -987,7 +987,6 @@ struct ibmvnic_adapter { + struct ibmvnic_statistics stats; + dma_addr_t stats_token; + struct completion stats_done; +- spinlock_t stats_lock; + int replenish_no_mem; + int replenish_add_buff_success; + int replenish_add_buff_failure; +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-rename-ibmvnic_send_req_caps-to-send_request.patch b/patches.suse/ibmvnic-rename-ibmvnic_send_req_caps-to-send_request.patch new file mode 100644 index 0000000..169a547 --- /dev/null +++ b/patches.suse/ibmvnic-rename-ibmvnic_send_req_caps-to-send_request.patch @@ -0,0 +1,52 @@ +From 09081b9d3ab9d7a8c67b1cbbd4287e02304dd642 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Sun, 27 Sep 2020 20:13:27 -0500 +Subject: [PATCH] ibmvnic: rename ibmvnic_send_req_caps to send_request_cap + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: 09081b9d3ab9d7a8c67b1cbbd4287e02304dd642 + +The new name send_request_cap pairs with handle_request_cap_rsp. + +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, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index d97ce62332df..dda11b165769 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -3299,7 +3299,7 @@ static int init_sub_crqs(struct ibmvnic_adapter *adapter) + return -1; + } + +-static void ibmvnic_send_req_caps(struct ibmvnic_adapter *adapter, int retry) ++static void send_request_cap(struct ibmvnic_adapter *adapter, int retry) + { + struct device *dev = &adapter->vdev->dev; + union ibmvnic_crq crq; +@@ -4266,7 +4266,7 @@ static void handle_request_cap_rsp(union ibmvnic_crq *crq, + be64_to_cpu(crq->request_capability_rsp.number); + } + +- ibmvnic_send_req_caps(adapter, 1); ++ send_request_cap(adapter, 1); + return; + default: + dev_err(dev, "Error %d in request cap rsp\n", +@@ -4582,7 +4582,7 @@ static void handle_query_cap_rsp(union ibmvnic_crq *crq, + out: + if (atomic_read(&adapter->running_cap_crqs) == 0) { + adapter->wait_capability = false; +- ibmvnic_send_req_caps(adapter, 0); ++ send_request_cap(adapter, 0); + } + } + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-rename-send_cap_queries-to-send_query_cap.patch b/patches.suse/ibmvnic-rename-send_cap_queries-to-send_query_cap.patch new file mode 100644 index 0000000..57dd6e0 --- /dev/null +++ b/patches.suse/ibmvnic-rename-send_cap_queries-to-send_query_cap.patch @@ -0,0 +1,61 @@ +From 491099ad74e6d3de96b887766600930f9f0cabf5 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Sun, 27 Sep 2020 20:13:26 -0500 +Subject: [PATCH] ibmvnic: rename send_cap_queries to send_query_cap + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: 491099ad74e6d3de96b887766600930f9f0cabf5 + +The new name send_query_cap pairs with handle_query_cap_rsp. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 98ebd942759e..d97ce62332df 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -101,7 +101,7 @@ static void send_map_query(struct ibmvnic_adapter *adapter); + static int send_request_map(struct ibmvnic_adapter *, dma_addr_t, __be32, u8); + static int send_request_unmap(struct ibmvnic_adapter *, u8); + static int send_login(struct ibmvnic_adapter *adapter); +-static void send_cap_queries(struct ibmvnic_adapter *adapter); ++static void send_query_cap(struct ibmvnic_adapter *adapter); + static int init_sub_crqs(struct ibmvnic_adapter *); + static int init_sub_crq_irqs(struct ibmvnic_adapter *adapter); + static int ibmvnic_reset_init(struct ibmvnic_adapter *, bool reset); +@@ -882,7 +882,7 @@ static int ibmvnic_login(struct net_device *netdev) + "Received partial success, retrying...\n"); + adapter->init_done_rc = 0; + reinit_completion(&adapter->init_done); +- send_cap_queries(adapter); ++ send_query_cap(adapter); + if (!wait_for_completion_timeout(&adapter->init_done, + timeout)) { + netdev_warn(netdev, +@@ -3836,7 +3836,7 @@ static void send_map_query(struct ibmvnic_adapter *adapter) + } + + /* Send a series of CRQs requesting various capabilities of the VNIC server */ +-static void send_cap_queries(struct ibmvnic_adapter *adapter) ++static void send_query_cap(struct ibmvnic_adapter *adapter) + { + union ibmvnic_crq crq; + +@@ -4750,7 +4750,7 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq, + be16_to_cpu(crq->version_exchange_rsp.version); + dev_info(dev, "Partner protocol version is %d\n", + ibmvnic_version); +- send_cap_queries(adapter); ++ send_query_cap(adapter); + break; + case QUERY_CAPABILITY_RSP: + handle_query_cap_rsp(crq, adapter); +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-rename-send_map_query-to-send_query_map.patch b/patches.suse/ibmvnic-rename-send_map_query-to-send_query_map.patch new file mode 100644 index 0000000..340ea19 --- /dev/null +++ b/patches.suse/ibmvnic-rename-send_map_query-to-send_query_map.patch @@ -0,0 +1,52 @@ +From 69980d021c47635058e3c1c37161bc8439d32606 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Sun, 27 Sep 2020 20:13:28 -0500 +Subject: [PATCH] ibmvnic: rename send_map_query to send_query_map + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: 69980d021c47635058e3c1c37161bc8439d32606 + +The new name send_query_map pairs with handle_query_map_rsp. + +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, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index dda11b165769..b6a9b7e00920 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -97,7 +97,7 @@ static int pending_scrq(struct ibmvnic_adapter *, + static union sub_crq *ibmvnic_next_scrq(struct ibmvnic_adapter *, + struct ibmvnic_sub_crq_queue *); + static int ibmvnic_poll(struct napi_struct *napi, int data); +-static void send_map_query(struct ibmvnic_adapter *adapter); ++static void send_query_map(struct ibmvnic_adapter *adapter); + static int send_request_map(struct ibmvnic_adapter *, dma_addr_t, __be32, u8); + static int send_request_unmap(struct ibmvnic_adapter *, u8); + static int send_login(struct ibmvnic_adapter *adapter); +@@ -1113,7 +1113,7 @@ static int init_resources(struct ibmvnic_adapter *adapter) + if (rc) + return rc; + +- send_map_query(adapter); ++ send_query_map(adapter); + + rc = init_rx_pools(netdev); + if (rc) +@@ -3825,7 +3825,7 @@ static int send_request_unmap(struct ibmvnic_adapter *adapter, u8 map_id) + return ibmvnic_send_crq(adapter, &crq); + } + +-static void send_map_query(struct ibmvnic_adapter *adapter) ++static void send_query_map(struct ibmvnic_adapter *adapter) + { + union ibmvnic_crq crq; + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-restore-adapter-state-on-failed-reset.patch b/patches.suse/ibmvnic-restore-adapter-state-on-failed-reset.patch index 3f0f470..d2619f5 100644 --- a/patches.suse/ibmvnic-restore-adapter-state-on-failed-reset.patch +++ b/patches.suse/ibmvnic-restore-adapter-state-on-failed-reset.patch @@ -22,9 +22,10 @@ Acked-by: Michal Suchanek 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 939a276dae7d..5ce9f70984ee 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c -@@ -1881,7 +1881,7 @@ static int do_change_param_reset(struct +@@ -1857,7 +1857,7 @@ static int do_change_param_reset(struct ibmvnic_adapter *adapter, if (reset_state == VNIC_OPEN) { rc = __ibmvnic_close(netdev); if (rc) @@ -33,10 +34,10 @@ diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvn } release_resources(adapter); -@@ -1899,24 +1899,25 @@ static int do_change_param_reset(struct +@@ -1875,24 +1875,25 @@ static int do_change_param_reset(struct ibmvnic_adapter *adapter, } - rc = ibmvnic_reset_init(adapter); + rc = ibmvnic_reset_init(adapter, true); - if (rc) - return IBMVNIC_INIT_FAILED; + if (rc) { @@ -65,7 +66,7 @@ diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvn ibmvnic_disable_irqs(adapter); -@@ -1926,8 +1927,10 @@ static int do_change_param_reset(struct +@@ -1902,8 +1903,10 @@ static int do_change_param_reset(struct ibmvnic_adapter *adapter, return 0; rc = __ibmvnic_open(netdev); @@ -78,7 +79,7 @@ diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvn /* refresh device's multicast list */ ibmvnic_set_multi(netdev); -@@ -1936,7 +1939,10 @@ static int do_change_param_reset(struct +@@ -1912,7 +1915,10 @@ static int do_change_param_reset(struct ibmvnic_adapter *adapter, for (i = 0; i < adapter->req_rx_queues; i++) napi_schedule(&adapter->napi[i]); @@ -90,7 +91,7 @@ diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvn } /** -@@ -2039,7 +2045,6 @@ static int do_reset(struct ibmvnic_adapt +@@ -2015,7 +2021,6 @@ static int do_reset(struct ibmvnic_adapter *adapter, rc = ibmvnic_login(netdev); if (rc) { @@ -98,7 +99,7 @@ diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvn goto out; } -@@ -2107,6 +2112,9 @@ static int do_reset(struct ibmvnic_adapt +@@ -2083,6 +2088,9 @@ static int do_reset(struct ibmvnic_adapter *adapter, rc = 0; out: @@ -108,7 +109,7 @@ diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvn rtnl_unlock(); return rc; -@@ -2139,43 +2147,46 @@ static int do_hard_reset(struct ibmvnic_ +@@ -2115,43 +2123,46 @@ static int do_hard_reset(struct ibmvnic_adapter *adapter, if (rc) { netdev_err(adapter->netdev, "Couldn't initialize crq. rc=%d\n", rc); @@ -116,7 +117,7 @@ diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvn + goto out; } - rc = ibmvnic_init(adapter); + rc = ibmvnic_reset_init(adapter, false); if (rc) - return rc; + goto out; @@ -168,7 +169,7 @@ diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvn } static struct ibmvnic_rwi *get_next_rwi(struct ibmvnic_adapter *adapter) -@@ -2270,13 +2281,7 @@ static void __ibmvnic_reset(struct work_ +@@ -2235,13 +2246,7 @@ static void __ibmvnic_reset(struct work_struct *work) rc = do_reset(adapter, rwi, reset_state); } kfree(rwi); @@ -178,8 +179,11 @@ diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvn - else - adapter->state = reset_state; - rc = 0; -- } else if (rc && rc != IBMVNIC_INIT_FAILED && -+ if (rc && rc != IBMVNIC_INIT_FAILED && rc != IBMVNIC_OPEN_FAILED && - !adapter->force_reset_recovery) - break; +- } ++ + if (rc) + netdev_dbg(adapter->netdev, "Reset failed, rc=%d\n", rc); +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-rework-to-ensure-SCRQ-entry-reads-are-proper.patch b/patches.suse/ibmvnic-rework-to-ensure-SCRQ-entry-reads-are-proper.patch new file mode 100644 index 0000000..fc1c857 --- /dev/null +++ b/patches.suse/ibmvnic-rework-to-ensure-SCRQ-entry-reads-are-proper.patch @@ -0,0 +1,84 @@ +From 665ab1eb18d7e8eaa8377fb8bf4924bfeb63bbce Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Fri, 29 Jan 2021 19:19:04 -0600 +Subject: [PATCH] ibmvnic: rework to ensure SCRQ entry reads are properly + ordered + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: 665ab1eb18d7e8eaa8377fb8bf4924bfeb63bbce + +Move the dma_rmb() between pending_scrq() and ibmvnic_next_scrq() +into the end of pending_scrq() to save the duplicated code since +this dma_rmb will be used 3 times. + +Signed-off-by: Lijun Pan +Acked-by: Thomas Falcon +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 30 +++++++++++------------------- + 1 file changed, 11 insertions(+), 19 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 +@@ -2374,12 +2374,6 @@ restart_poll: + + if (!pending_scrq(adapter, rx_scrq)) + break; +- /* The queue entry at the current index is peeked at above +- * to determine that there is a valid descriptor awaiting +- * processing. We want to be sure that the current slot +- * holds a valid descriptor before reading its contents. +- */ +- dma_rmb(); + next = ibmvnic_next_scrq(adapter, rx_scrq); + rx_buff = + (struct ibmvnic_rx_buff *)be64_to_cpu(next-> +@@ -3089,13 +3083,6 @@ restart_loop: + unsigned int pool = scrq->pool_index; + int num_entries = 0; + +- /* The queue entry at the current index is peeked at above +- * to determine that there is a valid descriptor awaiting +- * processing. We want to be sure that the current slot +- * holds a valid descriptor before reading its contents. +- */ +- dma_rmb(); +- + next = ibmvnic_next_scrq(adapter, scrq); + for (i = 0; i < next->tx_comp.num_comps; i++) { + if (next->tx_comp.rcs[i]) +@@ -3471,11 +3458,16 @@ static int pending_scrq(struct ibmvnic_a + struct ibmvnic_sub_crq_queue *scrq) + { + union sub_crq *entry = &scrq->msgs[scrq->cur]; ++ int rc; + +- if (entry->generic.first & IBMVNIC_CRQ_CMD_RSP) +- return 1; +- else +- return 0; ++ rc = !!(entry->generic.first & IBMVNIC_CRQ_CMD_RSP); ++ ++ /* Ensure that the SCRQ valid flag is loaded prior to loading the ++ * contents of the SCRQ descriptor ++ */ ++ dma_rmb(); ++ ++ return rc; + } + + static union sub_crq *ibmvnic_next_scrq(struct ibmvnic_adapter *adapter, +@@ -3494,8 +3486,8 @@ static union sub_crq *ibmvnic_next_scrq( + } + spin_unlock_irqrestore(&scrq->lock, flags); + +- /* Ensure that the entire buffer descriptor has been +- * loaded before reading its contents ++ /* Ensure that the SCRQ valid flag is loaded prior to loading the ++ * contents of the SCRQ descriptor + */ + dma_rmb(); + diff --git a/patches.suse/ibmvnic-send_login-should-check-for-crq-errors.patch b/patches.suse/ibmvnic-send_login-should-check-for-crq-errors.patch new file mode 100644 index 0000000..ba40996 --- /dev/null +++ b/patches.suse/ibmvnic-send_login-should-check-for-crq-errors.patch @@ -0,0 +1,89 @@ +From c98d9cc4170da7e16a1012563d0f9fbe1c7cfe27 Mon Sep 17 00:00:00 2001 +From: Dany Madden +Date: Wed, 25 Nov 2020 18:04:30 -0600 +Subject: [PATCH] ibmvnic: send_login should check for crq errors + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc7 +Git-commit: c98d9cc4170da7e16a1012563d0f9fbe1c7cfe27 + +send_login() does not check for the result of ibmvnic_send_crq() of the +login request. This results in the driver needlessly retrying the login +10 times even when CRQ is no longer active. Check the return code and +give up in case of errors in sending the CRQ. + +The only time we want to retry is if we get a PARITALSUCCESS response +from the partner. + +Fixes: 032c5e82847a2 ("Driver for IBM System i/p VNIC protocol") +Signed-off-by: Dany Madden +Signed-off-by: Sukadev Bhattiprolu +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 13eae1666477..5154e0421175 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -850,10 +850,8 @@ static int ibmvnic_login(struct net_device *netdev) + adapter->init_done_rc = 0; + reinit_completion(&adapter->init_done); + rc = send_login(adapter); +- if (rc) { +- netdev_warn(netdev, "Unable to login\n"); ++ if (rc) + return rc; +- } + + if (!wait_for_completion_timeout(&adapter->init_done, + timeout)) { +@@ -3729,15 +3727,16 @@ static int send_login(struct ibmvnic_adapter *adapter) + struct ibmvnic_login_rsp_buffer *login_rsp_buffer; + struct ibmvnic_login_buffer *login_buffer; + struct device *dev = &adapter->vdev->dev; ++ struct vnic_login_client_data *vlcd; + dma_addr_t rsp_buffer_token; + dma_addr_t buffer_token; + size_t rsp_buffer_size; + union ibmvnic_crq crq; ++ int client_data_len; + size_t buffer_size; + __be64 *tx_list_p; + __be64 *rx_list_p; +- int client_data_len; +- struct vnic_login_client_data *vlcd; ++ int rc; + int i; + + if (!adapter->tx_scrq || !adapter->rx_scrq) { +@@ -3843,16 +3842,23 @@ static int send_login(struct ibmvnic_adapter *adapter) + crq.login.len = cpu_to_be32(buffer_size); + + adapter->login_pending = true; +- ibmvnic_send_crq(adapter, &crq); ++ rc = ibmvnic_send_crq(adapter, &crq); ++ if (rc) { ++ adapter->login_pending = false; ++ netdev_err(adapter->netdev, "Failed to send login, rc=%d\n", rc); ++ goto buf_rsp_map_failed; ++ } + + return 0; + + buf_rsp_map_failed: + kfree(login_rsp_buffer); ++ adapter->login_rsp_buf = NULL; + buf_rsp_alloc_failed: + dma_unmap_single(dev, buffer_token, buffer_size, DMA_TO_DEVICE); + buf_map_failed: + kfree(login_buffer); ++ adapter->login_buf = NULL; + buf_alloc_failed: + return -1; + } +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-serialize-access-to-work-queue-on-remove.patch b/patches.suse/ibmvnic-serialize-access-to-work-queue-on-remove.patch index 4f44f7c..a07a4b3 100644 --- a/patches.suse/ibmvnic-serialize-access-to-work-queue-on-remove.patch +++ b/patches.suse/ibmvnic-serialize-access-to-work-queue-on-remove.patch @@ -33,19 +33,18 @@ Acked-by: Michal Suchanek 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c -index cd201f89ce6c..13ae7eee7ef5 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c -@@ -2395,6 +2395,8 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, +@@ -2294,6 +2294,8 @@ static int ibmvnic_reset(struct ibmvnic_ unsigned long flags; int ret; + spin_lock_irqsave(&adapter->rwi_lock, flags); + - /* - * If failover is pending don't schedule any other reset. + /* If failover is pending don't schedule any other reset. * Instead let the failover complete. If there is already a -@@ -2415,14 +2417,11 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, + * a failover reset scheduled, we will detect and drop the +@@ -2314,14 +2316,11 @@ static int ibmvnic_reset(struct ibmvnic_ goto err; } @@ -60,7 +59,7 @@ index cd201f89ce6c..13ae7eee7ef5 100644 ret = EBUSY; goto err; } -@@ -2430,8 +2429,6 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, +@@ -2329,8 +2328,6 @@ static int ibmvnic_reset(struct ibmvnic_ rwi = kzalloc(sizeof(*rwi), GFP_ATOMIC); if (!rwi) { @@ -69,7 +68,7 @@ index cd201f89ce6c..13ae7eee7ef5 100644 ret = ENOMEM; goto err; } -@@ -2444,12 +2441,17 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, +@@ -2343,12 +2340,17 @@ static int ibmvnic_reset(struct ibmvnic_ } rwi->reset_reason = reason; list_add_tail(&rwi->list, &adapter->rwi_list); @@ -89,7 +88,7 @@ index cd201f89ce6c..13ae7eee7ef5 100644 return -ret; } -@@ -5467,7 +5469,18 @@ static int ibmvnic_remove(struct vio_dev *dev) +@@ -5353,7 +5355,18 @@ static int ibmvnic_remove(struct vio_dev unsigned long flags; spin_lock_irqsave(&adapter->state_lock, flags); @@ -109,27 +108,21 @@ index cd201f89ce6c..13ae7eee7ef5 100644 flush_work(&adapter->ibmvnic_reset); diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h -index 07ced1016aa4..72fea3b1c87d 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.h +++ b/drivers/net/ethernet/ibm/ibmvnic.h -@@ -1081,6 +1081,7 @@ struct ibmvnic_adapter { +@@ -1081,11 +1081,14 @@ struct ibmvnic_adapter { + struct tasklet_struct tasklet; enum vnic_state state; - enum ibmvnic_reset_reason reset_reason; -+ /* when taking both state and rwi locks, take state lock first */ - spinlock_t rwi_lock; - struct list_head rwi_list; - struct work_struct ibmvnic_reset; -@@ -1097,6 +1098,8 @@ struct ibmvnic_adapter { - struct ibmvnic_tunables desired; - struct ibmvnic_tunables fallback; - - /* Used for serializatin of state field */ + /* Used for serialization of state field. When taking both state + * and rwi locks, take state lock first. + */ spinlock_t state_lock; - }; --- -2.26.2 - + enum ibmvnic_reset_reason reset_reason; + struct list_head rwi_list; + /* Used for serialization of rwi_list */ ++ /* when taking both state and rwi locks, take state lock first */ + spinlock_t rwi_lock; + struct work_struct ibmvnic_reset; + struct delayed_work ibmvnic_delayed_reset; diff --git a/patches.suse/ibmvnic-simplify-reset_long_term_buff-function.patch b/patches.suse/ibmvnic-simplify-reset_long_term_buff-function.patch new file mode 100644 index 0000000..a331bee --- /dev/null +++ b/patches.suse/ibmvnic-simplify-reset_long_term_buff-function.patch @@ -0,0 +1,111 @@ +From 1c7d45e7b2c29080bf6c8cd0e213cc3cbb62a054 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Fri, 12 Feb 2021 20:36:10 -0600 +Subject: [PATCH] ibmvnic: simplify reset_long_term_buff function + +References: bsc#1184114 ltc#192237 bsc#1183023 ltc#191791 +Patch-mainline: v5.12-rc1 +Git-commit: 1c7d45e7b2c29080bf6c8cd0e213cc3cbb62a054 + +The only thing reset_long_term_buff() should do is set +buffer to zero. After doing that, it is not necessary to +send_request_map again to VIOS since it actually does not +change the mapping. So, keep memset function and remove all +others. + +Signed-off-by: Lijun Pan +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 46 ++++++------------------------ + 1 file changed, 8 insertions(+), 38 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 1774fbaab146..7a5e589e7223 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -253,40 +253,12 @@ static void free_long_term_buff(struct ibmvnic_adapter *adapter, + dma_free_coherent(dev, ltb->size, ltb->buff, ltb->addr); + } + +-static int reset_long_term_buff(struct ibmvnic_adapter *adapter, +- struct ibmvnic_long_term_buff *ltb) ++static int reset_long_term_buff(struct ibmvnic_long_term_buff *ltb) + { +- struct device *dev = &adapter->vdev->dev; +- int rc; ++ if (!ltb->buff) ++ return -EINVAL; + + memset(ltb->buff, 0, ltb->size); +- +- mutex_lock(&adapter->fw_lock); +- adapter->fw_done_rc = 0; +- +- reinit_completion(&adapter->fw_done); +- rc = send_request_map(adapter, ltb->addr, ltb->size, ltb->map_id); +- if (rc) { +- mutex_unlock(&adapter->fw_lock); +- return rc; +- } +- +- rc = ibmvnic_wait_for_completion(adapter, &adapter->fw_done, 10000); +- if (rc) { +- dev_info(dev, +- "Reset failed, long term map request timed out or aborted\n"); +- mutex_unlock(&adapter->fw_lock); +- return rc; +- } +- +- if (adapter->fw_done_rc) { +- dev_info(dev, +- "Reset failed, attempting to free and reallocate buffer\n"); +- free_long_term_buff(adapter, ltb); +- mutex_unlock(&adapter->fw_lock); +- return alloc_long_term_buff(adapter, ltb, ltb->size); +- } +- mutex_unlock(&adapter->fw_lock); + return 0; + } + +@@ -508,8 +480,7 @@ static int reset_rx_pools(struct ibmvnic_adapter *adapter) + rx_pool->size * + rx_pool->buff_size); + } else { +- rc = reset_long_term_buff(adapter, +- &rx_pool->long_term_buff); ++ rc = reset_long_term_buff(&rx_pool->long_term_buff); + } + + if (rc) +@@ -632,12 +603,11 @@ static int init_rx_pools(struct net_device *netdev) + return 0; + } + +-static int reset_one_tx_pool(struct ibmvnic_adapter *adapter, +- struct ibmvnic_tx_pool *tx_pool) ++static int reset_one_tx_pool(struct ibmvnic_tx_pool *tx_pool) + { + int rc, i; + +- rc = reset_long_term_buff(adapter, &tx_pool->long_term_buff); ++ rc = reset_long_term_buff(&tx_pool->long_term_buff); + if (rc) + return rc; + +@@ -664,10 +634,10 @@ static int reset_tx_pools(struct ibmvnic_adapter *adapter) + + tx_scrqs = adapter->num_active_tx_pools; + for (i = 0; i < tx_scrqs; i++) { +- rc = reset_one_tx_pool(adapter, &adapter->tso_pool[i]); ++ rc = reset_one_tx_pool(&adapter->tso_pool[i]); + if (rc) + return rc; +- rc = reset_one_tx_pool(adapter, &adapter->tx_pool[i]); ++ rc = reset_one_tx_pool(&adapter->tx_pool[i]); + if (rc) + return rc; + } +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-skip-send_request_unmap-for-timeout-reset.patch b/patches.suse/ibmvnic-skip-send_request_unmap-for-timeout-reset.patch new file mode 100644 index 0000000..abaaef8 --- /dev/null +++ b/patches.suse/ibmvnic-skip-send_request_unmap-for-timeout-reset.patch @@ -0,0 +1,45 @@ +From 7d3a7b9ea59ddb223aec59b45fa1713c633aaed4 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Fri, 12 Feb 2021 20:49:00 -0600 +Subject: [PATCH] ibmvnic: skip send_request_unmap for timeout reset + +References: bsc#1184114 ltc#192237 bsc#1182485 ltc#191591 +Patch-mainline: v5.12-rc1 +Git-commit: 7d3a7b9ea59ddb223aec59b45fa1713c633aaed4 + +Timeout reset will trigger the VIOS to unmap it automatically, +similarly as FAILVOER and MOBILITY events. If we unmap it +in the linux side, we will see errors like +"30000003: Error 4 in REQUEST_UNMAP_RSP". +So, don't call send_request_unmap for timeout reset. + +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 | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index f6402a20ba32..cd201f89ce6c 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -247,8 +247,13 @@ static void free_long_term_buff(struct ibmvnic_adapter *adapter, + if (!ltb->buff) + return; + ++ /* VIOS automatically unmaps the long term buffer at remote ++ * end for the following resets: ++ * FAILOVER, MOBILITY, TIMEOUT. ++ */ + if (adapter->reset_reason != VNIC_RESET_FAILOVER && +- adapter->reset_reason != VNIC_RESET_MOBILITY) ++ adapter->reset_reason != VNIC_RESET_MOBILITY && ++ adapter->reset_reason != VNIC_RESET_TIMEOUT) + send_request_unmap(adapter, ltb->map_id); + dma_free_coherent(dev, ltb->size, ltb->buff, ltb->addr); + } +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-skip-tx-timeout-reset-while-in-resetting.patch b/patches.suse/ibmvnic-skip-tx-timeout-reset-while-in-resetting.patch new file mode 100644 index 0000000..7fe0efd --- /dev/null +++ b/patches.suse/ibmvnic-skip-tx-timeout-reset-while-in-resetting.patch @@ -0,0 +1,42 @@ +From 855a631a4c11458a9cef1ab79c1530436aa95fae Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Fri, 20 Nov 2020 16:40:13 -0600 +Subject: [PATCH] ibmvnic: skip tx timeout reset while in resetting + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc6 +Git-commit: 855a631a4c11458a9cef1ab79c1530436aa95fae + +Sometimes it takes longer than 5 seconds (watchdog timeout) to complete +failover, migration, and other resets. In stead of scheduling another +timeout reset, we wait for the current one to complete. + +Suggested-by: Brian King +Signed-off-by: Lijun Pan +Reviewed-by: Dany Madden +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 9665532a9ed2..2aa40b2f225c 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2356,6 +2356,12 @@ static void ibmvnic_tx_timeout(struct net_device *dev, unsigned int txqueue) + { + struct ibmvnic_adapter *adapter = netdev_priv(dev); + ++ if (test_bit(0, &adapter->resetting)) { ++ netdev_err(adapter->netdev, ++ "Adapter is resetting, skip timeout reset\n"); ++ return; ++ } ++ + ibmvnic_reset(adapter, VNIC_RESET_TIMEOUT); + } + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-stop-free_all_rwi-on-failed-reset.patch b/patches.suse/ibmvnic-stop-free_all_rwi-on-failed-reset.patch new file mode 100644 index 0000000..720d16d --- /dev/null +++ b/patches.suse/ibmvnic-stop-free_all_rwi-on-failed-reset.patch @@ -0,0 +1,74 @@ +From 18f141bf97d42f65abfdf17fd93fb3a0dac100e7 Mon Sep 17 00:00:00 2001 +From: Dany Madden +Date: Wed, 25 Nov 2020 18:04:25 -0600 +Subject: [PATCH] ibmvnic: stop free_all_rwi on failed reset + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc7 +Git-commit: 18f141bf97d42f65abfdf17fd93fb3a0dac100e7 + +When ibmvnic fails to reset, it breaks out of the reset loop and frees +all of the remaining resets from the workqueue. Doing so prevents the +adapter from recovering if no reset is scheduled after that. Instead, +have the driver continue to process resets on the workqueue. + +Remove the no longer need free_all_rwi(). + +Fixes: ed651a10875f1 ("ibmvnic: Updated reset handling") +Signed-off-by: Dany Madden +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 22 +++------------------- + 1 file changed, 3 insertions(+), 19 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index b28a979061dc..e9243d8c5abc 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2173,17 +2173,6 @@ static struct ibmvnic_rwi *get_next_rwi(struct ibmvnic_adapter *adapter) + return rwi; + } + +-static void free_all_rwi(struct ibmvnic_adapter *adapter) +-{ +- struct ibmvnic_rwi *rwi; +- +- rwi = get_next_rwi(adapter); +- while (rwi) { +- kfree(rwi); +- rwi = get_next_rwi(adapter); +- } +-} +- + static void __ibmvnic_reset(struct work_struct *work) + { + struct ibmvnic_rwi *rwi; +@@ -2252,9 +2241,9 @@ static void __ibmvnic_reset(struct work_struct *work) + else + adapter->state = reset_state; + rc = 0; +- } else if (rc && rc != IBMVNIC_INIT_FAILED && +- !adapter->force_reset_recovery) +- break; ++ } ++ if (rc) ++ netdev_dbg(adapter->netdev, "Reset failed, rc=%d\n", rc); + + rwi = get_next_rwi(adapter); + +@@ -2268,11 +2257,6 @@ static void __ibmvnic_reset(struct work_struct *work) + complete(&adapter->reset_done); + } + +- if (rc) { +- netdev_dbg(adapter->netdev, "Reset failed\n"); +- free_all_rwi(adapter); +- } +- + clear_bit_unlock(0, &adapter->resetting); + } + +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-store-RX-and-TX-subCRQ-handle-array-in-ibmvn.patch b/patches.suse/ibmvnic-store-RX-and-TX-subCRQ-handle-array-in-ibmvn.patch new file mode 100644 index 0000000..289cfd4 --- /dev/null +++ b/patches.suse/ibmvnic-store-RX-and-TX-subCRQ-handle-array-in-ibmvn.patch @@ -0,0 +1,156 @@ +From f3ae59c0c01530ab48faf72cc678f92ad8aa7b4f Mon Sep 17 00:00:00 2001 +From: Cristobal Forno +Date: Wed, 19 Aug 2020 13:16:23 -0500 +Subject: [PATCH] ibmvnic: store RX and TX subCRQ handle array in + ibmvnic_adapter struct + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc1 +Git-commit: f3ae59c0c01530ab48faf72cc678f92ad8aa7b4f + +Currently the driver reads RX and TX subCRQ handle array directly from +a DMA-mapped buffer address when it needs to make a H_SEND_SUBCRQ +hcall. This patch stores that information in the ibmvnic_sub_crq_queue +structure instead of reading from the buffer received at login. The +overall goal of this patch is to parse relevant information from the +login response buffer and store it in the driver's private data +structures so that we don't need to read directly from the buffer and +can then free up that memory. + +Signed-off-by: Cristobal Forno +Reviewed-by: Jesse Brandeburg +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 38 ++++++++++++++++++++---------- + drivers/net/ethernet/ibm/ibmvnic.h | 1 + + 2 files changed, 27 insertions(+), 12 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 5afb3c9c52d2..597801e7e8ba 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -306,6 +306,7 @@ static void replenish_rx_pool(struct ibmvnic_adapter *adapter, + struct ibmvnic_rx_pool *pool) + { + int count = pool->size - atomic_read(&pool->available); ++ u64 handle = adapter->rx_scrq[pool->index]->handle; + struct device *dev = &adapter->vdev->dev; + int buffers_added = 0; + unsigned long lpar_rc; +@@ -314,7 +315,6 @@ static void replenish_rx_pool(struct ibmvnic_adapter *adapter, + unsigned int offset; + dma_addr_t dma_addr; + unsigned char *dst; +- u64 *handle_array; + int shift = 0; + int index; + int i; +@@ -322,10 +322,6 @@ static void replenish_rx_pool(struct ibmvnic_adapter *adapter, + if (!pool->active) + return; + +- handle_array = (u64 *)((u8 *)(adapter->login_rsp_buf) + +- be32_to_cpu(adapter->login_rsp_buf-> +- off_rxadd_subcrqs)); +- + for (i = 0; i < count; ++i) { + skb = alloc_skb(pool->buff_size, GFP_ATOMIC); + if (!skb) { +@@ -369,8 +365,7 @@ static void replenish_rx_pool(struct ibmvnic_adapter *adapter, + #endif + sub_crq.rx_add.len = cpu_to_be32(pool->buff_size << shift); + +- lpar_rc = send_subcrq(adapter, handle_array[pool->index], +- &sub_crq); ++ lpar_rc = send_subcrq(adapter, handle, &sub_crq); + if (lpar_rc != H_SUCCESS) + goto failure; + +@@ -1524,9 +1519,9 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) + unsigned int offset; + int num_entries = 1; + unsigned char *dst; +- u64 *handle_array; + int index = 0; + u8 proto = 0; ++ u64 handle; + netdev_tx_t ret = NETDEV_TX_OK; + + if (test_bit(0, &adapter->resetting)) { +@@ -1553,8 +1548,7 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) + + tx_scrq = adapter->tx_scrq[queue_num]; + txq = netdev_get_tx_queue(netdev, skb_get_queue_mapping(skb)); +- handle_array = (u64 *)((u8 *)(adapter->login_rsp_buf) + +- be32_to_cpu(adapter->login_rsp_buf->off_txsubm_subcrqs)); ++ handle = tx_scrq->handle; + + index = tx_pool->free_map[tx_pool->consumer_index]; + +@@ -1666,14 +1660,14 @@ static netdev_tx_t ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) + ret = NETDEV_TX_OK; + goto tx_err_out; + } +- lpar_rc = send_subcrq_indirect(adapter, handle_array[queue_num], ++ lpar_rc = send_subcrq_indirect(adapter, handle, + (u64)tx_buff->indir_dma, + (u64)num_entries); + dma_unmap_single(dev, tx_buff->indir_dma, + sizeof(tx_buff->indir_arr), DMA_TO_DEVICE); + } else { + tx_buff->num_entries = num_entries; +- lpar_rc = send_subcrq(adapter, handle_array[queue_num], ++ lpar_rc = send_subcrq(adapter, handle, + &tx_crq); + } + if (lpar_rc != H_SUCCESS) { +@@ -4292,6 +4286,10 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq, + struct net_device *netdev = adapter->netdev; + struct ibmvnic_login_rsp_buffer *login_rsp = adapter->login_rsp_buf; + struct ibmvnic_login_buffer *login = adapter->login_buf; ++ u64 *tx_handle_array; ++ u64 *rx_handle_array; ++ int num_tx_pools; ++ int num_rx_pools; + int i; + + dma_unmap_single(dev, adapter->login_buf_token, adapter->login_buf_sz, +@@ -4326,6 +4324,22 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq, + ibmvnic_remove(adapter->vdev); + return -EIO; + } ++ ++ num_tx_pools = be32_to_cpu(adapter->login_rsp_buf->num_txsubm_subcrqs); ++ num_rx_pools = be32_to_cpu(adapter->login_rsp_buf->num_rxadd_subcrqs); ++ ++ tx_handle_array = (u64 *)((u8 *)(adapter->login_rsp_buf) + ++ be32_to_cpu(adapter->login_rsp_buf->off_txsubm_subcrqs)); ++ rx_handle_array = (u64 *)((u8 *)(adapter->login_rsp_buf) + ++ be32_to_cpu(adapter->login_rsp_buf->off_rxadd_subcrqs)); ++ ++ for (i = 0; i < num_tx_pools; i++) ++ adapter->tx_scrq[i]->handle = tx_handle_array[i]; ++ ++ for (i = 0; i < num_rx_pools; i++) ++ adapter->rx_scrq[i]->handle = rx_handle_array[i]; ++ ++ release_login_rsp_buffer(adapter); + release_login_buffer(adapter); + complete(&adapter->init_done); + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h +index f8416e1d4cf0..d99820212edd 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.h ++++ b/drivers/net/ethernet/ibm/ibmvnic.h +@@ -875,6 +875,7 @@ struct ibmvnic_sub_crq_queue { + struct ibmvnic_adapter *adapter; + atomic_t used; + char name[32]; ++ u64 handle; + }; + + struct ibmvnic_long_term_buff { +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-substitute-mb-with-dma_wmb-for-send_-crq-fun.patch b/patches.suse/ibmvnic-substitute-mb-with-dma_wmb-for-send_-crq-fun.patch new file mode 100644 index 0000000..116700d --- /dev/null +++ b/patches.suse/ibmvnic-substitute-mb-with-dma_wmb-for-send_-crq-fun.patch @@ -0,0 +1,46 @@ +From 1a42156f52bd4de0e2442671bc24b7ffc7b01c52 Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Fri, 12 Feb 2021 20:36:46 -0600 +Subject: [PATCH] ibmvnic: substitute mb() with dma_wmb() for send_*crq* + functions + +References: bsc#1184114 ltc#192237 bsc#1183023 ltc#191791 +Patch-mainline: v5.12-rc1 +Git-commit: 1a42156f52bd4de0e2442671bc24b7ffc7b01c52 + +The CRQ and subCRQ descriptors are DMA mapped, so dma_wmb(), +though weaker, is good enough to protect the data structures. + +Signed-off-by: Lijun Pan +Acked-by: Thomas Falcon +Signed-off-by: David S. Miller +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index 7a5e589e7223..927d5f36d308 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -3599,7 +3599,7 @@ static int send_subcrq_indirect(struct ibmvnic_adapter *adapter, + int rc; + + /* Make sure the hypervisor sees the complete request */ +- mb(); ++ dma_wmb(); + rc = plpar_hcall_norets(H_SEND_SUB_CRQ_INDIRECT, ua, + cpu_to_be64(remote_handle), + ioba, num_entries); +@@ -3629,7 +3629,7 @@ static int ibmvnic_send_crq(struct ibmvnic_adapter *adapter, + } + + /* Make sure the hypervisor sees the complete request */ +- mb(); ++ dma_wmb(); + + rc = plpar_hcall_norets(H_SEND_CRQ, ua, + cpu_to_be64(u64_crq[0]), +-- +2.26.2 + diff --git a/patches.suse/ibmvnic-track-pending-login.patch b/patches.suse/ibmvnic-track-pending-login.patch new file mode 100644 index 0000000..ab0412f --- /dev/null +++ b/patches.suse/ibmvnic-track-pending-login.patch @@ -0,0 +1,89 @@ +From 76cdc5c5d99ce4856ad0ac38facc33b52fa64f77 Mon Sep 17 00:00:00 2001 +From: Sukadev Bhattiprolu +Date: Wed, 25 Nov 2020 18:04:29 -0600 +Subject: [PATCH] ibmvnic: track pending login + +References: bsc#1184114 ltc#192237 bsc#1179243 ltc#189290 +Patch-mainline: v5.10-rc7 +Git-commit: 76cdc5c5d99ce4856ad0ac38facc33b52fa64f77 + +If after ibmvnic sends a LOGIN it gets a FAILOVER, it is possible that +the worker thread will start reset process and free the login response +buffer before it gets a (now stale) LOGIN_RSP. The ibmvnic tasklet will +then try to access the login response buffer and crash. + +Have ibmvnic track pending logins and discard any stale login responses. + +Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") +Signed-off-by: Sukadev Bhattiprolu +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 17 +++++++++++++++++ + drivers/net/ethernet/ibm/ibmvnic.h | 1 + + 2 files changed, 18 insertions(+) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index d4d40b349788..13eae1666477 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -3841,6 +3841,8 @@ static int send_login(struct ibmvnic_adapter *adapter) + crq.login.cmd = LOGIN; + crq.login.ioba = cpu_to_be32(buffer_token); + crq.login.len = cpu_to_be32(buffer_size); ++ ++ adapter->login_pending = true; + ibmvnic_send_crq(adapter, &crq); + + return 0; +@@ -4393,6 +4395,15 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq, + u64 *size_array; + int i; + ++ /* CHECK: Test/set of login_pending does not need to be atomic ++ * because only ibmvnic_tasklet tests/clears this. ++ */ ++ if (!adapter->login_pending) { ++ netdev_warn(netdev, "Ignoring unexpected login response\n"); ++ return 0; ++ } ++ adapter->login_pending = false; ++ + dma_unmap_single(dev, adapter->login_buf_token, adapter->login_buf_sz, + DMA_TO_DEVICE); + dma_unmap_single(dev, adapter->login_rsp_buf_token, +@@ -4764,6 +4775,11 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq, + case IBMVNIC_CRQ_INIT: + dev_info(dev, "Partner initialized\n"); + adapter->from_passive_init = true; ++ /* Discard any stale login responses from prev reset. ++ * CHECK: should we clear even on INIT_COMPLETE? ++ */ ++ adapter->login_pending = false; ++ + if (!completion_done(&adapter->init_done)) { + complete(&adapter->init_done); + adapter->init_done_rc = -EIO; +@@ -5196,6 +5212,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id) + dev_set_drvdata(&dev->dev, netdev); + adapter->vdev = dev; + adapter->netdev = netdev; ++ adapter->login_pending = false; + + ether_addr_copy(adapter->mac_addr, mac_addr_p); + ether_addr_copy(netdev->dev_addr, adapter->mac_addr); +diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h +index 47a3fd71c96f..bffa7f939ee1 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.h ++++ b/drivers/net/ethernet/ibm/ibmvnic.h +@@ -1086,6 +1086,7 @@ struct ibmvnic_adapter { + struct delayed_work ibmvnic_delayed_reset; + unsigned long resetting; + bool napi_enabled, from_passive_init; ++ bool login_pending; + + bool failover_pending; + bool force_reset_recovery; +-- +2.26.2 + diff --git a/patches.suse/mac80211-fix-double-free-in-ibss_leave.patch b/patches.suse/mac80211-fix-double-free-in-ibss_leave.patch new file mode 100644 index 0000000..f10998a --- /dev/null +++ b/patches.suse/mac80211-fix-double-free-in-ibss_leave.patch @@ -0,0 +1,76 @@ +From 3bd801b14e0c5d29eeddc7336558beb3344efaa3 Mon Sep 17 00:00:00 2001 +From: Markus Theil +Date: Sat, 13 Feb 2021 14:36:53 +0100 +Subject: [PATCH] mac80211: fix double free in ibss_leave +Git-commit: 3bd801b14e0c5d29eeddc7336558beb3344efaa3 +Patch-mainline: v5.12-rc5 +References: git-fixes + +Clear beacon ie pointer and ie length after free +in order to prevent double free. + +================================================================== +Bug: KASAN: double-free or invalid-free \ +in ieee80211_ibss_leave+0x83/0xe0 net/mac80211/ibss.c:1876 + +Cpu: 0 PID: 8472 Comm: syz-executor100 Not tainted 5.11.0-rc6-syzkaller #0 +Call Trace: + __dump_stack lib/dump_stack.c:79 [inline] + dump_stack+0x107/0x163 lib/dump_stack.c:120 + print_address_description.constprop.0.cold+0x5b/0x2c6 mm/kasan/report.c:230 + kasan_report_invalid_free+0x51/0x80 mm/kasan/report.c:355 + ____kasan_slab_free+0xcc/0xe0 mm/kasan/common.c:341 + kasan_slab_free include/linux/kasan.h:192 [inline] + __cache_free mm/slab.c:3424 [inline] + kfree+0xed/0x270 mm/slab.c:3760 + ieee80211_ibss_leave+0x83/0xe0 net/mac80211/ibss.c:1876 + rdev_leave_ibss net/wireless/rdev-ops.h:545 [inline] + __cfg80211_leave_ibss+0x19a/0x4c0 net/wireless/ibss.c:212 + __cfg80211_leave+0x327/0x430 net/wireless/core.c:1172 + cfg80211_leave net/wireless/core.c:1221 [inline] + cfg80211_netdev_notifier_call+0x9e8/0x12c0 net/wireless/core.c:1335 + notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 + call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2040 + call_netdevice_notifiers_extack net/core/dev.c:2052 [inline] + call_netdevice_notifiers net/core/dev.c:2066 [inline] + __dev_close_many+0xee/0x2e0 net/core/dev.c:1586 + __dev_close net/core/dev.c:1624 [inline] + __dev_change_flags+0x2cb/0x730 net/core/dev.c:8476 + dev_change_flags+0x8a/0x160 net/core/dev.c:8549 + dev_ifsioc+0x210/0xa70 net/core/dev_ioctl.c:265 + dev_ioctl+0x1b1/0xc40 net/core/dev_ioctl.c:511 + sock_do_ioctl+0x148/0x2d0 net/socket.c:1060 + sock_ioctl+0x477/0x6a0 net/socket.c:1177 + vfs_ioctl fs/ioctl.c:48 [inline] + __do_sys_ioctl fs/ioctl.c:753 [inline] + __se_sys_ioctl fs/ioctl.c:739 [inline] + __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739 + do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 + entry_SYSCALL_64_after_hwframe+0x44/0xa9 + +Reported-by: syzbot+93976391bf299d425f44@syzkaller.appspotmail.com +Signed-off-by: Markus Theil +Link: https://lore.kernel.org/r/20210213133653.367130-1-markus.theil@tu-ilmenau.de +Signed-off-by: Johannes Berg +Acked-by: Takashi Iwai + +--- + net/mac80211/ibss.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c +index 1f552f374e97..a7ac53a2f00d 100644 +--- a/net/mac80211/ibss.c ++++ b/net/mac80211/ibss.c +@@ -1874,6 +1874,8 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata) + + /* remove beacon */ + kfree(sdata->u.ibss.ie); ++ sdata->u.ibss.ie = NULL; ++ sdata->u.ibss.ie_len = 0; + + /* on the next join, re-program HT parameters */ + memset(&ifibss->ht_capa, 0, sizeof(ifibss->ht_capa)); +-- +2.26.2 + diff --git a/patches.suse/mac80211-fix-rate-mask-reset.patch b/patches.suse/mac80211-fix-rate-mask-reset.patch new file mode 100644 index 0000000..c8bc0dd --- /dev/null +++ b/patches.suse/mac80211-fix-rate-mask-reset.patch @@ -0,0 +1,57 @@ +From 1944015fe9c1d9fa5e9eb7ffbbb5ef8954d6753b Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Fri, 12 Feb 2021 11:22:14 +0100 +Subject: [PATCH] mac80211: fix rate mask reset +Git-commit: 1944015fe9c1d9fa5e9eb7ffbbb5ef8954d6753b +Patch-mainline: v5.12-rc5 +References: git-fixes + +Coverity reported the strange "if (~...)" condition that's +always true. It suggested that ! was intended instead of ~, +but upon further analysis I'm convinced that what really was +intended was a comparison to 0xff/0xffff (in HT/VHT cases +respectively), since this indicates that all of the rates +are enabled. + +Change the comparison accordingly. + +I'm guessing this never really mattered because a reset to +not having a rate mask is basically equivalent to having a +mask that enables all rates. + +Reported-by: Colin Ian King +Fixes: 2ffbe6d33366 ("mac80211: fix and optimize MCS mask handling") +Fixes: b119ad6e726c ("mac80211: add rate mask logic for vht rates") +Reviewed-by: Colin Ian King +Link: https://lore.kernel.org/r/20210212112213.36b38078f569.I8546a20c80bc1669058eb453e213630b846e107b@changeid +Signed-off-by: Johannes Berg +Acked-by: Takashi Iwai + +--- + net/mac80211/cfg.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c +index c4c70e30ad7f..68a0de02b561 100644 +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -2950,14 +2950,14 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, + continue; + + for (j = 0; j < IEEE80211_HT_MCS_MASK_LEN; j++) { +- if (~sdata->rc_rateidx_mcs_mask[i][j]) { ++ if (sdata->rc_rateidx_mcs_mask[i][j] != 0xff) { + sdata->rc_has_mcs_mask[i] = true; + break; + } + } + + for (j = 0; j < NL80211_VHT_NSS_MAX; j++) { +- if (~sdata->rc_rateidx_vht_mcs_mask[i][j]) { ++ if (sdata->rc_rateidx_vht_mcs_mask[i][j] != 0xffff) { + sdata->rc_has_vht_mcs_mask[i] = true; + break; + } +-- +2.26.2 + diff --git a/patches.suse/mmc-core-Use-DEFINE_DEBUGFS_ATTRIBUTE-instead-of-DEF.patch b/patches.suse/mmc-core-Use-DEFINE_DEBUGFS_ATTRIBUTE-instead-of-DEF.patch new file mode 100644 index 0000000..849c4bd --- /dev/null +++ b/patches.suse/mmc-core-Use-DEFINE_DEBUGFS_ATTRIBUTE-instead-of-DEF.patch @@ -0,0 +1,48 @@ +From 43170255321f83d8e8a3964f70040c49b3d19df0 Mon Sep 17 00:00:00 2001 +From: Zou Wei +Date: Thu, 23 Apr 2020 17:15:19 +0800 +Subject: [PATCH] mmc: core: Use DEFINE_DEBUGFS_ATTRIBUTE instead of + DEFINE_SIMPLE_ATTRIBUTE +Git-commit: 43170255321f83d8e8a3964f70040c49b3d19df0 +Patch-mainline: v5.8-rc1 +REferences: git-fixes + +Fixes coccicheck warning: + +drivers/mmc/core/debugfs.c:222:0-23: WARNING: mmc_clock_fops should be +defined with DEFINE_DEBUGFS_ATTRIBUTE + +Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE +for debugfs files + +Fixes: 703aae3d09a4b ("mmc: add a file to debugfs for changing host clock at runtime") +Fixes: a04c50aaa916f ("mmc: core: no need to check return value of debugfs_create functions") +Reported-by: Hulk Robot +Signed-off-by: Zou Wei +Link: https://lore.kernel.org/r/1587633319-19835-1-git-send-email-zou_wei@huawei.com +Signed-off-by: Ulf Hansson +Signed-off-by: Oliver Neukum +--- + drivers/mmc/core/debugfs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/mmc/core/debugfs.c ++++ b/drivers/mmc/core/debugfs.c +@@ -233,7 +233,7 @@ static int mmc_clock_opt_set(void *data, + return 0; + } + +-DEFINE_SIMPLE_ATTRIBUTE(mmc_clock_fops, mmc_clock_opt_get, mmc_clock_opt_set, ++DEFINE_DEBUGFS_ATTRIBUTE(mmc_clock_fops, mmc_clock_opt_get, mmc_clock_opt_set, + "%llu\n"); + + void mmc_add_host_debugfs(struct mmc_host *host) +@@ -254,7 +254,7 @@ void mmc_add_host_debugfs(struct mmc_hos + if (!debugfs_create_file("ios", S_IRUSR, root, host, &mmc_ios_fops)) + goto err_node; + +- if (!debugfs_create_file("clock", S_IRUSR | S_IWUSR, root, host, ++ if (!debugfs_create_file_unsafe("clock", S_IRUSR | S_IWUSR, root, host, + &mmc_clock_fops)) + goto err_node; + diff --git a/patches.suse/mmc-sdhci-of-arasan-Add-missed-checks-for-devm_clk_r.patch b/patches.suse/mmc-sdhci-of-arasan-Add-missed-checks-for-devm_clk_r.patch new file mode 100644 index 0000000..8ebe91d --- /dev/null +++ b/patches.suse/mmc-sdhci-of-arasan-Add-missed-checks-for-devm_clk_r.patch @@ -0,0 +1,36 @@ +From c99e1d0c91ac8d7db3062ea1af315f21295701d7 Mon Sep 17 00:00:00 2001 +From: Chuhong Yuan +Date: Tue, 9 Jun 2020 00:22:26 +0800 +Subject: [PATCH] mmc: sdhci-of-arasan: Add missed checks for + devm_clk_register() +Git-commit: c99e1d0c91ac8d7db3062ea1af315f21295701d7 +Patch-mainline: v5.9-rc1 +References: git-fixes + +These functions do not check the return value of devm_clk_register(): + - sdhci_arasan_register_sdcardclk() + - sdhci_arasan_register_sampleclk() + +Therefore, add the missed checks to fix them. + +Fixes: c390f2110adf1 ("mmc: sdhci-of-arasan: Add ability to export card clock") +Signed-off-by: Chuhong Yuan +Reviewed-by: Douglas Anderson +Link: https://lore.kernel.org/r/20200608162226.3259186-1-hslester96@gmail.com +Signed-off-by: Ulf Hansson +Signed-off-by: Oliver Neukum +--- + drivers/mmc/host/sdhci-of-arasan.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/mmc/host/sdhci-of-arasan.c ++++ b/drivers/mmc/host/sdhci-of-arasan.c +@@ -528,6 +528,8 @@ static int sdhci_arasan_register_sdclk(s + sdhci_arasan->sdcardclk_hw.init = &sdcardclk_init; + sdhci_arasan->sdcardclk = + devm_clk_register(dev, &sdhci_arasan->sdcardclk_hw); ++ if (IS_ERR(sdhci_arasan->sdcardclk)) ++ return PTR_ERR(sdhci_arasan->sdcardclk); + sdhci_arasan->sdcardclk_hw.init = NULL; + + ret = of_clk_add_provider(np, of_clk_src_simple_get, diff --git a/patches.suse/net-cdc-phonet-fix-data-interface-release-on-probe-f.patch b/patches.suse/net-cdc-phonet-fix-data-interface-release-on-probe-f.patch new file mode 100644 index 0000000..339ed5a --- /dev/null +++ b/patches.suse/net-cdc-phonet-fix-data-interface-release-on-probe-f.patch @@ -0,0 +1,37 @@ +From c79a707072fe3fea0e3c92edee6ca85c1e53c29f Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Thu, 18 Mar 2021 16:57:49 +0100 +Subject: [PATCH] net: cdc-phonet: fix data-interface release on probe failure +Git-commit: c79a707072fe3fea0e3c92edee6ca85c1e53c29f +Patch-mainline: v5.12-rc5 +References: git-fixes + +Set the disconnected flag before releasing the data interface in case +netdev registration fails to avoid having the disconnect callback try to +deregister the never registered netdev (and trigger a WARN_ON()). + +Fixes: 87cf65601e17 ("USB host CDC Phonet network interface driver") +Signed-off-by: Johan Hovold +Signed-off-by: David S. Miller +Acked-by: Takashi Iwai + +--- + drivers/net/usb/cdc-phonet.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c +index 02e6bbb17b15..8d1f69dad603 100644 +--- a/drivers/net/usb/cdc-phonet.c ++++ b/drivers/net/usb/cdc-phonet.c +@@ -387,6 +387,8 @@ static int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *i + + err = register_netdev(dev); + if (err) { ++ /* Set disconnected flag so that disconnect() returns early. */ ++ pnd->disconnected = 1; + usb_driver_release_interface(&usbpn_driver, data_intf); + goto out; + } +-- +2.26.2 + diff --git a/patches.suse/net-core-introduce-__netdev_notify_peers.patch b/patches.suse/net-core-introduce-__netdev_notify_peers.patch new file mode 100644 index 0000000..118d61c --- /dev/null +++ b/patches.suse/net-core-introduce-__netdev_notify_peers.patch @@ -0,0 +1,80 @@ +From 7061eb8cfa902daa1ec71d23b5cddb8b4391e72b Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Mon, 14 Dec 2020 15:19:28 -0600 +Subject: [PATCH] net: core: introduce __netdev_notify_peers + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.11-rc1 +Git-commit: 7061eb8cfa902daa1ec71d23b5cddb8b4391e72b + +There are some use cases for netdev_notify_peers in the context +when rtnl lock is already held. Introduce lockless version +of netdev_notify_peers call to save the extra code to call + call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, dev); + call_netdevice_notifiers(NETDEV_RESEND_IGMP, dev); +After that, convert netdev_notify_peers to call the new helper. + +Suggested-by: Nathan Lynch +Signed-off-by: Lijun Pan +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + include/linux/netdevice.h | 1 + + net/core/dev.c | 22 ++++++++++++++++++++-- + 2 files changed, 21 insertions(+), 2 deletions(-) + +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index 7bf167993c05..259be67644e3 100644 +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -4547,6 +4547,7 @@ void __dev_set_rx_mode(struct net_device *dev); + int dev_set_promiscuity(struct net_device *dev, int inc); + int dev_set_allmulti(struct net_device *dev, int inc); + void netdev_state_change(struct net_device *dev); ++void __netdev_notify_peers(struct net_device *dev); + void netdev_notify_peers(struct net_device *dev); + void netdev_features_change(struct net_device *dev); + /* Load a device via the kmod */ +diff --git a/net/core/dev.c b/net/core/dev.c +index a46334906c94..8fa739259041 100644 +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -1456,6 +1456,25 @@ void netdev_state_change(struct net_device *dev) + } + EXPORT_SYMBOL(netdev_state_change); + ++/** ++ * __netdev_notify_peers - notify network peers about existence of @dev, ++ * to be called when rtnl lock is already held. ++ * @dev: network device ++ * ++ * Generate traffic such that interested network peers are aware of ++ * @dev, such as by generating a gratuitous ARP. This may be used when ++ * a device wants to inform the rest of the network about some sort of ++ * reconfiguration such as a failover event or virtual machine ++ * migration. ++ */ ++void __netdev_notify_peers(struct net_device *dev) ++{ ++ ASSERT_RTNL(); ++ call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, dev); ++ call_netdevice_notifiers(NETDEV_RESEND_IGMP, dev); ++} ++EXPORT_SYMBOL(__netdev_notify_peers); ++ + /** + * netdev_notify_peers - notify network peers about existence of @dev + * @dev: network device +@@ -1469,8 +1488,7 @@ EXPORT_SYMBOL(netdev_state_change); + void netdev_notify_peers(struct net_device *dev) + { + rtnl_lock(); +- call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, dev); +- call_netdevice_notifiers(NETDEV_RESEND_IGMP, dev); ++ __netdev_notify_peers(dev); + rtnl_unlock(); + } + EXPORT_SYMBOL(netdev_notify_peers); +-- +2.26.2 + diff --git a/patches.suse/net-ethernet-ibm-ibmvnic-Fix-some-kernel-doc-misdeme.patch b/patches.suse/net-ethernet-ibm-ibmvnic-Fix-some-kernel-doc-misdeme.patch new file mode 100644 index 0000000..ac07f88 --- /dev/null +++ b/patches.suse/net-ethernet-ibm-ibmvnic-Fix-some-kernel-doc-misdeme.patch @@ -0,0 +1,137 @@ +From 807086021bf510ba03bd69a80a54e1de4a0fda30 Mon Sep 17 00:00:00 2001 +From: Lee Jones +Date: Fri, 15 Jan 2021 20:09:03 +0000 +Subject: [PATCH] net: ethernet: ibm: ibmvnic: Fix some kernel-doc + misdemeanours +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.12-rc1 +Git-commit: 807086021bf510ba03bd69a80a54e1de4a0fda30 + +Fixes the following W=1 kernel build warning(s): + + from drivers/net/ethernet/ibm/ibmvnic.c:35: + inlined from ‘handle_vpd_rsp’ at drivers/net/ethernet/ibm/ibmvnic.c:4124:3: + drivers/net/ethernet/ibm/ibmvnic.c:1362: warning: Function parameter or member 'hdr_field' not described in 'build_hdr_data' + drivers/net/ethernet/ibm/ibmvnic.c:1362: warning: Function parameter or member 'skb' not described in 'build_hdr_data' + drivers/net/ethernet/ibm/ibmvnic.c:1362: warning: Function parameter or member 'hdr_len' not described in 'build_hdr_data' + drivers/net/ethernet/ibm/ibmvnic.c:1362: warning: Function parameter or member 'hdr_data' not described in 'build_hdr_data' + drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Function parameter or member 'hdr_field' not described in 'create_hdr_descs' + drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Function parameter or member 'hdr_data' not described in 'create_hdr_descs' + drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Function parameter or member 'len' not described in 'create_hdr_descs' + drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Function parameter or member 'hdr_len' not described in 'create_hdr_descs' + drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Function parameter or member 'scrq_arr' not described in 'create_hdr_descs' + drivers/net/ethernet/ibm/ibmvnic.c:1474: warning: Function parameter or member 'txbuff' not described in 'build_hdr_descs_arr' + drivers/net/ethernet/ibm/ibmvnic.c:1474: warning: Function parameter or member 'num_entries' not described in 'build_hdr_descs_arr' + drivers/net/ethernet/ibm/ibmvnic.c:1474: warning: Function parameter or member 'hdr_field' not described in 'build_hdr_descs_arr' + drivers/net/ethernet/ibm/ibmvnic.c:1832: warning: Function parameter or member 'adapter' not described in 'do_change_param_reset' + drivers/net/ethernet/ibm/ibmvnic.c:1832: warning: Function parameter or member 'rwi' not described in 'do_change_param_reset' + drivers/net/ethernet/ibm/ibmvnic.c:1832: warning: Function parameter or member 'reset_state' not described in 'do_change_param_reset' + drivers/net/ethernet/ibm/ibmvnic.c:1911: warning: Function parameter or member 'adapter' not described in 'do_reset' + drivers/net/ethernet/ibm/ibmvnic.c:1911: warning: Function parameter or member 'rwi' not described in 'do_reset' + drivers/net/ethernet/ibm/ibmvnic.c:1911: warning: Function parameter or member 'reset_state' not described in 'do_reset' + +Signed-off-by: Lee Jones +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 27 +++++++++++++-------------- + drivers/net/xen-netfront.c | 6 +++--- + 2 files changed, 16 insertions(+), 17 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index aed985e08e8a..4c4252e68de5 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -1384,10 +1384,10 @@ static int ibmvnic_close(struct net_device *netdev) + + /** + * build_hdr_data - creates L2/L3/L4 header data buffer +- * @hdr_field - bitfield determining needed headers +- * @skb - socket buffer +- * @hdr_len - array of header lengths +- * @tot_len - total length of data ++ * @hdr_field: bitfield determining needed headers ++ * @skb: socket buffer ++ * @hdr_len: array of header lengths ++ * @hdr_data: buffer to write the header to + * + * Reads hdr_field to determine which headers are needed by firmware. + * Builds a buffer containing these headers. Saves individual header +@@ -1444,11 +1444,11 @@ static int build_hdr_data(u8 hdr_field, struct sk_buff *skb, + + /** + * create_hdr_descs - create header and header extension descriptors +- * @hdr_field - bitfield determining needed headers +- * @data - buffer containing header data +- * @len - length of data buffer +- * @hdr_len - array of individual header lengths +- * @scrq_arr - descriptor array ++ * @hdr_field: bitfield determining needed headers ++ * @hdr_data: buffer containing header data ++ * @len: length of data buffer ++ * @hdr_len: array of individual header lengths ++ * @scrq_arr: descriptor array + * + * Creates header and, if needed, header extension descriptors and + * places them in a descriptor array, scrq_arr +@@ -1496,10 +1496,9 @@ static int create_hdr_descs(u8 hdr_field, u8 *hdr_data, int len, int *hdr_len, + + /** + * build_hdr_descs_arr - build a header descriptor array +- * @skb - socket buffer +- * @num_entries - number of descriptors to be sent +- * @subcrq - first TX descriptor +- * @hdr_field - bit field determining which headers will be sent ++ * @txbuff: tx buffer ++ * @num_entries: number of descriptors to be sent ++ * @hdr_field: bit field determining which headers will be sent + * + * This function will build a TX descriptor array with applicable + * L2/L3/L4 packet header descriptors to be sent by send_subcrq_indirect. +@@ -1925,7 +1924,7 @@ static int ibmvnic_set_mac(struct net_device *netdev, void *p) + return rc; + } + +-/** ++/* + * 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. + */ +diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c +index c20b78120bb4..6ef2adbd283a 100644 +--- a/drivers/net/xen-netfront.c ++++ b/drivers/net/xen-netfront.c +@@ -1580,7 +1580,7 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev) + return ERR_PTR(err); + } + +-/** ++/* + * Entry point to this code when a new device is created. Allocate the basic + * structures and the ring buffers for communication with the backend, and + * inform the backend of the appropriate details for those. +@@ -1657,7 +1657,7 @@ static void xennet_disconnect_backend(struct netfront_info *info) + } + } + +-/** ++/* + * We are reconnecting to the backend, due to a suspend/resume, or a backend + * driver restart. We tear down our netif structure and recreate it, but + * leave the device-layer structures intact so that this is transparent to the +@@ -2303,7 +2303,7 @@ static int xennet_connect(struct net_device *dev) + return 0; + } + +-/** ++/* + * Callback received when the backend's state changes. + */ + static void netback_changed(struct xenbus_device *dev, +-- +2.26.2 + diff --git a/patches.suse/net-qrtr-fix-a-kernel-infoleak-in-qrtr_recvmsg.patch b/patches.suse/net-qrtr-fix-a-kernel-infoleak-in-qrtr_recvmsg.patch new file mode 100644 index 0000000..a79fb5d --- /dev/null +++ b/patches.suse/net-qrtr-fix-a-kernel-infoleak-in-qrtr_recvmsg.patch @@ -0,0 +1,77 @@ +From 50535249f624d0072cd885bcdce4e4b6fb770160 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Fri, 12 Mar 2021 08:59:48 -0800 +Subject: [PATCH] net: qrtr: fix a kernel-infoleak in qrtr_recvmsg() +Git-commit: 50535249f624d0072cd885bcdce4e4b6fb770160 +Patch-mainline: v5.12-rc5 +References: CVE-2021-29647 bsc#1184192 + +struct sockaddr_qrtr has a 2-byte hole, and qrtr_recvmsg() currently +does not clear it before copying kernel data to user space. + +It might be too late to name the hole since sockaddr_qrtr structure is uapi. + +Bug: KMSAN: kernel-infoleak in kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249 +Cpu: 0 PID: 29705 Comm: syz-executor.3 Not tainted 5.11.0-rc7-syzkaller #0 +Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 +Call Trace: + __dump_stack lib/dump_stack.c:79 [inline] + dump_stack+0x21c/0x280 lib/dump_stack.c:120 + kmsan_report+0xfb/0x1e0 mm/kmsan/kmsan_report.c:118 + kmsan_internal_check_memory+0x202/0x520 mm/kmsan/kmsan.c:402 + kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249 + instrument_copy_to_user include/linux/instrumented.h:121 [inline] + _copy_to_user+0x1ac/0x270 lib/usercopy.c:33 + copy_to_user include/linux/uaccess.h:209 [inline] + move_addr_to_user+0x3a2/0x640 net/socket.c:237 + ____sys_recvmsg+0x696/0xd50 net/socket.c:2575 + ___sys_recvmsg net/socket.c:2610 [inline] + do_recvmmsg+0xa97/0x22d0 net/socket.c:2710 + __sys_recvmmsg net/socket.c:2789 [inline] + __do_sys_recvmmsg net/socket.c:2812 [inline] + __se_sys_recvmmsg+0x24a/0x410 net/socket.c:2805 + __x64_sys_recvmmsg+0x62/0x80 net/socket.c:2805 + do_syscall_64+0x9f/0x140 arch/x86/entry/common.c:48 + entry_SYSCALL_64_after_hwframe+0x44/0xa9 +Rip: 0033:0x465f69 +Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 +Rsp: 002b:00007f43659d6188 EFLAGS: 00000246 ORIG_RAX: 000000000000012b +Rax: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000465f69 +Rdx: 0000000000000008 RSI: 0000000020003e40 RDI: 0000000000000003 +Rbp: 00000000004bfa8f R08: 0000000000000000 R09: 0000000000000000 +R10: 0000000000010060 R11: 0000000000000246 R12: 000000000056bf60 +R13: 0000000000a9fb1f R14: 00007f43659d6300 R15: 0000000000022000 + +Local variable ----addr@____sys_recvmsg created at: + ____sys_recvmsg+0x168/0xd50 net/socket.c:2550 + ____sys_recvmsg+0x168/0xd50 net/socket.c:2550 + +Bytes 2-3 of 12 are uninitialized +Memory access of size 12 starts at ffff88817c627b40 +Data copied to user address 0000000020000140 + +Fixes: bdabad3e363d ("net: Add Qualcomm IPC router") +Signed-off-by: Eric Dumazet +Cc: Courtney Cavin +Reported-by: syzbot +Signed-off-by: David S. Miller +Acked-by: Takashi Iwai + +--- + net/qrtr/qrtr.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/net/qrtr/qrtr.c ++++ b/net/qrtr/qrtr.c +@@ -815,6 +815,11 @@ static int qrtr_recvmsg(struct socket *s + rc = copied; + + if (addr) { ++ /* There is an anonymous 2-byte hole after sq_family, ++ * make sure to clear it. ++ */ ++ memset(addr, 0, sizeof(*addr)); ++ + addr->sq_family = AF_QIPCRTR; + addr->sq_node = le32_to_cpu(phdr->src_node_id); + addr->sq_port = le32_to_cpu(phdr->src_port_id); diff --git a/patches.suse/net-re-solve-some-conflicts-after-net-net-next-merge.patch b/patches.suse/net-re-solve-some-conflicts-after-net-net-next-merge.patch new file mode 100644 index 0000000..ba4c963 --- /dev/null +++ b/patches.suse/net-re-solve-some-conflicts-after-net-net-next-merge.patch @@ -0,0 +1,33 @@ +From b646acd5eb48ec49ef90404336d7e8ee502ecd05 Mon Sep 17 00:00:00 2001 +From: Jakub Kicinski +Date: Tue, 16 Feb 2021 22:58:44 -0800 +Subject: [PATCH] net: re-solve some conflicts after net -> net-next merge + +References: bsc#1184114 ltc#192237 bsc#1176855 ltc#187293 +Patch-mainline: v5.12-rc1 +Git-commit: b646acd5eb48ec49ef90404336d7e8ee502ecd05 (ibmvnic only) + +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 5 ++-- + drivers/net/ethernet/ibm/ibmvnic.h | 10 +++++--- + .../net/ethernet/mellanox/mlx5/core/en_main.c | 5 ---- + drivers/net/ethernet/realtek/r8169_main.c | 25 ------------------- + .../selftests/net/forwarding/tc_flower.sh | 3 ++- + 5 files changed, 11 insertions(+), 37 deletions(-) + +--- a/drivers/net/ethernet/ibm/ibmvnic.h ++++ b/drivers/net/ethernet/ibm/ibmvnic.h +@@ -1087,8 +1087,9 @@ struct ibmvnic_adapter { + spinlock_t state_lock; + enum ibmvnic_reset_reason reset_reason; + struct list_head rwi_list; +- /* Used for serialization of rwi_list */ +- /* when taking both state and rwi locks, take state lock first */ ++ /* Used for serialization of rwi_list. When taking both state ++ * and rwi locks, take state lock first ++ */ + spinlock_t rwi_lock; + struct work_struct ibmvnic_reset; + struct delayed_work ibmvnic_delayed_reset; diff --git a/patches.suse/perf-x86-intel-fix-a-crash-caused-by-zero-pebs-status.patch b/patches.suse/perf-x86-intel-fix-a-crash-caused-by-zero-pebs-status.patch new file mode 100644 index 0000000..bfb1a83 --- /dev/null +++ b/patches.suse/perf-x86-intel-fix-a-crash-caused-by-zero-pebs-status.patch @@ -0,0 +1,55 @@ +From: Kan Liang +Date: Fri, 12 Mar 2021 05:21:37 -0800 +Subject: perf/x86/intel: Fix a crash caused by zero PEBS status +Git-commit: d88d05a9e0b6d9356e97129d4ff9942d765f46ea +Patch-mainline: v5.12-rc4 +References: CVE-2021-28971 bsc#1184196 + +A repeatable crash can be triggered by the perf_fuzzer on some Haswell +system. +https://lore.kernel.org/lkml/7170d3b-c17f-1ded-52aa-cc6d9ae999f4@maine.edu/ + +For some old CPUs (HSW and earlier), the PEBS status in a PEBS record +may be mistakenly set to 0. To minimize the impact of the defect, the +commit was introduced to try to avoid dropping the PEBS record for some +cases. It adds a check in the intel_pmu_drain_pebs_nhm(), and updates +the local pebs_status accordingly. However, it doesn't correct the PEBS +status in the PEBS record, which may trigger the crash, especially for +the large PEBS. + +It's possible that all the PEBS records in a large PEBS have the PEBS +status 0. If so, the first get_next_pebs_record_by_bit() in the +__intel_pmu_pebs_event() returns NULL. The at = NULL. Since it's a large +PEBS, the 'count' parameter must > 1. The second +get_next_pebs_record_by_bit() will crash. + +Besides the local pebs_status, correct the PEBS status in the PEBS +record as well. + +Fixes: 01330d7288e0 ("perf/x86: Allow zero PEBS status with only single active event") +Reported-by: Vince Weaver +Suggested-by: Peter Zijlstra (Intel) +Signed-off-by: Kan Liang +Signed-off-by: Peter Zijlstra (Intel) +Cc: stable@vger.kernel.org +Link: https://lkml.kernel.org/r/1615555298-140216-1-git-send-email-kan.liang@linux.intel.com + +Signed-off-by: Tony Jones +--- + arch/x86/events/intel/ds.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c +index 7ebae1826403..d32b302719fe 100644 +--- a/arch/x86/events/intel/ds.c ++++ b/arch/x86/events/intel/ds.c +@@ -2010,7 +2010,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs, struct perf_sample_d + */ + if (!pebs_status && cpuc->pebs_enabled && + !(cpuc->pebs_enabled & (cpuc->pebs_enabled-1))) +- pebs_status = cpuc->pebs_enabled; ++ pebs_status = p->status = cpuc->pebs_enabled; + + bit = find_first_bit((unsigned long *)&pebs_status, + x86_pmu.max_pebs_events); + diff --git a/patches.suse/powerpc-Convert-to-using-pOF-instead-of-full_name.patch b/patches.suse/powerpc-Convert-to-using-pOF-instead-of-full_name.patch index d07f1b0..da50bef 100644 --- a/patches.suse/powerpc-Convert-to-using-pOF-instead-of-full_name.patch +++ b/patches.suse/powerpc-Convert-to-using-pOF-instead-of-full_name.patch @@ -2016,7 +2016,7 @@ diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseri --- a/arch/powerpc/platforms/pseries/vio.c +++ b/arch/powerpc/platforms/pseries/vio.c @@ -1362,9 +1362,9 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) - else if (!strcmp(parent_node->full_name, "/vdevice")) + else if (!strcmp(parent_node->type, "vdevice")) family = VDEVICE; else { - pr_warn("%s: parent(%s) of %s not recognized.\n", diff --git a/patches.suse/powerpc-Convert-to-using-pOFn-instead-of-device_node.patch b/patches.suse/powerpc-Convert-to-using-pOFn-instead-of-device_node.patch new file mode 100644 index 0000000..0c65104 --- /dev/null +++ b/patches.suse/powerpc-Convert-to-using-pOFn-instead-of-device_node.patch @@ -0,0 +1,298 @@ +From b9ef7b4b867f56114bedbe6bf104cfaba0ca818e Mon Sep 17 00:00:00 2001 +From: Rob Herring +Date: Mon, 27 Aug 2018 20:52:07 -0500 +Subject: [PATCH] powerpc: Convert to using %pOFn instead of device_node.name + +References: bsc#1181674 ltc#189159 +Patch-mainline: v4.20-rc1 +Git-commit: b9ef7b4b867f56114bedbe6bf104cfaba0ca818e + +In preparation to remove the node name pointer from struct device_node, +convert printf users to use the %pOFn format specifier. + +Cc: Benjamin Herrenschmidt +Cc: Paul Mackerras +Cc: Michael Ellerman +Cc: Arnd Bergmann +Cc: linuxppc-dev@lists.ozlabs.org +Signed-off-by: Rob Herring +Signed-off-by: Michael Ellerman +[Drop 44x hunk] +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/44x/fsp2.c | 8 +++--- + arch/powerpc/platforms/cell/spu_manage.c | 4 +-- + arch/powerpc/platforms/embedded6xx/wii.c | 2 +- + .../powerpc/platforms/powernv/opal-powercap.c | 3 +- + .../platforms/powernv/opal-sensor-groups.c | 4 +-- + .../powerpc/platforms/powernv/opal-sysparam.c | 2 +- + arch/powerpc/platforms/pseries/hotplug-cpu.c | 28 +++++++++---------- + arch/powerpc/platforms/pseries/ibmebus.c | 2 +- + arch/powerpc/platforms/pseries/vio.c | 27 +++++++++--------- + 9 files changed, 40 insertions(+), 40 deletions(-) + +diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c +index e7a04af71452..f7e36373f6e0 100644 +--- a/arch/powerpc/platforms/cell/spu_manage.c ++++ b/arch/powerpc/platforms/cell/spu_manage.c +@@ -282,8 +282,8 @@ static int __init of_enumerate_spus(int (*fn)(void *data)) + for_each_node_by_type(node, "spe") { + ret = fn(node); + if (ret) { +- printk(KERN_WARNING "%s: Error initializing %s\n", +- __func__, node->name); ++ printk(KERN_WARNING "%s: Error initializing %pOFn\n", ++ __func__, node); + of_node_put(node); + break; + } +diff --git a/arch/powerpc/platforms/embedded6xx/wii.c b/arch/powerpc/platforms/embedded6xx/wii.c +index 403523c061ba..ecf703ee3a76 100644 +--- a/arch/powerpc/platforms/embedded6xx/wii.c ++++ b/arch/powerpc/platforms/embedded6xx/wii.c +@@ -112,7 +112,7 @@ static void __iomem *wii_ioremap_hw_regs(char *name, char *compatible) + } + error = of_address_to_resource(np, 0, &res); + if (error) { +- pr_err("no valid reg found for %s\n", np->name); ++ pr_err("no valid reg found for %pOFn\n", np); + goto out_put; + } + +diff --git a/arch/powerpc/platforms/powernv/opal-powercap.c b/arch/powerpc/platforms/powernv/opal-powercap.c +index badb29bde93f..d90ee4fc2c6a 100644 +--- a/arch/powerpc/platforms/powernv/opal-powercap.c ++++ b/arch/powerpc/platforms/powernv/opal-powercap.c +@@ -199,7 +199,7 @@ void __init opal_powercap_init(void) + } + + j = 0; +- pcaps[i].pg.name = node->name; ++ pcaps[i].pg.name = kasprintf(GFP_KERNEL, "%pOFn", node); + if (has_min) { + powercap_add_attr(min, "powercap-min", + &pcaps[i].pattrs[j]); +@@ -237,6 +237,7 @@ void __init opal_powercap_init(void) + while (--i >= 0) { + kfree(pcaps[i].pattrs); + kfree(pcaps[i].pg.attrs); ++ kfree(pcaps[i].pg.name); + } + kobject_put(powercap_kobj); + out_pcaps: +diff --git a/arch/powerpc/platforms/powernv/opal-sensor-groups.c b/arch/powerpc/platforms/powernv/opal-sensor-groups.c +index f7d04b6a2d7a..179609220e6f 100644 +--- a/arch/powerpc/platforms/powernv/opal-sensor-groups.c ++++ b/arch/powerpc/platforms/powernv/opal-sensor-groups.c +@@ -214,9 +214,9 @@ void __init opal_sensor_groups_init(void) + } + + if (!of_property_read_u32(node, "ibm,chip-id", &chipid)) +- sprintf(sgs[i].name, "%s%d", node->name, chipid); ++ sprintf(sgs[i].name, "%pOFn%d", node, chipid); + else +- sprintf(sgs[i].name, "%s", node->name); ++ sprintf(sgs[i].name, "%pOFn", node); + + sgs[i].sg.name = sgs[i].name; + if (add_attr_group(ops, len, &sgs[i], sgid)) { +diff --git a/arch/powerpc/platforms/powernv/opal-sysparam.c b/arch/powerpc/platforms/powernv/opal-sysparam.c +index 9aa87df114fd..916a4b7b1bb5 100644 +--- a/arch/powerpc/platforms/powernv/opal-sysparam.c ++++ b/arch/powerpc/platforms/powernv/opal-sysparam.c +@@ -194,7 +194,7 @@ void __init opal_sys_param_init(void) + count = of_property_count_strings(sysparam, "param-name"); + if (count < 0) { + pr_err("SYSPARAM: No string found of property param-name in " +- "the node %s\n", sysparam->name); ++ "the node %pOFn\n", sysparam); + goto out_param_buf; + } + +diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c +index 6ef77caf7bcf..2f8e62163602 100644 +--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c ++++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c +@@ -287,7 +287,7 @@ static int pseries_add_processor(struct device_node *np) + + if (cpumask_empty(tmp)) { + printk(KERN_ERR "Unable to find space in cpu_present_mask for" +- " processor %s with %d thread(s)\n", np->name, ++ " processor %pOFn with %d thread(s)\n", np, + nthreads); + goto out_unlock; + } +@@ -481,8 +481,8 @@ static ssize_t dlpar_cpu_add(u32 drc_index) + + if (rc) { + saved_rc = rc; +- pr_warn("Failed to attach node %s, rc: %d, drc index: %x\n", +- dn->name, rc, drc_index); ++ pr_warn("Failed to attach node %pOFn, rc: %d, drc index: %x\n", ++ dn, rc, drc_index); + + rc = dlpar_release_drc(drc_index); + if (!rc) +@@ -494,8 +494,8 @@ static ssize_t dlpar_cpu_add(u32 drc_index) + rc = dlpar_online_cpu(dn); + if (rc) { + saved_rc = rc; +- pr_warn("Failed to online cpu %s, rc: %d, drc index: %x\n", +- dn->name, rc, drc_index); ++ pr_warn("Failed to online cpu %pOFn, rc: %d, drc index: %x\n", ++ dn, rc, drc_index); + + rc = dlpar_detach_node(dn); + if (!rc) +@@ -504,7 +504,7 @@ static ssize_t dlpar_cpu_add(u32 drc_index) + return saved_rc; + } + +- pr_debug("Successfully added CPU %s, drc index: %x\n", dn->name, ++ pr_debug("Successfully added CPU %pOFn, drc index: %x\n", dn, + drc_index); + return rc; + } +@@ -570,19 +570,19 @@ static ssize_t dlpar_cpu_remove(struct device_node *dn, u32 drc_index) + { + int rc; + +- pr_debug("Attempting to remove CPU %s, drc index: %x\n", +- dn->name, drc_index); ++ pr_debug("Attempting to remove CPU %pOFn, drc index: %x\n", ++ dn, drc_index); + + rc = dlpar_offline_cpu(dn); + if (rc) { +- pr_warn("Failed to offline CPU %s, rc: %d\n", dn->name, rc); ++ pr_warn("Failed to offline CPU %pOFn, rc: %d\n", dn, rc); + return -EINVAL; + } + + rc = dlpar_release_drc(drc_index); + if (rc) { +- pr_warn("Failed to release drc (%x) for CPU %s, rc: %d\n", +- drc_index, dn->name, rc); ++ pr_warn("Failed to release drc (%x) for CPU %pOFn, rc: %d\n", ++ drc_index, dn, rc); + dlpar_online_cpu(dn); + return rc; + } +@@ -591,7 +591,7 @@ static ssize_t dlpar_cpu_remove(struct device_node *dn, u32 drc_index) + if (rc) { + int saved_rc = rc; + +- pr_warn("Failed to detach CPU %s, rc: %d", dn->name, rc); ++ pr_warn("Failed to detach CPU %pOFn, rc: %d", dn, rc); + + rc = dlpar_acquire_drc(drc_index); + if (!rc) +@@ -662,8 +662,8 @@ static int find_dlpar_cpus_to_remove(u32 *cpu_drcs, int cpus_to_remove) + rc = of_property_read_u32(dn, "ibm,my-drc-index", + &cpu_drcs[cpus_found - 1]); + if (rc) { +- pr_warn("Error occurred getting drc-index for %s\n", +- dn->name); ++ pr_warn("Error occurred getting drc-index for %pOFn\n", ++ dn); + of_node_put(dn); + return -1; + } +diff --git a/arch/powerpc/platforms/pseries/ibmebus.c b/arch/powerpc/platforms/pseries/ibmebus.c +--- a/arch/powerpc/platforms/pseries/ibmebus.c ++++ b/arch/powerpc/platforms/pseries/ibmebus.c +@@ -404,7 +404,7 @@ static ssize_t name_show(struct device *dev, + struct platform_device *ofdev; + + ofdev = to_platform_device(dev); +- return sprintf(buf, "%s\n", ofdev->dev.of_node->name); ++ return sprintf(buf, "%pOFn\n", ofdev->dev.of_node); + } + + static ssize_t modalias_show(struct device *dev, +diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c +index 49e04ec19238..88f1ad1d6309 100644 +--- a/arch/powerpc/platforms/pseries/vio.c ++++ b/arch/powerpc/platforms/pseries/vio.c +@@ -1349,7 +1349,6 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) + struct device_node *parent_node; + const __be32 *prop; + enum vio_dev_family family; +- const char *of_node_name = of_node->name ? of_node->name : ""; + + /* + * Determine if this node is a under the /vdevice node or under the +@@ -1362,24 +1361,24 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) + else if (!strcmp(parent_node->type, "vdevice")) + family = VDEVICE; + else { +- pr_warn("%s: parent(%pOF) of %s not recognized.\n", ++ pr_warn("%s: parent(%pOF) of %pOFn not recognized.\n", + __func__, + parent_node, +- of_node_name); ++ of_node); + of_node_put(parent_node); + return NULL; + } + of_node_put(parent_node); + } else { +- pr_warn("%s: could not determine the parent of node %s.\n", +- __func__, of_node_name); ++ pr_warn("%s: could not determine the parent of node %pOFn.\n", ++ __func__, of_node); + return NULL; + } + + if (family == PFO) { + if (of_get_property(of_node, "interrupt-controller", NULL)) { +- pr_debug("%s: Skipping the interrupt controller %s.\n", +- __func__, of_node_name); ++ pr_debug("%s: Skipping the interrupt controller %pOFn.\n", ++ __func__, of_node); + return NULL; + } + } +@@ -1399,15 +1398,15 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) + if (of_node->type != NULL) + viodev->type = of_node->type; + else { +- pr_warn("%s: node %s is missing the 'device_type' " +- "property.\n", __func__, of_node_name); ++ pr_warn("%s: node %pOFn is missing the 'device_type' " ++ "property.\n", __func__, of_node); + goto out; + } + + prop = of_get_property(of_node, "reg", NULL); + if (prop == NULL) { +- pr_warn("%s: node %s missing 'reg'\n", +- __func__, of_node_name); ++ pr_warn("%s: node %pOFn missing 'reg'\n", ++ __func__, of_node); + goto out; + } + unit_address = of_read_number(prop, 1); +@@ -1422,8 +1421,8 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) + if (prop != NULL) + viodev->resource_id = of_read_number(prop, 1); + +- dev_set_name(&viodev->dev, "%s", of_node_name); +- viodev->type = of_node_name; ++ dev_set_name(&viodev->dev, "%pOFn", of_node); ++ viodev->type = dev_name(&viodev->dev); + viodev->irq = 0; + } + +@@ -1694,7 +1693,7 @@ struct vio_dev *vio_find_node(struct device_node *vnode) + snprintf(kobj_name, sizeof(kobj_name), "%x", + (uint32_t)of_read_number(prop, 1)); + } else if (!strcmp(dev_type, "ibm,platform-facilities")) +- snprintf(kobj_name, sizeof(kobj_name), "%s", vnode->name); ++ snprintf(kobj_name, sizeof(kobj_name), "%pOFn", vnode); + else + return NULL; + +-- +2.26.2 + diff --git a/patches.suse/powerpc-Fix-some-spelling-mistakes.patch b/patches.suse/powerpc-Fix-some-spelling-mistakes.patch new file mode 100644 index 0000000..84b37c3 --- /dev/null +++ b/patches.suse/powerpc-Fix-some-spelling-mistakes.patch @@ -0,0 +1,67 @@ +From b802ab46ba12c617fd55b072f1906627e636947b Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Mon, 5 Jun 2017 16:49:12 +1000 +Subject: [PATCH] powerpc: Fix some spelling mistakes + +References: bsc#1181674 ltc#189159 +Patch-mainline: v4.13-rc1 +Git-commit: b802ab46ba12c617fd55b072f1906627e636947b + +Collation of some spelling fixes from Colin. + + Attemping -> Attempting + intialized -> initialized + missmanaged -> mismanaged + +Signed-off-by: Colin Ian King +Signed-off-by: Michael Ellerman +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 +- + arch/powerpc/sysdev/xive/common.c | 2 +- + drivers/tty/hvc/hvcs.c | 3 +-- + 3 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c +index 7bc0e91f8715..6afd1efd3633 100644 +--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c ++++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c +@@ -554,7 +554,7 @@ static ssize_t dlpar_cpu_remove(struct device_node *dn, u32 drc_index) + { + int rc; + +- pr_debug("Attemping to remove CPU %s, drc index: %x\n", ++ pr_debug("Attempting to remove CPU %s, drc index: %x\n", + dn->name, drc_index); + + rc = dlpar_offline_cpu(dn); +diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c +index 913825086b8d..afc9484ae747 100644 +--- a/arch/powerpc/sysdev/xive/common.c ++++ b/arch/powerpc/sysdev/xive/common.c +@@ -1417,7 +1417,7 @@ bool xive_core_init(const struct xive_ops *ops, void __iomem *area, u32 offset, + /* Get ready for interrupts */ + xive_setup_cpu(); + +- pr_info("Interrupt handling intialized with %s backend\n", ++ pr_info("Interrupt handling initialized with %s backend\n", + xive_ops->name); + pr_info("Using priority %d for all interrupts\n", max_prio); + +diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c +index 99bb875178d7..423e28ec27fb 100644 +--- a/drivers/tty/hvc/hvcs.c ++++ b/drivers/tty/hvc/hvcs.c +@@ -1242,8 +1242,7 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp) + free_irq(irq, hvcsd); + return; + } else if (hvcsd->port.count < 0) { +- printk(KERN_ERR "HVCS: vty-server@%X open_count: %d" +- " is missmanaged.\n", ++ printk(KERN_ERR "HVCS: vty-server@%X open_count: %d is mismanaged.\n", + hvcsd->vdev->unit_address, hvcsd->port.count); + } + +-- +2.26.2 + diff --git a/patches.suse/powerpc-hvcall-add-token-and-codes-for-H_VASI_SIGNAL.patch b/patches.suse/powerpc-hvcall-add-token-and-codes-for-H_VASI_SIGNAL.patch new file mode 100644 index 0000000..327fef2 --- /dev/null +++ b/patches.suse/powerpc-hvcall-add-token-and-codes-for-H_VASI_SIGNAL.patch @@ -0,0 +1,50 @@ +From 9bae89f528c041f3117f0a6c21878dda5a55af60 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:38 -0600 +Subject: [PATCH] powerpc/hvcall: add token and codes for H_VASI_SIGNAL + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 9bae89f528c041f3117f0a6c21878dda5a55af60 + +H_VASI_SIGNAL can be used by a partition to request cancellation of +its migration. To be used in future changes. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-7-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/hvcall.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h +index c1fbccb04390..c98f5141e3fc 100644 +--- a/arch/powerpc/include/asm/hvcall.h ++++ b/arch/powerpc/include/asm/hvcall.h +@@ -155,6 +155,14 @@ + #define H_VASI_RESUMED 5 + #define H_VASI_COMPLETED 6 + ++/* VASI signal codes. Only the Cancel code is valid for H_VASI_SIGNAL. */ ++#define H_VASI_SIGNAL_CANCEL 1 ++#define H_VASI_SIGNAL_ABORT 2 ++#define H_VASI_SIGNAL_SUSPEND 3 ++#define H_VASI_SIGNAL_COMPLETE 4 ++#define H_VASI_SIGNAL_ENABLE 5 ++#define H_VASI_SIGNAL_FAILOVER 6 ++ + /* Each control block has to be on a 4K boundary */ + #define H_CB_ALIGNMENT 4096 + +@@ -261,6 +269,7 @@ + #define H_ADD_CONN 0x284 + #define H_DEL_CONN 0x288 + #define H_JOIN 0x298 ++#define H_VASI_SIGNAL 0x2A0 + #define H_VASI_STATE 0x2A4 + #define H_VIOCTL 0x2A8 + #define H_ENABLE_CRQ 0x2B0 +-- +2.26.2 + diff --git a/patches.suse/powerpc-machdep-remove-suspend_disable_cpu.patch b/patches.suse/powerpc-machdep-remove-suspend_disable_cpu.patch new file mode 100644 index 0000000..57c405c --- /dev/null +++ b/patches.suse/powerpc-machdep-remove-suspend_disable_cpu.patch @@ -0,0 +1,35 @@ +From 796f9247b4fa9bec320d6b47ffde2ecf86cc71c0 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:52 -0600 +Subject: [PATCH] powerpc/machdep: remove suspend_disable_cpu() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 796f9247b4fa9bec320d6b47ffde2ecf86cc71c0 + +There are no users left of the suspend_disable_cpu() callback, remove +it. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-21-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/machdep.h | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h +index 475687f24f4a..cf6ebbc16cb4 100644 +--- a/arch/powerpc/include/asm/machdep.h ++++ b/arch/powerpc/include/asm/machdep.h +@@ -207,7 +207,6 @@ struct machdep_calls { + void (*suspend_disable_irqs)(void); + void (*suspend_enable_irqs)(void); + #endif +- int (*suspend_disable_cpu)(void); + + #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE + ssize_t (*cpu_probe)(const char *, size_t); +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-Fix-build-when-CONFIG_NUMA-n.patch b/patches.suse/powerpc-numa-Fix-build-when-CONFIG_NUMA-n.patch index 477ac41..3b41775 100644 --- a/patches.suse/powerpc-numa-Fix-build-when-CONFIG_NUMA-n.patch +++ b/patches.suse/powerpc-numa-Fix-build-when-CONFIG_NUMA-n.patch @@ -24,7 +24,7 @@ Acked-by: Michal Suchanek diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h -@@ -5,6 +5,7 @@ +@@ -6,6 +6,7 @@ struct device; struct device_node; @@ -32,7 +32,7 @@ diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topo #ifdef CONFIG_NUMA -@@ -62,6 +63,9 @@ static inline int early_cpu_to_node(int +@@ -61,6 +62,9 @@ static inline int early_cpu_to_node(int cpu) */ return (nid < 0) ? 0 : nid; } @@ -42,10 +42,10 @@ diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topo #else static inline int early_cpu_to_node(int cpu) { return 0; } -@@ -82,10 +86,12 @@ static inline int numa_update_cpu_topolo - { - return 0; - } +@@ -84,10 +88,12 @@ static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc) + + static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {} + -#endif /* CONFIG_NUMA */ +static inline int of_drconf_to_nid_single(struct drmem_lmb *lmb) +{ @@ -57,4 +57,7 @@ diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topo +#endif /* CONFIG_NUMA */ #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) - extern int start_topology_update(void); + extern int find_and_online_cpu_nid(int cpu); +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-Remove-late-request-for-home-node-assoc.patch b/patches.suse/powerpc-numa-Remove-late-request-for-home-node-assoc.patch new file mode 100644 index 0000000..5c5b622 --- /dev/null +++ b/patches.suse/powerpc-numa-Remove-late-request-for-home-node-assoc.patch @@ -0,0 +1,89 @@ +From 247257b03b04398ca07da4bce3d17bee25d623cb Mon Sep 17 00:00:00 2001 +From: Srikar Dronamraju +Date: Wed, 29 Jan 2020 19:23:01 +0530 +Subject: [PATCH] powerpc/numa: Remove late request for home node associativity + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.7-rc1 +Git-commit: 247257b03b04398ca07da4bce3d17bee25d623cb + +With commit ("powerpc/numa: Early request for home node associativity"), +commit 2ea626306810 ("powerpc/topology: Get topology for shared +processors at boot") which was requesting home node associativity +becomes redundant. + +Hence remove the late request for home node associativity. + +Signed-off-by: Srikar Dronamraju +Reported-by: Abdul Haleem +Reviewed-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200129135301.24739-6-srikar@linux.vnet.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/topology.h | 4 ---- + arch/powerpc/kernel/smp.c | 5 ----- + arch/powerpc/mm/numa.c | 9 --------- + 3 files changed, 18 deletions(-) + +diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h +index e2e1ccd4a18d..2db7ba789720 100644 +--- a/arch/powerpc/include/asm/topology.h ++++ b/arch/powerpc/include/asm/topology.h +@@ -98,7 +98,6 @@ extern int stop_topology_update(void); + extern int prrn_is_enabled(void); + extern int find_and_online_cpu_nid(int cpu); + extern int timed_topology_update(int nsecs); +-extern void __init shared_proc_topology_init(void); + #else + static inline int start_topology_update(void) + { +@@ -121,9 +120,6 @@ static inline int timed_topology_update(int nsecs) + return 0; + } + +-#ifdef CONFIG_SMP +-static inline void shared_proc_topology_init(void) {} +-#endif + #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */ + + #include +diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c +index f68cde82bdf3..37c12e3bab9e 100644 +--- a/arch/powerpc/kernel/smp.c ++++ b/arch/powerpc/kernel/smp.c +@@ -1383,11 +1383,6 @@ void __init smp_cpus_done(unsigned int max_cpus) + if (smp_ops && smp_ops->bringup_done) + smp_ops->bringup_done(); + +- /* +- * On a shared LPAR, associativity needs to be requested. +- * Hence, get numa topology before dumping cpu topology +- */ +- shared_proc_topology_init(); + dump_numa_cpu_topology(); + + #ifdef CONFIG_SCHED_SMT +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +index 5a8abf0165d7..9fcf2d195830 100644 +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1632,15 +1632,6 @@ int prrn_is_enabled(void) + return prrn_enabled; + } + +-void __init shared_proc_topology_init(void) +-{ +- if (lppaca_shared_proc(get_lppaca())) { +- bitmap_fill(cpumask_bits(&cpu_associativity_changes_mask), +- nr_cpumask_bits); +- numa_update_cpu_topology(false); +- } +-} +- + static int topology_read(struct seq_file *file, void *v) + { + if (vphn_enabled || prrn_enabled) +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-Suppress-VPHN-is-not-supported-messages.patch b/patches.suse/powerpc-numa-Suppress-VPHN-is-not-supported-messages.patch new file mode 100644 index 0000000..f572be5 --- /dev/null +++ b/patches.suse/powerpc-numa-Suppress-VPHN-is-not-supported-messages.patch @@ -0,0 +1,38 @@ +From 437ccdc8ce629470babdda1a7086e2f477048cbd Mon Sep 17 00:00:00 2001 +From: Satheesh Rajendran +Date: Thu, 8 Nov 2018 10:47:56 +0530 +Subject: [PATCH] powerpc/numa: Suppress "VPHN is not supported" messages + +References: bsc#1181674 ltc#189159 +Patch-mainline: v4.20-rc3 +Git-commit: 437ccdc8ce629470babdda1a7086e2f477048cbd + +When VPHN function is not supported and during cpu hotplug event, +kernel prints message 'VPHN function not supported. Disabling +polling...'. Currently it prints on every hotplug event, it floods +dmesg when a KVM guest tries to hotplug huge number of vcpus, let's +just print once and suppress further kernel prints. + +Signed-off-by: Satheesh Rajendran +Signed-off-by: Michael Ellerman +Acked-by: Michal Suchanek +--- + arch/powerpc/mm/numa.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +index 3a048e98a132..ce28ae5ca080 100644 +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1178,7 +1178,7 @@ static long vphn_get_associativity(unsigned long cpu, + + switch (rc) { + case H_FUNCTION: +- printk(KERN_INFO ++ printk_once(KERN_INFO + "VPHN is not supported. Disabling polling...\n"); + stop_topology_update(); + break; +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-make-vphn_enabled-prrn_enabled-flags-co.patch b/patches.suse/powerpc-numa-make-vphn_enabled-prrn_enabled-flags-co.patch new file mode 100644 index 0000000..7d16578 --- /dev/null +++ b/patches.suse/powerpc-numa-make-vphn_enabled-prrn_enabled-flags-co.patch @@ -0,0 +1,39 @@ +From e6eacf8eb4dee7bc7021c837666e3ebf1b0ec3b5 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:25 -0500 +Subject: [PATCH] powerpc/numa: make vphn_enabled, prrn_enabled flags const + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: e6eacf8eb4dee7bc7021c837666e3ebf1b0ec3b5 + +Previous changes have made it so these flags are never changed; +enforce this by making them const. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-6-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/mm/numa.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +index 9e20f12e6caf..1b89bacb8975 100644 +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1132,8 +1132,8 @@ struct topology_update_data { + #define TOPOLOGY_DEF_TIMER_SECS 60 + + static cpumask_t cpu_associativity_changes_mask; +-static int vphn_enabled; +-static int prrn_enabled; ++static const int vphn_enabled; ++static const int prrn_enabled; + static void reset_topology_timer(void); + static int topology_timer_secs = 1; + static int topology_inited; +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-remove-ability-to-enable-topology-updat.patch b/patches.suse/powerpc-numa-remove-ability-to-enable-topology-updat.patch new file mode 100644 index 0000000..7af7ea1 --- /dev/null +++ b/patches.suse/powerpc-numa-remove-ability-to-enable-topology-updat.patch @@ -0,0 +1,120 @@ +From c30f931e891eb0a32885ecd79984e1e7366fceda Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:23 -0500 +Subject: [PATCH] powerpc/numa: remove ability to enable topology updates + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: c30f931e891eb0a32885ecd79984e1e7366fceda + +Remove the /proc/powerpc/topology_updates interface and the +topology_updates=on/off command line argument. The internal +topology_updates_enabled flag remains for now, but always false. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-4-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/mm/numa.c | 71 +----------------------------------------- + 1 file changed, 1 insertion(+), 70 deletions(-) + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -984,27 +984,7 @@ static int __init early_numa(char *p) + } + early_param("numa", early_numa); + +-/* +- * The platform can inform us through one of several mechanisms +- * (post-migration device tree updates, PRRN or VPHN) that the NUMA +- * assignment of a resource has changed. This controls whether we act +- * on that. Disabled by default. +- */ +-static bool topology_updates_enabled; +- +-static int __init early_topology_updates(char *p) +-{ +- if (!p) +- return 0; +- +- if (!strcmp(p, "on")) { +- pr_warn("Caution: enabling topology updates\n"); +- topology_updates_enabled = true; +- } +- +- return 0; +-} +-early_param("topology_updates", early_topology_updates); ++static const bool topology_updates_enabled; + + #ifdef CONFIG_MEMORY_HOTPLUG + /* +@@ -1632,52 +1612,6 @@ int prrn_is_enabled(void) + return prrn_enabled; + } + +-static int topology_read(struct seq_file *file, void *v) +-{ +- if (vphn_enabled || prrn_enabled) +- seq_puts(file, "on\n"); +- else +- seq_puts(file, "off\n"); +- +- return 0; +-} +- +-static int topology_open(struct inode *inode, struct file *file) +-{ +- return single_open(file, topology_read, NULL); +-} +- +-static ssize_t topology_write(struct file *file, const char __user *buf, +- size_t count, loff_t *off) +-{ +- char kbuf[4]; /* "on" or "off" plus null. */ +- int read_len; +- +- read_len = count < 3 ? count : 3; +- if (copy_from_user(kbuf, buf, read_len)) +- return -EINVAL; +- +- kbuf[read_len] = '\0'; +- +- if (!strncmp(kbuf, "on", 2)) { +- topology_updates_enabled = true; +- start_topology_update(); +- } else if (!strncmp(kbuf, "off", 3)) { +- stop_topology_update(); +- topology_updates_enabled = false; +- } else +- return -EINVAL; +- +- return count; +-} +- +-static const struct file_operations topology_ops = { +- .read = seq_read, +- .write = topology_write, +- .open = topology_open, +- .release = single_release +-}; +- + static int topology_update_init(void) + { + start_topology_update(); +@@ -1685,9 +1619,6 @@ static int topology_update_init(void) + if (vphn_enabled) + topology_schedule_update(); + +- if (!proc_create("powerpc/topology_updates", 0644, NULL, &topology_ops)) +- return -ENOMEM; +- + topology_inited = 1; + return 0; + } +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-remove-arch_update_cpu_topology.patch b/patches.suse/powerpc-numa-remove-arch_update_cpu_topology.patch new file mode 100644 index 0000000..bfbe195 --- /dev/null +++ b/patches.suse/powerpc-numa-remove-arch_update_cpu_topology.patch @@ -0,0 +1,69 @@ +From cdf082c4570f186d608aca688f2cc872b014558a Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:34 -0500 +Subject: [PATCH] powerpc/numa: remove arch_update_cpu_topology + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: cdf082c4570f186d608aca688f2cc872b014558a + +Since arch_update_cpu_topology() doesn't do anything on powerpc now, +remove it and associated dead code. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-15-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/topology.h | 6 ------ + arch/powerpc/mm/numa.c | 10 ---------- + 2 files changed, 16 deletions(-) + +diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h +--- a/arch/powerpc/include/asm/topology.h ++++ b/arch/powerpc/include/asm/topology.h +@@ -43,7 +43,6 @@ extern void __init dump_numa_cpu_topology(void); + + extern int sysfs_add_device_to_node(struct device *dev, int nid); + extern void sysfs_remove_device_from_node(struct device *dev, int nid); +-extern int numa_update_cpu_topology(bool cpus_locked); + + static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) + { +@@ -78,11 +77,6 @@ static inline void sysfs_remove_device_from_node(struct device *dev, + { + } + +-static inline int numa_update_cpu_topology(bool cpus_locked) +-{ +- return 0; +-} +- + static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {} + + #endif /* CONFIG_NUMA */ +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +index 26fcc947dd2d..e437a9ac4956 100644 +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1200,16 +1200,6 @@ int find_and_online_cpu_nid(int cpu) + return new_nid; + } + +-int numa_update_cpu_topology(bool cpus_locked) +-{ +- return 0; +-} +- +-int arch_update_cpu_topology(void) +-{ +- return numa_update_cpu_topology(true); +-} +- + static int topology_update_init(void) + { + topology_inited = 1; +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-remove-prrn_is_enabled.patch b/patches.suse/powerpc-numa-remove-prrn_is_enabled.patch new file mode 100644 index 0000000..38b2040 --- /dev/null +++ b/patches.suse/powerpc-numa-remove-prrn_is_enabled.patch @@ -0,0 +1,58 @@ +From 042ef7cc43f4571d8cbe44a7c735ab6622809142 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:33 -0500 +Subject: [PATCH] powerpc/numa: remove prrn_is_enabled() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 042ef7cc43f4571d8cbe44a7c735ab6622809142 + +All users of this prrn_is_enabled() are gone; remove it. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-14-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/topology.h | 5 ----- + arch/powerpc/mm/numa.c | 5 ----- + 2 files changed, 10 deletions(-) + +diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h +index 537c638582eb..658aad65912b 100644 +--- a/arch/powerpc/include/asm/topology.h ++++ b/arch/powerpc/include/asm/topology.h +@@ -93,13 +93,8 @@ static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc) + #endif /* CONFIG_NUMA */ + + #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) +-extern int prrn_is_enabled(void); + extern int find_and_online_cpu_nid(int cpu); + #else +-static inline int prrn_is_enabled(void) +-{ +- return 0; +-} + static inline int find_and_online_cpu_nid(int cpu) + { + return 0; +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +index dec7ce3b5e67..26fcc947dd2d 100644 +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1210,11 +1210,6 @@ int arch_update_cpu_topology(void) + return numa_update_cpu_topology(true); + } + +-int prrn_is_enabled(void) +-{ +- return 0; +-} +- + static int topology_update_init(void) + { + topology_inited = 1; +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-remove-start-stop_topology_update.patch b/patches.suse/powerpc-numa-remove-start-stop_topology_update.patch new file mode 100644 index 0000000..06bb9f0 --- /dev/null +++ b/patches.suse/powerpc-numa-remove-start-stop_topology_update.patch @@ -0,0 +1,138 @@ +From 1835303e5690cbeef2c07a9a5416045475ddaa13 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:31 -0500 +Subject: [PATCH] powerpc/numa: remove start/stop_topology_update() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 1835303e5690cbeef2c07a9a5416045475ddaa13 + +These APIs have become no-ops, so remove them and all call sites. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-12-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/topology.h | 10 ---------- + arch/powerpc/mm/numa.c | 20 -------------------- + arch/powerpc/platforms/pseries/mobility.c | 4 ---- + arch/powerpc/platforms/pseries/suspend.c | 5 +---- + 4 files changed, 1 insertion(+), 38 deletions(-) + +diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h +index 379e2cc3789f..537c638582eb 100644 +--- a/arch/powerpc/include/asm/topology.h ++++ b/arch/powerpc/include/asm/topology.h +@@ -93,19 +93,9 @@ static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc) + #endif /* CONFIG_NUMA */ + + #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) +-extern int start_topology_update(void); +-extern int stop_topology_update(void); + extern int prrn_is_enabled(void); + extern int find_and_online_cpu_nid(int cpu); + #else +-static inline int start_topology_update(void) +-{ +- return 0; +-} +-static inline int stop_topology_update(void) +-{ +- return 0; +-} + static inline int prrn_is_enabled(void) + { + return 0; +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1140,13 +1140,11 @@ static long vphn_get_associativity(unsig + case H_FUNCTION: + printk_once(KERN_INFO + "VPHN is not supported. Disabling polling...\n"); +- stop_topology_update(); + break; + case H_HARDWARE: + printk(KERN_ERR + "hcall_vphn() experienced a hardware fault " + "preventing VPHN. Disabling polling...\n"); +- stop_topology_update(); + break; + case H_SUCCESS: + dbg("VPHN hcall succeeded. Reset polling...\n"); +@@ -1205,22 +1203,6 @@ int arch_update_cpu_topology(void) + return numa_update_cpu_topology(true); + } + +-/* +- * Start polling for associativity changes. +- */ +-int start_topology_update(void) +-{ +- return 0; +-} +- +-/* +- * Disable polling for VPHN associativity changes. +- */ +-int stop_topology_update(void) +-{ +- return 0; +-} +- + int prrn_is_enabled(void) + { + return 0; +@@ -1228,8 +1210,6 @@ int prrn_is_enabled(void) + + static int topology_update_init(void) + { +- start_topology_update(); +- + topology_inited = 1; + return 0; + } +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +index 10d982997736..c0b09f6f0ae3 100644 +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -388,8 +388,6 @@ static ssize_t migration_store(struct class *class, + if (rc) + return rc; + +- stop_topology_update(); +- + do { + rc = rtas_ibm_suspend_me(streamid); + if (rc == -EAGAIN) +@@ -401,8 +399,6 @@ static ssize_t migration_store(struct class *class, + + post_mobility_fixup(); + +- start_topology_update(); +- + return count; + } + +diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c +index f789693f61f4..81e0ac58d620 100644 +--- a/arch/powerpc/platforms/pseries/suspend.c ++++ b/arch/powerpc/platforms/pseries/suspend.c +@@ -145,11 +145,8 @@ static ssize_t store_hibernate(struct device *dev, + ssleep(1); + } while (rc == -EAGAIN); + +- if (!rc) { +- stop_topology_update(); ++ if (!rc) + rc = pm_suspend(PM_SUSPEND_MEM); +- start_topology_update(); +- } + + stream_id = 0; + +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-remove-timed_topology_update.patch b/patches.suse/powerpc-numa-remove-timed_topology_update.patch new file mode 100644 index 0000000..db37077 --- /dev/null +++ b/patches.suse/powerpc-numa-remove-timed_topology_update.patch @@ -0,0 +1,94 @@ +From b1815aeac7fde2dc3412daf2efaededd21cd58e0 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:30 -0500 +Subject: [PATCH] powerpc/numa: remove timed_topology_update() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: b1815aeac7fde2dc3412daf2efaededd21cd58e0 + +timed_topology_update is a no-op now, so remove it and all call sites. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-11-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/topology.h | 5 ----- + arch/powerpc/mm/numa.c | 9 --------- + arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 -- + 3 files changed, 16 deletions(-) + +diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h +index 2db7ba789720..379e2cc3789f 100644 +--- a/arch/powerpc/include/asm/topology.h ++++ b/arch/powerpc/include/asm/topology.h +@@ -97,7 +97,6 @@ extern int start_topology_update(void); + extern int stop_topology_update(void); + extern int prrn_is_enabled(void); + extern int find_and_online_cpu_nid(int cpu); +-extern int timed_topology_update(int nsecs); + #else + static inline int start_topology_update(void) + { +@@ -115,10 +114,6 @@ static inline int find_and_online_cpu_nid(int cpu) + { + return 0; + } +-static inline int timed_topology_update(int nsecs) +-{ +- return 0; +-} + + #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */ + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1124,14 +1124,6 @@ u64 memory_hotplug_max(void) + return rc; + } + +-/* +- * Change polling interval for associativity changes. +- */ +-int timed_topology_update(int nsecs) +-{ +- return 0; +-} +- + /* + * Retrieve the new associativity information for a virtual processor's + * home node. +@@ -1147,7 +1139,6 @@ static long vphn_get_associativity(unsigned long cpu, + break; + case H_SUCCESS: + dbg("VPHN hcall succeeded. Reset polling...\n"); +- timed_topology_update(0); + break; + } + +diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c +index d4b346355bb9..dbfabb185eb5 100644 +--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c ++++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c +@@ -263,7 +263,6 @@ static int dlpar_offline_cpu(struct device_node *dn) + break; + + cpu_maps_update_done(); +- timed_topology_update(1); + rc = device_offline(get_cpu_device(cpu)); + if (rc) + goto out; +@@ -302,7 +301,6 @@ static int dlpar_online_cpu(struct device_node *dn) + if (get_hard_smp_processor_id(cpu) != thread) + continue; + cpu_maps_update_done(); +- timed_topology_update(1); + find_and_online_cpu_nid(cpu); + rc = device_online(get_cpu_device(cpu)); + if (rc) { +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-remove-unreachable-topology-timer-code.patch b/patches.suse/powerpc-numa-remove-unreachable-topology-timer-code.patch new file mode 100644 index 0000000..8f22086 --- /dev/null +++ b/patches.suse/powerpc-numa-remove-unreachable-topology-timer-code.patch @@ -0,0 +1,74 @@ +From 50e0cf3742a01e72f4ea4a8fe9221b152e22871b Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:26 -0500 +Subject: [PATCH] powerpc/numa: remove unreachable topology timer code + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 50e0cf3742a01e72f4ea4a8fe9221b152e22871b + +Since vphn_enabled is always 0, we can stub out +timed_topology_update() and remove the code which becomes unreachable. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-7-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/mm/numa.c | 21 --------------------- + 1 file changed, 21 deletions(-) + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1129,13 +1129,9 @@ struct topology_update_data { + int new_nid; + }; + +-#define TOPOLOGY_DEF_TIMER_SECS 60 +- + static cpumask_t cpu_associativity_changes_mask; + static const int vphn_enabled; + static const int prrn_enabled; +-static void reset_topology_timer(void); +-static int topology_timer_secs = 1; + static int topology_inited; + + static long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity) +@@ -1143,15 +1139,6 @@ static int topology_inited; + */ + int timed_topology_update(int nsecs) + { +- if (vphn_enabled) { +- if (nsecs > 0) +- topology_timer_secs = nsecs; +- else +- topology_timer_secs = TOPOLOGY_DEF_TIMER_SECS; +- +- reset_topology_timer(); +- } +- + return 0; + } + +@@ -1438,16 +1425,6 @@ static void topology_schedule_update(void) + schedule_work(&topology_work); + } + +-static struct timer_list topology_timer = +- TIMER_INITIALIZER(topology_timer_fn, 0, 0); +- +-static void reset_topology_timer(void) +-{ +- topology_timer.data = 0; +- topology_timer.expires = jiffies + topology_timer_secs * HZ; +- mod_timer(&topology_timer, topology_timer.expires); +-} +- + /* + * Start polling for associativity changes. + */ +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-remove-unreachable-topology-update-code.patch b/patches.suse/powerpc-numa-remove-unreachable-topology-update-code.patch new file mode 100644 index 0000000..5bc2b48 --- /dev/null +++ b/patches.suse/powerpc-numa-remove-unreachable-topology-update-code.patch @@ -0,0 +1,224 @@ +From 7d35bef96a46f7e9e167bb25258c0bd389aeab1b Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:24 -0500 +Subject: [PATCH] powerpc/numa: remove unreachable topology update code + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 7d35bef96a46f7e9e167bb25258c0bd389aeab1b + +Since the topology_updates_enabled flag is now always false, remove it +and the code which has become unreachable. This is the minimum change +that prevents 'defined but unused' warnings emitted by the compiler +after stubbing out the start/stop_topology_updates() functions. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-5-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/mm/numa.c | 149 +---------------------------------------- + 1 file changed, 2 insertions(+), 147 deletions(-) + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -984,8 +984,6 @@ static int __init early_numa(char *p) + } + early_param("numa", early_numa); + +-static const bool topology_updates_enabled; +- + #ifdef CONFIG_MEMORY_HOTPLUG + /* + * Find the node associated with a hot added memory section for +@@ -1133,7 +1131,6 @@ struct topology_update_data { + + #define TOPOLOGY_DEF_TIMER_SECS 60 + +-static u8 vphn_cpu_change_counts[NR_CPUS][MAX_DISTANCE_REF_POINTS]; + static cpumask_t cpu_associativity_changes_mask; + static int vphn_enabled; + static int prrn_enabled; +@@ -1158,63 +1155,6 @@ int timed_topology_update(int nsecs) + return 0; + } + +-/* +- * Store the current values of the associativity change counters in the +- * hypervisor. +- */ +-static void setup_cpu_associativity_change_counters(void) +-{ +- int cpu; +- +- /* The VPHN feature supports a maximum of 8 reference points */ +- BUILD_BUG_ON(MAX_DISTANCE_REF_POINTS > 8); +- +- for_each_possible_cpu(cpu) { +- int i; +- u8 *counts = vphn_cpu_change_counts[cpu]; +- volatile u8 *hypervisor_counts = lppaca[cpu].vphn_assoc_counts; +- +- for (i = 0; i < distance_ref_points_depth; i++) +- counts[i] = hypervisor_counts[i]; +- } +-} +- +-/* +- * The hypervisor maintains a set of 8 associativity change counters in +- * the VPA of each cpu that correspond to the associativity levels in the +- * ibm,associativity-reference-points property. When an associativity +- * level changes, the corresponding counter is incremented. +- * +- * Set a bit in cpu_associativity_changes_mask for each cpu whose home +- * node associativity levels have changed. +- * +- * Returns the number of cpus with unhandled associativity changes. +- */ +-static int update_cpu_associativity_changes_mask(void) +-{ +- int cpu; +- cpumask_t *changes = &cpu_associativity_changes_mask; +- +- for_each_possible_cpu(cpu) { +- int i, changed = 0; +- u8 *counts = vphn_cpu_change_counts[cpu]; +- volatile u8 *hypervisor_counts = lppaca[cpu].vphn_assoc_counts; +- +- for (i = 0; i < distance_ref_points_depth; i++) { +- if (hypervisor_counts[i] != counts[i]) { +- counts[i] = hypervisor_counts[i]; +- changed = 1; +- } +- } +- if (changed) { +- cpumask_or(changes, changes, cpu_sibling_mask(cpu)); +- cpu = cpu_last_thread_sibling(cpu); +- } +- } +- +- return cpumask_weight(changes); +-} +- + /* + * Retrieve the new associativity information for a virtual processor's + * home node. +@@ -1498,16 +1438,6 @@ static void topology_schedule_update(void) + schedule_work(&topology_work); + } + +-static void topology_timer_fn(unsigned long ignored) +-{ +- if (prrn_enabled && cpumask_weight(&cpu_associativity_changes_mask)) +- topology_schedule_update(); +- else if (vphn_enabled) { +- if (update_cpu_associativity_changes_mask() > 0) +- topology_schedule_update(); +- reset_topology_timer(); +- } +-} + static struct timer_list topology_timer = + TIMER_INITIALIZER(topology_timer_fn, 0, 0); + +@@ -1516,68 +1446,12 @@ static void reset_topology_timer(void) + mod_timer(&topology_timer, topology_timer.expires); + } + +-#ifdef CONFIG_SMP +- +-static int dt_update_callback(struct notifier_block *nb, +- unsigned long action, void *data) +-{ +- struct of_reconfig_data *update = data; +- int rc = NOTIFY_DONE; +- +- switch (action) { +- case OF_RECONFIG_UPDATE_PROPERTY: +- if (!of_prop_cmp(update->dn->type, "cpu") && +- !of_prop_cmp(update->prop->name, "ibm,associativity")) { +- u32 core_id; +- of_property_read_u32(update->dn, "reg", &core_id); +- rc = dlpar_cpu_readd(core_id); +- rc = NOTIFY_OK; +- } +- break; +- } +- +- return rc; +-} +- +-static struct notifier_block dt_update_nb = { +- .notifier_call = dt_update_callback, +-}; +- +-#endif +- + /* + * Start polling for associativity changes. + */ + int start_topology_update(void) + { +- int rc = 0; +- +- if (!topology_updates_enabled) +- return 0; +- +- if (firmware_has_feature(FW_FEATURE_PRRN)) { +- if (!prrn_enabled) { +- prrn_enabled = 1; +-#ifdef CONFIG_SMP +- rc = of_reconfig_notifier_register(&dt_update_nb); +-#endif +- } +- } +- if (firmware_has_feature(FW_FEATURE_VPHN) && +- lppaca_shared_proc(get_lppaca())) { +- if (!vphn_enabled) { +- vphn_enabled = 1; +- setup_cpu_associativity_change_counters(); +- init_timer_deferrable(&topology_timer); +- reset_topology_timer(); +- } +- } +- +- pr_info("Starting topology update%s%s\n", +- (prrn_enabled ? " prrn_enabled" : ""), +- (vphn_enabled ? " vphn_enabled" : "")); +- +- return rc; ++ return 0; + } + + /* +@@ -1586,25 +1459,7 @@ int start_topology_update(void) + */ + int stop_topology_update(void) + { +- int rc = 0; +- +- if (!topology_updates_enabled) +- return 0; +- +- if (prrn_enabled) { +- prrn_enabled = 0; +-#ifdef CONFIG_SMP +- rc = of_reconfig_notifier_unregister(&dt_update_nb); +-#endif +- } +- if (vphn_enabled) { +- vphn_enabled = 0; +- rc = del_timer_sync(&topology_timer); +- } +- +- pr_info("Stopping topology update\n"); +- +- return rc; ++ return 0; + } + + int prrn_is_enabled(void) +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-remove-unreachable-topology-workqueue-c.patch b/patches.suse/powerpc-numa-remove-unreachable-topology-workqueue-c.patch new file mode 100644 index 0000000..08c1751 --- /dev/null +++ b/patches.suse/powerpc-numa-remove-unreachable-topology-workqueue-c.patch @@ -0,0 +1,57 @@ +From 6325cb4a4ea8f4af8515b923650dd8f709694b44 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:27 -0500 +Subject: [PATCH] powerpc/numa: remove unreachable topology workqueue code + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 6325cb4a4ea8f4af8515b923650dd8f709694b44 + +Since vphn_enabled is always 0, we can remove the call to +topology_schedule_update() and remove the code which becomes +unreachable as a result. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-8-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/mm/numa.c | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +index 6207297490a8..8415481a7f13 100644 +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1414,17 +1414,6 @@ int arch_update_cpu_topology(void) + return numa_update_cpu_topology(true); + } + +-static void topology_work_fn(struct work_struct *work) +-{ +- rebuild_sched_domains(); +-} +-static DECLARE_WORK(topology_work, topology_work_fn); +- +-static void topology_schedule_update(void) +-{ +- schedule_work(&topology_work); +-} +- + /* + * Start polling for associativity changes. + */ +@@ -1450,9 +1439,6 @@ static int topology_update_init(void) + { + start_topology_update(); + +- if (vphn_enabled) +- topology_schedule_update(); +- + topology_inited = 1; + return 0; + } +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-remove-vphn_enabled-and-prrn_enabled-in.patch b/patches.suse/powerpc-numa-remove-vphn_enabled-and-prrn_enabled-in.patch new file mode 100644 index 0000000..317a2fe --- /dev/null +++ b/patches.suse/powerpc-numa-remove-vphn_enabled-and-prrn_enabled-in.patch @@ -0,0 +1,55 @@ +From 9fb8b5fd1bf782a8257506ad5198237f4124d556 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:28 -0500 +Subject: [PATCH] powerpc/numa: remove vphn_enabled and prrn_enabled internal + flags + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 9fb8b5fd1bf782a8257506ad5198237f4124d556 + +These flags are always zero now; remove them and suitably adjust the +remaining references to them. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-9-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/mm/numa.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1130,8 +1130,6 @@ struct topology_update_data { + }; + + static cpumask_t cpu_associativity_changes_mask; +-static const int vphn_enabled; +-static const int prrn_enabled; + static int topology_inited; + + static long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity) +@@ -1292,7 +1290,7 @@ int numa_update_cpu_topology(bool cpus_locked) + struct device *dev; + int weight, new_nid, i = 0; + +- if (!prrn_enabled && !vphn_enabled && topology_inited) ++ if (topology_inited) + return 0; + + weight = cpumask_weight(&cpu_associativity_changes_mask); +@@ -1432,7 +1430,7 @@ int stop_topology_update(void) + + int prrn_is_enabled(void) + { +- return prrn_enabled; ++ return 0; + } + + static int topology_update_init(void) +-- +2.26.2 + diff --git a/patches.suse/powerpc-numa-stub-out-numa_update_cpu_topology.patch b/patches.suse/powerpc-numa-stub-out-numa_update_cpu_topology.patch new file mode 100644 index 0000000..5eaa977 --- /dev/null +++ b/patches.suse/powerpc-numa-stub-out-numa_update_cpu_topology.patch @@ -0,0 +1,240 @@ +From 893ec6461f46c91487d914e6d467d2e804b9a883 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:29 -0500 +Subject: [PATCH] powerpc/numa: stub out numa_update_cpu_topology() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 893ec6461f46c91487d914e6d467d2e804b9a883 + +Previous changes have removed the code which sets bits in +cpu_associativity_changes_mask and thus it is never modifed at +runtime. From this we can reason that numa_update_cpu_topology() +always returns 0 without doing anything. Remove the body of +numa_update_cpu_topology() and remove all code which becomes +unreachable as a result. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-10-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/mm/numa.c | 193 +---------------------------------------- + 1 file changed, 1 insertion(+), 192 deletions(-) + +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1122,14 +1122,6 @@ u64 memory_hotplug_max(void) + + #include "vphn.h" + +-struct topology_update_data { +- struct topology_update_data *next; +- unsigned int cpu; +- int old_nid; +- int new_nid; +-}; +- +-static cpumask_t cpu_associativity_changes_mask; + static int topology_inited; + + static long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity) +@@ -1219,192 +1211,9 @@ int find_and_online_cpu_nid(int cpu) + return new_nid; + } + +-/* +- * Update the CPU maps and sysfs entries for a single CPU when its NUMA +- * characteristics change. This function doesn't perform any locking and is +- * only safe to call from stop_machine(). +- */ +-static int update_cpu_topology(void *data) +-{ +- struct topology_update_data *update; +- unsigned long cpu; +- +- if (!data) +- return -EINVAL; +- +- cpu = smp_processor_id(); +- +- for (update = data; update; update = update->next) { +- int new_nid = update->new_nid; +- if (cpu != update->cpu) +- continue; +- +- unmap_cpu_from_node(cpu); +- map_cpu_to_node(cpu, new_nid); +- set_cpu_numa_node(cpu, new_nid); +- set_cpu_numa_mem(cpu, local_memory_node(new_nid)); +- vdso_getcpu_init(); +- } +- +- return 0; +-} +- +-static int update_lookup_table(void *data) +-{ +- struct topology_update_data *update; +- +- if (!data) +- return -EINVAL; +- +- /* +- * Upon topology update, the numa-cpu lookup table needs to be updated +- * for all threads in the core, including offline CPUs, to ensure that +- * future hotplug operations respect the cpu-to-node associativity +- * properly. +- */ +- for (update = data; update; update = update->next) { +- int nid, base, j; +- +- nid = update->new_nid; +- base = cpu_first_thread_sibling(update->cpu); +- +- for (j = 0; j < threads_per_core; j++) { +- update_numa_cpu_lookup_table(base + j, nid); +- } +- } +- +- return 0; +-} +- +-/* +- * Update the node maps and sysfs entries for each cpu whose home node +- * has changed. Returns 1 when the topology has changed, and 0 otherwise. +- * +- * cpus_locked says whether we already hold cpu_hotplug_lock. +- */ + int numa_update_cpu_topology(bool cpus_locked) + { +- unsigned int cpu, sibling, changed = 0; +- struct topology_update_data *updates, *ud; +- cpumask_t updated_cpus; +- struct device *dev; +- int weight, new_nid, i = 0; +- +- if (topology_inited) +- return 0; +- +- weight = cpumask_weight(&cpu_associativity_changes_mask); +- if (!weight) +- return 0; +- +- updates = kzalloc(weight * (sizeof(*updates)), GFP_KERNEL); +- if (!updates) +- return 0; +- +- cpumask_clear(&updated_cpus); +- +- for_each_cpu(cpu, &cpu_associativity_changes_mask) { +- /* +- * If siblings aren't flagged for changes, updates list +- * will be too short. Skip on this update and set for next +- * update. +- */ +- if (!cpumask_subset(cpu_sibling_mask(cpu), +- &cpu_associativity_changes_mask)) { +- pr_info("Sibling bits not set for associativity " +- "change, cpu%d\n", cpu); +- cpumask_or(&cpu_associativity_changes_mask, +- &cpu_associativity_changes_mask, +- cpu_sibling_mask(cpu)); +- cpu = cpu_last_thread_sibling(cpu); +- continue; +- } +- +- new_nid = find_and_online_cpu_nid(cpu); +- +- if (new_nid == numa_cpu_lookup_table[cpu]) { +- cpumask_andnot(&cpu_associativity_changes_mask, +- &cpu_associativity_changes_mask, +- cpu_sibling_mask(cpu)); +- dbg("Assoc chg gives same node %d for cpu%d\n", +- new_nid, cpu); +- cpu = cpu_last_thread_sibling(cpu); +- continue; +- } +- +- for_each_cpu(sibling, cpu_sibling_mask(cpu)) { +- ud = &updates[i++]; +- ud->next = &updates[i]; +- ud->cpu = sibling; +- ud->new_nid = new_nid; +- ud->old_nid = numa_cpu_lookup_table[sibling]; +- cpumask_set_cpu(sibling, &updated_cpus); +- } +- cpu = cpu_last_thread_sibling(cpu); +- } +- +- /* +- * Prevent processing of 'updates' from overflowing array +- * where last entry filled in a 'next' pointer. +- */ +- if (i) +- updates[i-1].next = NULL; +- +- pr_debug("Topology update for the following CPUs:\n"); +- if (cpumask_weight(&updated_cpus)) { +- for (ud = &updates[0]; ud; ud = ud->next) { +- pr_debug("cpu %d moving from node %d " +- "to %d\n", ud->cpu, +- ud->old_nid, ud->new_nid); +- } +- } +- +- /* +- * In cases where we have nothing to update (because the updates list +- * is too short or because the new topology is same as the old one), +- * skip invoking update_cpu_topology() via stop-machine(). This is +- * necessary (and not just a fast-path optimization) since stop-machine +- * can end up electing a random CPU to run update_cpu_topology(), and +- * thus trick us into setting up incorrect cpu-node mappings (since +- * 'updates' is kzalloc()'ed). +- * +- * And for the similar reason, we will skip all the following updating. +- */ +- if (!cpumask_weight(&updated_cpus)) +- goto out; +- +- if (cpus_locked) +- stop_machine_cpuslocked(update_cpu_topology, &updates[0], +- &updated_cpus); +- else +- stop_machine(update_cpu_topology, &updates[0], &updated_cpus); +- +- /* +- * Update the numa-cpu lookup table with the new mappings, even for +- * offline CPUs. It is best to perform this update from the stop- +- * machine context. +- */ +- if (cpus_locked) +- stop_machine_cpuslocked(update_lookup_table, &updates[0], +- cpumask_of(raw_smp_processor_id())); +- else +- stop_machine(update_lookup_table, &updates[0], +- cpumask_of(raw_smp_processor_id())); +- +- for (ud = &updates[0]; ud; ud = ud->next) { +- unregister_cpu_under_node(ud->cpu, ud->old_nid); +- register_cpu_under_node(ud->cpu, ud->new_nid); +- +- dev = get_cpu_device(ud->cpu); +- if (dev) +- kobject_uevent(&dev->kobj, KOBJ_CHANGE); +- cpumask_clear_cpu(ud->cpu, &cpu_associativity_changes_mask); +- changed = 1; +- } +- +-out: +- kfree(updates); +- return changed; ++ return 0; + } + + int arch_update_cpu_topology(void) +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-Add-empty-update_numa_cpu_lookup_tab.patch b/patches.suse/powerpc-pseries-Add-empty-update_numa_cpu_lookup_tab.patch new file mode 100644 index 0000000..4a76c88 --- /dev/null +++ b/patches.suse/powerpc-pseries-Add-empty-update_numa_cpu_lookup_tab.patch @@ -0,0 +1,46 @@ +From c1e150ceb61e4a585bad156da15c33bfe89f5858 Mon Sep 17 00:00:00 2001 +From: Corentin Labbe +Date: Wed, 14 Feb 2018 12:17:47 +0000 +Subject: [PATCH] powerpc/pseries: Add empty update_numa_cpu_lookup_table() for + NUMA=n +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +References: bsc#1181674 ltc#189159 +Patch-mainline: v4.16-rc2 +Git-commit: c1e150ceb61e4a585bad156da15c33bfe89f5858 + +When CONFIG_NUMA is not set, the build fails with: + + arch/powerpc/platforms/pseries/hotplug-cpu.c:335:4: + error: déclaration implicite de la fonction « update_numa_cpu_lookup_table » + +So we have to add update_numa_cpu_lookup_table() as an empty function +when CONFIG_NUMA is not set. + +Fixes: 1d9a090783be ("powerpc/numa: Invalidate numa_cpu_lookup_table on cpu remove") +Signed-off-by: Corentin Labbe +Signed-off-by: Michael Ellerman +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/topology.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h +index 593248110902..9f421641a35c 100644 +--- a/arch/powerpc/include/asm/topology.h ++++ b/arch/powerpc/include/asm/topology.h +@@ -81,6 +81,9 @@ static inline int numa_update_cpu_topology(bool cpus_locked) + { + return 0; + } ++ ++static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {} ++ + #endif /* CONFIG_NUMA */ + + #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-Generalize-hcall_vphn.patch b/patches.suse/powerpc-pseries-Generalize-hcall_vphn.patch new file mode 100644 index 0000000..25e8d13 --- /dev/null +++ b/patches.suse/powerpc-pseries-Generalize-hcall_vphn.patch @@ -0,0 +1,95 @@ +From ef34e0efa22a867f8db16feb79fba9964cfbe253 Mon Sep 17 00:00:00 2001 +From: "Naveen N. Rao" +Date: Wed, 3 Jul 2019 22:33:58 +0530 +Subject: [PATCH] powerpc/pseries: Generalize hcall_vphn() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.3-rc1 +Git-commit: ef34e0efa22a867f8db16feb79fba9964cfbe253 + +H_HOME_NODE_ASSOCIATIVITY hcall can take two different flags and return +different associativity information in each case. Generalize the +existing hcall_vphn() function to take flags as an argument and to +return the result. Update the only existing user to pass the proper +arguments. + +Signed-off-by: Naveen N. Rao +Signed-off-by: Michael Ellerman +Acked-by: Michal Suchanek +--- + arch/powerpc/mm/vphn.h | 8 ++++++++ + arch/powerpc/mm/numa.c | 27 +++++++++++++-------------- + 2 files changed, 21 insertions(+), 14 deletions(-) + +diff --git a/arch/powerpc/mm/vphn.h b/arch/powerpc/mm/book3s64/vphn.h +index f0b93c2dd578..f7ff1e0c3801 100644 +--- a/arch/powerpc/mm/vphn.h ++++ b/arch/powerpc/mm/vphn.h +@@ -11,6 +11,14 @@ + */ + #define VPHN_ASSOC_BUFSIZE (VPHN_REGISTER_COUNT*sizeof(u64)/sizeof(u16) + 1) + ++/* ++ * The H_HOME_NODE_ASSOCIATIVITY hcall takes two values for flags: ++ * 1 for retrieving associativity information for a guest cpu ++ * 2 for retrieving associativity information for a host/hypervisor cpu ++ */ ++#define VPHN_FLAG_VCPU 1 ++#define VPHN_FLAG_PCPU 2 ++ + extern int vphn_unpack_associativity(const long *packed, __be32 *unpacked); + + #endif +diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c +index 57e64273cb33..57f006b6214b 100644 +--- a/arch/powerpc/mm/numa.c ++++ b/arch/powerpc/mm/numa.c +@@ -1087,6 +1087,17 @@ static void reset_topology_timer(void); + static int topology_timer_secs = 1; + static int topology_inited; + ++static long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity) ++{ ++ long rc; ++ long retbuf[PLPAR_HCALL9_BUFSIZE] = {0}; ++ ++ rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, cpu); ++ vphn_unpack_associativity(retbuf, associativity); ++ ++ return rc; ++} ++ + /* + * Change polling interval for associativity changes. + */ +@@ -1165,25 +1176,13 @@ static int update_cpu_associativity_changes_mask(void) + * Retrieve the new associativity information for a virtual processor's + * home node. + */ +-static long hcall_vphn(unsigned long cpu, __be32 *associativity) +-{ +- long rc; +- long retbuf[PLPAR_HCALL9_BUFSIZE] = {0}; +- u64 flags = 1; +- int hwcpu = get_hard_smp_processor_id(cpu); +- +- rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, hwcpu); +- vphn_unpack_associativity(retbuf, associativity); +- +- return rc; +-} +- + static long vphn_get_associativity(unsigned long cpu, + __be32 *associativity) + { + long rc; + +- rc = hcall_vphn(cpu, associativity); ++ rc = hcall_vphn(get_hard_smp_processor_id(cpu), ++ VPHN_FLAG_VCPU, associativity); + + switch (rc) { + case H_FUNCTION: +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-hibernation-drop-pseries_suspend_beg.patch b/patches.suse/powerpc-pseries-hibernation-drop-pseries_suspend_beg.patch new file mode 100644 index 0000000..ca0de47 --- /dev/null +++ b/patches.suse/powerpc-pseries-hibernation-drop-pseries_suspend_beg.patch @@ -0,0 +1,73 @@ +From 52719fce3f4c7a8ac9eaa191e8d75a697f9fbcbc Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:49 -0600 +Subject: [PATCH] powerpc/pseries/hibernation: drop pseries_suspend_begin() + from suspend ops + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 52719fce3f4c7a8ac9eaa191e8d75a697f9fbcbc + +There are three ways pseries_suspend_begin() can be reached: + +1. When "mem" is written to /sys/power/state: + +kobj_attr_store() +-> state_store() + -> pm_suspend() + -> suspend_devices_and_enter() + -> pseries_suspend_begin() + +This never works because there is no way to supply a valid stream id +using this interface, and H_VASI_STATE is called with a stream id of +zero. So this call path is useless at best. + +2. When a stream id is written to /sys/devices/system/power/hibernate. +pseries_suspend_begin() is polled directly from store_hibernate() +until the stream is in the "Suspending" state (i.e. the platform is +ready for the OS to suspend execution): + +dev_attr_store() +-> store_hibernate() + -> pseries_suspend_begin() + +3. When a stream id is written to /sys/devices/system/power/hibernate +(continued). After #2, pseries_suspend_begin() is called once again +from the pm core: + +dev_attr_store() +-> store_hibernate() + -> pm_suspend() + -> suspend_devices_and_enter() + -> pseries_suspend_begin() + +This is redundant because the VASI suspend state is already known to +be Suspending. + +The begin() callback of platform_suspend_ops is optional, so we can +simply remove that assignment with no loss of function. + +Fixes: 32d8ad4e621d ("powerpc/pseries: Partition hibernation support") +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-18-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/suspend.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c +index 81e0ac58d620..3eaa9d59dc7a 100644 +--- a/arch/powerpc/platforms/pseries/suspend.c ++++ b/arch/powerpc/platforms/pseries/suspend.c +@@ -187,7 +187,6 @@ static struct bus_type suspend_subsys = { + + static const struct platform_suspend_ops pseries_suspend_ops = { + .valid = suspend_valid_only_mem, +- .begin = pseries_suspend_begin, + .prepare_late = pseries_prepare_late, + .enter = pseries_suspend_enter, + }; +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-hibernation-pass-stream-id-via-funct.patch b/patches.suse/powerpc-pseries-hibernation-pass-stream-id-via-funct.patch new file mode 100644 index 0000000..4e25f8b --- /dev/null +++ b/patches.suse/powerpc-pseries-hibernation-pass-stream-id-via-funct.patch @@ -0,0 +1,72 @@ +From a10a5a17f4ac4f84fcc26162d43b53e2a4e1009a Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:50 -0600 +Subject: [PATCH] powerpc/pseries/hibernation: pass stream id via function + arguments + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: a10a5a17f4ac4f84fcc26162d43b53e2a4e1009a + +There is no need for the stream id to be a file-global variable; pass +it from hibernate_store() to pseries_suspend_begin() for the +H_VASI_STATE call. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-19-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/suspend.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c +index 3eaa9d59dc7a..232621f33510 100644 +--- a/arch/powerpc/platforms/pseries/suspend.c ++++ b/arch/powerpc/platforms/pseries/suspend.c +@@ -15,7 +15,6 @@ + #include + #include "../../kernel/cacheinfo.h" + +-static u64 stream_id; + static struct device suspend_dev; + static DECLARE_COMPLETION(suspend_work); + static struct rtas_suspend_me_data suspend_data; +@@ -29,7 +28,7 @@ static atomic_t suspending; + * Return value: + * 0 on success / other on failure + **/ +-static int pseries_suspend_begin(suspend_state_t state) ++static int pseries_suspend_begin(u64 stream_id) + { + long vasi_state, rc; + unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; +@@ -132,6 +131,7 @@ static ssize_t store_hibernate(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) + { ++ u64 stream_id; + int rc; + + if (!capable(CAP_SYS_ADMIN)) +@@ -140,7 +140,7 @@ static ssize_t store_hibernate(struct device *dev, + stream_id = simple_strtoul(buf, NULL, 16); + + do { +- rc = pseries_suspend_begin(PM_SUSPEND_MEM); ++ rc = pseries_suspend_begin(stream_id); + if (rc == -EAGAIN) + ssleep(1); + } while (rc == -EAGAIN); +@@ -148,8 +148,6 @@ static ssize_t store_hibernate(struct device *dev, + if (!rc) + rc = pm_suspend(PM_SUSPEND_MEM); + +- stream_id = 0; +- + if (!rc) + rc = count; + +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-hibernation-perform-post-suspend-fix.patch b/patches.suse/powerpc-pseries-hibernation-perform-post-suspend-fix.patch new file mode 100644 index 0000000..d01dbdf --- /dev/null +++ b/patches.suse/powerpc-pseries-hibernation-perform-post-suspend-fix.patch @@ -0,0 +1,81 @@ +From fa53bcdb7413e7c40170106781f6b5bb9d74db84 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:57 -0600 +Subject: [PATCH] powerpc/pseries/hibernation: perform post-suspend fixups + later + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: fa53bcdb7413e7c40170106781f6b5bb9d74db84 + +The pseries hibernate code calls post_mobility_fixup() which is sort +of a dumping ground of fixups that need to run after resuming from +suspend regardless of whether suspend was a hibernation or a +migration. Calling post_mobility_fixup() from +pseries_suspend_enable_irqs() runs this code early in resume with +devices suspended and only one CPU up, while the much more commonly +used migration case runs these fixups in a more typical process +context. + +Call post_mobility_fixup() after the suspend core returns a success +status to the hibernate sysfs store method and remove +pseries_suspend_enable_irqs(). + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-26-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/suspend.c | 21 ++++----------------- + 1 file changed, 4 insertions(+), 17 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c +index 6a94cc0deb88..589a91730db8 100644 +--- a/arch/powerpc/platforms/pseries/suspend.c ++++ b/arch/powerpc/platforms/pseries/suspend.c +@@ -50,21 +50,6 @@ static int pseries_suspend_begin(u64 stream_id) + return 0; + } + +-/** +- * pseries_suspend_enable_irqs +- * +- * Post suspend configuration updates +- * +- **/ +-static void pseries_suspend_enable_irqs(void) +-{ +- /* +- * Update configuration which can be modified based on device tree +- * changes during resume. +- */ +- post_mobility_fixup(); +-} +- + /** + * pseries_suspend_enter - Final phase of hibernation + * +@@ -127,8 +112,11 @@ static ssize_t store_hibernate(struct device *dev, + if (!rc) + rc = pm_suspend(PM_SUSPEND_MEM); + +- if (!rc) ++ if (!rc) { + rc = count; ++ post_mobility_fixup(); ++ } ++ + + return rc; + } +@@ -214,7 +202,6 @@ static int __init pseries_suspend_init(void) + if ((rc = pseries_suspend_sysfs_register(&suspend_dev))) + return rc; + +- ppc_md.suspend_enable_irqs = pseries_suspend_enable_irqs; + suspend_set_ops(&pseries_suspend_ops); + return 0; + } +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-hibernation-remove-prepare_late-call.patch b/patches.suse/powerpc-pseries-hibernation-remove-prepare_late-call.patch new file mode 100644 index 0000000..1b1b28a --- /dev/null +++ b/patches.suse/powerpc-pseries-hibernation-remove-prepare_late-call.patch @@ -0,0 +1,81 @@ +From d102f8312e1ea5e8bf84fceebf99186f22d16fc6 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:58 -0600 +Subject: [PATCH] powerpc/pseries/hibernation: remove prepare_late() callback + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: d102f8312e1ea5e8bf84fceebf99186f22d16fc6 + +The pseries hibernate code no longer calls into the original +join/suspend code in kernel/rtas.c, so pseries_prepare_late() and +related code don't accomplish anything now. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-27-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/suspend.c | 25 ------------------------ + 1 file changed, 25 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c +index 589a91730db8..1b902cbf85c5 100644 +--- a/arch/powerpc/platforms/pseries/suspend.c ++++ b/arch/powerpc/platforms/pseries/suspend.c +@@ -15,9 +15,6 @@ + #include + + static struct device suspend_dev; +-static DECLARE_COMPLETION(suspend_work); +-static struct rtas_suspend_me_data suspend_data; +-static atomic_t suspending; + + /** + * pseries_suspend_begin - First phase of hibernation +@@ -61,23 +58,6 @@ static int pseries_suspend_enter(suspend_state_t state) + return rtas_ibm_suspend_me(NULL); + } + +-/** +- * pseries_prepare_late - Prepare to suspend all other CPUs +- * +- * Return value: +- * 0 on success / other on failure +- **/ +-static int pseries_prepare_late(void) +-{ +- atomic_set(&suspending, 1); +- atomic_set(&suspend_data.working, 0); +- atomic_set(&suspend_data.done, 0); +- atomic_set(&suspend_data.error, 0); +- suspend_data.complete = &suspend_work; +- reinit_completion(&suspend_work); +- return 0; +-} +- + /** + * store_hibernate - Initiate partition hibernation + * @dev: subsys root device +@@ -152,7 +132,6 @@ static struct bus_type suspend_subsys = { + + static const struct platform_suspend_ops pseries_suspend_ops = { + .valid = suspend_valid_only_mem, +- .prepare_late = pseries_prepare_late, + .enter = pseries_suspend_enter, + }; + +@@ -195,10 +174,6 @@ static int __init pseries_suspend_init(void) + if (!firmware_has_feature(FW_FEATURE_LPAR)) + return 0; + +- suspend_data.token = rtas_token("ibm,suspend-me"); +- if (suspend_data.token == RTAS_UNKNOWN_SERVICE) +- return 0; +- + if ((rc = pseries_suspend_sysfs_register(&suspend_dev))) + return rc; + +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-hibernation-remove-pseries_suspend_c.patch b/patches.suse/powerpc-pseries-hibernation-remove-pseries_suspend_c.patch new file mode 100644 index 0000000..d7a5976 --- /dev/null +++ b/patches.suse/powerpc-pseries-hibernation-remove-pseries_suspend_c.patch @@ -0,0 +1,58 @@ +From ed22bb8d39fa7f3980afc6e16d2a891847367d33 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:51 -0600 +Subject: [PATCH] powerpc/pseries/hibernation: remove pseries_suspend_cpu() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: ed22bb8d39fa7f3980afc6e16d2a891847367d33 + +Since commit 48f6e7f6d948 ("powerpc/pseries: remove cede offline state +for CPUs"), ppc_md.suspend_disable_cpu() is no longer used and all +CPUs (save one) are placed into true offline state as opposed to +H_JOIN. So pseries_suspend_cpu() is effectively unused; remove it. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-20-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/suspend.c | 15 --------------- + 1 file changed, 15 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c +index 232621f33510..3315d698d5ab 100644 +--- a/arch/powerpc/platforms/pseries/suspend.c ++++ b/arch/powerpc/platforms/pseries/suspend.c +@@ -48,20 +48,6 @@ static int pseries_suspend_begin(u64 stream_id) + vasi_state); + return -EIO; + } +- +- return 0; +-} +- +-/** +- * pseries_suspend_cpu - Suspend a single CPU +- * +- * Makes the H_JOIN call to suspend the CPU +- * +- **/ +-static int pseries_suspend_cpu(void) +-{ +- if (atomic_read(&suspending)) +- return rtas_suspend_cpu(&suspend_data); + return 0; + } + +@@ -235,7 +221,6 @@ static int __init pseries_suspend_init(void) + if ((rc = pseries_suspend_sysfs_register(&suspend_dev))) + return rc; + +- ppc_md.suspend_disable_cpu = pseries_suspend_cpu; + ppc_md.suspend_enable_irqs = pseries_suspend_enable_irqs; + suspend_set_ops(&pseries_suspend_ops); + return 0; +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-hibernation-remove-redundant-cachein.patch b/patches.suse/powerpc-pseries-hibernation-remove-redundant-cachein.patch index 69bb0c3..502484d 100644 --- a/patches.suse/powerpc-pseries-hibernation-remove-redundant-cachein.patch +++ b/patches.suse/powerpc-pseries-hibernation-remove-redundant-cachein.patch @@ -28,6 +28,7 @@ Acked-by: Michal Suchanek 1 file changed, 3 deletions(-) diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c +index 703728cb95ec..6a94cc0deb88 100644 --- a/arch/powerpc/platforms/pseries/suspend.c +++ b/arch/powerpc/platforms/pseries/suspend.c @@ -13,7 +13,6 @@ @@ -36,8 +37,8 @@ diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/p #include -#include "../../kernel/cacheinfo.h" - static u64 stream_id; static struct device suspend_dev; + static DECLARE_COMPLETION(suspend_work); @@ -63,9 +62,7 @@ static void pseries_suspend_enable_irqs(void) * Update configuration which can be modified based on device tree * changes during resume. diff --git a/patches.suse/powerpc-pseries-hibernation-switch-to-rtas_ibm_suspe.patch b/patches.suse/powerpc-pseries-hibernation-switch-to-rtas_ibm_suspe.patch new file mode 100644 index 0000000..abb3718 --- /dev/null +++ b/patches.suse/powerpc-pseries-hibernation-switch-to-rtas_ibm_suspe.patch @@ -0,0 +1,46 @@ +From 366fb13bf13b029c4d43bf19382f7aea69bfa4b7 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:54 -0600 +Subject: [PATCH] powerpc/pseries/hibernation: switch to rtas_ibm_suspend_me() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 366fb13bf13b029c4d43bf19382f7aea69bfa4b7 + +rtas_suspend_last_cpu() and related code perform a lot of work that +isn't relevant to the hibernation workflow. All other CPUs are offline +when called so there is no need to place them in H_JOIN or prod them +on resume, nor is there need for retries or operations on shared +state. + +Call the rtas_ibm_suspend_me() wrapper function directly from +pseries_suspend_enter() instead of using rtas_suspend_last_cpu(). + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-23-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/suspend.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c +index 3315d698d5ab..703728cb95ec 100644 +--- a/arch/powerpc/platforms/pseries/suspend.c ++++ b/arch/powerpc/platforms/pseries/suspend.c +@@ -76,11 +76,7 @@ static void pseries_suspend_enable_irqs(void) + **/ + static int pseries_suspend_enter(suspend_state_t state) + { +- int rc = rtas_suspend_last_cpu(&suspend_data); +- +- atomic_set(&suspending, 0); +- atomic_set(&suspend_data.done, 1); +- return rc; ++ return rtas_ibm_suspend_me(NULL); + } + + /** +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-mobility-Add-pr_debug-for-device-tre.patch b/patches.suse/powerpc-pseries-mobility-Add-pr_debug-for-device-tre.patch new file mode 100644 index 0000000..550e878 --- /dev/null +++ b/patches.suse/powerpc-pseries-mobility-Add-pr_debug-for-device-tre.patch @@ -0,0 +1,56 @@ +From 5d8b1f9dea17b4bf5e5f088f39eeab32c7e487be Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Thu, 27 Jun 2019 00:30:44 -0500 +Subject: [PATCH] powerpc/pseries/mobility: Add pr_debug() for device tree + changes + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 5d8b1f9dea17b4bf5e5f088f39eeab32c7e487be + +When investigating issues with partition migration or resource +reassignments it is helpful to have a log of which nodes and +properties in the device tree have changed. Use pr_debug() so it's +easy to enable these at runtime with the dynamic debug facility. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20190627053044.9238-3-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +index 0ede49a35121..d6f4162478a5 100644 +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -67,6 +67,8 @@ static int delete_dt_node(__be32 phandle) + if (!dn) + return -ENOENT; + ++ pr_debug("removing node %pOFfp\n", dn); ++ + dlpar_detach_node(dn); + of_node_put(dn); + return 0; +@@ -125,6 +127,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop, + } + + if (!more) { ++ pr_debug("updating node %pOF property %s\n", dn, name); + of_update_property(dn, new_prop); + *prop = NULL; + } +@@ -243,6 +246,8 @@ static int add_dt_node(__be32 parent_phandle, __be32 drc_index) + if (rc) + dlpar_free_cc_nodes(dn); + ++ pr_debug("added node %pOFfp\n", dn); ++ + of_node_put(parent_dn); + return rc; + } +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-mobility-Set-pr_fmt.patch b/patches.suse/powerpc-pseries-mobility-Set-pr_fmt.patch new file mode 100644 index 0000000..2527230 --- /dev/null +++ b/patches.suse/powerpc-pseries-mobility-Set-pr_fmt.patch @@ -0,0 +1,51 @@ +From 494a66f34e00b6a1897b5a1ab150a19265696b17 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Thu, 27 Jun 2019 00:30:43 -0500 +Subject: [PATCH] powerpc/pseries/mobility: Set pr_fmt() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 494a66f34e00b6a1897b5a1ab150a19265696b17 + +The pr_err() callsites in mobility.c already manually include a +"mobility:" prefix, let's make it official for the benefit of messages +to be added later. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20190627053044.9238-2-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -6,6 +6,9 @@ + * 2 as published by the Free Software Foundation. + */ + ++ ++#define pr_fmt(fmt) "mobility: " fmt ++ + #include + #include + #include +@@ -396,11 +399,11 @@ static int __init mobility_sysfs_init(void) + + rc = sysfs_create_file(mobility_kobj, &class_attr_migration.attr); + if (rc) +- pr_err("mobility: unable to create migration sysfs file (%d)\n", rc); ++ pr_err("unable to create migration sysfs file (%d)\n", rc); + + rc = sysfs_create_file(mobility_kobj, &class_attr_api_version.attr.attr); + if (rc) +- pr_err("mobility: unable to create api_version sysfs file (%d)\n", rc); ++ pr_err("unable to create api_version sysfs file (%d)\n", rc); + + return 0; + } +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-mobility-add-missing-break-to-defaul.patch b/patches.suse/powerpc-pseries-mobility-add-missing-break-to-defaul.patch new file mode 100644 index 0000000..ef54431 --- /dev/null +++ b/patches.suse/powerpc-pseries-mobility-add-missing-break-to-defaul.patch @@ -0,0 +1,35 @@ +From aa5e5c9b556a2e5f68a915e4b5dfa5c6bda47c64 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:40 -0600 +Subject: [PATCH] powerpc/pseries/mobility: add missing break to default case + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: aa5e5c9b556a2e5f68a915e4b5dfa5c6bda47c64 + +update_dt_node() has a switch statement where the default case lacks a +break statement. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-9-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +index e66359b00297..527a64e2d89f 100644 +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -213,6 +213,7 @@ static int update_dt_node(__be32 phandle, s32 scope) + } + + prop_data += vd; ++ break; + } + + cond_resched(); +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-mobility-don-t-error-on-absence-of-i.patch b/patches.suse/powerpc-pseries-mobility-don-t-error-on-absence-of-i.patch new file mode 100644 index 0000000..74f7290 --- /dev/null +++ b/patches.suse/powerpc-pseries-mobility-don-t-error-on-absence-of-i.patch @@ -0,0 +1,38 @@ +From b06a6717873560e9dd1c07357781fc2b27545701 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:39 -0600 +Subject: [PATCH] powerpc/pseries/mobility: don't error on absence of ibm, + update-nodes + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: b06a6717873560e9dd1c07357781fc2b27545701 + +Treat the absence of the ibm,update-nodes function as benign instead +of reporting an error. If the platform does not provide that facility, +it's not a problem for Linux. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-8-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +index 6ff642e84c6a..e66359b00297 100644 +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -261,7 +261,7 @@ int pseries_devicetree_update(s32 scope) + + update_nodes_token = rtas_token("ibm,update-nodes"); + if (update_nodes_token == RTAS_UNKNOWN_SERVICE) +- return -EINVAL; ++ return 0; + + rtas_buf = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL); + if (!rtas_buf) +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-mobility-error-message-improvements.patch b/patches.suse/powerpc-pseries-mobility-error-message-improvements.patch new file mode 100644 index 0000000..6b23f24 --- /dev/null +++ b/patches.suse/powerpc-pseries-mobility-error-message-improvements.patch @@ -0,0 +1,50 @@ +From 2d5be6f16c4ba5c27d06704976daf55f3236a236 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:41 -0600 +Subject: [PATCH] powerpc/pseries/mobility: error message improvements + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 2d5be6f16c4ba5c27d06704976daf55f3236a236 + +- Convert printk(KERN_ERR) to pr_err(). +- Include errno in property update failure message. +- Remove reference to "Post-mobility" from device tree update message: + with pr_err() it will have a "mobility:" prefix. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-10-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +index 527a64e2d89f..31d81b7da961 100644 +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -208,8 +208,8 @@ static int update_dt_node(__be32 phandle, s32 scope) + rc = update_dt_property(dn, &prop, prop_name, + vd, prop_data); + if (rc) { +- printk(KERN_ERR "Could not update %s" +- " property\n", prop_name); ++ pr_err("updating %s property failed: %d\n", ++ prop_name, rc); + } + + prop_data += vd; +@@ -343,8 +343,7 @@ void post_mobility_fixup(void) + + rc = pseries_devicetree_update(MIGRATION_SCOPE); + if (rc) +- printk(KERN_ERR "Post-mobility device tree update " +- "failed: %d\n", rc); ++ pr_err("device tree update failed: %d\n", rc); + + cacheinfo_rebuild(); + +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-mobility-extract-VASI-session-pollin.patch b/patches.suse/powerpc-pseries-mobility-extract-VASI-session-pollin.patch new file mode 100644 index 0000000..952ec2d --- /dev/null +++ b/patches.suse/powerpc-pseries-mobility-extract-VASI-session-pollin.patch @@ -0,0 +1,117 @@ +From d9213319b84ee8393475c38361c84151d5c33415 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:43 -0600 +Subject: [PATCH] powerpc/pseries/mobility: extract VASI session polling logic + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: d9213319b84ee8393475c38361c84151d5c33415 + +The behavior of rtas_ibm_suspend_me_unsafe() is to return -EAGAIN to +the caller until the specified VASI suspend session state makes the +transition from H_VASI_ENABLED to H_VASI_SUSPENDING. In the interest +of separating concerns to prepare for a new implementation of the +join/suspend sequence, extract VASI session polling logic into a +couple of local functions. Waiting for the session state to reach +H_VASI_SUSPENDING before calling rtas_ibm_suspend_me_unsafe() ensures +that we will never get an EAGAIN result necessitating a retry. No +user-visible change in behavior is intended. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-12-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 69 +++++++++++++++++++++-- + 1 file changed, 64 insertions(+), 5 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -345,6 +345,66 @@ void post_mobility_fixup(void) + return; + } + ++static int poll_vasi_state(u64 handle, unsigned long *res) ++{ ++ unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; ++ long hvrc; ++ int ret; ++ ++ hvrc = plpar_hcall(H_VASI_STATE, retbuf, handle); ++ switch (hvrc) { ++ case H_SUCCESS: ++ ret = 0; ++ *res = retbuf[0]; ++ break; ++ case H_PARAMETER: ++ ret = -EINVAL; ++ break; ++ case H_FUNCTION: ++ ret = -EOPNOTSUPP; ++ break; ++ case H_HARDWARE: ++ default: ++ pr_err("unexpected H_VASI_STATE result %ld\n", hvrc); ++ ret = -EIO; ++ break; ++ } ++ return ret; ++} ++ ++static int wait_for_vasi_session_suspending(u64 handle) ++{ ++ unsigned long state; ++ int ret; ++ ++ /* ++ * Wait for transition from H_VASI_ENABLED to ++ * H_VASI_SUSPENDING. Treat anything else as an error. ++ */ ++ while (true) { ++ ret = poll_vasi_state(handle, &state); ++ ++ if (ret != 0 || state == H_VASI_SUSPENDING) { ++ break; ++ } else if (state == H_VASI_ENABLED) { ++ ssleep(1); ++ } else { ++ pr_err("unexpected H_VASI_STATE result %lu\n", state); ++ ret = -EIO; ++ break; ++ } ++ } ++ ++ /* ++ * Proceed even if H_VASI_STATE is unavailable. If H_JOIN or ++ * ibm,suspend-me are also unimplemented, we'll recover then. ++ */ ++ if (ret == -EOPNOTSUPP) ++ ret = 0; ++ ++ return ret; ++} ++ + static ssize_t migrate_store(struct class *class, struct class_attribute *attr, + const char *buf, size_t count) + { +@@ -356,12 +416,11 @@ static ssize_t migration_store(struct class *class, + if (rc) + return rc; + +- do { +- rc = rtas_ibm_suspend_me_unsafe(streamid); +- if (rc == -EAGAIN) +- ssleep(1); +- } while (rc == -EAGAIN); ++ rc = wait_for_vasi_session_suspending(streamid); ++ if (rc) ++ return rc; + ++ rc = rtas_ibm_suspend_me_unsafe(streamid); + if (rc) + return rc; + +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-mobility-notify-network-peers-after-.patch b/patches.suse/powerpc-pseries-mobility-notify-network-peers-after-.patch index e129e72..54e5c85 100644 --- a/patches.suse/powerpc-pseries-mobility-notify-network-peers-after-.patch +++ b/patches.suse/powerpc-pseries-mobility-notify-network-peers-after-.patch @@ -21,6 +21,7 @@ Acked-by: Michal Suchanek arch/powerpc/platforms/pseries/mobility.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c @@ -19,6 +19,9 @@ @@ -33,16 +34,16 @@ Acked-by: Michal Suchanek #include #include -@@ -333,6 +336,8 @@ void post_mobility_fixup(void) +@@ -299,6 +302,8 @@ int pseries_devicetree_update(s32 scope) + void post_mobility_fixup(void) { int rc; - int activate_fw_token; + struct net_device *netdev; + struct net *net; - activate_fw_token = rtas_token("ibm,activate-firmware"); - if (activate_fw_token == RTAS_UNKNOWN_SERVICE) { -@@ -373,6 +378,22 @@ void post_mobility_fixup(void) + rtas_activate_firmware(); + +@@ -326,6 +331,22 @@ void post_mobility_fixup(void) /* Possibly switch to a new RFI flush type */ pseries_setup_rfi_flush(); diff --git a/patches.suse/powerpc-pseries-mobility-refactor-node-lookup-during.patch b/patches.suse/powerpc-pseries-mobility-refactor-node-lookup-during.patch new file mode 100644 index 0000000..c9c833e --- /dev/null +++ b/patches.suse/powerpc-pseries-mobility-refactor-node-lookup-during.patch @@ -0,0 +1,154 @@ +From 2efd7f6eb9b7107e469837d8452e750d7d080a5d Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:52:00 -0600 +Subject: [PATCH] powerpc/pseries/mobility: refactor node lookup during DT + update + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 2efd7f6eb9b7107e469837d8452e750d7d080a5d + +In pseries_devicetree_update(), with each call to ibm,update-nodes the +partition firmware communicates the node to be deleted or updated by +placing its phandle in the work buffer. Each of delete_dt_node(), +update_dt_node(), and add_dt_node() have duplicate lookups using the +phandle value and corresponding refcount management. + +Move the lookup and of_node_put() into pseries_devicetree_update(), +and emit a warning on any failed lookups. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-29-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 49 ++++++++--------------- + 1 file changed, 17 insertions(+), 32 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +index e670180f311d..ea4d6a660e0d 100644 +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -61,18 +61,10 @@ static int mobility_rtas_call(int token, char *buf, s32 scope) + return rc; + } + +-static int delete_dt_node(__be32 phandle) ++static int delete_dt_node(struct device_node *dn) + { +- struct device_node *dn; +- +- dn = of_find_node_by_phandle(be32_to_cpu(phandle)); +- if (!dn) +- return -ENOENT; +- + pr_debug("removing node %pOFfp\n", dn); +- + dlpar_detach_node(dn); +- of_node_put(dn); + return 0; + } + +@@ -137,10 +129,9 @@ static int update_dt_property(struct device_node *dn, struct property **prop, + return 0; + } + +-static int update_dt_node(__be32 phandle, s32 scope) ++static int update_dt_node(struct device_node *dn, s32 scope) + { + struct update_props_workarea *upwa; +- struct device_node *dn; + struct property *prop = NULL; + int i, rc, rtas_rc; + char *prop_data; +@@ -157,14 +148,8 @@ static int update_dt_node(__be32 phandle, s32 scope) + if (!rtas_buf) + return -ENOMEM; + +- dn = of_find_node_by_phandle(be32_to_cpu(phandle)); +- if (!dn) { +- kfree(rtas_buf); +- return -ENOENT; +- } +- + upwa = (struct update_props_workarea *)&rtas_buf[0]; +- upwa->phandle = phandle; ++ upwa->phandle = cpu_to_be32(dn->phandle); + + do { + rtas_rc = mobility_rtas_call(update_properties_token, rtas_buf, +@@ -224,26 +209,18 @@ static int update_dt_node(__be32 phandle, s32 scope) + cond_resched(); + } while (rtas_rc == 1); + +- of_node_put(dn); + kfree(rtas_buf); + return 0; + } + +-static int add_dt_node(__be32 parent_phandle, __be32 drc_index) ++static int add_dt_node(struct device_node *parent_dn, __be32 drc_index) + { + struct device_node *dn; +- struct device_node *parent_dn; + int rc; + +- parent_dn = of_find_node_by_phandle(be32_to_cpu(parent_phandle)); +- if (!parent_dn) +- return -ENOENT; +- + dn = dlpar_configure_connector(drc_index, parent_dn); +- if (!dn) { +- of_node_put(parent_dn); ++ if (!dn) + return -ENOENT; +- } + + rc = dlpar_attach_node(dn, parent_dn); + if (rc) +@@ -251,7 +228,6 @@ static int add_dt_node(__be32 parent_phandle, __be32 drc_index) + + pr_debug("added node %pOFfp\n", dn); + +- of_node_put(parent_dn); + return rc; + } + +@@ -284,22 +260,31 @@ int pseries_devicetree_update(s32 scope) + data++; + + for (i = 0; i < node_count; i++) { ++ struct device_node *np; + __be32 phandle = *data++; + __be32 drc_index; + ++ np = of_find_node_by_phandle(be32_to_cpu(phandle)); ++ if (!np) { ++ pr_warn("Failed lookup: phandle 0x%x for action 0x%x\n", ++ be32_to_cpu(phandle), action); ++ continue; ++ } ++ + switch (action) { + case DELETE_DT_NODE: +- delete_dt_node(phandle); ++ delete_dt_node(np); + break; + case UPDATE_DT_NODE: +- update_dt_node(phandle, scope); ++ update_dt_node(np, scope); + break; + case ADD_DT_NODE: + drc_index = *data++; +- add_dt_node(phandle, drc_index); ++ add_dt_node(np, drc_index); + break; + } + ++ of_node_put(np); + cond_resched(); + } + } +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-mobility-retry-partition-suspend-aft.patch b/patches.suse/powerpc-pseries-mobility-retry-partition-suspend-aft.patch new file mode 100644 index 0000000..68fee30 --- /dev/null +++ b/patches.suse/powerpc-pseries-mobility-retry-partition-suspend-aft.patch @@ -0,0 +1,113 @@ +From aeca35b9a52b0e0d019a5244fbaab699f753b443 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:46 -0600 +Subject: [PATCH] powerpc/pseries/mobility: retry partition suspend after error + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: aeca35b9a52b0e0d019a5244fbaab699f753b443 + +This is a mitigation for the relatively rare occurrence where a +virtual IOA can be in a transient state that prevents the +suspend/migration from succeeding, resulting in an error from +ibm,suspend-me. + +If the join/suspend sequence returns an error, it is acceptable to +retry as long as the VASI suspend session state is still +"Suspending" (i.e. the platform is still waiting for the OS to +suspend). + +Retry a few times on suspend failure while this condition holds, +progressively increasing the delay between attempts. We don't want to +retry indefinitey because firmware emits an error log event on each +unsuccessful attempt. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-15-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 59 ++++++++++++++++++++++- + 1 file changed, 57 insertions(+), 2 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +index f234a7ed87aa..fe7e35cdc9d5 100644 +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -542,16 +542,71 @@ static void pseries_cancel_migration(u64 handle, int err) + pr_err("H_VASI_SIGNAL error: %ld\n", hvrc); + } + ++static int pseries_suspend(u64 handle) ++{ ++ const unsigned int max_attempts = 5; ++ unsigned int retry_interval_ms = 1; ++ unsigned int attempt = 1; ++ int ret; ++ ++ while (true) { ++ atomic_t counter = ATOMIC_INIT(0); ++ unsigned long vasi_state; ++ int vasi_err; ++ ++ ret = stop_machine(do_join, &counter, cpu_online_mask); ++ if (ret == 0) ++ break; ++ /* ++ * Encountered an error. If the VASI stream is still ++ * in Suspending state, it's likely a transient ++ * condition related to some device in the partition ++ * and we can retry in the hope that the cause has ++ * cleared after some delay. ++ * ++ * A better design would allow drivers etc to prepare ++ * for the suspend and avoid conditions which prevent ++ * the suspend from succeeding. For now, we have this ++ * mitigation. ++ */ ++ pr_notice("Partition suspend attempt %u of %u error: %d\n", ++ attempt, max_attempts, ret); ++ ++ if (attempt == max_attempts) ++ break; ++ ++ vasi_err = poll_vasi_state(handle, &vasi_state); ++ if (vasi_err == 0) { ++ if (vasi_state != H_VASI_SUSPENDING) { ++ pr_notice("VASI state %lu after failed suspend\n", ++ vasi_state); ++ break; ++ } ++ } else if (vasi_err != -EOPNOTSUPP) { ++ pr_err("VASI state poll error: %d", vasi_err); ++ break; ++ } ++ ++ pr_notice("Will retry partition suspend after %u ms\n", ++ retry_interval_ms); ++ ++ msleep(retry_interval_ms); ++ retry_interval_ms *= 10; ++ attempt++; ++ } ++ ++ return ret; ++} ++ + static int pseries_migrate_partition(u64 handle) + { +- atomic_t counter = ATOMIC_INIT(0); + int ret; + + ret = wait_for_vasi_session_suspending(handle); + if (ret) + return ret; + +- ret = stop_machine(do_join, &counter, cpu_online_mask); ++ ret = pseries_suspend(handle); + if (ret == 0) + post_mobility_fixup(); + else +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-mobility-signal-suspend-cancellation.patch b/patches.suse/powerpc-pseries-mobility-signal-suspend-cancellation.patch new file mode 100644 index 0000000..3696e5e --- /dev/null +++ b/patches.suse/powerpc-pseries-mobility-signal-suspend-cancellation.patch @@ -0,0 +1,76 @@ +From 37cddc7d6cf4568a7fb69aeff6f26e4c8a3bc0f7 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:45 -0600 +Subject: [PATCH] powerpc/pseries/mobility: signal suspend cancellation to + platform + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 37cddc7d6cf4568a7fb69aeff6f26e4c8a3bc0f7 + +If we're returning an error to user space, use H_VASI_SIGNAL to send a +cancellation request to the platform. This isn't strictly required but +it communicates that Linux will not attempt to complete the suspend, +which allows the various entities involved to promptly end the +operation in progress. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-14-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 31 +++++++++++++++++++++++ + 1 file changed, 31 insertions(+) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +index 5a3951626a96..f234a7ed87aa 100644 +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -513,6 +513,35 @@ static int do_join(void *arg) + return ret; + } + ++/* ++ * Abort reason code byte 0. We use only the 'Migrating partition' value. ++ */ ++enum vasi_aborting_entity { ++ ORCHESTRATOR = 1, ++ VSP_SOURCE = 2, ++ PARTITION_FIRMWARE = 3, ++ PLATFORM_FIRMWARE = 4, ++ VSP_TARGET = 5, ++ MIGRATING_PARTITION = 6, ++}; ++ ++static void pseries_cancel_migration(u64 handle, int err) ++{ ++ u32 reason_code; ++ u32 detail; ++ u8 entity; ++ long hvrc; ++ ++ entity = MIGRATING_PARTITION; ++ detail = abs(err) & 0xffffff; ++ reason_code = (entity << 24) | detail; ++ ++ hvrc = plpar_hcall_norets(H_VASI_SIGNAL, handle, ++ H_VASI_SIGNAL_CANCEL, reason_code); ++ if (hvrc) ++ pr_err("H_VASI_SIGNAL error: %ld\n", hvrc); ++} ++ + static int pseries_migrate_partition(u64 handle) + { + atomic_t counter = ATOMIC_INIT(0); +@@ -525,6 +554,8 @@ static int pseries_migrate_partition(u64 handle) + ret = stop_machine(do_join, &counter, cpu_online_mask); + if (ret == 0) + post_mobility_fixup(); ++ else ++ pseries_cancel_migration(handle, ret); + + return ret; + } +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-mobility-use-rtas_activate_firmware-.patch b/patches.suse/powerpc-pseries-mobility-use-rtas_activate_firmware-.patch new file mode 100644 index 0000000..afdff36 --- /dev/null +++ b/patches.suse/powerpc-pseries-mobility-use-rtas_activate_firmware-.patch @@ -0,0 +1,52 @@ +From c3ae9781d5a64093f161e6cc5dfefb0773106ca9 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:42 -0600 +Subject: [PATCH] powerpc/pseries/mobility: use rtas_activate_firmware() on + resume + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: c3ae9781d5a64093f161e6cc5dfefb0773106ca9 + +It's incorrect to abort post-suspend processing if +ibm,activate-firmware isn't available. Use rtas_activate_firmware(), +which logs this condition appropriately and allows us to proceed. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-11-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 15 +-------------- + 1 file changed, 1 insertion(+), 14 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +index 31d81b7da961..01ac7c03558e 100644 +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -312,21 +312,8 @@ int pseries_devicetree_update(s32 scope) + void post_mobility_fixup(void) + { + int rc; +- int activate_fw_token; + +- activate_fw_token = rtas_token("ibm,activate-firmware"); +- if (activate_fw_token == RTAS_UNKNOWN_SERVICE) { +- printk(KERN_ERR "Could not make post-mobility " +- "activate-fw call.\n"); +- return; +- } +- +- do { +- rc = rtas_call(activate_fw_token, 0, 1, NULL); +- } while (rtas_busy_delay(rc)); +- +- if (rc) +- printk(KERN_ERR "Post-mobility activate-fw failed: %d\n", rc); ++ rtas_activate_firmware(); + + /* + * We don't want CPUs to go online/offline while the device +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-mobility-use-stop_machine-for-join-s.patch b/patches.suse/powerpc-pseries-mobility-use-stop_machine-for-join-s.patch new file mode 100644 index 0000000..f7bc43f --- /dev/null +++ b/patches.suse/powerpc-pseries-mobility-use-stop_machine-for-join-s.patch @@ -0,0 +1,215 @@ +From 9327dc0aeef36a3cbb9d94f79b79cc4f91ff8a41 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:44 -0600 +Subject: [PATCH] powerpc/pseries/mobility: use stop_machine for join/suspend + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 9327dc0aeef36a3cbb9d94f79b79cc4f91ff8a41 + +The partition suspend sequence as specified in the platform +architecture requires that all active processor threads call +H_JOIN, which: + +- suspends the calling thread until it is the target of + an H_PROD; or +- immediately returns H_CONTINUE, if the calling thread is the last to + call H_JOIN. This thread is expected to call ibm,suspend-me to + completely suspend the partition. + +Upon returning from ibm,suspend-me the calling thread must wake all +others using H_PROD. + +rtas_ibm_suspend_me_unsafe() uses on_each_cpu() to implement this +protocol, but because of its synchronizing nature this is susceptible +to deadlock versus users of stop_machine() or other callers of +on_each_cpu(). + +Not only is stop_machine() intended for use cases like this, it +handles error propagation and allows us to keep the data shared +between CPUs minimal: a single atomic counter which ensures exactly +one CPU will wake the others from their joined states. + +Switch the migration code to use stop_machine() and a less complex +local implementation of the H_JOIN/ibm,suspend-me logic, which +carries additional benefits: + +- more informative error reporting, appropriately ratelimited +- resets the lockup detector / watchdog on resume to prevent lockup + warnings when the OS has been suspended for a time exceeding the + threshold. + +Fixes: 91dc182ca6e2 ("[PATCH] powerpc: special-case ibm,suspend-me RTAS call") +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-13-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 132 ++++++++++++++++++++-- + 1 file changed, 125 insertions(+), 7 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -12,9 +12,11 @@ + #include + #include + #include ++#include + #include + #include + #include ++#include + #include + #include + #include +@@ -405,6 +407,128 @@ static int wait_for_vasi_session_suspending(u64 handle) + return ret; + } + ++static void prod_single(unsigned int target_cpu) ++{ ++ long hvrc; ++ int hwid; ++ ++ hwid = get_hard_smp_processor_id(target_cpu); ++ hvrc = plpar_hcall_norets(H_PROD, hwid); ++ if (hvrc == H_SUCCESS) ++ return; ++ pr_err_ratelimited("H_PROD of CPU %u (hwid %d) error: %ld\n", ++ target_cpu, hwid, hvrc); ++} ++ ++static void prod_others(void) ++{ ++ unsigned int cpu; ++ ++ for_each_online_cpu(cpu) { ++ if (cpu != smp_processor_id()) ++ prod_single(cpu); ++ } ++} ++ ++static u16 clamp_slb_size(void) ++{ ++ u16 prev = mmu_slb_size; ++ ++ slb_set_size(SLB_MIN_SIZE); ++ ++ return prev; ++} ++ ++static int do_suspend(void) ++{ ++ u16 saved_slb_size; ++ int status; ++ int ret; ++ ++ pr_info("calling ibm,suspend-me on CPU %i\n", smp_processor_id()); ++ ++ /* ++ * The destination processor model may have fewer SLB entries ++ * than the source. We reduce mmu_slb_size to a safe minimum ++ * before suspending in order to minimize the possibility of ++ * programming non-existent entries on the destination. If ++ * suspend fails, we restore it before returning. On success ++ * the OF reconfig path will update it from the new device ++ * tree after resuming on the destination. ++ */ ++ saved_slb_size = clamp_slb_size(); ++ ++ ret = rtas_ibm_suspend_me(&status); ++ if (ret != 0) { ++ pr_err("ibm,suspend-me error: %d\n", status); ++ slb_set_size(saved_slb_size); ++ } ++ ++ return ret; ++} ++ ++static int do_join(void *arg) ++{ ++ atomic_t *counter = arg; ++ long hvrc; ++ int ret; ++ ++ /* Must ensure MSR.EE off for H_JOIN. */ ++ hard_irq_disable(); ++ hvrc = plpar_hcall_norets(H_JOIN); ++ ++ switch (hvrc) { ++ case H_CONTINUE: ++ /* ++ * All other CPUs are offline or in H_JOIN. This CPU ++ * attempts the suspend. ++ */ ++ ret = do_suspend(); ++ break; ++ case H_SUCCESS: ++ /* ++ * The suspend is complete and this cpu has received a ++ * prod. ++ */ ++ ret = 0; ++ break; ++ case H_BAD_MODE: ++ case H_HARDWARE: ++ default: ++ ret = -EIO; ++ pr_err_ratelimited("H_JOIN error %ld on CPU %i\n", ++ hvrc, smp_processor_id()); ++ break; ++ } ++ ++ if (atomic_inc_return(counter) == 1) { ++ pr_info("CPU %u waking all threads\n", smp_processor_id()); ++ prod_others(); ++ } ++ /* ++ * Execution may have been suspended for several seconds, so ++ * reset the watchdog. ++ */ ++ touch_nmi_watchdog(); ++ return ret; ++} ++ ++static int pseries_migrate_partition(u64 handle) ++{ ++ atomic_t counter = ATOMIC_INIT(0); ++ int ret; ++ ++ ret = wait_for_vasi_session_suspending(handle); ++ if (ret) ++ return ret; ++ ++ ret = stop_machine(do_join, &counter, cpu_online_mask); ++ if (ret == 0) ++ post_mobility_fixup(); ++ ++ return ret; ++} ++ + static ssize_t migrate_store(struct class *class, struct class_attribute *attr, + const char *buf, size_t count) + { +@@ -416,16 +540,10 @@ static ssize_t migration_store(struct class *class, + if (rc) + return rc; + +- rc = wait_for_vasi_session_suspending(streamid); ++ rc = pseries_migrate_partition(streamid); + if (rc) + return rc; + +- rc = rtas_ibm_suspend_me_unsafe(streamid); +- if (rc) +- return rc; +- +- post_mobility_fixup(); +- + return count; + } + +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-remove-dlpar_cpu_readd.patch b/patches.suse/powerpc-pseries-remove-dlpar_cpu_readd.patch new file mode 100644 index 0000000..51c87f6 --- /dev/null +++ b/patches.suse/powerpc-pseries-remove-dlpar_cpu_readd.patch @@ -0,0 +1,65 @@ +From 38c392cef19019457ddcfb197ff3d9c5267698e6 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:37 -0500 +Subject: [PATCH] powerpc/pseries: remove dlpar_cpu_readd() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 38c392cef19019457ddcfb197ff3d9c5267698e6 + +dlpar_cpu_readd() is unused now. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-18-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/topology.h | 1 - + arch/powerpc/platforms/pseries/hotplug-cpu.c | 19 ------------------- + 2 files changed, 20 deletions(-) + +diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h +index b2c346c5e16f..f0b6300e7dd3 100644 +--- a/arch/powerpc/include/asm/topology.h ++++ b/arch/powerpc/include/asm/topology.h +@@ -115,7 +115,6 @@ int get_physical_package_id(int cpu); + #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) + #define topology_core_id(cpu) (cpu_to_core_id(cpu)) + +-int dlpar_cpu_readd(int cpu); + #endif + #endif + +diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c +index dbfabb185eb5..4bad7a83addc 100644 +--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c ++++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c +@@ -779,25 +779,6 @@ static int dlpar_cpu_add_by_count(u32 cpus_to_add) + return rc; + } + +-int dlpar_cpu_readd(int cpu) +-{ +- struct device_node *dn; +- struct device *dev; +- u32 drc_index; +- int rc; +- +- dev = get_cpu_device(cpu); +- dn = dev->of_node; +- +- rc = of_property_read_u32(dn, "ibm,my-drc-index", &drc_index); +- +- rc = dlpar_cpu_remove_by_index(drc_index); +- if (!rc) +- rc = dlpar_cpu_add(drc_index); +- +- return rc; +-} +- + int dlpar_cpu(struct pseries_hp_errorlog *hp_elog) + { + u32 count, drc_index; +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-remove-memory-re-add-implementation.patch b/patches.suse/powerpc-pseries-remove-memory-re-add-implementation.patch new file mode 100644 index 0000000..fdf585a --- /dev/null +++ b/patches.suse/powerpc-pseries-remove-memory-re-add-implementation.patch @@ -0,0 +1,103 @@ +From 4abe60c6448bf1dba48689450ad1348e5fc6f7b7 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:36 -0500 +Subject: [PATCH] powerpc/pseries: remove memory "re-add" implementation + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 4abe60c6448bf1dba48689450ad1348e5fc6f7b7 + +dlpar_memory() no longer has any callers which pass +PSERIES_HP_ELOG_ACTION_READD. Remove this case and the corresponding +unreachable code. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-17-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/rtas.h | 1 - + .../platforms/pseries/hotplug-memory.c | 42 ------------------- + 2 files changed, 43 deletions(-) + +diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h +index 0107d724e9da..55f9a154c95d 100644 +--- a/arch/powerpc/include/asm/rtas.h ++++ b/arch/powerpc/include/asm/rtas.h +@@ -215,7 +215,6 @@ inline uint16_t pseries_errorlog_length(struct pseries_errorlog *sect) + + #define PSERIES_HP_ELOG_ACTION_ADD 1 + #define PSERIES_HP_ELOG_ACTION_REMOVE 2 +-#define PSERIES_HP_ELOG_ACTION_READD 3 + + #define PSERIES_HP_ELOG_ID_DRC_NAME 1 + #define PSERIES_HP_ELOG_ID_DRC_INDEX 2 +diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c +--- a/arch/powerpc/platforms/pseries/hotplug-memory.c ++++ b/arch/powerpc/platforms/pseries/hotplug-memory.c +@@ -487,40 +487,6 @@ static int dlpar_memory_remove_by_index(u32 drc_index) + return rc; + } + +-static int dlpar_memory_readd_by_index(u32 drc_index) +-{ +- struct drmem_lmb *lmb; +- int lmb_found; +- int rc; +- +- pr_info("Attempting to update LMB, drc index %x\n", drc_index); +- +- lmb_found = 0; +- for_each_drmem_lmb(lmb) { +- if (lmb->drc_index == drc_index) { +- lmb_found = 1; +- rc = dlpar_remove_lmb(lmb); +- if (!rc) { +- rc = dlpar_add_lmb(lmb); +- if (rc) +- dlpar_release_drc(lmb->drc_index); +- } +- break; +- } +- } +- +- if (!lmb_found) +- rc = -EINVAL; +- +- if (rc) +- pr_info("Failed to update memory at %llx\n", +- lmb->base_addr); +- else +- pr_info("Memory at %llx was updated\n", lmb->base_addr); +- +- return rc; +-} +- + static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index) + { + struct drmem_lmb *lmb, *start_lmb, *end_lmb; +@@ -617,10 +583,6 @@ static int dlpar_memory_remove_by_index(u32 drc_index) + { + return -EOPNOTSUPP; + } +-static int dlpar_memory_readd_by_index(u32 drc_index) +-{ +- return -EOPNOTSUPP; +-} + + static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index) + { +@@ -902,10 +864,6 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog) + rc = -EINVAL; + } + +- break; +- case PSERIES_HP_ELOG_ACTION_READD: +- drc_index = hp_elog->_drc_u.drc_index; +- rc = dlpar_memory_readd_by_index(drc_index); + break; + default: + pr_err("Invalid action (%d) specified\n", hp_elog->action); +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-remove-obsolete-memory-hotplug-DT-no.patch b/patches.suse/powerpc-pseries-remove-obsolete-memory-hotplug-DT-no.patch new file mode 100644 index 0000000..28793e8 --- /dev/null +++ b/patches.suse/powerpc-pseries-remove-obsolete-memory-hotplug-DT-no.patch @@ -0,0 +1,149 @@ +From e978a3ccaa714b5ff125857d2cbecbb6fdf6c094 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:38 -0500 +Subject: [PATCH] powerpc/pseries: remove obsolete memory hotplug DT notifier + code + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: e978a3ccaa714b5ff125857d2cbecbb6fdf6c094 + +pseries_update_drconf_memory() runs from a DT notifier in response to +an update to the ibm,dynamic-memory property of the +/ibm,dynamic-reconfiguration-memory node. This property is an older +less compact format than the ibm,dynamic-memory-v2 property used in +most currently supported firmwares. There has never been an equivalent +function for the v2 property. + +pseries_update_drconf_memory() compares the 'assigned' flag for each +LMB in the old vs new properties and adds or removes the block +accordingly. However it appears to be of no actual utility: + +* Partition suspension and PRRNs are specified only to change LMBs' + NUMA affinity information. This notifier should be a no-op for those + scenarios since the assigned flags should not change. + +* The memory hotplug/DLPAR path has a hack which short-circuits + execution of the notifier: + dlpar_memory() + ... + rtas_hp_event = true; + drmem_update_dt() + of_update_property() + pseries_memory_notifier() + pseries_update_drconf_memory() + if (rtas_hp_event) return; + +So this code only makes sense as a relic of the time when more of the +DLPAR workflow took place in user space. I don't see a purpose for it +now. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-19-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + .../platforms/pseries/hotplug-memory.c | 65 +------------------ + 1 file changed, 1 insertion(+), 64 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c +index 67ece3ac9ac2..73a5dcd977e1 100644 +--- a/arch/powerpc/platforms/pseries/hotplug-memory.c ++++ b/arch/powerpc/platforms/pseries/hotplug-memory.c +@@ -22,8 +22,6 @@ + #include + #include "pseries.h" + +-static bool rtas_hp_event; +- + unsigned long pseries_memory_block_size(void) + { + struct device_node *np; +@@ -871,11 +869,8 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog) + break; + } + +- if (!rc) { +- rtas_hp_event = true; ++ if (!rc) + rc = drmem_update_dt(); +- rtas_hp_event = false; +- } + + unlock_device_hotplug(); + return rc; +@@ -911,60 +906,6 @@ static int pseries_add_mem_node(struct device_node *np) + return (ret < 0) ? -EINVAL : 0; + } + +-static int pseries_update_drconf_memory(struct of_reconfig_data *pr) +-{ +- struct of_drconf_cell_v1 *new_drmem, *old_drmem; +- unsigned long memblock_size; +- u32 entries; +- __be32 *p; +- int i, rc = -EINVAL; +- +- if (rtas_hp_event) +- return 0; +- +- memblock_size = pseries_memory_block_size(); +- if (!memblock_size) +- return -EINVAL; +- +- if (!pr->old_prop) +- return 0; +- +- p = (__be32 *) pr->old_prop->value; +- if (!p) +- return -EINVAL; +- +- /* The first int of the property is the number of lmb's described +- * by the property. This is followed by an array of of_drconf_cell +- * entries. Get the number of entries and skip to the array of +- * of_drconf_cell's. +- */ +- entries = be32_to_cpu(*p++); +- old_drmem = (struct of_drconf_cell_v1 *)p; +- +- p = (__be32 *)pr->prop->value; +- p++; +- new_drmem = (struct of_drconf_cell_v1 *)p; +- +- for (i = 0; i < entries; i++) { +- if ((be32_to_cpu(old_drmem[i].flags) & DRCONF_MEM_ASSIGNED) && +- (!(be32_to_cpu(new_drmem[i].flags) & DRCONF_MEM_ASSIGNED))) { +- rc = pseries_remove_memblock( +- be64_to_cpu(old_drmem[i].base_addr), +- memblock_size); +- break; +- } else if ((!(be32_to_cpu(old_drmem[i].flags) & +- DRCONF_MEM_ASSIGNED)) && +- (be32_to_cpu(new_drmem[i].flags) & +- DRCONF_MEM_ASSIGNED)) { +- rc = memblock_add(be64_to_cpu(old_drmem[i].base_addr), +- memblock_size); +- rc = (rc < 0) ? -EINVAL : 0; +- break; +- } +- } +- return rc; +-} +- + static int pseries_memory_notifier(struct notifier_block *nb, + unsigned long action, void *data) + { +@@ -978,10 +919,6 @@ static int pseries_memory_notifier(struct notifier_block *nb, + case OF_RECONFIG_DETACH_NODE: + err = pseries_remove_mem_node(rd->dn); + break; +- case OF_RECONFIG_UPDATE_PROPERTY: +- if (!strcmp(rd->prop->name, "ibm,dynamic-memory")) +- err = pseries_update_drconf_memory(rd); +- break; + } + return notifier_from_errno(err); + } +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-remove-prrn-special-case-from-DT-upd.patch b/patches.suse/powerpc-pseries-remove-prrn-special-case-from-DT-upd.patch new file mode 100644 index 0000000..f5719c0 --- /dev/null +++ b/patches.suse/powerpc-pseries-remove-prrn-special-case-from-DT-upd.patch @@ -0,0 +1,71 @@ +From bb7c3d36e3b18aa02d34358ae75e1b91f69a968b Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:35 -0500 +Subject: [PATCH] powerpc/pseries: remove prrn special case from DT update path + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: bb7c3d36e3b18aa02d34358ae75e1b91f69a968b + +pseries_devicetree_update() is no longer called with PRRN_SCOPE. The +purpose of prrn_update_node() was to remove and then add back a LMB +whose NUMA assignment had changed. This has never been reliable, and +this codepath has been default-disabled for several releases. Remove +prrn_update_node(). + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-16-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/mobility.c | 27 ----------------------- + 1 file changed, 27 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +index c0b09f6f0ae3..78cd772a579b 100644 +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -244,29 +244,6 @@ static int add_dt_node(__be32 parent_phandle, __be32 drc_index) + return rc; + } + +-static void prrn_update_node(__be32 phandle) +-{ +- struct pseries_hp_errorlog hp_elog; +- struct device_node *dn; +- +- /* +- * If a node is found from a the given phandle, the phandle does not +- * represent the drc index of an LMB and we can ignore. +- */ +- dn = of_find_node_by_phandle(be32_to_cpu(phandle)); +- if (dn) { +- of_node_put(dn); +- return; +- } +- +- hp_elog.resource = PSERIES_HP_ELOG_RESOURCE_MEM; +- hp_elog.action = PSERIES_HP_ELOG_ACTION_READD; +- hp_elog.id_type = PSERIES_HP_ELOG_ID_DRC_INDEX; +- hp_elog._drc_u.drc_index = phandle; +- +- handle_dlpar_errorlog(&hp_elog); +-} +- + int pseries_devicetree_update(s32 scope) + { + char *rtas_buf; +@@ -305,10 +282,6 @@ int pseries_devicetree_update(s32 scope) + break; + case UPDATE_DT_NODE: + update_dt_node(phandle, scope); +- +- if (scope == PRRN_SCOPE) +- prrn_update_node(phandle); +- + break; + case ADD_DT_NODE: + drc_index = *data++; +-- +2.26.2 + diff --git a/patches.suse/powerpc-pseries-update-device-tree-before-ejecting-h.patch b/patches.suse/powerpc-pseries-update-device-tree-before-ejecting-h.patch index adddd03..15014b1 100644 --- a/patches.suse/powerpc-pseries-update-device-tree-before-ejecting-h.patch +++ b/patches.suse/powerpc-pseries-update-device-tree-before-ejecting-h.patch @@ -60,45 +60,36 @@ Acked-by: Michal Suchanek diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c -@@ -393,6 +393,9 @@ static int dlpar_remove_lmb(struct drmem_lmb *lmb) +@@ -393,6 +393,7 @@ static int dlpar_remove_lmb(struct drmem_lmb *lmb) invalidate_lmb_associativity_index(lmb); lmb->flags &= ~DRCONF_MEM_ASSIGNED; -+ rtas_hp_event = true; + drmem_update_dt(); -+ rtas_hp_event = false; remove_memory(nid, base_addr, block_sz); -@@ -627,6 +628,9 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) +@@ -627,6 +628,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) } lmb->flags |= DRCONF_MEM_ASSIGNED; -+ rtas_hp_event = true; + drmem_update_dt(); -+ rtas_hp_event = false; block_sz = memory_block_size_bytes(); -@@ -648,6 +650,9 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) +@@ -648,6 +650,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) invalidate_lmb_associativity_index(lmb); lmb->flags &= ~DRCONF_MEM_ASSIGNED; -+ rtas_hp_event = true; + drmem_update_dt(); -+ rtas_hp_event = false; remove_memory(nid, base_addr, block_sz); } -@@ -900,12 +903,6 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog) +@@ -900,9 +903,6 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog) break; } -- if (!rc) { -- rtas_hp_event = true; +- if (!rc) - rc = drmem_update_dt(); -- rtas_hp_event = false; -- } - unlock_device_hotplug(); return rc; diff --git a/patches.suse/powerpc-rtas-Unexport-rtas_online_cpus_mask-rtas_off.patch b/patches.suse/powerpc-rtas-Unexport-rtas_online_cpus_mask-rtas_off.patch new file mode 100644 index 0000000..4f3ee6b --- /dev/null +++ b/patches.suse/powerpc-rtas-Unexport-rtas_online_cpus_mask-rtas_off.patch @@ -0,0 +1,42 @@ +From ae2e953fdca791270e80c08d6a830d9aa472a111 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Thu, 18 Jul 2019 11:22:14 -0500 +Subject: [PATCH] powerpc/rtas: Unexport rtas_online_cpus_mask, + rtas_offline_cpus_mask + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.4-rc1 +Git-commit: ae2e953fdca791270e80c08d6a830d9aa472a111 + +These aren't used by modular code, nor should they be. + +Fixes: 120496ac2d2d ("powerpc: Bring all threads online prior to migration/hibernation") +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20190718162214.5694-1-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/kernel/rtas.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c +index 5faf0a64c92b..49159bb38949 100644 +--- a/arch/powerpc/kernel/rtas.c ++++ b/arch/powerpc/kernel/rtas.c +@@ -922,13 +922,11 @@ int rtas_online_cpus_mask(cpumask_var_t cpus) + + return ret; + } +-EXPORT_SYMBOL(rtas_online_cpus_mask); + + int rtas_offline_cpus_mask(cpumask_var_t cpus) + { + return rtas_cpu_state_change_mask(DOWN, cpus); + } +-EXPORT_SYMBOL(rtas_offline_cpus_mask); + + int rtas_ibm_suspend_me(u64 handle) + { +-- +2.26.2 + diff --git a/patches.suse/powerpc-rtas-add-rtas_activate_firmware.patch b/patches.suse/powerpc-rtas-add-rtas_activate_firmware.patch new file mode 100644 index 0000000..ff3563d --- /dev/null +++ b/patches.suse/powerpc-rtas-add-rtas_activate_firmware.patch @@ -0,0 +1,82 @@ +From 5f485a66f4d0693a535e4ab38ffc3538716d2c2b Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:37 -0600 +Subject: [PATCH] powerpc/rtas: add rtas_activate_firmware() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 5f485a66f4d0693a535e4ab38ffc3538716d2c2b + +Provide a documented wrapper function for the ibm,activate-firmware +service, which must be called after a partition migration or +hibernation. + +If the function is absent or the call fails, the OS will continue to +run normally with the current firmware, so there is no need to perform +any recovery. Just log it and continue. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-6-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/rtas.h | 1 + + arch/powerpc/kernel/rtas.c | 30 ++++++++++++++++++++++++++++++ + 2 files changed, 31 insertions(+) + +diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h +index b43165fc6c2a..fdefe6a974eb 100644 +--- a/arch/powerpc/include/asm/rtas.h ++++ b/arch/powerpc/include/asm/rtas.h +@@ -247,6 +247,7 @@ extern void __noreturn rtas_restart(char *cmd); + extern void rtas_power_off(void); + extern void __noreturn rtas_halt(void); + extern void rtas_os_term(char *str); ++void rtas_activate_firmware(void); + extern int rtas_get_sensor(int sensor, int index, int *state); + extern int rtas_get_sensor_fast(int sensor, int index, int *state); + extern int rtas_get_power_level(int powerdomain, int *level); +diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c +index 8a618a3c4beb..3a740ae933f8 100644 +--- a/arch/powerpc/kernel/rtas.c ++++ b/arch/powerpc/kernel/rtas.c +@@ -798,6 +798,36 @@ void rtas_os_term(char *str) + printk(KERN_EMERG "ibm,os-term call failed %d\n", status); + } + ++/** ++ * rtas_activate_firmware() - Activate a new version of firmware. ++ * ++ * Activate a new version of partition firmware. The OS must call this ++ * after resuming from a partition hibernation or migration in order ++ * to maintain the ability to perform live firmware updates. It's not ++ * catastrophic for this method to be absent or to fail; just log the ++ * condition in that case. ++ * ++ * Context: This function may sleep. ++ */ ++void rtas_activate_firmware(void) ++{ ++ int token; ++ int fwrc; ++ ++ token = rtas_token("ibm,activate-firmware"); ++ if (token == RTAS_UNKNOWN_SERVICE) { ++ pr_notice("ibm,activate-firmware method unavailable\n"); ++ return; ++ } ++ ++ do { ++ fwrc = rtas_call(token, 0, 1, NULL); ++ } while (rtas_busy_delay(fwrc)); ++ ++ if (fwrc) ++ pr_err("ibm,activate-firmware failed (%i)\n", fwrc); ++} ++ + static int ibm_suspend_me_token = RTAS_UNKNOWN_SERVICE; + #ifdef CONFIG_PPC_PSERIES + static int __rtas_suspend_last_cpu(struct rtas_suspend_me_data *data, int wake_when_done) +-- +2.26.2 + diff --git a/patches.suse/powerpc-rtas-add-rtas_ibm_suspend_me.patch b/patches.suse/powerpc-rtas-add-rtas_ibm_suspend_me.patch new file mode 100644 index 0000000..272aa40 --- /dev/null +++ b/patches.suse/powerpc-rtas-add-rtas_ibm_suspend_me.patch @@ -0,0 +1,104 @@ +From 701ba68342412ae9be99a7c7f3badebf95271403 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:36 -0600 +Subject: [PATCH] powerpc/rtas: add rtas_ibm_suspend_me() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 701ba68342412ae9be99a7c7f3badebf95271403 + +Now that the name is available, provide a simple wrapper for +ibm,suspend-me which returns both a Linux errno and optionally the +actual RTAS status to the caller. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-5-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/rtas.h | 1 + + arch/powerpc/kernel/rtas.c | 57 +++++++++++++++++++++++++++++++++ + 2 files changed, 58 insertions(+) + +diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h +--- a/arch/powerpc/include/asm/rtas.h ++++ b/arch/powerpc/include/asm/rtas.h +@@ -258,6 +258,7 @@ extern void rtas_progress(char *s, unsigned short hex); + extern int rtas_suspend_cpu(struct rtas_suspend_me_data *data); + extern int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data); + int rtas_ibm_suspend_me_unsafe(u64 handle); ++int rtas_ibm_suspend_me(int *fw_status); + + struct rtc_time; + extern unsigned long rtas_get_boot_time(void); +diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c +index 0a8e5dc2c108..8a618a3c4beb 100644 +--- a/arch/powerpc/kernel/rtas.c ++++ b/arch/powerpc/kernel/rtas.c +@@ -684,6 +684,63 @@ int rtas_set_indicator_fast(int indicator, int index, int new_value) + return rc; + } + ++/** ++ * rtas_ibm_suspend_me() - Call ibm,suspend-me to suspend the LPAR. ++ * ++ * @fw_status: RTAS call status will be placed here if not NULL. ++ * ++ * rtas_ibm_suspend_me() should be called only on a CPU which has ++ * received H_CONTINUE from the H_JOIN hcall. All other active CPUs ++ * should be waiting to return from H_JOIN. ++ * ++ * rtas_ibm_suspend_me() may suspend execution of the OS ++ * indefinitely. Callers should take appropriate measures upon return, such as ++ * resetting watchdog facilities. ++ * ++ * Callers may choose to retry this call if @fw_status is ++ * %RTAS_THREADS_ACTIVE. ++ * ++ * Return: ++ * 0 - The partition has resumed from suspend, possibly after ++ * migration to a different host. ++ * -ECANCELED - The operation was aborted. ++ * -EAGAIN - There were other CPUs not in H_JOIN at the time of the call. ++ * -EBUSY - Some other condition prevented the suspend from succeeding. ++ * -EIO - Hardware/platform error. ++ */ ++int rtas_ibm_suspend_me(int *fw_status) ++{ ++ int fwrc; ++ int ret; ++ ++ fwrc = rtas_call(rtas_token("ibm,suspend-me"), 0, 1, NULL); ++ ++ switch (fwrc) { ++ case 0: ++ ret = 0; ++ break; ++ case RTAS_SUSPEND_ABORTED: ++ ret = -ECANCELED; ++ break; ++ case RTAS_THREADS_ACTIVE: ++ ret = -EAGAIN; ++ break; ++ case RTAS_NOT_SUSPENDABLE: ++ case RTAS_OUTSTANDING_COPROC: ++ ret = -EBUSY; ++ break; ++ case -1: ++ default: ++ ret = -EIO; ++ break; ++ } ++ ++ if (fw_status) ++ *fw_status = fwrc; ++ ++ return ret; ++} ++ + void __noreturn rtas_restart(char *cmd) + { + if (rtas_flash_term_hook) +-- +2.26.2 + diff --git a/patches.suse/powerpc-rtas-complete-ibm-suspend-me-status-codes.patch b/patches.suse/powerpc-rtas-complete-ibm-suspend-me-status-codes.patch new file mode 100644 index 0000000..9913c96 --- /dev/null +++ b/patches.suse/powerpc-rtas-complete-ibm-suspend-me-status-codes.patch @@ -0,0 +1,45 @@ +From 970e453ea4ecdd7a16a46c229294547148d1c7b6 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:34 -0600 +Subject: [PATCH] powerpc/rtas: complete ibm,suspend-me status codes + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 970e453ea4ecdd7a16a46c229294547148d1c7b6 + +We don't completely account for the possible return codes for +ibm,suspend-me. Add definitions for these. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-3-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/rtas.h | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h +index 55f9a154c95d..f060181a0d32 100644 +--- a/arch/powerpc/include/asm/rtas.h ++++ b/arch/powerpc/include/asm/rtas.h +@@ -23,11 +23,16 @@ + #define RTAS_RMOBUF_MAX (64 * 1024) + + /* RTAS return status codes */ +-#define RTAS_NOT_SUSPENDABLE -9004 + #define RTAS_BUSY -2 /* RTAS Busy */ + #define RTAS_EXTENDED_DELAY_MIN 9900 + #define RTAS_EXTENDED_DELAY_MAX 9905 + ++/* statuses specific to ibm,suspend-me */ ++#define RTAS_SUSPEND_ABORTED 9000 /* Suspension aborted */ ++#define RTAS_NOT_SUSPENDABLE -9004 /* Partition not suspendable */ ++#define RTAS_THREADS_ACTIVE -9005 /* Multiple processor threads active */ ++#define RTAS_OUTSTANDING_COPROC -9006 /* Outstanding coprocessor operations */ ++ + /* + * In general to call RTAS use rtas_token("string") to lookup + * an RTAS token for the given string (e.g. "event-scan"). +-- +2.26.2 + diff --git a/patches.suse/powerpc-rtas-dispatch-partition-migration-requests-t.patch b/patches.suse/powerpc-rtas-dispatch-partition-migration-requests-t.patch new file mode 100644 index 0000000..f608bc6 --- /dev/null +++ b/patches.suse/powerpc-rtas-dispatch-partition-migration-requests-t.patch @@ -0,0 +1,86 @@ +From 4d756894ba75f1afe7945ccafe9afebff50484b6 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:47 -0600 +Subject: [PATCH] powerpc/rtas: dispatch partition migration requests to + pseries + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 4d756894ba75f1afe7945ccafe9afebff50484b6 + +sys_rtas() cannot call ibm,suspend-me directly in the same way it +handles other inputs. Instead it must dispatch the request to code +that can first perform the H_JOIN sequence before any call to +ibm,suspend-me can succeed. Over time kernel/rtas.c has accreted a fair +amount of platform-specific code to implement this. + +Since a different, more robust implementation of the suspend sequence +is now in the pseries platform code, we want to dispatch the request +there. + +Note that invoking ibm,suspend-me via the RTAS syscall is all but +deprecated; this change preserves ABI compatibility for old programs +while providing to them the benefit of the new partition suspend +implementation. This is a behavior change in that the kernel performs +the device tree update and firmware activation before returning, but +experimentation indicates this is tolerated fine by legacy user space. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-16-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/rtas.h | 5 +++++ + arch/powerpc/kernel/rtas.c | 2 +- + arch/powerpc/platforms/pseries/mobility.c | 5 +++++ + 3 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h +index fdefe6a974eb..3b52d8574fcc 100644 +--- a/arch/powerpc/include/asm/rtas.h ++++ b/arch/powerpc/include/asm/rtas.h +@@ -279,8 +279,13 @@ extern time64_t last_rtas_event; + extern int clobbering_unread_rtas_event(void); + extern int pseries_devicetree_update(s32 scope); + extern void post_mobility_fixup(void); ++int rtas_syscall_dispatch_ibm_suspend_me(u64 handle); + #else + static inline int clobbering_unread_rtas_event(void) { return 0; } ++static inline int rtas_syscall_dispatch_ibm_suspend_me(u64 handle) ++{ ++ return -EINVAL; ++} + #endif + + #ifdef CONFIG_PPC_RTAS_DAEMON +diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c +index 3a740ae933f8..d4b048571728 100644 +--- a/arch/powerpc/kernel/rtas.c ++++ b/arch/powerpc/kernel/rtas.c +@@ -1272,7 +1272,7 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) + int rc = 0; + u64 handle = ((u64)be32_to_cpu(args.args[0]) << 32) + | be32_to_cpu(args.args[1]); +- rc = rtas_ibm_suspend_me_unsafe(handle); ++ rc = rtas_syscall_dispatch_ibm_suspend_me(handle); + if (rc == -EAGAIN) + args.rets[0] = cpu_to_be32(RTAS_NOT_SUSPENDABLE); + else if (rc == -EIO) +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -615,6 +615,11 @@ static int pseries_migrate_partition(u64 handle) + return ret; + } + ++int rtas_syscall_dispatch_ibm_suspend_me(u64 handle) ++{ ++ return pseries_migrate_partition(handle); ++} ++ + static ssize_t migrate_store(struct class *class, struct class_attribute *attr, + const char *buf, size_t count) + { +-- +2.26.2 + diff --git a/patches.suse/powerpc-rtas-don-t-online-CPUs-for-partition-suspend.patch b/patches.suse/powerpc-rtas-don-t-online-CPUs-for-partition-suspend.patch index efb8f0c..79ee20d 100644 --- a/patches.suse/powerpc-rtas-don-t-online-CPUs-for-partition-suspend.patch +++ b/patches.suse/powerpc-rtas-don-t-online-CPUs-for-partition-suspend.patch @@ -49,7 +49,6 @@ Fixes: 120496ac2d2d ("powerpc: Bring all threads online prior to migration/hiber Signed-off-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200612051238.1007764-3-nathanl@linux.ibm.com -[keep exported functions] Acked-by: Michal Suchanek --- arch/powerpc/include/asm/rtas.h | 2 - @@ -57,9 +56,11 @@ Acked-by: Michal Suchanek arch/powerpc/platforms/pseries/suspend.c | 22 +--- 3 files changed, 3 insertions(+), 143 deletions(-) +diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h +index 014968f25f7e..0107d724e9da 100644 --- a/arch/powerpc/include/asm/rtas.h +++ b/arch/powerpc/include/asm/rtas.h -@@ -372,8 +372,6 @@ extern int rtas_set_indicator_fast(int i +@@ -253,8 +253,6 @@ extern int rtas_set_indicator_fast(int indicator, int index, int new_value); extern void rtas_progress(char *s, unsigned short hex); extern int rtas_suspend_cpu(struct rtas_suspend_me_data *data); extern int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data); @@ -68,9 +69,10 @@ Acked-by: Michal Suchanek extern int rtas_ibm_suspend_me(u64 handle); struct rtc_time; +diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c -@@ -845,95 +845,15 @@ static void rtas_percpu_suspend_me(void +@@ -843,96 +843,6 @@ static void rtas_percpu_suspend_me(void *info) __rtas_suspend_cpu((struct rtas_suspend_me_data *)info, 1); } @@ -138,8 +140,8 @@ Acked-by: Michal Suchanek -} -#endif - - int rtas_online_cpus_mask(cpumask_var_t cpus) - { +-int rtas_online_cpus_mask(cpumask_var_t cpus) +-{ - int ret; - - ret = rtas_cpu_state_change_mask(UP, cpus); @@ -157,18 +159,17 @@ Acked-by: Michal Suchanek - } - - return ret; -+ return 0; - } - EXPORT_SYMBOL(rtas_online_cpus_mask); - - int rtas_offline_cpus_mask(cpumask_var_t cpus) - { +-} +- +-int rtas_offline_cpus_mask(cpumask_var_t cpus) +-{ - return rtas_cpu_state_change_mask(DOWN, cpus); -+ return -ENOTSUPP; - } - EXPORT_SYMBOL(rtas_offline_cpus_mask); - -@@ -944,8 +864,6 @@ int rtas_ibm_suspend_me(u64 handle) +-} +- + int rtas_ibm_suspend_me(u64 handle) + { + long state; +@@ -940,8 +850,6 @@ int rtas_ibm_suspend_me(u64 handle) unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; struct rtas_suspend_me_data data; DECLARE_COMPLETION_ONSTACK(done); @@ -177,7 +178,7 @@ Acked-by: Michal Suchanek if (!rtas_service_present("ibm,suspend-me")) return -ENOSYS; -@@ -966,9 +884,6 @@ int rtas_ibm_suspend_me(u64 handle) +@@ -962,9 +870,6 @@ int rtas_ibm_suspend_me(u64 handle) return -EIO; } @@ -187,7 +188,7 @@ Acked-by: Michal Suchanek atomic_set(&data.working, 0); atomic_set(&data.done, 0); atomic_set(&data.error, 0); -@@ -977,24 +892,8 @@ int rtas_ibm_suspend_me(u64 handle) +@@ -973,24 +878,8 @@ int rtas_ibm_suspend_me(u64 handle) lock_device_hotplug(); @@ -212,7 +213,7 @@ Acked-by: Michal Suchanek /* Call function on all CPUs. One of us will make the * rtas call */ -@@ -1006,18 +905,11 @@ int rtas_ibm_suspend_me(u64 handle) +@@ -1001,18 +890,11 @@ int rtas_ibm_suspend_me(u64 handle) if (atomic_read(&data.error) != 0) printk(KERN_ERR "Error doing global join\n"); @@ -233,9 +234,10 @@ Acked-by: Michal Suchanek return atomic_read(&data.error); } #else /* CONFIG_PPC_PSERIES */ +diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c --- a/arch/powerpc/platforms/pseries/suspend.c +++ b/arch/powerpc/platforms/pseries/suspend.c -@@ -145,15 +145,11 @@ static ssize_t store_hibernate(struct de +@@ -132,15 +132,11 @@ static ssize_t store_hibernate(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -251,7 +253,7 @@ Acked-by: Michal Suchanek stream_id = simple_strtoul(buf, NULL, 16); do { -@@ -163,32 +159,16 @@ static ssize_t store_hibernate(struct de +@@ -150,32 +146,16 @@ static ssize_t store_hibernate(struct device *dev, } while (rc == -EAGAIN); if (!rc) { @@ -285,3 +287,6 @@ Acked-by: Michal Suchanek return rc; } +-- +2.26.2 + diff --git a/patches.suse/powerpc-rtas-prevent-suspend-related-sys_rtas-use-on.patch b/patches.suse/powerpc-rtas-prevent-suspend-related-sys_rtas-use-on.patch new file mode 100644 index 0000000..c90b74a --- /dev/null +++ b/patches.suse/powerpc-rtas-prevent-suspend-related-sys_rtas-use-on.patch @@ -0,0 +1,46 @@ +From de0f7349a0dd072e54b5fc04c305907b22d28a5f Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:33 -0600 +Subject: [PATCH] powerpc/rtas: prevent suspend-related sys_rtas use on LE + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: de0f7349a0dd072e54b5fc04c305907b22d28a5f + +While drmgr has had work in some areas to make its RTAS syscall +interactions endian-neutral, its code for performing partition +migration via the syscall has never worked on LE. While it is able to +complete ibm,suspend-me successfully, it crashes when attempting the +subsequent ibm,update-nodes call. + +drmgr is the only known (or plausible) user of ibm,suspend-me, +ibm,update-nodes, and ibm,update-properties, so allow them only in +big-endian configurations. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-2-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/kernel/rtas.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c +index 954f41676f69..4ed64aba37d6 100644 +--- a/arch/powerpc/kernel/rtas.c ++++ b/arch/powerpc/kernel/rtas.c +@@ -1050,9 +1050,11 @@ static struct rtas_filter rtas_filters[] __ro_after_init = { + { "set-time-for-power-on", -1, -1, -1, -1, -1 }, + { "ibm,set-system-parameter", -1, 1, -1, -1, -1 }, + { "set-time-of-day", -1, -1, -1, -1, -1 }, ++#ifdef CONFIG_CPU_BIG_ENDIAN + { "ibm,suspend-me", -1, -1, -1, -1, -1 }, + { "ibm,update-nodes", -1, 0, -1, -1, -1, 4096 }, + { "ibm,update-properties", -1, 0, -1, -1, -1, 4096 }, ++#endif + { "ibm,physical-attestation", -1, 0, 1, -1, -1 }, + }; + +-- +2.26.2 + diff --git a/patches.suse/powerpc-rtas-remove-rtas_ibm_suspend_me_unsafe.patch b/patches.suse/powerpc-rtas-remove-rtas_ibm_suspend_me_unsafe.patch new file mode 100644 index 0000000..ac94872 --- /dev/null +++ b/patches.suse/powerpc-rtas-remove-rtas_ibm_suspend_me_unsafe.patch @@ -0,0 +1,114 @@ +From 5f6665e400569de479733677e77862542aebb6cc Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:48 -0600 +Subject: [PATCH] powerpc/rtas: remove rtas_ibm_suspend_me_unsafe() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 5f6665e400569de479733677e77862542aebb6cc + +rtas_ibm_suspend_me_unsafe() is now unused; remove it and +rtas_percpu_suspend_me() which becomes unused as a result. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-17-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/rtas.h | 1 - + arch/powerpc/kernel/rtas.c | 67 +-------------------------------- + 2 files changed, 1 insertion(+), 67 deletions(-) + +diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h +index 3b52d8574fcc..9a6107ffe378 100644 +--- a/arch/powerpc/include/asm/rtas.h ++++ b/arch/powerpc/include/asm/rtas.h +@@ -258,7 +258,6 @@ extern int rtas_set_indicator_fast(int indicator, int index, int new_value); + extern void rtas_progress(char *s, unsigned short hex); + extern int rtas_suspend_cpu(struct rtas_suspend_me_data *data); + extern int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data); +-int rtas_ibm_suspend_me_unsafe(u64 handle); + int rtas_ibm_suspend_me(int *fw_status); + + struct rtc_time; +diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c +--- a/arch/powerpc/kernel/rtas.c ++++ b/arch/powerpc/kernel/rtas.c +@@ -923,73 +923,7 @@ int rtas_suspend_cpu(struct rtas_suspend + { + return __rtas_suspend_cpu(data, 0); + } +- +-static void rtas_percpu_suspend_me(void *info) +-{ +- __rtas_suspend_cpu((struct rtas_suspend_me_data *)info, 1); +-} +- +-int rtas_ibm_suspend_me_unsafe(u64 handle) +-{ +- long state; +- long rc; +- unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; +- struct rtas_suspend_me_data data; +- DECLARE_COMPLETION_ONSTACK(done); +- +- if (!rtas_service_present("ibm,suspend-me")) +- return -ENOSYS; +- +- /* Make sure the state is valid */ +- rc = plpar_hcall(H_VASI_STATE, retbuf, handle); +- +- state = retbuf[0]; +- +- if (rc) { +- printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned %ld\n",rc); +- return rc; +- } else if (state == H_VASI_ENABLED) { +- return -EAGAIN; +- } else if (state != H_VASI_SUSPENDING) { +- printk(KERN_ERR "rtas_ibm_suspend_me: vasi_state returned state %ld\n", +- state); +- return -EIO; +- } +- +- atomic_set(&data.working, 0); +- atomic_set(&data.done, 0); +- atomic_set(&data.error, 0); +- data.token = rtas_token("ibm,suspend-me"); +- data.complete = &done; +- +- lock_device_hotplug(); +- +- cpu_hotplug_disable(); +- +- /* Call function on all CPUs. One of us will make the +- * rtas call +- */ +- if (on_each_cpu(rtas_percpu_suspend_me, &data, 0)) +- atomic_set(&data.error, -EINVAL); +- +- wait_for_completion(&done); +- +- if (atomic_read(&data.error) != 0) +- printk(KERN_ERR "Error doing global join\n"); +- +- +- cpu_hotplug_enable(); +- +- unlock_device_hotplug(); +- +- return atomic_read(&data.error); +-} +-#else /* CONFIG_PPC_PSERIES */ +-int rtas_ibm_suspend_me_unsafe(u64 handle) +-{ +- return -ENOSYS; +-} +-#endif ++#endif /* CONFIG_PPC_PSERIES */ + + /** + * Find a specific pseries error log in an RTAS extended event log. +-- +2.26.2 + diff --git a/patches.suse/powerpc-rtas-remove-rtas_suspend_cpu.patch b/patches.suse/powerpc-rtas-remove-rtas_suspend_cpu.patch new file mode 100644 index 0000000..3d95ce0 --- /dev/null +++ b/patches.suse/powerpc-rtas-remove-rtas_suspend_cpu.patch @@ -0,0 +1,97 @@ +From 395b2c090907975c627902ba8fda0bdb04c7cad3 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:53 -0600 +Subject: [PATCH] powerpc/rtas: remove rtas_suspend_cpu() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 395b2c090907975c627902ba8fda0bdb04c7cad3 + +rtas_suspend_cpu() no longer has users; remove it and +__rtas_suspend_cpu() which now becomes unused as well. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-22-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/rtas.h | 1 - + arch/powerpc/kernel/rtas.c | 52 --------------------------------- + 2 files changed, 53 deletions(-) + +diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h +index 9a6107ffe378..97ccb40fb09f 100644 +--- a/arch/powerpc/include/asm/rtas.h ++++ b/arch/powerpc/include/asm/rtas.h +@@ -256,7 +256,6 @@ extern bool rtas_indicator_present(int token, int *maxindex); + extern int rtas_set_indicator(int indicator, int index, int new_value); + extern int rtas_set_indicator_fast(int indicator, int index, int new_value); + extern void rtas_progress(char *s, unsigned short hex); +-extern int rtas_suspend_cpu(struct rtas_suspend_me_data *data); + extern int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data); + int rtas_ibm_suspend_me(int *fw_status); + +diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c +--- a/arch/powerpc/kernel/rtas.c ++++ b/arch/powerpc/kernel/rtas.c +@@ -873,57 +873,6 @@ int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data) + return __rtas_suspend_last_cpu(data, 0); + } + +-static int __rtas_suspend_cpu(struct rtas_suspend_me_data *data, int wake_when_done) +-{ +- long rc = H_SUCCESS; +- unsigned long msr_save; +- int cpu; +- +- atomic_inc(&data->working); +- +- /* really need to ensure MSR.EE is off for H_JOIN */ +- msr_save = mfmsr(); +- mtmsr(msr_save & ~(MSR_EE)); +- +- while (rc == H_SUCCESS && !atomic_read(&data->done) && !atomic_read(&data->error)) +- rc = plpar_hcall_norets(H_JOIN); +- +- mtmsr(msr_save); +- +- if (rc == H_SUCCESS) { +- /* This cpu was prodded and the suspend is complete. */ +- goto out; +- } else if (rc == H_CONTINUE) { +- /* All other cpus are in H_JOIN, this cpu does +- * the suspend. +- */ +- return __rtas_suspend_last_cpu(data, wake_when_done); +- } else { +- printk(KERN_ERR "H_JOIN on cpu %i failed with rc = %ld\n", +- smp_processor_id(), rc); +- atomic_set(&data->error, rc); +- } +- +- if (wake_when_done) { +- atomic_set(&data->done, 1); +- +- /* This cpu did the suspend or got an error; in either case, +- * we need to prod all other other cpus out of join state. +- * Extra prods are harmless. +- */ +- for_each_online_cpu(cpu) +- plpar_hcall_norets(H_PROD, get_hard_smp_processor_id(cpu)); +- } +-out: +- if (atomic_dec_return(&data->working) == 0) +- complete(data->complete); +- return rc; +-} +- +-int rtas_suspend_cpu(struct rtas_suspend_me_data *data) +-{ +- return __rtas_suspend_cpu(data, 0); +-} + #endif /* CONFIG_PPC_PSERIES */ + + /** +-- +2.26.2 + diff --git a/patches.suse/powerpc-rtas-remove-unused-rtas_suspend_last_cpu.patch b/patches.suse/powerpc-rtas-remove-unused-rtas_suspend_last_cpu.patch new file mode 100644 index 0000000..771a461 --- /dev/null +++ b/patches.suse/powerpc-rtas-remove-unused-rtas_suspend_last_cpu.patch @@ -0,0 +1,89 @@ +From 1b2488176ea56e299d2b084772daeb5ecbfc16d1 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:55 -0600 +Subject: [PATCH] powerpc/rtas: remove unused rtas_suspend_last_cpu() + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 1b2488176ea56e299d2b084772daeb5ecbfc16d1 + +rtas_suspend_last_cpu() is now unused, remove it and +__rtas_suspend_last_cpu() which also becomes unused. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-24-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/rtas.h | 1 - + arch/powerpc/kernel/rtas.c | 43 --------------------------------- + 2 files changed, 44 deletions(-) + +diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h +index 97ccb40fb09f..332e1000ca0f 100644 +--- a/arch/powerpc/include/asm/rtas.h ++++ b/arch/powerpc/include/asm/rtas.h +@@ -256,7 +256,6 @@ extern bool rtas_indicator_present(int token, int *maxindex); + extern int rtas_set_indicator(int indicator, int index, int new_value); + extern int rtas_set_indicator_fast(int indicator, int index, int new_value); + extern void rtas_progress(char *s, unsigned short hex); +-extern int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data); + int rtas_ibm_suspend_me(int *fw_status); + + struct rtc_time; +diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c +--- a/arch/powerpc/kernel/rtas.c ++++ b/arch/powerpc/kernel/rtas.c +@@ -829,49 +829,6 @@ void rtas_activate_firmware(void) + + static int ibm_suspend_me_token = RTAS_UNKNOWN_SERVICE; + #ifdef CONFIG_PPC_PSERIES +-static int __rtas_suspend_last_cpu(struct rtas_suspend_me_data *data, int wake_when_done) +-{ +- u16 slb_size = mmu_slb_size; +- int rc = H_MULTI_THREADS_ACTIVE; +- int cpu; +- +- slb_set_size(SLB_MIN_SIZE); +- printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n", smp_processor_id()); +- +- while (rc == H_MULTI_THREADS_ACTIVE && !atomic_read(&data->done) && +- !atomic_read(&data->error)) +- rc = rtas_call(data->token, 0, 1, NULL); +- +- if (rc || atomic_read(&data->error)) { +- printk(KERN_DEBUG "ibm,suspend-me returned %d\n", rc); +- slb_set_size(slb_size); +- } +- +- if (atomic_read(&data->error)) +- rc = atomic_read(&data->error); +- +- atomic_set(&data->error, rc); +- pSeries_coalesce_init(); +- +- if (wake_when_done) { +- atomic_set(&data->done, 1); +- +- for_each_online_cpu(cpu) +- plpar_hcall_norets(H_PROD, get_hard_smp_processor_id(cpu)); +- } +- +- if (atomic_dec_return(&data->working) == 0) +- complete(data->complete); +- +- return rc; +-} +- +-int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data) +-{ +- atomic_inc(&data->working); +- return __rtas_suspend_last_cpu(data, 0); +-} +- + #endif /* CONFIG_PPC_PSERIES */ + + /** +-- +2.26.2 + diff --git a/patches.suse/powerpc-rtas-remove-unused-rtas_suspend_me_data.patch b/patches.suse/powerpc-rtas-remove-unused-rtas_suspend_me_data.patch new file mode 100644 index 0000000..b724b50 --- /dev/null +++ b/patches.suse/powerpc-rtas-remove-unused-rtas_suspend_me_data.patch @@ -0,0 +1,37 @@ +From 87b57ea7e109520d3c6dfb01671a0cb134d3ccff Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:59 -0600 +Subject: [PATCH] powerpc/rtas: remove unused rtas_suspend_me_data + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 87b57ea7e109520d3c6dfb01671a0cb134d3ccff + +All code which used this type has been removed. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-28-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/rtas-types.h | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h +--- a/arch/powerpc/include/asm/rtas.h ++++ b/arch/powerpc/include/asm/rtas.h +@@ -66,14 +66,6 @@ struct rtas_t { + struct device_node *dev; /* virtual address pointer */ + }; + +-struct rtas_suspend_me_data { +- atomic_t working; /* number of cpus accessing this struct */ +- atomic_t done; +- int token; /* ibm,suspend-me */ +- atomic_t error; +- struct completion *complete; /* wait on this until working == 0 */ +-}; +- + /* RTAS event classes */ + #define RTAS_INTERNAL_ERROR 0x80000000 /* set bit 0 */ + #define RTAS_EPOW_WARNING 0x40000000 /* set bit 1 */ diff --git a/patches.suse/powerpc-rtas-rtas_ibm_suspend_me-rtas_ibm_suspend_me.patch b/patches.suse/powerpc-rtas-rtas_ibm_suspend_me-rtas_ibm_suspend_me.patch new file mode 100644 index 0000000..074b16c --- /dev/null +++ b/patches.suse/powerpc-rtas-rtas_ibm_suspend_me-rtas_ibm_suspend_me.patch @@ -0,0 +1,95 @@ +From 7049b288ea8c95f270ec8fe643e3c3187938d5af Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Mon, 7 Dec 2020 15:51:35 -0600 +Subject: [PATCH] powerpc/rtas: rtas_ibm_suspend_me -> + rtas_ibm_suspend_me_unsafe + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.11-rc1 +Git-commit: 7049b288ea8c95f270ec8fe643e3c3187938d5af + +The pseries partition suspend sequence requires that all active CPUs +call H_JOIN, which suspends all but one of them with interrupts +disabled. The "chosen" CPU is then to call ibm,suspend-me to complete +the suspend. Upon returning from ibm,suspend-me, the chosen CPU is to +use H_PROD to wake the joined CPUs. + +Using on_each_cpu() for this, as rtas_ibm_suspend_me() does to +implement partition migration, is susceptible to deadlock with other +users of on_each_cpu() and with users of stop_machine APIs. The +callback passed to on_each_cpu() is not allowed to synchronize with +other CPUs in the way it is used here. + +Complicating the fix is the fact that rtas_ibm_suspend_me() also +occupies the function name that should be used to provide a more +conventional wrapper for ibm,suspend-me. Rename rtas_ibm_suspend_me() +to rtas_ibm_suspend_me_unsafe() to free up the name and indicate that +it should not gain users. + +Signed-off-by: Nathan Lynch +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20201207215200.1785968-4-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/include/asm/rtas.h | 2 +- + arch/powerpc/kernel/rtas.c | 6 +++--- + arch/powerpc/platforms/pseries/mobility.c | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h +--- a/arch/powerpc/include/asm/rtas.h ++++ b/arch/powerpc/include/asm/rtas.h +@@ -257,7 +257,7 @@ extern int rtas_set_indicator_fast(int indicator, int index, int new_value); + extern void rtas_progress(char *s, unsigned short hex); + extern int rtas_suspend_cpu(struct rtas_suspend_me_data *data); + extern int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data); +-extern int rtas_ibm_suspend_me(u64 handle); ++int rtas_ibm_suspend_me_unsafe(u64 handle); + + struct rtc_time; + extern unsigned long rtas_get_boot_time(void); +diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c +--- a/arch/powerpc/kernel/rtas.c ++++ b/arch/powerpc/kernel/rtas.c +@@ -843,7 +843,7 @@ static void rtas_percpu_suspend_me(void *info) + __rtas_suspend_cpu((struct rtas_suspend_me_data *)info, 1); + } + +-int rtas_ibm_suspend_me(u64 handle) ++int rtas_ibm_suspend_me_unsafe(u64 handle) + { + long state; + long rc; +@@ -949,6 +949,6 @@ int rtas_call_reentrant(int token, int nargs, int nret, int *outputs, ...) + } + #else /* CONFIG_PPC_PSERIES */ +-int rtas_ibm_suspend_me(u64 handle) ++int rtas_ibm_suspend_me_unsafe(u64 handle) + { + return -ENOSYS; + } +@@ -1185,7 +1185,7 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) + int rc = 0; + u64 handle = ((u64)be32_to_cpu(args.args[0]) << 32) + | be32_to_cpu(args.args[1]); +- rc = rtas_ibm_suspend_me(handle); ++ rc = rtas_ibm_suspend_me_unsafe(handle); + if (rc == -EAGAIN) + args.rets[0] = cpu_to_be32(RTAS_NOT_SUSPENDABLE); + else if (rc == -EIO) +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c +index 2f73cb5bf12d..6ff642e84c6a 100644 +--- a/arch/powerpc/platforms/pseries/mobility.c ++++ b/arch/powerpc/platforms/pseries/mobility.c +@@ -370,7 +370,7 @@ static ssize_t migration_store(struct class *class, + return rc; + + do { +- rc = rtas_ibm_suspend_me(streamid); ++ rc = rtas_ibm_suspend_me_unsafe(streamid); + if (rc == -EAGAIN) + ssleep(1); + } while (rc == -EAGAIN); +-- +2.26.2 + diff --git a/patches.suse/powerpc-rtasd-simplify-handle_rtas_event-emit-messag.patch b/patches.suse/powerpc-rtasd-simplify-handle_rtas_event-emit-messag.patch new file mode 100644 index 0000000..60d8da4 --- /dev/null +++ b/patches.suse/powerpc-rtasd-simplify-handle_rtas_event-emit-messag.patch @@ -0,0 +1,78 @@ +From 91713ac377859893a7798999cb2e3a388d8ae710 Mon Sep 17 00:00:00 2001 +From: Nathan Lynch +Date: Fri, 12 Jun 2020 00:12:32 -0500 +Subject: [PATCH] powerpc/rtasd: simplify handle_rtas_event(), emit message on + events + +References: bsc#1181674 ltc#189159 +Patch-mainline: v5.9-rc1 +Git-commit: 91713ac377859893a7798999cb2e3a388d8ae710 + +prrn_is_enabled() always returns false/0, so handle_rtas_event() can +be simplified and some dead code can be removed. Use machine_is() +instead of #ifdef to run this code only on pseries, and add an +informational ratelimited message that we are ignoring the +events. PRRN events are relatively rare in normal operation and +usually arise from operator-initiated actions such as a DPO (Dynamic +Platform Optimizer) run. + +Eventually we do want to consume these events and update the device +tree, but that needs more care to be safe vs LPM and DLPAR. + +Signed-off-by: Nathan Lynch +Reviewed-by: Srikar Dronamraju +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200612051238.1007764-13-nathanl@linux.ibm.com +Acked-by: Michal Suchanek +--- + arch/powerpc/kernel/rtasd.c | 28 +++------------------------- + 1 file changed, 3 insertions(+), 25 deletions(-) + +diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c +index 89b798f8f656..8561dfb33f24 100644 +--- a/arch/powerpc/kernel/rtasd.c ++++ b/arch/powerpc/kernel/rtasd.c +@@ -273,37 +273,15 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal) + } + } + +-#ifdef CONFIG_PPC_PSERIES +-static void handle_prrn_event(s32 scope) +-{ +- /* +- * For PRRN, we must pass the negative of the scope value in +- * the RTAS event. +- */ +- pseries_devicetree_update(-scope); +- numa_update_cpu_topology(false); +-} +- + static void handle_rtas_event(const struct rtas_error_log *log) + { +- if (rtas_error_type(log) != RTAS_TYPE_PRRN || !prrn_is_enabled()) ++ if (!machine_is(pseries)) + return; + +- /* For PRRN Events the extended log length is used to denote +- * the scope for calling rtas update-nodes. +- */ +- handle_prrn_event(rtas_error_extended_log_length(log)); ++ if (rtas_error_type(log) == RTAS_TYPE_PRRN) ++ pr_info_ratelimited("Platform resource reassignment ignored.\n"); + } + +-#else +- +-static void handle_rtas_event(const struct rtas_error_log *log) +-{ +- return; +-} +- +-#endif +- + static int rtas_log_open(struct inode * inode, struct file * file) + { + return 0; +-- +2.26.2 + diff --git a/patches.suse/powerpc-vio-Use-device_type-to-detect-family.patch b/patches.suse/powerpc-vio-Use-device_type-to-detect-family.patch new file mode 100644 index 0000000..88a1ca1 --- /dev/null +++ b/patches.suse/powerpc-vio-Use-device_type-to-detect-family.patch @@ -0,0 +1,48 @@ +From bcf21e3a97a1247178338793df9ae332a036e22b Mon Sep 17 00:00:00 2001 +From: Michael Ellerman +Date: Tue, 22 Aug 2017 15:14:50 +1000 +Subject: [PATCH] powerpc/vio: Use device_type to detect family + +References: bsc#1181674 ltc#189159 +Patch-mainline: v4.14-rc1 +Git-commit: bcf21e3a97a1247178338793df9ae332a036e22b + +Currently in the vio.c code we use a comparision against the parent +device node's full path to decide if the device is a PFO or VIO family +device. + +Both the ibm,platform-facilities and vdevice nodes are defined by PAPR, +and must have a matching device_type. So instead of using the path we +can instead compare the device_type. + +I've checked Qemu and kvmtool both do this correctly, and all the +PowerVM systems I have access to do also. So it seems to be safe. + +This removes the dependency on full_name, which is being removed +upstream. + +Signed-off-by: Michael Ellerman +Acked-by: Michal Suchanek +--- + arch/powerpc/platforms/pseries/vio.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c +index 8a47f168476b..f26f906e6021 100644 +--- a/arch/powerpc/platforms/pseries/vio.c ++++ b/arch/powerpc/platforms/pseries/vio.c +@@ -1357,9 +1357,9 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) + */ + parent_node = of_get_parent(of_node); + if (parent_node) { +- if (!strcmp(parent_node->full_name, "/ibm,platform-facilities")) ++ if (!strcmp(parent_node->type, "ibm,platform-facilities")) + family = PFO; +- else if (!strcmp(parent_node->full_name, "/vdevice")) ++ else if (!strcmp(parent_node->type, "vdevice")) + family = VDEVICE; + else { + pr_warn("%s: parent(%s) of %s not recognized.\n", +-- +2.26.2 + diff --git a/patches.suse/pseries-hotplug-memory-hot-add-skip-redundant-LMB-lo.patch b/patches.suse/pseries-hotplug-memory-hot-add-skip-redundant-LMB-lo.patch index 607361d..dd29024 100644 --- a/patches.suse/pseries-hotplug-memory-hot-add-skip-redundant-LMB-lo.patch +++ b/patches.suse/pseries-hotplug-memory-hot-add-skip-redundant-LMB-lo.patch @@ -105,16 +105,16 @@ Acked-by: Michal Suchanek diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h -@@ -84,6 +84,9 @@ static inline int numa_update_cpu_topolo - } +@@ -86,6 +86,9 @@ static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc) + #endif /* CONFIG_NUMA */ +struct drmem_lmb; +int of_drconf_to_nid_single(struct drmem_lmb *lmb); + #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) - extern int start_topology_update(void); - extern int stop_topology_update(void); + extern int find_and_online_cpu_nid(int cpu); + #else diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index b725fb66e913..8335399b7509 100644 --- a/arch/powerpc/mm/numa.c diff --git a/patches.suse/usb-storage-Add-quirk-to-defeat-Kindle-s-automatic-u.patch b/patches.suse/usb-storage-Add-quirk-to-defeat-Kindle-s-automatic-u.patch new file mode 100644 index 0000000..21dfb88 --- /dev/null +++ b/patches.suse/usb-storage-Add-quirk-to-defeat-Kindle-s-automatic-u.patch @@ -0,0 +1,103 @@ +From 546aa0e4ea6ed81b6c51baeebc4364542fa3f3a7 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Wed, 17 Mar 2021 15:06:54 -0400 +Subject: [PATCH] usb-storage: Add quirk to defeat Kindle's automatic unload +Git-commit: 546aa0e4ea6ed81b6c51baeebc4364542fa3f3a7 +Patch-mainline: v5.12-rc4 +References: git-fixes + +Matthias reports that the Amazon Kindle automatically removes its +emulated media if it doesn't receive another SCSI command within about +one second after a SYNCHRONIZE CACHE. It does so even when the host +has sent a PREVENT MEDIUM REMOVAL command. The reason for this +behavior isn't clear, although it's not hard to make some guesses. + +At any rate, the results can be unexpected for anyone who tries to +access the Kindle in an unusual fashion, and in theory they can lead +to data loss (for example, if one file is closed and synchronized +while other files are still in the middle of being written). + +To avoid such problems, this patch creates a new usb-storage quirks +flag telling the driver always to issue a REQUEST SENSE following a +SYNCHRONIZE CACHE command, and adds an unusual_devs entry for the +Kindle with the flag set. This is sufficient to prevent the Kindle +from doing its automatic unload, without interfering with proper +operation. + +Another possible way to deal with this would be to increase the +frequency of TEST UNIT READY polling that the kernel normally carries +out for removable-media storage devices. However that would increase +the overall load on the system and it is not as reliable, because the +user can override the polling interval. Changing the driver's +behavior is safer and has minimal overhead. + +Cc: +Reported-and-tested-by: Matthias Schwarzott +Signed-off-by: Alan Stern +Link: https://lore.kernel.org/r/20210317190654.GA497856@rowland.harvard.edu +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/usb/storage/transport.c | 7 +++++++ + drivers/usb/storage/unusual_devs.h | 12 ++++++++++++ + include/linux/usb_usual.h | 2 ++ + 3 files changed, 21 insertions(+) + +diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c +index 5eb895b19c55..f4304ce69350 100644 +--- a/drivers/usb/storage/transport.c ++++ b/drivers/usb/storage/transport.c +@@ -656,6 +656,13 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us) + need_auto_sense = 1; + } + ++ /* Some devices (Kindle) require another command after SYNC CACHE */ ++ if ((us->fflags & US_FL_SENSE_AFTER_SYNC) && ++ srb->cmnd[0] == SYNCHRONIZE_CACHE) { ++ usb_stor_dbg(us, "-- sense after SYNC CACHE\n"); ++ need_auto_sense = 1; ++ } ++ + /* + * If we have a failure, we're going to do a REQUEST_SENSE + * automatically. Note that we differentiate between a command +diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h +index 5732e9691f08..efa972be2ee3 100644 +--- a/drivers/usb/storage/unusual_devs.h ++++ b/drivers/usb/storage/unusual_devs.h +@@ -2211,6 +2211,18 @@ UNUSUAL_DEV( 0x1908, 0x3335, 0x0200, 0x0200, + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_NO_READ_DISC_INFO ), + ++/* ++ * Reported by Matthias Schwarzott ++ * The Amazon Kindle treats SYNCHRONIZE CACHE as an indication that ++ * the host may be finished with it, and automatically ejects its ++ * emulated media unless it receives another command within one second. ++ */ ++UNUSUAL_DEV( 0x1949, 0x0004, 0x0000, 0x9999, ++ "Amazon", ++ "Kindle", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_SENSE_AFTER_SYNC ), ++ + /* + * Reported by Oliver Neukum + * This device morphes spontaneously into another device if the access +diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h +index 6b03fdd69d27..712363c7a2e8 100644 +--- a/include/linux/usb_usual.h ++++ b/include/linux/usb_usual.h +@@ -86,6 +86,8 @@ + /* lies about caching, so always sync */ \ + US_FLAG(NO_SAME, 0x40000000) \ + /* Cannot handle WRITE_SAME */ \ ++ US_FLAG(SENSE_AFTER_SYNC, 0x80000000) \ ++ /* Do REQUEST_SENSE after SYNCHRONIZE_CACHE */ \ + + #define US_FLAG(name, value) US_FL_##name = value , + enum { US_DO_ALL_FLAGS }; +-- +2.26.2 + diff --git a/patches.suse/use-__netdev_notify_peers-in-ibmvnic.patch b/patches.suse/use-__netdev_notify_peers-in-ibmvnic.patch new file mode 100644 index 0000000..e8abb16 --- /dev/null +++ b/patches.suse/use-__netdev_notify_peers-in-ibmvnic.patch @@ -0,0 +1,48 @@ +From 6be4666221cafcfd58cc078aa8bd1ba11b699f6b Mon Sep 17 00:00:00 2001 +From: Lijun Pan +Date: Mon, 14 Dec 2020 15:19:29 -0600 +Subject: [PATCH] use __netdev_notify_peers in ibmvnic + +References: bsc#1184114 ltc#192237 bsc#1183871 ltc#192139 +Patch-mainline: v5.11-rc1 +Git-commit: 6be4666221cafcfd58cc078aa8bd1ba11b699f6b + +Start to use the lockless version of netdev_notify_peers. + +Signed-off-by: Lijun Pan +Signed-off-by: Jakub Kicinski +Acked-by: Michal Suchanek +--- + drivers/net/ethernet/ibm/ibmvnic.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c +index a2191392ca4f..f302504faa8a 100644 +--- a/drivers/net/ethernet/ibm/ibmvnic.c ++++ b/drivers/net/ethernet/ibm/ibmvnic.c +@@ -2171,10 +2171,8 @@ static int do_reset(struct ibmvnic_adapter *adapter, + napi_schedule(&adapter->napi[i]); + + if (adapter->reset_reason == VNIC_RESET_FAILOVER || +- adapter->reset_reason == VNIC_RESET_MOBILITY) { +- call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev); +- call_netdevice_notifiers(NETDEV_RESEND_IGMP, netdev); +- } ++ adapter->reset_reason == VNIC_RESET_MOBILITY) ++ __netdev_notify_peers(netdev); + + rc = 0; + +@@ -2249,8 +2247,7 @@ static int do_hard_reset(struct ibmvnic_adapter *adapter, + goto out; + } + +- call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev); +- call_netdevice_notifiers(NETDEV_RESEND_IGMP, netdev); ++ __netdev_notify_peers(netdev); + out: + /* restore adapter state if reset failed */ + if (rc) +-- +2.26.2 + diff --git a/patches.suse/xen-blkback-don-t-leak-persistent-grants-from-xen_bl.patch b/patches.suse/xen-blkback-don-t-leak-persistent-grants-from-xen_bl.patch new file mode 100644 index 0000000..3382d7b --- /dev/null +++ b/patches.suse/xen-blkback-don-t-leak-persistent-grants-from-xen_bl.patch @@ -0,0 +1,39 @@ +Patch-mainline: 5.12-rc6 +Git-commit: a846738f8c3788d846ed1f587270d2f2e3d32432 +References: bsc#1183646, CVE-2021-28688, XSA-371 +From: Jan Beulich +Date: Fri, 26 Mar 2021 16:33:53 +0100 +Subject: [PATCH] xen-blkback: don't leak persistent grants from + xen_blkbk_map() + +The fix for XSA-365 zapped too many of the ->persistent_gnt[] entries. +Ones successfully obtained should not be overwritten, but instead left +for xen_blkbk_unmap_prepare() to pick up and put. + +This is XSA-371. + +Signed-off-by: Jan Beulich +Cc: stable@vger.kernel.org +Reviewed-by: Juergen Gross +Reviewed-by: Wei Liu +Signed-off-by: Juergen Gross +--- + drivers/block/xen-blkback/blkback.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c +index da16121140ca..3874233f7194 100644 +--- a/drivers/block/xen-blkback/blkback.c ++++ b/drivers/block/xen-blkback/blkback.c +@@ -891,7 +891,7 @@ static int xen_blkbk_map(struct xen_blkif_ring *ring, + out: + for (i = last_map; i < num; i++) { + /* Don't zap current batch's valid persistent grants. */ +- if(i >= last_map + segs_to_map) ++ if(i >= map_until) + pages[i]->persistent_gnt = NULL; + pages[i]->handle = BLKBACK_INVALID_HANDLE; + } +-- +2.26.2 + diff --git a/series.conf b/series.conf index 9909d8f..33ae08f 100644 --- a/series.conf +++ b/series.conf @@ -3790,6 +3790,7 @@ patches.suse/powerpc-fadump-Update-comment-about-offset-where-fadump-is-registered.patch patches.suse/powerpc-fadump-Set-an-upper-limit-for-boot-memory-size.patch patches.suse/powerpc-lib-xor_vmx-Ensure-no-altivec-code-executes-.patch + patches.suse/powerpc-Fix-some-spelling-mistakes.patch patches.suse/cxl-Unlock-on-error-in-probe.patch patches.suse/powerpc-64s-Machine-check-handle-ifetch-from-foreign-real-address-for-POWER9.patch patches.suse/powerpc-64s-Optimize-hypercall-syscall-entry.patch @@ -9457,6 +9458,7 @@ patches.suse/powerpc-Remove-redundant-FP-Altivec-giveup-code.patch patches.suse/powerpc-perf-fix-usage-of-nest_imc_refc.patch patches.suse/powerpc-mm-Rename-find_linux_pte_or_hugepte.patch + patches.suse/powerpc-vio-Use-device_type-to-detect-family.patch patches.suse/powerpc-Convert-to-using-pOF-instead-of-full_name.patch patches.suse/powerpc-pseries-remove-dlpar_attach_node-dependency-.patch patches.suse/powerpc-mm-Move-pgdir-setting-into-a-helper.patch @@ -24607,6 +24609,7 @@ patches.suse/0015-arm64-Add-missing-Falkor-part-number-for-branch-pred.patch patches.suse/0001-arm64-proc-Set-PTE_NG-for-table-entries-to-avoid-tra.patch patches.suse/powerpc-xive-Use-hw-CPU-ids-when-configuring-the-CPU.patch + patches.suse/powerpc-pseries-Add-empty-update_numa_cpu_lookup_tab.patch patches.suse/powerpc-pseries-Check-for-zero-filled-ibm-dynamic-me.patch patches.suse/mtd-nand-vf610-set-correct-ooblayout.patch patches.suse/mmc-bcm2835-Don-t-overwrite-max-frequency-unconditio @@ -43239,6 +43242,7 @@ patches.suse/powerpc-pseries-Remove-unneeded-uses-of-dlpar-work-q.patch patches.suse/powerpc-pseries-Disable-CPU-hotplug-across-migration.patch patches.suse/powerpc-fadump-re-register-firmware-assisted-dump-if.patch + patches.suse/powerpc-Convert-to-using-pOFn-instead-of-device_node.patch patches.suse/powerpc-pseries-Fix-DTL-buffer-registration.patch patches.suse/powerpc-pseries-Fix-how-we-iterate-over-the-DTL-entr.patch patches.suse/powerpc-tm-Remove-msr_tm_active.patch @@ -43947,6 +43951,7 @@ patches.suse/block-copy-ioprio-in-__bio_clone_fast.patch patches.suse/0001-block-fix-32-bit-overflow-in-__blkdev_issue_discard.patch patches.suse/SCSI-fix-queue-cleanup-race-before-queue-initializat.patch + patches.suse/powerpc-numa-Suppress-VPHN-is-not-supported-messages.patch patches.suse/drm-dp_mst-Check-if-primary-mstb-is-null.patch patches.suse/0004-drm-amdgpu-fix-bug-with-IH-ring-setup.patch patches.suse/drm-amd-pp-Fix-truncated-clock-value-when-set-waterm.patch @@ -50898,6 +50903,7 @@ patches.suse/powerpc-pci-of-Parse-unassigned-resources.patch patches.suse/KVM-PPC-Book3S-HV-Fix-CR0-setting-in-TM-emulation.patch patches.suse/powerpc-mm-mark-more-tlb-functions-as-__always_inlin.patch + patches.suse/powerpc-pseries-Generalize-hcall_vphn.patch patches.suse/powerpc-mm-hash-4k-Don-t-use-64K-page-size-for-vmemm.patch patches.suse/powerpc-mm-radix-Use-the-right-page-size-for-vmemmap.patch patches.suse/powerpc-mm-drconf-Use-NUMA_NO_NODE-on-failures-inste.patch @@ -52066,6 +52072,7 @@ patches.suse/drm-msm-Use-the-correct-dma_sync-calls-harder.patch patches.suse/0001-drm-i915-gvt-update-vgpu-workload-head-pointer-corre.patch patches.suse/0002-drm-nouveau-kms-nv50-Don-t-create-MSTMs-for-eDP-conn.patch + patches.suse/powerpc-rtas-Unexport-rtas_online_cpus_mask-rtas_off.patch patches.suse/PCI-rpaphp-Avoid-a-sometimes-uninitialized-warning.patch patches.suse/powerpc-powernv-Restrict-OPAL-symbol-map-to-only-be-.patch patches.suse/powerpc-pseries-Fix-cpu_hotplug_lock-acquisition-in-.patch @@ -55156,6 +55163,7 @@ patches.suse/random-always-use-batched-entropy-for-get_random_u-3.patch patches.suse/powerpc-drmem-avoid-NULL-pointer-dereference-when-dr.patch patches.suse/powerpc-smp-Use-nid-as-fallback-for-package_id.patch + patches.suse/powerpc-numa-Remove-late-request-for-home-node-assoc.patch patches.suse/cpufreq-powernv-Fix-use-after-free.patch patches.suse/cpufreq-powernv-Fix-unsafe-notifiers.patch patches.suse/tty-evh_bytechan-Fix-out-of-bounds-accesses.patch @@ -55619,6 +55627,7 @@ patches.suse/lpfc_debugfs-get-rid-of-pointless-access_ok.patch patches.suse/pcm_native-result-of-put_user-needs-to-be-checked.patch patches.suse/mmc-sdhci-msm-Set-SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12.patch + patches.suse/mmc-core-Use-DEFINE_DEBUGFS_ATTRIBUTE-instead-of-DEF.patch patches.suse/mmc-sdio-Fix-potential-NULL-pointer-error-in-mmc_sdi.patch patches.suse/mmc-fix-compilation-of-user-API.patch patches.suse/mmc-sdhci-esdhc-imx-fix-the-mask-for-tuning-start-po.patch @@ -56365,6 +56374,7 @@ patches.suse/USB-serial-qcserial-add-EM7305-QDL-product-ID.patch patches.suse/usb-xhci-define-IDs-for-various-ASMedia-host-control.patch patches.suse/usb-xhci-Fix-ASMedia-ASM1142-DMA-addressing.patch + patches.suse/mmc-sdhci-of-arasan-Add-missed-checks-for-devm_clk_r.patch patches.suse/leds-lm355x-avoid-enum-conversion-warning.patch patches.suse/leds-88pm860x-fix-use-after-free-on-unbind.patch patches.suse/leds-da903x-fix-use-after-free-on-unbind.patch @@ -56566,6 +56576,22 @@ patches.suse/powerpc-pmem-Initialize-pmem-device-on-newer-hardwar.patch patches.suse/powerpc-pseries-remove-cede-offline-state-for-CPUs.patch patches.suse/powerpc-rtas-don-t-online-CPUs-for-partition-suspend.patch + patches.suse/powerpc-numa-remove-ability-to-enable-topology-updat.patch + patches.suse/powerpc-numa-remove-unreachable-topology-update-code.patch + patches.suse/powerpc-numa-make-vphn_enabled-prrn_enabled-flags-co.patch + patches.suse/powerpc-numa-remove-unreachable-topology-timer-code.patch + patches.suse/powerpc-numa-remove-unreachable-topology-workqueue-c.patch + patches.suse/powerpc-numa-remove-vphn_enabled-and-prrn_enabled-in.patch + patches.suse/powerpc-numa-stub-out-numa_update_cpu_topology.patch + patches.suse/powerpc-numa-remove-timed_topology_update.patch + patches.suse/powerpc-numa-remove-start-stop_topology_update.patch + patches.suse/powerpc-rtasd-simplify-handle_rtas_event-emit-messag.patch + patches.suse/powerpc-numa-remove-prrn_is_enabled.patch + patches.suse/powerpc-numa-remove-arch_update_cpu_topology.patch + patches.suse/powerpc-pseries-remove-prrn-special-case-from-DT-upd.patch + patches.suse/powerpc-pseries-remove-memory-re-add-implementation.patch + patches.suse/powerpc-pseries-remove-dlpar_cpu_readd.patch + patches.suse/powerpc-pseries-remove-obsolete-memory-hotplug-DT-no.patch patches.suse/powerpc-Add-cputime_to_nsecs.patch patches.suse/powerpc-fadump-fix-race-between-pstore-write-and-fad.patch patches.suse/pseries-Fix-64-bit-logical-memory-block-panic.patch @@ -56579,6 +56605,8 @@ patches.suse/powerpc-boot-Fix-CONFIG_PPC_MPC52XX-references.patch patches.suse/powerpc-xmon-Use-dcbf-inplace-of-dcbi-instruction-fo.patch patches.suse/powerpc-book3s64-radix-Add-kernel-command-line-optio.patch + patches.suse/powerpc-pseries-mobility-Set-pr_fmt.patch + patches.suse/powerpc-pseries-mobility-Add-pr_debug-for-device-tre.patch patches.suse/powerpc-pseries-hotplug-cpu-Remove-double-free-in-er.patch patches.suse/powerpc-Fix-circular-dependency-between-percpu.h-and.patch patches.suse/0001-xen-balloon-fix-accounting-in-alloc_xenballooned_pag.patch @@ -57202,6 +57230,13 @@ patches.suse/HID-wacom-Avoid-entering-wacom_wac_pen_report-for-pa.patch patches.suse/tracing-fix-race-in-trace_open-and-buffer-resize-call.patch patches.suse/ima-Remove-semicolon-at-the-end-of-ima_get_binary_ru.patch + patches.suse/ibmvnic-store-RX-and-TX-subCRQ-handle-array-in-ibmvn.patch + patches.suse/ibmvnic-Fix-use-after-free-of-VNIC-login-response-bu.patch + patches.suse/ibmvnic-compare-adapter-init_done_rc-with-more-reada.patch + patches.suse/ibmvnic-improve-ibmvnic_init-and-ibmvnic_reset_init.patch + patches.suse/ibmvnic-remove-never-executed-if-statement.patch + patches.suse/ibmvnic-merge-ibmvnic_reset_init-and-ibmvnic_init.patch + patches.suse/ibmvnic-Harden-device-Command-Response-Queue-handsha.patch patches.suse/net-ena-ethtool-convert-stat_offset-to-64-bit-resolu.patch patches.suse/net-ena-ethtool-Add-new-device-statistics.patch patches.suse/net-ena-ethtool-add-stats-printing-to-XDP-queues.patch @@ -57225,6 +57260,7 @@ patches.suse/mwifiex-remove-function-pointer-check.patch patches.suse/brcmsmac-fix-memory-leak-in-wlc_phy_attach_lcnphy.patch patches.suse/net-ethernet-mlx4-Avoid-assigning-a-value-to-ring_co.patch + patches.suse/Revert-ibmvnic-remove-never-executed-if-statement.patch patches.suse/net-ena-Change-license-into-format-to-SPDX-in-all-fi.patch patches.suse/net-ena-Change-log-message-to-netif-dev-function.patch patches.suse/net-ena-Capitalize-all-log-strings-and-improve-code-.patch @@ -57235,6 +57271,11 @@ patches.suse/s390-bpf-fix-multiple-tail-calls patches.suse/ath9k-hif_usb-fix-race-condition-between-usb_get_urb.patch patches.suse/ath6kl-wmi-prevent-a-shift-wrapping-bug-in-ath6kl_wm.patch + patches.suse/ibmvnic-rename-send_cap_queries-to-send_query_cap.patch + patches.suse/ibmvnic-rename-ibmvnic_send_req_caps-to-send_request.patch + patches.suse/ibmvnic-rename-send_map_query-to-send_query_map.patch + patches.suse/ibmvnic-create-send_query_ip_offload.patch + patches.suse/ibmvnic-create-send_control_ip_offload.patch patches.suse/Bluetooth-hci_uart-Cancel-init-work-before-unregiste.patch patches.suse/Bluetooth-Only-mark-socket-zapped-after-unlocking.patch patches.suse/Bluetooth-A2MP-Fix-not-initializing-all-members.patch @@ -57504,6 +57545,7 @@ patches.suse/page_frag-Recover-from-memory-pressure.patch patches.suse/net-mlx5-Add-handling-of-port-type-in-rule-deletion.patch patches.suse/net-mlx4_core-Fix-init_hca-fields-offset.patch + patches.suse/0001-drm-bridge-dw-hdmi-Avoid-resetting-force-in-the-dete.patch patches.suse/drm-sun4i-dw-hdmi-fix-error-return-code-in-sun8i_dw_.patch patches.suse/drm-i915-gvt-Set-ENHANCED_FRAME_CAP-bit.patch patches.suse/ALSA-hda-realtek-Add-some-Clove-SSID-in-the-ALC293-A.patch @@ -57551,6 +57593,7 @@ patches.suse/net-af_iucv-set-correct-sk_protocol-for-child-sockets patches.suse/ibmvnic-fix-call_netdevice_notifiers-in-do_reset.patch patches.suse/ibmvnic-notify-peers-when-failover-and-migration-hap.patch + patches.suse/ibmvnic-skip-tx-timeout-reset-while-in-resetting.patch patches.suse/iwlwifi-pcie-limit-memory-read-spin-time.patch patches.suse/iwlwifi-mvm-fix-kernel-panic-in-case-of-assert-durin.patch patches.suse/i40e-Fix-removing-driver-while-bare-metal-VFs-pass-t.patch @@ -57559,6 +57602,7 @@ patches.suse/net-ena-set-initial-DMA-width-to-avoid-intel-iommu-i.patch patches.suse/net-ena-fix-packet-s-addresses-for-rx_offset-feature.patch patches.suse/ibmvnic-fix-NULL-pointer-dereference-in-reset_sub_cr.patch + patches.suse/ibmvnic-fix-NULL-pointer-dereference-in-ibmvic_reset.patch patches.suse/ibmvnic-enhance-resetting-status-check-during-module.patch patches.suse/batman-adv-set-.owner-to-THIS_MODULE.patch patches.suse/can-gs_usb-fix-endianess-problem-with-candleLight-fi.patch @@ -57578,11 +57622,19 @@ patches.suse/ALSA-hda-generic-Add-option-to-enforce-preferred_dac.patch patches.suse/ALSA-hda-realtek-Add-mute-LED-quirk-to-yet-another-H.patch patches.suse/s390-pci-fix-cpu-address-in-msi-for-directed-irq + patches.suse/ibmvnic-handle-inconsistent-login-with-reset.patch + patches.suse/ibmvnic-stop-free_all_rwi-on-failed-reset.patch patches.suse/ibmvnic-avoid-memset-null-scrq-msgs.patch patches.suse/ibmvnic-restore-adapter-state-on-failed-reset.patch patches.suse/ibmvnic-delay-next-reset-if-hard-reset-fails.patch + patches.suse/ibmvnic-track-pending-login.patch + patches.suse/ibmvnic-send_login-should-check-for-crq-errors.patch + patches.suse/ibmvnic-no-reset-timeout-for-5-seconds-after-reset.patch + patches.suse/ibmvnic-reduce-wait-for-completion-time.patch patches.suse/chelsio-chtls-fix-panic-during-unload-reload-chtls.patch patches.suse/can-c_can-c_can_power_up-fix-error-handling.patch + patches.suse/ibmvnic-Ensure-that-SCRQ-entry-reads-are-correctly-o.patch + patches.suse/ibmvnic-Fix-TX-completion-error-handling.patch patches.suse/inet_ecn-Fix-endianness-of-checksum-update-when-sett.patch patches.suse/net-x25-prevent-a-couple-of-overflows.patch patches.suse/cxgb3-fix-error-return-code-in-t3_sge_alloc_qset.patch @@ -57666,6 +57718,10 @@ patches.suse/mm-memory_failure-always-pin-the-page-in-madvise_inj.patch patches.suse/mm-don-t-wake-kswapd-prematurely-when-watermark-boosting-is-disabled.patch patches.suse/wimax-fix-duplicate-initializer-warning.patch + patches.suse/ibmvnic-Ensure-that-device-queue-memory-is-cache-lin.patch + patches.suse/ibmvnic-Correctly-re-enable-interrupts-in-NAPI-polli.patch + patches.suse/ibmvnic-Use-netdev_alloc_skb-instead-of-alloc_skb-to.patch + patches.suse/ibmvnic-Do-not-replenish-RX-buffers-after-every-poll.patch patches.suse/mwifiex-fix-mwifiex_shutdown_sw-causing-sw-reset-fai.patch patches.suse/mwifiex-pcie-skip-cancel_work_sync-on-reset-failure-.patch patches.suse/orinoco-Move-context-allocation-after-processing-the.patch @@ -57855,9 +57911,38 @@ patches.suse/powerpc-pci-Remove-LSI-mappings-on-device-teardown.patch patches.suse/powerpc-xmon-Change-printk-to-pr_cont.patch patches.suse/powerpc-Fix-incorrect-stw-ux-u-x-instructions-in-__s.patch + patches.suse/powerpc-rtas-prevent-suspend-related-sys_rtas-use-on.patch + patches.suse/powerpc-rtas-complete-ibm-suspend-me-status-codes.patch + patches.suse/powerpc-rtas-rtas_ibm_suspend_me-rtas_ibm_suspend_me.patch + patches.suse/powerpc-rtas-add-rtas_ibm_suspend_me.patch + patches.suse/powerpc-rtas-add-rtas_activate_firmware.patch + patches.suse/powerpc-hvcall-add-token-and-codes-for-H_VASI_SIGNAL.patch + patches.suse/powerpc-pseries-mobility-don-t-error-on-absence-of-i.patch + patches.suse/powerpc-pseries-mobility-add-missing-break-to-defaul.patch + patches.suse/powerpc-pseries-mobility-error-message-improvements.patch + patches.suse/powerpc-pseries-mobility-use-rtas_activate_firmware-.patch + patches.suse/powerpc-pseries-mobility-extract-VASI-session-pollin.patch + patches.suse/powerpc-pseries-mobility-use-stop_machine-for-join-s.patch + patches.suse/powerpc-pseries-mobility-signal-suspend-cancellation.patch + patches.suse/powerpc-pseries-mobility-retry-partition-suspend-aft.patch + patches.suse/powerpc-rtas-dispatch-partition-migration-requests-t.patch + patches.suse/powerpc-rtas-remove-rtas_ibm_suspend_me_unsafe.patch + patches.suse/powerpc-pseries-hibernation-drop-pseries_suspend_beg.patch + patches.suse/powerpc-pseries-hibernation-pass-stream-id-via-funct.patch + patches.suse/powerpc-pseries-hibernation-remove-pseries_suspend_c.patch + patches.suse/powerpc-machdep-remove-suspend_disable_cpu.patch + patches.suse/powerpc-rtas-remove-rtas_suspend_cpu.patch + patches.suse/powerpc-pseries-hibernation-switch-to-rtas_ibm_suspe.patch + patches.suse/powerpc-rtas-remove-unused-rtas_suspend_last_cpu.patch patches.suse/powerpc-pseries-hibernation-remove-redundant-cachein.patch + patches.suse/powerpc-pseries-hibernation-perform-post-suspend-fix.patch + patches.suse/powerpc-pseries-hibernation-remove-prepare_late-call.patch + patches.suse/powerpc-rtas-remove-unused-rtas_suspend_me_data.patch + patches.suse/powerpc-pseries-mobility-refactor-node-lookup-during.patch patches.suse/powerpc-rtas-fix-typo-of-ibm-open-errinjct-in-rtas-f.patch patches.suse/powerpc-perf-Exclude-kernel-samples-while-counting-e.patch + patches.suse/net-core-introduce-__netdev_notify_peers.patch + patches.suse/use-__netdev_notify_peers-in-ibmvnic.patch patches.suse/pwm-lp3943-Dynamically-allocate-PWM-chip-base.patch patches.suse/HSI-omap_ssi-Don-t-jump-to-free-ID-in-ssi_add_contro.patch patches.suse/power-supply-bq24190_charger-fix-reference-leak.patch @@ -57987,6 +58072,7 @@ patches.suse/futex-Handle-faults-correctly-for-PI-futexes.patch patches.suse/igc-fix-link-speed-advertising.patch patches.suse/can-dev-prevent-potential-information-leak-in-can_fi.patch + patches.suse/ibmvnic-Ensure-that-CRQ-entry-read-are-correctly-ord.patch patches.suse/net-mlx5-Fix-memory-leak-on-flow-table-creation-erro.patch patches.suse/drm-i915-Check-for-all-subplatform-bits.patch patches.suse/iommu-vt-d-do-not-use-flush-queue-when-caching-mode-is-on @@ -58018,10 +58104,23 @@ patches.suse/ibmvnic-Clear-failover_pending-if-unable-to-schedule.patch patches.suse/net-hns3-add-a-check-for-queue_id-in-hclge_reset_vf_.patch patches.suse/net-hns3-add-a-check-for-index-in-hclge_get_rss_key.patch + patches.suse/bpf-Fix-32-bit-src-register-truncation-on-div-mod.patch patches.suse/tracing-check-length-before-giving-out-the-filter-buffer.patch + patches.suse/ibmvnic-merge-do_change_param_reset-into-do_reset.patch + patches.suse/net-ethernet-ibm-ibmvnic-Fix-some-kernel-doc-misdeme.patch patches.suse/vmxnet3-Remove-buf_info-from-device-accessible-struc.patch + patches.suse/ibmvnic-rework-to-ensure-SCRQ-entry-reads-are-proper.patch + patches.suse/ibmvnic-remove-unnecessary-rmb-inside-ibmvnic_poll.patch patches.suse/wlcore-Fix-command-execute-failure-19-for-wl12xx.patch patches.suse/net-bridge-use-switchdev-for-port-flags-set-through-.patch + patches.suse/ibmvnic-prefer-unsigned-long-over-unsigned-long-int.patch + patches.suse/ibmvnic-fix-block-comments.patch + patches.suse/ibmvnic-fix-braces.patch + patches.suse/ibmvnic-avoid-multiple-line-dereference.patch + patches.suse/ibmvnic-fix-miscellaneous-checks.patch + patches.suse/ibmvnic-add-comments-for-spinlock_t-definitions.patch + patches.suse/ibmvnic-remove-unused-spinlock_t-stats_lock-definiti.patch + patches.suse/ibmvnic-prefer-strscpy-over-strlcpy.patch patches.suse/Bluetooth-btqcomsmd-Fix-a-resource-leak-in-error-han.patch patches.suse/Bluetooth-hci_uart-Fix-a-race-for-write_work-schedul.patch patches.suse/Bluetooth-Fix-initializing-response-id-after-clearin.patch @@ -58030,12 +58129,18 @@ patches.suse/Bluetooth-Fix-null-pointer-dereference-in-amp_read_l.patch patches.suse/ath9k-fix-data-bus-crash-when-setting-nf_override-vi.patch patches.suse/mac80211-fix-potential-overflow-when-multiplying-to-.patch + patches.suse/ibmvnic-simplify-reset_long_term_buff-function.patch + patches.suse/ibmvnic-substitute-mb-with-dma_wmb-for-send_-crq-fun.patch patches.suse/bpf-x64-Pad-NOPs-to-make-images-converge-more-easily.patch patches.suse/bpf_lru_list-Read-double-checked-variable-once-witho.patch patches.suse/ibmvnic-Set-to-CLOSED-state-even-on-error.patch + patches.suse/bpf-Fix-truncation-handling-for-mod32-dst-reg-wrt-ze.patch patches.suse/cxgb4-chtls-cxgbit-Keeping-the-max-ofld-immediate-da.patch patches.suse/b43-N-PHY-Fix-the-update-of-coef-for-the-PHY-revisio.patch + patches.suse/ibmvnic-add-memory-barrier-to-protect-long-term-buff.patch + patches.suse/ibmvnic-skip-send_request_unmap-for-timeout-reset.patch patches.suse/ibmvnic-serialize-access-to-work-queue-on-remove.patch + patches.suse/net-re-solve-some-conflicts-after-net-net-next-merge.patch patches.suse/reset-hisilicon-correct-vendor-prefix.patch patches.suse/usb-dwc2-Do-not-update-data-length-if-it-is-0-on-inb.patch patches.suse/usb-dwc2-Abort-transaction-after-errors-with-unknown.patch @@ -58048,6 +58153,7 @@ patches.suse/usb-quirks-add-quirk-to-start-video-capture-on-ELMO-.patch patches.suse/staging-rtl8723bs-wifi_regd.c-Fix-incorrect-number-o.patch patches.suse/staging-rtl8188eu-Add-Edimax-EW-7811UN-V2-to-device-.patch + patches.suse/ACPI-scan-Rearrange-memory-allocation-in-acpi_device.patch patches.suse/ACPI-property-Fix-fwnode-string-properties-matching.patch patches.suse/ACPI-property-Satisfy-kernel-doc-validator-part-1.patch patches.suse/ACPI-configfs-add-missing-check-after-configfs_regis.patch @@ -58077,6 +58183,8 @@ patches.suse/0001-fbdev-aty-SPARC64-requires-FB_ATY_CT.patch patches.suse/0003-drm-gma500-Fix-error-return-code-in-psb_driver_load.patch patches.suse/0004-gma500-clean-up-error-handling-in-init.patch + patches.suse/0002-drm-amdgpu-Fix-macro-name-_AMDGPU_TRACE_H_-in-prepro.patch + patches.suse/0003-drm-mediatek-Fix-aal-size-config.patch patches.suse/tpm_tis-Fix-check_locality-for-correct-locality-acqu.patch patches.suse/tpm_tis-clean-up-locality-release.patch patches.suse/hwrng-timeriomem-Fix-cooldown-period-calculation.patch @@ -58155,14 +58263,17 @@ patches.suse/rsxx-Return-EFAULT-if-copy_to_user-fails.patch patches.suse/RDMA-uverbs-Fix-kernel-doc-warning-of-_uverbs_alloc.patch patches.suse/powerpc-pseries-Don-t-enforce-MSI-affinity-with-kdum.patch + patches.suse/gpiolib-acpi-Add-missing-IRQF_ONESHOT.patch patches.suse/net-hns3-fix-query-vlan-mask-value-error-for-flow-di.patch patches.suse/net-hns3-fix-bug-when-calculating-the-TCAM-table-inf.patch patches.suse/can-skb-can_skb_set_owner-fix-ref-counting-if-socket.patch + patches.suse/ibmvnic-Fix-possibly-uninitialized-old_num_tx_queues.patch patches.suse/ixgbe-fail-to-create-xfrm-offload-of-IPsec-tunnel-mo.patch patches.suse/net-usb-qmi_wwan-allow-qmimux-add-del-with-master-up.patch patches.suse/ibmvnic-always-store-valid-MAC-address.patch patches.suse/xsk-Remove-dangling-function-declaration-from-header.patch patches.suse/ibmvnic-remove-excessive-irqsave.patch + patches.suse/gianfar-fix-jumbo-packets-napi-rx-overrun-crash.patch patches.suse/ethernet-alx-fix-order-of-calls-on-resume.patch patches.suse/s390-cio-return-efault-if-copy_to_user-fails-51c44bab.patch patches.suse/s390-crypto-return-efault-if-copy_to_user-fails.patch @@ -58170,6 +58281,8 @@ patches.suse/media-usbtv-Fix-deadlock-on-suspend.patch patches.suse/qxl-Fix-uninitialised-struct-field-head.surface_id.patch patches.suse/drm-meson_drv-add-shutdown-function.patch + patches.suse/0005-drm-compat-Clear-bounce-structures.patch + patches.suse/drm-radeon-fix-AGP-dependency.patch patches.suse/xen-events-reset-affinity-of-2-level-event-when-tear.patch patches.suse/xen-events-don-t-unmask-an-event-channel-when-an-eoi.patch patches.suse/xen-events-avoid-handling-the-same-event-on-two-cpus.patch @@ -58194,15 +58307,34 @@ 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/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 patches.suse/PCI-rpadlpar-Fix-potential-drc_name-corruption-in-st.patch patches.suse/firmware-efi-Fix-a-use-after-bug-in-efi_mem_reserve_.patch + patches.suse/perf-x86-intel-fix-a-crash-caused-by-zero-pebs-status.patch + patches.suse/usb-storage-Add-quirk-to-defeat-Kindle-s-automatic-u.patch patches.suse/iio-adc-qcom-spmi-vadc-add-default-scale-to-LR_MUX2_.patch patches.suse/iio-hid-sensor-prox-Fix-scale-not-correct-issue.patch patches.suse/iio-hid-sensor-humidity-Fix-alignment-issue-of-times.patch patches.suse/iio-hid-sensor-temperature-Fix-issues-of-timestamp-c.patch patches.suse/iio-gyro-mpu3050-Fix-error-handling-in-mpu3050_trigg.patch + patches.suse/net-qrtr-fix-a-kernel-infoleak-in-qrtr_recvmsg.patch + patches.suse/can-peak_usb-add-forgotten-supported-devices.patch + patches.suse/can-c_can_pci-c_can_pci_remove-fix-use-after-free.patch + patches.suse/can-c_can-move-runtime-PM-enable-disable-to-c_can_pl.patch + patches.suse/can-m_can-m_can_do_rx_poll-fix-extraneous-msg-loss-w.patch + patches.suse/mac80211-fix-rate-mask-reset.patch + patches.suse/mac80211-fix-double-free-in-ibss_leave.patch + patches.suse/bpf-Prohibit-alu-ops-for-pointer-types-not-defining-.patch + patches.suse/bpf-Fix-off-by-one-for-area-size-in-creating-mask-to.patch + patches.suse/bpf-Simplify-alu_limit-masking-for-pointer-arithmeti.patch + patches.suse/bpf-Add-sanity-check-for-upper-ptr_limit.patch + patches.suse/net-cdc-phonet-fix-data-interface-release-on-probe-f.patch + patches.suse/can-peak_usb-Revert-can-peak_usb-add-forgotten-suppo.patch + patches.suse/drm-msm-fix-shutdown-hook-in-case-GPU-components-fai.patch + patches.suse/bus-omap_l3_noc-mark-l3-irqs-as-IRQF_NO_THREAD.patch + patches.suse/xen-blkback-don-t-leak-persistent-grants-from-xen_bl.patch # dhowells/linux-fs keys-uefi patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch @@ -59136,6 +59268,7 @@ patches.kabi/KVM-Fix-kABI-set_virtual_apic_mode.patch patches.kabi/mm-thp-kABI-move-the-added-flag-to-the-end-of-enum.patch patches.kabi/fix-kabi-after-call_single_data-modification.patch + patches.kabi/powerpc-kABI-add-back-suspend_disable_cpu-in-machdep.patch ######################################################## # You'd better have a good reason for adding a patch