FAILED: patch "[PATCH] s390: Revert support for DCACHE_WORD_ACCESS" failed to apply to 6.12-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 37540b8c287fc817bdbd0c62bb75ad6eab0e5d03
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026071418-catsup-creasing-f440@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 37540b8c287fc817bdbd0c62bb75ad6eab0e5d03 Mon Sep 17 00:00:00 2001
From: Heiko Carstens <[email protected]>
Date: Thu, 11 Jun 2026 17:37:46 +0200
Subject: [PATCH] s390: Revert support for DCACHE_WORD_ACCESS
load_unaligned_zeropad() reads eight bytes from unaligned addresses and may cross page boundaries. It handles exceptions which may happen if reading from the second page results in an exception.
For pages which are donated to the Ultravisor for secure execution purposes the do_secure_storage_access() exception handler however does not handle such exceptions correctly. Such an exception may result in an endless exception loop which will never be resolved.
An attempt to fix this [1] turned out to be not sufficient. For now revert load_unaligned_zeropad() until this problem has been resolved in a proper way.
Note that the implementation of load_unaligned_zeropad() itself is correct. The revert is just a temporary workaround until there is complete fix for secure storage access exceptions.
[1] commit b00be77302d7 ("s390/mm: Add missing secure storage access fixups for donated memory")
arch/s390/Kconfig +0 -1
@@ -166,7 +166,6 @@ config S390 select ARCH_WANTS_THP_SWAP select BUILDTIME_TABLE_SORT select CLONE_BACKWARDS2 - select DCACHE_WORD_ACCESS if !KMSAN select DYNAMIC_FTRACE if FUNCTION_TRACER select FUNCTION_ALIGNMENT_8B if CC_IS_GCC select FUNCTION_ALIGNMENT_16B if !CC_IS_GCC
arch/s390/include/asm/asm-extable.h +0 -4
@@ -12,7 +12,6 @@#define EX_TYPE_UA_FAULT 3#define EX_TYPE_UA_LOAD_REG 5#define EX_TYPE_UA_LOAD_REGPAIR 6 -#define EX_TYPE_ZEROPAD 7#define EX_TYPE_FPC 8#define EX_TYPE_UA_MVCOS_TO 9#define EX_TYPE_UA_MVCOS_FROM 10
@@ -80,9 +79,6 @@#define EX_TABLE_UA_LOAD_REGPAIR (_fault, _target, _regerr, _regzero) \ __EX_TABLE(__ex_table, _fault, _target, EX_TYPE_UA_LOAD_REGPAIR, _regerr, _regzero, 0) -#define EX_TABLE_ZEROPAD (_fault, _target, _regdata, _regaddr) \ - __EX_TABLE(__ex_table, _fault, _target, EX_TYPE_ZEROPAD, _regdata, _regaddr, 0) -#define EX_TABLE_FPC (_fault, _target) \ __EX_TABLE(__ex_table, _fault, _target, EX_TYPE_FPC, __stringify(%%r0), __stringify(%%r0), 0)
arch/s390/include/asm/word-at-a-time.h +0 -22
@@ -4,7 +4,6 @@#include <linux/bitops.h> #include <linux/wordpart.h> -#include <asm/asm-extable.h> #include <asm/bitsperlong.h> struct word_at_a_time {
@@ -41,25 +40,4 @@ static inline unsigned long zero_bytemask(unsigned long data) return ~1UL << data; } -/* -* Load an unaligned word from kernel space. -* -* In the (very unlikely) case of the word being a page-crosser -* and the next page not being mapped, take the exception and -* return zeroes in the non-existing part. -*/ -static inline unsigned long load_unaligned_zeropad (const void *addr) -{ -unsigned long data; - - asm_inline volatile( -"0: lg %[data],0(%[addr])\n" -"1: nopr %%r7\n" - EX_TABLE_ZEROPAD(0b, 1b, %[data], %[addr]) - EX_TABLE_ZEROPAD(1b, 1b, %[data], %[addr]) - : [data] "=d" (data) - : [addr] "a" (addr), "m" (*(unsigned long *)addr)); -return data; -} -#endif /* _ASM_WORD_AT_A_TIME_H */
arch/s390/mm/extable.c +0 -18
@@ -50,22 +50,6 @@ static bool ex_handler_ua_load_reg(const struct exception_table_entry *ex,return true; } -static bool ex_handler_zeropad (const struct exception_table_entry *ex,struct pt_regs *regs) -{ -unsigned int reg_addr =FIELD_GET (EX_DATA_REG_ADDR , ex->data); -unsigned int reg_data =FIELD_GET (EX_DATA_REG_ERR , ex->data); -unsigned long data, addr, offset; - - addr = regs->gprs[reg_addr]; - offset = addr & (sizeof (unsigned long ) -1 ); - addr &= ~(sizeof (unsigned long ) -1 ); - data = *(unsigned long *)addr; - data <<=BITS_PER_BYTE * offset; - regs->gprs[reg_data] = data; - regs->psw.addr =extable_fixup (ex); -return true; -} -static bool ex_handler_fpc (const struct exception_table_entry *ex,struct pt_regs *regs) {fpu_sfpc (0 );
@@ -134,8 +118,6 @@ bool fixup_exception(struct pt_regs *regs)return ex_handler_ua_load_reg (ex, false, regs);case EX_TYPE_UA_LOAD_REGPAIR :return ex_handler_ua_load_reg (ex, true, regs); -case EX_TYPE_ZEROPAD : -return ex_handler_zeropad (ex, regs);case EX_TYPE_FPC :return ex_handler_fpc (ex, regs);case EX_TYPE_UA_MVCOS_TO :
Heiko Carstens
maintainerPATCH 1/1 s390: Revert support for DCACHE_WORD_ACCESS
load_unaligned_zeropad() reads eight bytes from unaligned addresses and may cross page boundaries. It handles exceptions which may happen if reading from the second page results in an exception.
For pages which are donated to the Ultravisor for secure execution purposes the do_secure_storage_access() exception handler however does not handle such exceptions correctly. Such an exception may result in an endless exception loop which will never be resolved.
An attempt to fix this [1] turned out to be not sufficient. For now revert load_unaligned_zeropad() until this problem has been resolved in a proper way.
Note that the implementation of load_unaligned_zeropad() itself is correct. The revert is just a temporary workaround until there is complete fix for secure storage access exceptions.
[1] commit b00be77302d7 ("s390/mm: Add missing secure storage access fixups for donated memory")
--- arch/s390/Kconfig | 1 - arch/s390/include/asm/asm-extable.h | 4 ---- arch/s390/include/asm/word-at-a-time.h | 22 ---------------------- arch/s390/mm/extable.c | 18 ------------------ 4 files changed, 45 deletions(-)
arch/s390/Kconfig +0 -1
@@ -137,7 +137,6 @@ config S390 select ARCH_WANT_LD_ORPHAN_WARN select BUILDTIME_TABLE_SORT select CLONE_BACKWARDS2 - select DCACHE_WORD_ACCESS if !KMSAN select DYNAMIC_FTRACE if FUNCTION_TRACER select FUNCTION_ALIGNMENT_8B if CC_IS_GCC select FUNCTION_ALIGNMENT_16B if !CC_IS_GCC
arch/s390/include/asm/asm-extable.h +0 -4
@@ -13,7 +13,6 @@#define EX_TYPE_UA_LOAD_MEM 4#define EX_TYPE_UA_LOAD_REG 5#define EX_TYPE_UA_LOAD_REGPAIR 6 -#define EX_TYPE_ZEROPAD 7#define EX_TYPE_FPC 8#define EX_DATA_REG_ERR_SHIFT 0
@@ -82,9 +81,6 @@#define EX_TABLE_UA_LOAD_REGPAIR (_fault, _target, _regerr, _regzero) \ __EX_TABLE(__ex_table, _fault, _target, EX_TYPE_UA_LOAD_REGPAIR, _regerr, _regzero, 0) -#define EX_TABLE_ZEROPAD (_fault, _target, _regdata, _regaddr) \ - __EX_TABLE(__ex_table, _fault, _target, EX_TYPE_ZEROPAD, _regdata, _regaddr, 0) -#define EX_TABLE_FPC (_fault, _target) \ __EX_TABLE(__ex_table, _fault, _target, EX_TYPE_FPC, __stringify(%%r0), __stringify(%%r0), 0)
arch/s390/include/asm/word-at-a-time.h +0 -22
@@ -4,7 +4,6 @@#include <linux/bitops.h> #include <linux/wordpart.h> -#include <asm/asm-extable.h> #include <asm/bitsperlong.h> struct word_at_a_time {
@@ -41,25 +40,4 @@ static inline unsigned long zero_bytemask(unsigned long data) return ~1UL << data; } -/* -* Load an unaligned word from kernel space. -* -* In the (very unlikely) case of the word being a page-crosser -* and the next page not being mapped, take the exception and -* return zeroes in the non-existing part. -*/ -static inline unsigned long load_unaligned_zeropad (const void *addr) -{ -unsigned long data; - - asmvolatile ( -"0: lg %[data],0(%[addr])\n" -"1: nopr %%r7\n" - EX_TABLE_ZEROPAD(0b, 1b, %[data], %[addr]) - EX_TABLE_ZEROPAD(1b, 1b, %[data], %[addr]) - : [data] "=d" (data) - : [addr] "a" (addr), "m" (*(unsigned long *)addr)); -return data; -} -#endif /* _ASM_WORD_AT_A_TIME_H */
arch/s390/mm/extable.c +0 -18
@@ -61,22 +61,6 @@ static bool ex_handler_ua_load_reg(const struct exception_table_entry *ex,return true; } -static bool ex_handler_zeropad (const struct exception_table_entry *ex,struct pt_regs *regs) -{ -unsigned int reg_addr =FIELD_GET (EX_DATA_REG_ADDR , ex->data); -unsigned int reg_data =FIELD_GET (EX_DATA_REG_ERR , ex->data); -unsigned long data, addr, offset; - - addr = regs->gprs[reg_addr]; - offset = addr & (sizeof (unsigned long ) -1 ); - addr &= ~(sizeof (unsigned long ) -1 ); - data = *(unsigned long *)addr; - data <<=BITS_PER_BYTE * offset; - regs->gprs[reg_data] = data; - regs->psw.addr =extable_fixup (ex); -return true; -} -static bool ex_handler_fpc (const struct exception_table_entry *ex,struct pt_regs *regs) { asmvolatile ("sfpc %[val]\n" : : [val]"d" (0 ));
@@ -104,8 +88,6 @@ bool fixup_exception(struct pt_regs *regs)return ex_handler_ua_load_reg (ex, false, regs);case EX_TYPE_UA_LOAD_REGPAIR :return ex_handler_ua_load_reg (ex, true, regs); -case EX_TYPE_ZEROPAD : -return ex_handler_zeropad (ex, regs);case EX_TYPE_FPC :return ex_handler_fpc (ex, regs); }
Signature · 1 line
2.53.0
Re: [PATCH 6.12.y] s390: Revert support for DCACHE_WORD_ACCESS
Quoted 3 lines
An attempt to fix this [1] turned out to be not sufficient. For now revert
load_unaligned_zeropad()until this problem has been resolved in a proper way.
Queued for 6.12, thanks.
Signature · 2 lines
Thanks, Sasha