]> www.infradead.org Git - users/dwmw2/linux.git/log
users/dwmw2/linux.git
3 months agos390/vmlogrdr: Use internal_name for error messages
Heiko Carstens [Fri, 24 Jan 2025 13:51:53 +0000 (14:51 +0100)]
s390/vmlogrdr: Use internal_name for error messages

Use the internal_name member of vmlogrdr_priv_t to print error messages
instead of the system_service member. The system_service member is not a
string, but a non-null terminated eight byte character array, which
contains the ASCII representation of a z/VM system service.

Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/sclp: Initialize sclp subsystem via arch_cpu_finalize_init()
Heiko Carstens [Mon, 20 Jan 2025 10:53:42 +0000 (11:53 +0100)]
s390/sclp: Initialize sclp subsystem via arch_cpu_finalize_init()

With the switch to GENERIC_CPU_DEVICES an early call to the sclp subsystem
was added to smp_prepare_cpus(). This will usually succeed since the sclp
subsystem is implicitly initialized early enough if an sclp based console
is present.

If no such console is present the initialization happens with an
arch_initcall(); in such cases calls to the sclp subsystem will fail.
For CPU detection this means that the fallback sigp loop will be used
permanently to detect CPUs instead of the preferred READ_CPU_INFO sclp
request.

Fix this by adding an explicit early sclp_init() call via
arch_cpu_finalize_init().

Reported-by: Sheshu Ramanandan <sheshu.ramanandan@ibm.com>
Fixes: 4a39f12e753d ("s390/smp: Switch to GENERIC_CPU_DEVICES")
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/tools: Use array instead of string initializer
Heiko Carstens [Fri, 24 Jan 2025 13:51:52 +0000 (14:51 +0100)]
s390/tools: Use array instead of string initializer

The in-kernel disassembler intentionally uses nun-null terminated
strings in order to keep the arrays which contain mnemonics as small
as possible. GCC 15 however warns about this:

./arch/s390/include/generated/asm/dis-defs.h:1662:71: error: initializer-string
 for array of ‘char’ is too long [-Werror=unterminated-string-initialization]
 1662 |         [1261] = { .opfrag = 0xea, .format = INSTR_SS_L0RDRD, .name = "unpka" }, \

Get rid of this warning by using array initializers.

Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/vmem: Fix null-pointer-arithmetic warning in vmem_map_init()
Vasily Gorbik [Mon, 27 Jan 2025 14:23:02 +0000 (15:23 +0100)]
s390/vmem: Fix null-pointer-arithmetic warning in vmem_map_init()

Fixes the following clang warning introduced by commit d7bebcb4a898
("s390: Optimize __pa/__va when RANDOMIZE_IDENTITY_BASE is off")

arch/s390/mm/vmem.c:665:36: warning: performing pointer arithmetic on
a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
  665 |                 __set_memory_4k(__va(0), __va(0) + ident_map_size);
      |                                          ~~~~~~~ ^

Fixes: d7bebcb4a898 ("s390: Optimize __pa/__va when RANDOMIZE_IDENTITY_BASE is off")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501270309.HzsVNo3o-lkp@intel.com/
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390: Add '-std=gnu11' to decompressor and purgatory CFLAGS
Nathan Chancellor [Thu, 23 Jan 2025 02:54:27 +0000 (19:54 -0700)]
s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS

GCC changed the default C standard dialect from gnu17 to gnu23,
which should not have impacted the kernel because it explicitly requests
the gnu11 standard in the main Makefile. However, there are certain
places in the s390 code that use their own CFLAGS without a '-std='
value, which break with this dialect change because of the kernel's own
definitions of bool, false, and true conflicting with the C23 reserved
keywords.

  include/linux/stddef.h:11:9: error: cannot use keyword 'false' as enumeration constant
     11 |         false   = 0,
        |         ^~~~~
  include/linux/stddef.h:11:9: note: 'false' is a keyword with '-std=c23' onwards
  include/linux/types.h:35:33: error: 'bool' cannot be defined via 'typedef'
     35 | typedef _Bool                   bool;
        |                                 ^~~~
  include/linux/types.h:35:33: note: 'bool' is a keyword with '-std=c23' onwards

Add '-std=gnu11' to the decompressor and purgatory CFLAGS to eliminate
these errors and make the C standard version of these areas match the
rest of the kernel.

Cc: stable@vger.kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20250122-s390-fix-std-for-gcc-15-v1-1-8b00cadee083@kernel.org
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/bitops: Use correct constraint for arch_test_bit() inline assembly
Heiko Carstens [Thu, 23 Jan 2025 08:14:15 +0000 (09:14 +0100)]
s390/bitops: Use correct constraint for arch_test_bit() inline assembly

Use the "Q" instead of "R" constraint to correctly reflect the instruction
format of the tm instruction: the first operand is a memory reference
without index register and short displacement. The "R" constraint indicates
a memory reference with index register instead.

