diff --git a/patches.suse/watchdog-diag288_wdt-do-not-use-stack-buffers-for-ha.patch b/patches.suse/watchdog-diag288_wdt-do-not-use-stack-buffers-for-ha.patch new file mode 100644 index 0000000..77b05f8 --- /dev/null +++ b/patches.suse/watchdog-diag288_wdt-do-not-use-stack-buffers-for-ha.patch @@ -0,0 +1,55 @@ +From fe8973a3ad0905cb9ba2d42db42ed51de14737df Mon Sep 17 00:00:00 2001 +From: Alexander Egorenkov +Date: Fri, 27 Jan 2023 14:52:41 +0100 +Subject: [PATCH] watchdog: diag288_wdt: do not use stack buffers for hardware + data +References: bsc#1207497 +Git-commit: fe8973a3ad0905cb9ba2d42db42ed51de14737df +Patch-mainline: v6.2-rc7 + +With CONFIG_VMAP_STACK=y the stack is allocated from the vmalloc space. +Data passed to a hardware or a hypervisor interface that +requires V=R can no longer be allocated on the stack. + +Use kmalloc() to get memory for a diag288 command. + +Signed-off-by: Alexander Egorenkov +Reviewed-by: Heiko Carstens +Cc: +Signed-off-by: Heiko Carstens +Signed-off-by: Thomas Abraham +--- + drivers/watchdog/diag288_wdt.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/drivers/watchdog/diag288_wdt.c b/drivers/watchdog/diag288_wdt.c +index 4cb10877017c..2112eef69969 100644 +--- a/drivers/watchdog/diag288_wdt.c ++++ b/drivers/watchdog/diag288_wdt.c +@@ -268,12 +268,21 @@ static int __init diag288_init(void) + char ebc_begin[] = { + 194, 197, 199, 201, 213 + }; ++ char *ebc_cmd; + + watchdog_set_nowayout(&wdt_dev, nowayout_info); + + if (MACHINE_IS_VM) { +- if (__diag288_vm(WDT_FUNC_INIT, 15, +- ebc_begin, sizeof(ebc_begin)) != 0) { ++ ebc_cmd = kmalloc(sizeof(ebc_begin), GFP_KERNEL); ++ if (!ebc_cmd) { ++ pr_err("The watchdog cannot be initialized\n"); ++ return -ENOMEM; ++ } ++ memcpy(ebc_cmd, ebc_begin, sizeof(ebc_begin)); ++ ret = __diag288_vm(WDT_FUNC_INIT, 15, ++ ebc_cmd, sizeof(ebc_begin)); ++ kfree(ebc_cmd); ++ if (ret != 0) { + pr_err("The watchdog cannot be initialized\n"); + return -EINVAL; + } +-- +2.35.3 + diff --git a/patches.suse/watchdog-diag288_wdt-fix-__diag288-inline-assembly.patch b/patches.suse/watchdog-diag288_wdt-fix-__diag288-inline-assembly.patch new file mode 100644 index 0000000..67be5e7 --- /dev/null +++ b/patches.suse/watchdog-diag288_wdt-fix-__diag288-inline-assembly.patch @@ -0,0 +1,38 @@ +From 32e40f9506b9e32917eb73154f93037b443124d1 Mon Sep 17 00:00:00 2001 +From: Alexander Egorenkov +Date: Fri, 27 Jan 2023 14:52:42 +0100 +Subject: [PATCH] watchdog: diag288_wdt: fix __diag288() inline assembly +References: bsc#1207497 +Git-commit: 32e40f9506b9e32917eb73154f93037b443124d1 +Patch-mainline: v6.2-rc7 + +The DIAG 288 statement consumes an EBCDIC string the address of which is +passed in a register. Use a "memory" clobber to tell the compiler that +memory is accessed within the inline assembly. + +Signed-off-by: Alexander Egorenkov +Reviewed-by: Heiko Carstens +Cc: +Signed-off-by: Heiko Carstens +Signed-off-by: Thomas Abraham + +--- + drivers/watchdog/diag288_wdt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/watchdog/diag288_wdt.c b/drivers/watchdog/diag288_wdt.c +index 2112eef69969..6ca5d9515d85 100644 +--- a/drivers/watchdog/diag288_wdt.c ++++ b/drivers/watchdog/diag288_wdt.c +@@ -86,7 +86,7 @@ static int __diag288(unsigned int func, unsigned int timeout, + "1:\n" + EX_TABLE(0b, 1b) + : "+d" (err) : "d"(__func), "d"(__timeout), +- "d"(__action), "d"(__len) : "1", "cc"); ++ "d"(__action), "d"(__len) : "1", "cc", "memory"); + return err; + } + +-- +2.35.3 + diff --git a/series.conf b/series.conf index 7654a88..171aa6f 100644 --- a/series.conf +++ b/series.conf @@ -58400,6 +58400,8 @@ patches.suse/HID-betop-check-shape-of-output-reports.patch patches.suse/netfilter-nft_payload-incorrect-arithmetics-when-fet.patch patches.suse/RDMA-core-Fix-ib-block-iterator-counter-overflow.patch + patches.suse/watchdog-diag288_wdt-do-not-use-stack-buffers-for-ha.patch + patches.suse/watchdog-diag288_wdt-fix-__diag288-inline-assembly.patch # netdev/net patches.suse/sctp-fail-if-no-bound-addresses-can-be-used-for-a-gi.patch