This may lead to compile errors like:

  arch/s390/include/asm/bitops.h: Assembler messages:
  arch/s390/include/asm/bitops.h:60: Error: operand 1: syntax error; missing ')' after base register
  arch/s390/include/asm/bitops.h:60: Error: operand 2: syntax error; ')' not allowed here
  arch/s390/include/asm/bitops.h:60: Error: junk at end of line: `,4'

Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/r/20250122-s390-fix-std-for-gcc-15-v1-1-8b00cadee083@kernel.org
Fixes: b2bc1b1a77c0 ("s390/bitops: Provide optimized arch_test_bit()")
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/pci: Fix SR-IOV for PFs initially in standby
Niklas Schnelle [Wed, 22 Jan 2025 13:36:01 +0000 (14:36 +0100)]
s390/pci: Fix SR-IOV for PFs initially in standby

Since commit 25f39d3dcb48 ("s390/pci: Ignore RID for isolated VFs") PFs
which are not initially configured but in standby are considered
isolated. That is they create only a single function PCI domain. Due to
the PCI domains being created on discovery, this means that even if they
are configured later on, sibling PFs and their child VFs will not be
added to their PCI domain breaking SR-IOV expectations.

The reason the referenced commit ignored standby PFs for the creation of
multi-function PCI subhierarchies, was to work around a PCI domain
renumbering scenario on reboot. The renumbering would occur after
removing a previously in standby PF, whose domain number is used for its
configured sibling PFs and their child VFs, but which itself remained in
standby. When this is followed by a reboot, the sibling PF is used
instead to determine the PCI domain number of it and its child VFs.

In principle it is not possible to know which standby PFs will be
configured later and which may be removed. The PCI domain and root bus
are pre-requisites for hotplug slots so the decision of which functions
belong to which domain can not be postponed. With the renumbering
occurring only in rare circumstances and being generally benign, accept
it as an oddity and fix SR-IOV for initially standby PFs simply by
allowing them to create PCI domains.

Cc: stable@vger.kernel.org
Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com>
Fixes: 25f39d3dcb48 ("s390/pci: Ignore RID for isolated VFs")
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/futex: Avoid KMSAN instrumention for user pointers
Heiko Carstens [Tue, 21 Jan 2025 14:55:03 +0000 (15:55 +0100)]
s390/futex: Avoid KMSAN instrumention for user pointers

Similar to commit eb6efdfeaeca ("s390/uaccess: add KMSAN support to
put_user() and get_user()") disable KMSAN instrumention for futex inline
assemblies, which contain dereferenced user pointers. With KMSAN
instrumentation this would lead to accesses of shadows for user pointers,
which should not happen.

Handle the futex operations like they copy a value (old) from user
space to kernel space.

Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/uaccess: Rename get_put_user_noinstr_attributes to uaccess_kmsan_or_inline
Heiko Carstens [Tue, 21 Jan 2025 14:55:02 +0000 (15:55 +0100)]
s390/uaccess: Rename get_put_user_noinstr_attributes to uaccess_kmsan_or_inline

Rename get_put_user_noinstr_attributes to a more generic
uaccess_kmsan_or_inline name. This allows to use it for other non
put_user()/get_user() uaccess functions withour causing confusion.

Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/futex: Cleanup futex_atomic_cmpxchg_inatomic()
Heiko Carstens [Tue, 21 Jan 2025 14:55:01 +0000 (15:55 +0100)]
s390/futex: Cleanup futex_atomic_cmpxchg_inatomic()

Cleanup the futex_atomic_cmpxchg_inatomic() inline assembly to make it
a bit more readable.

Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/futex: Generate futex atomic op functions
Heiko Carstens [Tue, 21 Jan 2025 14:55:00 +0000 (15:55 +0100)]
s390/futex: Generate futex atomic op functions

Cleanup the futex atomic op inline assembly and generate a function for
each futex atomic op. This makes the code hopefully a bit more readable.

Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/uaccess: Remove INLINE_COPY_FROM_USER and INLINE_COPY_TO_USER
Heiko Carstens [Thu, 16 Jan 2025 15:24:31 +0000 (16:24 +0100)]
s390/uaccess: Remove INLINE_COPY_FROM_USER and INLINE_COPY_TO_USER

The s390 implementations of raw_copy_from_user() and raw_copy_to_user() are
never inlined. However INLINE_COPY_FROM_USER and INLINE_COPY_TO_USER are
still set. This leads to the odd situation that only the error handling
(memset to zero of the not copied bytes) of copy_from_user() is inlined,
while the actual fast path code is out-of-line.

This would make sense if raw_copy_from_user() and raw_copy_to_user() were
implemented in assembler files, where inlining is not possible. But the
current s390 setup does not make any sense.

Address this by moving the raw uaccess copy inline assemblies to the
uaccess header file, and remove INLINE_COPY_FROM_USER and
INLINE_COPY_TO_USER definitions. This way the uaccess code, but now
including error handling, is still out-of-line with the common code
_copy_from_user() and _copy_to_user() variants, which inline the raw
uaccess functions via _inline_copy_from_user() and _inline_copy_to_user().

This reduces the size of the kernel image by ~17kb.
(defconfig, gcc 14.2.0)

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/uaccess: Use asm goto for put_user()/get_user()
Heiko Carstens [Mon, 13 Jan 2025 12:37:06 +0000 (13:37 +0100)]
s390/uaccess: Use asm goto for put_user()/get_user()

Use asm goto if available for put_user() and get_user().
This generates slightly better code.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/uaccess: Remove usage of the oac specifier
Heiko Carstens [Mon, 13 Jan 2025 12:37:05 +0000 (13:37 +0100)]
s390/uaccess: Remove usage of the oac specifier

Remove usage of the operand access control specifier for put_user()
and get_user() (again). Instead hardcode the specifier for both inline
assemblies. This saves one instruction.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/uaccess: Replace EX_TABLE_UA_LOAD_MEM exception handling
Heiko Carstens [Mon, 13 Jan 2025 12:37:04 +0000 (13:37 +0100)]
s390/uaccess: Replace EX_TABLE_UA_LOAD_MEM exception handling

Remove EX_TABLE_UA_LOAD_MEM exception handling and replace it with
EX_TABLE_UA_FAULT. Open code the return code check, and also open code
setting of the destination to zero in case of an error. In almost all cases
the compiler is able to optimize the open coded checks away, since all
users of get_users() must check the return code, and are not supposed to
use the result in case of an error.

In addition this allows to change the get_user() inline assembly so that
the "Q" constraint can be used for the destination, instead of only an "a"
constraint. This generates slightly better code.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/uaccess: Cleanup noinstr __put_user()/__get_user() inline assembly constraints
Heiko Carstens [Mon, 13 Jan 2025 12:37:03 +0000 (13:37 +0100)]
s390/uaccess: Cleanup noinstr __put_user()/__get_user() inline assembly constraints

Remove superfluous underscores, brackets, and early clobber to make
the code a bit more readable.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/uaccess: Remove __put_user_fn()/__get_user_fn() wrappers
Heiko Carstens [Mon, 13 Jan 2025 12:37:02 +0000 (13:37 +0100)]
s390/uaccess: Remove __put_user_fn()/__get_user_fn() wrappers

The __put_user_fn() and __get_user_fn() wrappers are leftovers from the
time where the kernel was compiled with or without mvcos support plus they
were later used to workaround the problems that came with asm register
constructs.

Both reasons do not exist anymore, therefore remove the wrappers and
shorten the code.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/uaccess: Move put_user() / __put_user() close to put_user() asm code
Heiko Carstens [Mon, 13 Jan 2025 12:37:01 +0000 (13:37 +0100)]
s390/uaccess: Move put_user() / __put_user() close to put_user() asm code

Keep put_user() and get_user() code separated.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/uaccess: Use asm goto for __mvc_kernel_nofault()
Heiko Carstens [Mon, 13 Jan 2025 12:37:00 +0000 (13:37 +0100)]
s390/uaccess: Use asm goto for __mvc_kernel_nofault()

Use asm goto for __mvc_kernel_nofault() if available. This generates
slightly better code, since the error checking happens implicitly with
the goto (aka exception) and the good path comes without any checks and
branches.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/uaccess: Implement __get_kernel_nofault()/__put_kernel_nofault() with mvc
Heiko Carstens [Mon, 13 Jan 2025 12:36:59 +0000 (13:36 +0100)]
s390/uaccess: Implement __get_kernel_nofault()/__put_kernel_nofault() with mvc

Use the mvc instruction in order to implement __get_kernel_nofault() and
__put_kernel_nofault(). Both functions have a source and destination
address where the code is supposed to read from and write to. Use the mvc
instruction to copy from source to destination instead of lg/stg like
instructions. This generates slightly better code.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/extable: Rename EX_TABLE_UA_STORE to EX_TABLE_UA_FAULT
Heiko Carstens [Mon, 13 Jan 2025 12:36:58 +0000 (13:36 +0100)]
s390/extable: Rename EX_TABLE_UA_STORE to EX_TABLE_UA_FAULT

Rename EX_TABLE_UA_STORE to a more generic EX_TABLE_UA_FAULT
name. This allows to use the extable type also for uaccess inline
assemblies which read from userspace, without causing confusion.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/fpu: Use CONFIG_CC_HAS_ASM_AOR_FORMAT_FLAGS instead of CONFIG_CC_IS_CLANG
Heiko Carstens [Mon, 13 Jan 2025 12:36:57 +0000 (13:36 +0100)]
s390/fpu: Use CONFIG_CC_HAS_ASM_AOR_FORMAT_FLAGS instead of CONFIG_CC_IS_CLANG

Use the more precise CONFIG_CC_HAS_ASM_AOR_FORMAT_FLAGS to tell if the
compiler has support for the A, O, and R inline assembly format flags.
This allows recent Clang compilers to generate better code.

Move code around so the good (aka better) case at the top of each ifdef
construct.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390: Introduce CC_HAS_ASM_AOR_FORMAT_FLAGS Kconfig option
Heiko Carstens [Mon, 13 Jan 2025 12:36:56 +0000 (13:36 +0100)]
s390: Introduce CC_HAS_ASM_AOR_FORMAT_FLAGS Kconfig option

Introduce CC_HAS_ASM_AOR_FORMAT_FLAGS Kconfig option. Use this option for
inline assemblies where the A, O, or R format flags are used.
Those flags are not available for Clang versions before 19.1.0.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390: Rename GCC_ASM_FLAG_OUTPUT_BROKEN to CC_ASM_FLAG_OUTPUT_BROKEN
Heiko Carstens [Mon, 13 Jan 2025 12:36:55 +0000 (13:36 +0100)]
s390: Rename GCC_ASM_FLAG_OUTPUT_BROKEN to CC_ASM_FLAG_OUTPUT_BROKEN

Config options which can be used to check for compiler bugs and features
have the compiler independent CC prefix in order to avoid duplicating and
having to check config options for multiple compilers. Therefore rename the
config option accordingly.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/extable: Replace open-coded sfpc inline assembly with fpu_sfpc()
Heiko Carstens [Fri, 10 Jan 2025 10:52:18 +0000 (11:52 +0100)]
s390/extable: Replace open-coded sfpc inline assembly with fpu_sfpc()

Use fpc_sfpc() instead of open-coding.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/fpu: Add fpc exception handler / remove fixup section again
Heiko Carstens [Fri, 10 Jan 2025 10:52:17 +0000 (11:52 +0100)]
s390/fpu: Add fpc exception handler / remove fixup section again

The fixup section was added again by mistake when test_fp_ctl() was
removed. The reason for the removal of the fixup section is described in
commit 484a8ed8b7d1 ("s390/extable: add dedicated uaccess handler").
Remove it again for the same reason.

Add an exception handler which handles exceptions when the floating point
control register is attempted to be set to invalid values. The exception
handler sets the floating point control register to zero and continues
execution at the specified address.

The new sfpc inline assembly is open-coded to make back porting a bit
easier.

Fixes: 702644249d3e ("s390/fpu: get rid of test_fp_ctl()")
Cc: stable@vger.kernel.org
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/ipl_report: Remove unused 'size' variable
Vasily Gorbik [Wed, 11 Dec 2024 11:33:45 +0000 (12:33 +0100)]
s390/ipl_report: Remove unused 'size' variable

Remove unused since commit f913a6600491 ("s390/boot: rework decompressor
reserved tracking") 'size' variable from get_cert_comp_list_size().

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390: Optimize __pa/__va when RANDOMIZE_IDENTITY_BASE is off
Vasily Gorbik [Wed, 11 Dec 2024 11:29:40 +0000 (12:29 +0100)]
s390: Optimize __pa/__va when RANDOMIZE_IDENTITY_BASE is off

Use a zero identity base when CONFIG_RANDOMIZE_IDENTITY_BASE is off,
slightly optimizing __pa/__va calculations.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Improve decompression error reporting
Vasily Gorbik [Thu, 12 Dec 2024 15:39:05 +0000 (16:39 +0100)]
s390/boot: Improve decompression error reporting

Currently, decompression error messages can be very uninformative:
[    0.029853] startup: read error
[    0.040507] startup:  -- System halted

Improve these messages to make it clear that the error originates from
the decompression code. Additionally, on decompression failures, if
bootdebug is enabled, dump the message ring buffer before halting. This
provides more context for diagnosing startup issues.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add startup debugging support
Vasily Gorbik [Wed, 11 Dec 2024 15:57:21 +0000 (16:57 +0100)]
s390/boot: Add startup debugging support

Add boot_debug() calls to log various memory layout decisions and
randomization details during early startup, improving debugging
capabilities.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add vmem debugging support
Vasily Gorbik [Wed, 11 Dec 2024 11:11:04 +0000 (12:11 +0100)]
s390/boot: Add vmem debugging support

Introduce boot_debug() calls in vmem code to log page table mappings
including KASAN shadow mappings for improved early boot debugging.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Move command line parsing earlier
Vasily Gorbik [Wed, 11 Dec 2024 10:59:50 +0000 (11:59 +0100)]
s390/boot: Move command line parsing earlier

Reorder the store_ipl_parmblock(), uv_query_info(), and command line
setup calls to occur earlier. This ensures debug printing covers all
memory tracking activities from the start.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add physmem tracking debug support
Vasily Gorbik [Wed, 11 Dec 2024 10:06:19 +0000 (11:06 +0100)]
s390/boot: Add physmem tracking debug support

Introduce boot_debug() calls to track memory detection, online ranges,
reserved areas, and allocations (except for VMEM allocations, which are
too frequent). Instead introduce dump_physmem_reserved() function which
prints out full memory tracking information. This helps in debugging
early boot memory handling.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390: Use pr_info for "KernelAddressSanitizer initialized" message
Vasily Gorbik [Fri, 29 Nov 2024 11:57:44 +0000 (12:57 +0100)]
s390: Use pr_info for "KernelAddressSanitizer initialized" message

sclp_early_printk() ignores boot console debug settings and prints
unconditionally. It also prints message without any timestamp
or formatting. Convert it to pr_info().

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add timestamps to early boot messages
Vasily Gorbik [Fri, 29 Nov 2024 11:56:48 +0000 (12:56 +0100)]
s390/boot: Add timestamps to early boot messages

When CONFIG_PRINTK_TIME is enabled, add timestamps to boot messages in
the same format as regular printk. Timestamps appear only with earlyprintk
and are stored in the boot messages ring buffer, but are not propagated
to main kernel messages (if earlyprintk is not enabled). This prevents
double timestamps in the output.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Dump message ring buffer on crash with bootdebug
Vasily Gorbik [Wed, 20 Nov 2024 19:30:10 +0000 (20:30 +0100)]
s390/boot: Dump message ring buffer on crash with bootdebug

Dump the boot message ring buffer when a crash occurs during boot, but
only if bootdebug is enabled. This helps assist in analyzing boot-time
issues by providing additional debugging information.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add prefix filtering to bootdebug messages
Vasily Gorbik [Fri, 22 Nov 2024 23:02:25 +0000 (00:02 +0100)]
s390/boot: Add prefix filtering to bootdebug messages

Enhance boot debugging by allowing the "bootdebug" kernel parameter to
accept an optional comma-separated list of prefixes. Only debug messages
starting with these prefixes will be printed during boot. For example:

    bootdebug=startup,vmem

Not specifying a filter for the "bootdebug" parameter prints all debug
messages. The `boot_fmt` macro can be defined to set a common prefix:

    #define boot_fmt(fmt) "startup: " fmt

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add bootdebug option to control debug messages
Vasily Gorbik [Wed, 20 Nov 2024 21:23:48 +0000 (22:23 +0100)]
s390/boot: Add bootdebug option to control debug messages

Suppress decompressor debug messages by default, similar to regular
kernel debug messages that require 'DEBUG' or 'dyndbg' to be enabled
(depending on CONFIG_DYNAMIC_DEBUG). Introduce a 'bootdebug' option to
enable printing these messages when needed.

All messages are still stored in the boot ring buffer regardless.

To enable boot debug messages:

  bootdebug debug

Or combine with 'earlyprintk' to print them without delay:

  bootdebug debug earlyprintk

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Defer boot messages when earlyprintk is not enabled
Vasily Gorbik [Wed, 20 Nov 2024 20:46:17 +0000 (21:46 +0100)]
s390/boot: Defer boot messages when earlyprintk is not enabled

When earlyprintk is not specified, boot messages are only stored in a
ring buffer to be printed later by printk when console driver is
registered.

Critical messages from boot_emerg() are always printed immediately,
even without earlyprintk.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Make boot_printk() return int
Vasily Gorbik [Wed, 20 Nov 2024 19:36:46 +0000 (20:36 +0100)]
s390/boot: Make boot_printk() return int

Modify boot_printk() to return int, aligning it with printk().

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Introduce ring buffer for boot messages
Vasily Gorbik [Wed, 20 Nov 2024 19:10:50 +0000 (20:10 +0100)]
s390/boot: Introduce ring buffer for boot messages

Collect all boot messages into a ring buffer independent of the current
log level. This allows to retain all boot-time messages, which is
particularly useful for analyzing early crashes.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Use decimal format specifiers in boot messages
Vasily Gorbik [Sun, 24 Nov 2024 13:47:58 +0000 (14:47 +0100)]
s390/boot: Use decimal format specifiers in boot messages

Now that boot_printk() supports decimal specifiers, update boot_emerg()
messages to use %d and %lu instead of %x and %lx where appropriate.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Replace boot_printk() with loglevel-specific helpers
Vasily Gorbik [Wed, 20 Nov 2024 16:07:56 +0000 (17:07 +0100)]
s390/boot: Replace boot_printk() with loglevel-specific helpers

Replaces boot_printk() calls with appropriate loglevel-specific helpers
such as boot_emerg(), boot_warn(), and boot_debug().

Using functions with explicit log levels improves log clarity and aligns
the boot code with standard kernel logging practices. This makes it
easier to filter and manage boot-time messages based on their severity.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add support for boot messages loglevels
Vasily Gorbik [Wed, 20 Nov 2024 15:56:12 +0000 (16:56 +0100)]
s390/boot: Add support for boot messages loglevels

Add message severity levels for boot messages, similar to the main
kernel. Support command-line options that control console output
verbosity, including "loglevel," "ignore_loglevel," "debug," and "quiet".

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add decimal conversion specifiers to boot_printk()
Vasily Gorbik [Thu, 28 Nov 2024 01:35:17 +0000 (02:35 +0100)]
s390/boot: Add decimal conversion specifiers to boot_printk()

Enable the boot_printk() function to print decimal values. Add the 'd',
'i', and 'u' conversion specifiers support.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add field width and padding handling to boot_printk()
Vasily Gorbik [Thu, 28 Nov 2024 01:22:54 +0000 (02:22 +0100)]
s390/boot: Add field width and padding handling to boot_printk()

Enhance boot_printk() to support field width and padding across all
argument types for better formatting.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add length modifiers to boot_printk()
Vasily Gorbik [Wed, 20 Nov 2024 15:10:55 +0000 (16:10 +0100)]
s390/boot: Add length modifiers to boot_printk()

Add support for the 'l', 'h', 'hh', and 'z' length modifiers.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add %% support to boot_printk()
Vasily Gorbik [Wed, 20 Nov 2024 14:58:56 +0000 (15:58 +0100)]
s390/boot: Add %% support to boot_printk()

Add "%%" support for the boot_printk() format string.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Allow KASAN mapping to fallback to small pages
Vasily Gorbik [Tue, 10 Dec 2024 10:18:32 +0000 (11:18 +0100)]
s390/boot: Allow KASAN mapping to fallback to small pages

For KASAN shadow mappings, switch from physmem_alloc_or_die() to
physmem_alloc() and return INVALID_PHYS_ADDR on allocation failure. This
allows gracefully falling back from large pages to smaller pages (1MB
or 4KB) if the allocation of 2GB size/aligned pages cannot be fulfilled.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Add physmem_alloc()
Vasily Gorbik [Fri, 29 Nov 2024 01:26:19 +0000 (02:26 +0100)]
s390/boot: Add physmem_alloc()

Add physmem_alloc() as a variant of physmem_alloc_or_die() that can return
an error instead of triggering a panic on OOM. This allows callers to
implement alternative fallback paths.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/boot: Rename physmem_alloc_top_down() to physmem_alloc_or_die()
Vasily Gorbik [Thu, 12 Dec 2024 23:59:26 +0000 (00:59 +0100)]
s390/boot: Rename physmem_alloc_top_down() to physmem_alloc_or_die()

The new name better reflects the function's behavior, emphasizing that
it will terminate execution if allocation fails.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/mm: Allow large pages for KASAN shadow mapping
Vasily Gorbik [Fri, 29 Nov 2024 00:49:26 +0000 (01:49 +0100)]
s390/mm: Allow large pages for KASAN shadow mapping

Commit c98d2ecae08f ("s390/mm: Uncouple physical vs virtual address
spaces") introduced a large_allowed() helper that restricts which mapping
modes can use large pages. This change unintentionally prevented KASAN
shadow mappings from using large pages, despite there being no reason
to avoid them. In fact, large pages are preferred for performance.

Since commit d8073dc6bc04 ("s390/mm: Allow large pages only for aligned
physical addresses"), both can_large_pud() and can_large_pmd() call _pa()
to check if large page physical addresses are aligned. However, _pa()
has a side effect: it allocates memory in POPULATE_KASAN_MAP_SHADOW
mode.

Rename large_allowed() to large_page_mapping_allowed() and add
POPULATE_KASAN_MAP_SHADOW to the allowed list to restore large page
mappings for KASAN shadows.

While large_page_mapping_allowed() isn't strictly necessary with current
mapping modes since disallowed modes either don't map anything or fail
alignment and size checks, keep it for clarity.

Rename _pa() to resolve_pa_may_alloc() for clarity and to emphasize
existing side effect. Rework can_large_pud()/can_large_pmd() to take
the side effect into consideration and actually return physical address
instead of just checking conditions.

Fixes: c98d2ecae08f ("s390/mm: Uncouple physical vs virtual address spaces")
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/futex: Fix FUTEX_OP_ANDN implementation
Heiko Carstens [Tue, 7 Jan 2025 10:28:58 +0000 (11:28 +0100)]
s390/futex: Fix FUTEX_OP_ANDN implementation

The futex operation FUTEX_OP_ANDN is supposed to implement

*(int *)UADDR2 &= ~OPARG;

The s390 implementation just implements an AND instead of ANDN.
Add the missing bitwise not operation to oparg to fix this.

This is broken since nearly 19 years, so it looks like user space is
not making use of this operation.

Fixes: 3363fbdd6fb4 ("[PATCH] s390: futex atomic operations")
Cc: stable@vger.kernel.org
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/diag: Add memory topology information via diag310
Mete Durlu [Tue, 14 Jan 2025 16:03:09 +0000 (17:03 +0100)]
s390/diag: Add memory topology information via diag310

Introduce diag310 and memory topology related subcodes.
Provide memory topology information obtanied from diag310 to userspace
via diag ioctl.

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/bitops: Provide optimized arch_test_bit()
Heiko Carstens [Fri, 13 Dec 2024 12:27:34 +0000 (13:27 +0100)]
s390/bitops: Provide optimized arch_test_bit()

Provide an optimized arch_test_bit() implementation which makes use of
flag output constraint. This generates slightly better code:

bloat-o-meter:
add/remove: 51/19 grow/shrink: 450/2444 up/down: 25198/-49136 (-23938)

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/bitops: Switch to generic bitops
Heiko Carstens [Fri, 13 Dec 2024 12:27:33 +0000 (13:27 +0100)]
s390/bitops: Switch to generic bitops

The generic bitops implementation is nearly identical to the s390
implementation therefore switch to the generic variant.

This results in a small kernel image size decrease. This is because for
the generic variant the nr parameter for most bitops functions is of
type unsigned int while the s390 variant uses unsigned long.

bloat-o-meter:
add/remove: 670/670 grow/shrink: 167/209 up/down: 21440/-21792 (-352)

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/ebcdic: Fix length decrement in codepage_convert()
Sven Schnelle [Wed, 8 Jan 2025 14:27:06 +0000 (15:27 +0100)]
s390/ebcdic: Fix length decrement in codepage_convert()

The inline assembly uses the ahi instruction to decrement and test
whether more than 256 bytes are left for conversion. But the nr
variable passed is of type unsigned long. Therefore use aghi.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reported-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/ebcdic: Fix length check in codepage_convert()
Sven Schnelle [Wed, 8 Jan 2025 14:27:05 +0000 (15:27 +0100)]
s390/ebcdic: Fix length check in codepage_convert()

The current code compares whether the nr argument is less or equal to
zero. As nr is of type unsigned long, this isn't correct. Fix this by just
testing for zero. This is also reported by checkpatch:

unsignedLessThanZero: Checking if unsigned expression 'nr--' is less
than zero.

Reported-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/ebcdic: Use exrl instead of ex
Sven Schnelle [Wed, 8 Jan 2025 14:27:04 +0000 (15:27 +0100)]
s390/ebcdic: Use exrl instead of ex

exrl is present in all machines currently supported, therefore prefer
it over ex. This saves one instruction and doesn't need an additional
register to hold the address of the target instruction.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/amode31: Use exrl instead of ex
Sven Schnelle [Wed, 8 Jan 2025 14:27:03 +0000 (15:27 +0100)]
s390/amode31: Use exrl instead of ex

exrl is present in all machines currently supported, therefore prefer
it over ex. This saves one instruction and doesn't need an additional
register to hold the address of the target instruction.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/stackleak: Use exrl instead of ex in __stackleak_poison()
Sven Schnelle [Wed, 8 Jan 2025 14:27:02 +0000 (15:27 +0100)]
s390/stackleak: Use exrl instead of ex in __stackleak_poison()

exrl is present in all machines currently supported, therefore prefer
it over ex. This saves one instruction and doesn't need an additional
register to hold the address of the target instruction.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/lib: Use exrl instead of ex in xor functions
Sven Schnelle [Wed, 8 Jan 2025 14:27:01 +0000 (15:27 +0100)]
s390/lib: Use exrl instead of ex in xor functions

exrl is present in all machines currently supported, therefore prefer
it over ex. This saves one instruction and doesn't need an additional
register to hold the address of the target instruction.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/topology: Improve topology detection
Mete Durlu [Wed, 8 Jan 2025 10:31:27 +0000 (11:31 +0100)]
s390/topology: Improve topology detection

Add early polarization detection instead of assuming horizontal
polarization.

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/tlb: Add missing TLB range adjustment
Alexander Gordeev [Tue, 7 Jan 2025 07:40:06 +0000 (08:40 +0100)]
s390/tlb: Add missing TLB range adjustment

While converting to generic mmu_gather with commit 9de7d833e370
("s390/tlb: Convert to generic mmu_gather") __tlb_adjust_range()
is called from pte|pmd|p4d_free_tlb(), but not for pud_free_tlb().

__tlb_adjust_range() adjusts the span of TLB range to be flushed,
but s390 does not make use of it. Thus, this change is only for
consistency.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/pkey: Constify 'struct bin_attribute'
Thomas Weißschuh [Wed, 11 Dec 2024 17:54:43 +0000 (18:54 +0100)]
s390/pkey: Constify 'struct bin_attribute'

The sysfs core now allows instances of 'struct bin_attribute' to be
moved into read-only memory. Make use of that to protect them against
accidental or malicious modifications.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Tested-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Link: https://lore.kernel.org/r/20241211-sysfs-const-bin_attr-s390-v1-5-be01f66bfcf7@weissschuh.net
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/sclp: Constify 'struct bin_attribute'
Thomas Weißschuh [Wed, 11 Dec 2024 17:54:42 +0000 (18:54 +0100)]
s390/sclp: Constify 'struct bin_attribute'

The sysfs core now allows instances of 'struct bin_attribute' to be
moved into read-only memory. Make use of that to protect them against
accidental or malicious modifications.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Link: https://lore.kernel.org/r/20241211-sysfs-const-bin_attr-s390-v1-4-be01f66bfcf7@weissschuh.net
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/pci: Constify 'struct bin_attribute'
Thomas Weißschuh [Wed, 11 Dec 2024 17:54:41 +0000 (18:54 +0100)]
s390/pci: Constify 'struct bin_attribute'

The sysfs core now allows instances of 'struct bin_attribute' to be
moved into read-only memory. Make use of that to protect them against
accidental or malicious modifications.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Link: https://lore.kernel.org/r/20241211-sysfs-const-bin_attr-s390-v1-3-be01f66bfcf7@weissschuh.net
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/ipl: Constify 'struct bin_attribute'
Thomas Weißschuh [Wed, 11 Dec 2024 17:54:40 +0000 (18:54 +0100)]
s390/ipl: Constify 'struct bin_attribute'

The sysfs core now allows instances of 'struct bin_attribute' to be
moved into read-only memory. Make use of that to protect them against
accidental or malicious modifications.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Link: https://lore.kernel.org/r/20241211-sysfs-const-bin_attr-s390-v1-2-be01f66bfcf7@weissschuh.net
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/crypto/cpacf: Constify 'struct bin_attribute'
Thomas Weißschuh [Wed, 11 Dec 2024 17:54:39 +0000 (18:54 +0100)]
s390/crypto/cpacf: Constify 'struct bin_attribute'

The sysfs core now allows instances of 'struct bin_attribute' to be
moved into read-only memory. Make use of that to protect them against
accidental or malicious modifications.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Tested-by: Finn Callies <fcallies@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Link: https://lore.kernel.org/r/20241211-sysfs-const-bin_attr-s390-v1-1-be01f66bfcf7@weissschuh.net
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/qdio: Move memory alloc/pointer arithmetic for slib and sl into one place
Benjamin Block [Wed, 5 Apr 2023 14:28:34 +0000 (16:28 +0200)]
s390/qdio: Move memory alloc/pointer arithmetic for slib and sl into one place

Instead of distributing the memory allocation and pointer arithmetic to
place slib and sl on the page that is allocated for them over multiple
functions and comments, move both into the same context directly next to
each other, so that the knowledge of how this is done is immediately
visible.

The actual layout in memory doesn't change with this, just the structure
of the code to achieve it.

Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/cio: Use array indices instead of pointer arithmetic
Benjamin Block [Tue, 4 Apr 2023 18:33:59 +0000 (20:33 +0200)]
s390/cio: Use array indices instead of pointer arithmetic

ccw_device_get_ciw() already uses array indices to iterate over the vector
of CIWs, but then switches to pointer arithmetic when returning the one it
found. Change this to make it more consistent.

Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 months agos390/qdio: Rename feature flag aif_osa to aif_qdio
Benjamin Block [Thu, 23 Mar 2023 16:40:41 +0000 (17:40 +0100)]
s390/qdio: Rename feature flag aif_osa to aif_qdio

This feature is not only utilized by OSA, but by QDIO in general. Clear
up possible confusions.

Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Acked-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agoMerge branch 'pci-device-recovery' into features
Alexander Gordeev [Wed, 18 Dec 2024 15:06:24 +0000 (16:06 +0100)]
Merge branch 'pci-device-recovery' into features

Niklas Schnelle says:

===================
This patch series enhances the introspectability of the PCI device
recovery for firmware. Until now when Linux performs recovery in
response to a firmware error report. For example, until now firmware
debug data would have no indication if the recovery was successfull or
if it failed, for example due to KVM pass-through.

Improve on this by reporting recovery status as well as some debug
information such as device driver name and s390dbf/pci_msg/sprintf logs
via the SCLP Write Event Data Action Qualifier 2 (Log Data provided)
mechanism.
===================

Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/diag: Move diag.c to diag specific folder
Sumanth Korikkar [Thu, 12 Dec 2024 16:17:20 +0000 (17:17 +0100)]
s390/diag: Move diag.c to diag specific folder

Move implementation of s390 diagnose code to diag specific folder.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/diag324: Retrieve power readings via diag 0x324
Sumanth Korikkar [Thu, 12 Dec 2024 16:17:19 +0000 (17:17 +0100)]
s390/diag324: Retrieve power readings via diag 0x324

Retrieve electrical power readings for resources in a computing
environment via diag 0x324. diag 0x324 stores the power readings in the
power information block (pib).

Provide power readings from pib via diag324 ioctl interface.  diag324
ioctl provides new pib to the user only if the threshold time has passed
since the last call. Otherwise, cache data is returned. When there are
no active readers, cleanup of pib buffer is performed.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/diag: Create misc device /dev/diag
Sumanth Korikkar [Thu, 12 Dec 2024 16:17:18 +0000 (17:17 +0100)]
s390/diag: Create misc device /dev/diag

Create a misc device /dev/diag to fetch diagnose specific information
from the kernel and provide it to userspace.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/lib: Use exrl instead of ex in string functions
Sven Schnelle [Thu, 12 Dec 2024 09:55:03 +0000 (10:55 +0100)]
s390/lib: Use exrl instead of ex in string functions

exrl is present in all machines currently supported in the linux
kernel, therefore prefer it over ex. This saves one instruction
and doesn't need an additional register to hold the address of the
target instruction.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/mm: Simplify noexec page protection handling
Heiko Carstens [Mon, 9 Dec 2024 09:45:18 +0000 (10:45 +0100)]
s390/mm: Simplify noexec page protection handling

By default page protection definitions like PAGE_RX have the _PAGE_NOEXEC
bit set. For older machines without the instruction execution protection
facility this bit is not allowed to be used in page table entries, and
therefore must be removed.

This is done at a couple of page table walkers, but also at some but not
all page table modification functions like ptep_modify_prot_commit(). Avoid
all of this and change the page, segment and region3 protection definitions
so that the noexec bit is masked out automatically if the instruction
execution-protection facility is not available. This is similar to what
also various other architectures do which had to solve the same problem.

Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/mm: Remove unused PAGE_KERNEL_EXEC and friends
Heiko Carstens [Mon, 9 Dec 2024 09:45:17 +0000 (10:45 +0100)]
s390/mm: Remove unused PAGE_KERNEL_EXEC and friends

Remove unused PAGE_KERNEL_EXEC, SEGMENT_KERNEL_EXEC,
and REGION3_KERNEL_EXEC.

Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/mm: Remove incorrect comment
Heiko Carstens [Mon, 9 Dec 2024 09:45:16 +0000 (10:45 +0100)]
s390/mm: Remove incorrect comment

Remove an outdated comment that is also located at a random place. The
generic statement that read permissions imply execute permissions is
wrong since the instruction execution-protection facility is available.

Reviewed-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/pci: Add pci_msg debug view to PCI report
Niklas Schnelle [Fri, 13 Dec 2024 13:47:33 +0000 (14:47 +0100)]
s390/pci: Add pci_msg debug view to PCI report

Using the newly introduced debug_dump() mechanism add formatted content
of pci_debug_msg_id to the PCI report. The formatting is based on the
existing sprintf format but removes caller pointer and area index and
adds an column header. This will allow the platform to collect this log
data together with hardware errors. This sets the reverse flag such that
the newest log entries get added to the PCI report even if not all debug
log entries fit.

Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Co-developed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/debug: Add a reverse mode for debug_dump()
Niklas Schnelle [Fri, 13 Dec 2024 13:47:32 +0000 (14:47 +0100)]
s390/debug: Add a reverse mode for debug_dump()

In this mode debug_dump() writes the debug log starting at the newest
entry followed by earlier entries. To this end add a debug_prev_entry()
helper analogous to debug_next_entry() a helper to get the latest entry
which is one before the active entry and a helper to iterate either
forward or backward.

Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Co-developed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/debug: Add debug_dump() to write debug view to a string buffer
Niklas Schnelle [Fri, 13 Dec 2024 13:47:31 +0000 (14:47 +0100)]
s390/debug: Add debug_dump() to write debug view to a string buffer

The debug_dump() function allows to get the content of a debug log and
view pair in a string buffer. One future application of this is to
provide debug logs to the platform to be collected with hardware error
logs during recovery.

Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Co-developed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/debug: Split private data alloc/free out of file operations
Niklas Schnelle [Fri, 13 Dec 2024 13:47:30 +0000 (14:47 +0100)]
s390/debug: Split private data alloc/free out of file operations

Split the allocation respectively freeing of file_private_info_t out
of open() respectively close(). This will be used in a follow on change
to access to debug views without going through the s390dbf filesystem.

Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/debug: Simplify and document debug_next_entry() logic
Niklas Schnelle [Fri, 13 Dec 2024 13:47:29 +0000 (14:47 +0100)]
s390/debug: Simplify and document debug_next_entry() logic

Contrary to convention debug_next_entry() returns a falsy 0 value if
there are more entries and a truthy 1 value when there are no more
entries. As there is only one caller just reverse this logic to be less
surprising and document the behavior in a kdoc comment. Also replace the
goto with an early return. In the future this allows using it in
a do {} while (debug_next_entry(...)) loop.

Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/pci: Report PCI error recovery results via SCLP
Niklas Schnelle [Fri, 13 Dec 2024 13:47:28 +0000 (14:47 +0100)]
s390/pci: Report PCI error recovery results via SCLP

Add a mechanism with which the status of PCI error recovery runs
is reported to the platform. Together with the status supply additional
information that may aid in problem determination.

Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/mm/hugetlbfs: Remove huge_pte_none() / huge_pte_none_mostly()
Heiko Carstens [Fri, 6 Dec 2024 13:52:35 +0000 (14:52 +0100)]
s390/mm/hugetlbfs: Remove huge_pte_none() / huge_pte_none_mostly()

Slightly cleanup arch/s390/include/asm/hugetlb.h:

- Remove huge_pte_none() / huge_pte_none_mostly() which are identical
  to the generic variants

- Coding style adjustments

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390: Add KERNEL_IMAGE_BASE to kasan.config
Vasily Gorbik [Tue, 10 Dec 2024 11:35:49 +0000 (12:35 +0100)]
s390: Add KERNEL_IMAGE_BASE to kasan.config

Although Kconfig specifies:

config KERNEL_IMAGE_BASE
        hex "Kernel image base address"
        range 0x100000 0x1FFFFFE0000000 if !KASAN
        range 0x100000 0x1BFFFFE0000000 if KASAN
        default 0x3FFE0000000 if !KASAN
        default 0x7FFFE0000000 if KASAN

Running make defconfig or make debug_defconfig
followed by make kasan.config results in a suboptimal
CONFIG_KERNEL_IMAGE_BASE=0x3FFE0000000. Add
CONFIG_KERNEL_IMAGE_BASE=0x7FFFE0000000 to kasan.config to address that.

Acked-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/abs_lowcore: Include linux/smp.h for get_cpu() and put_cpu()
Vasily Gorbik [Tue, 10 Dec 2024 11:35:46 +0000 (12:35 +0100)]
s390/abs_lowcore: Include linux/smp.h for get_cpu() and put_cpu()

Add missing include of <linux/smp.h> in abs_lowcore.h to provide
declarations for get_cpu() and put_cpu() used in the code.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390: Remove __bootdata annotations from declarations
Vasily Gorbik [Tue, 10 Dec 2024 11:35:40 +0000 (12:35 +0100)]
s390: Remove __bootdata annotations from declarations

For consistency, remove the `__bootdata` and `__bootdata_preserved`
section annotations from variable declarations in header files. Section
annotations should be applied to definitions, not declarations. This
change moves the annotations to the variable definitions in the
corresponding source files.

Acked-by: Heiko Carstens <hca@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/preempt: Optimize __preempt_count_dec_and_test()
Heiko Carstens [Wed, 11 Dec 2024 11:58:05 +0000 (12:58 +0100)]
s390/preempt: Optimize __preempt_count_dec_and_test()

Use __atomic_add_const_and_test() within __preempt_count_dec_and_test().
With this it is possible to decrease preempt_count by one and test if
need_resched is set with one instruction, if the compiler has support for
flag output operand constraints.

Reviewed-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/atomic: Provide arch_atomic_*_and_test() implementations
Heiko Carstens [Wed, 11 Dec 2024 11:58:04 +0000 (12:58 +0100)]
s390/atomic: Provide arch_atomic_*_and_test() implementations

Provide arch_atomic_*_and_test() implementations which make use of flag
output constraints, and allow the compiler to generate slightly better
code.

Reviewed-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390: Remove superfluous new lines from inline assemblies
Heiko Carstens [Wed, 11 Dec 2024 11:58:03 +0000 (12:58 +0100)]
s390: Remove superfluous new lines from inline assemblies

GCC uses the number of lines of an inline assembly to calculate its length
(number of instructions). This has an impact on GCCs inlining decisions.

Therefore remove superfluous new lines from a couple of inline
assemblies, so that their real size is reflected.

Also use an "asm inline" statement for the fpu_lfpc_safe() inline assembly
to enforce that GCC assumes the minimum size for this inline assembly,
since it contains various statements which make it appear much larger than
the resulting code is.

Suggested-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/preempt: Adjust coding style
Heiko Carstens [Wed, 4 Dec 2024 11:31:02 +0000 (12:31 +0100)]
s390/preempt: Adjust coding style

Just remove a line break which reduces readability.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/preempt: Remove special pre MARCH_HAS_Z196_FEATURES implementation
Heiko Carstens [Wed, 4 Dec 2024 11:31:01 +0000 (12:31 +0100)]
s390/preempt: Remove special pre MARCH_HAS_Z196_FEATURES implementation

Remove the preempt count implementation for pre MARCH_HAS_Z196_FEATURES
builds. If the kernel is compiled with PREEMPT=n, which is the default for
all distributions, this has close to zero impact in the generated code.

Therefore remove the alternative implementation to keep things simple.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/preempt: Add comments
Heiko Carstens [Wed, 4 Dec 2024 11:31:00 +0000 (12:31 +0100)]
s390/preempt: Add comments

The s390 preempt_count implementation is more or less a copy of the x86
implementation using different instructions. For clarification how this
works also add all comments from x86 with some minor modifications.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/atomic: Consistent layering between atomic.h and atomic_ops.h
Heiko Carstens [Wed, 4 Dec 2024 11:30:59 +0000 (12:30 +0100)]
s390/atomic: Consistent layering between atomic.h and atomic_ops.h

With commit c8a91c285d8c ("s390/atomic: move remaining inline assemblies to
atomic_ops.h") all remaining atomic inline assemblies have been moved to
atomic_ops.h.

However the result is inconsistent: the functions in atomic_ops.h are
supposed to be used with integral types like int and long pointers, while
the functions in atomic.h work with atomic types.

This layering got violated with the named commit. Therefore adjust this
now, and also use consistent variable names in atomic_ops.h.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/atomic: Implement arch_atomic_inc() / arch_atomic_dec()
Heiko Carstens [Wed, 4 Dec 2024 11:30:58 +0000 (12:30 +0100)]
s390/atomic: Implement arch_atomic_inc() / arch_atomic_dec()

Implement arch_atomic_inc() / arch_atomic_dec() functions which result
in a single instruction if compiled for z196 or newer architectures.

Reduces the kernel image size by ~6K (defconfig):

bloat-o-meter:
add/remove: 0/0 grow/shrink: 12/1005 up/down: 106/-6404 (-6298)

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/setup: Cleanup stack_alloc() and stack_free()
Heiko Carstens [Mon, 2 Dec 2024 11:56:39 +0000 (12:56 +0100)]
s390/setup: Cleanup stack_alloc() and stack_free()

Some small cleanups to stack_alloc() and stack_free():

- Rename ret to stack to reflect what the variable is used for
- Whitespace removal

Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
4 months agos390/Kconfig: Select VMAP_STACK unconditionally
Heiko Carstens [Mon, 2 Dec 2024 11:56:38 +0000 (12:56 +0100)]
s390/Kconfig: Select VMAP_STACK unconditionally

There is no point in supporting !VMAP_STACK kernel builds. VMAP_STACK has
proven to work since many years. Also, since KASAN_VMALLOC is supported,
kernels built with !VMAP_STACK are completely untested.

Therefore select VMAP_STACK unconditionally and remove all config options
and code required for !VMAP_STACK builds.

Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>