linux/arch/s390/kernel
David Hildenbrand 3ec8a8330a s390/uv: Don't return 0 from make_hva_secure() if the operation was not successful
If s390_wiggle_split_folio() returns 0 because splitting a large folio
succeeded, we will return 0 from make_hva_secure() even though a retry
is required. Return -EAGAIN in that case.

Otherwise, we'll return 0 from gmap_make_secure(), and consequently from
unpack_one(). In kvm_s390_pv_unpack(), we assume that unpacking
succeeded and skip unpacking this page. Later on, we run into issues
and fail booting the VM.

So far, this issue was only observed with follow-up patches where we
split large pagecache XFS folios. Maybe it can also be triggered with
shmem?

We'll cleanup s390_wiggle_split_folio() a bit next, to also return 0
if no split was required.

Fixes: d8dfda5af0 ("KVM: s390: pv: fix race when making a page secure")
Cc: stable@vger.kernel.org
Signed-off-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20250516123946.1648026-2-david@redhat.com
Message-ID: <20250516123946.1648026-2-david@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
2025-05-28 14:13:20 +02:00
..
diag s390: Use inline qualifier for all EX_TABLE and ALTERNATIVE inline assemblies 2025-03-18 17:13:51 +01:00
syscalls fs: add open_tree_attr() 2025-02-12 12:12:28 +01:00
vdso32 s390/vdso: Switch to generic storage implementation 2025-02-21 09:54:02 +01:00
vdso64 s390/vdso: Switch to generic storage implementation 2025-02-21 09:54:02 +01:00
.gitignore
abs_lowcore.c s390/lowcore: Convert relocated lowcore alternative to machine feature 2025-03-04 17:18:05 +01:00
alternative.c s390/alternatives: Add debug functionality 2025-03-04 17:18:08 +01:00
asm-offsets.c s390/asm-offsets: Remove ASM_OFFSETS_C 2025-03-31 12:20:39 +02:00
audit.c
audit.h
cache.c
cert_store.c s390: Use inline qualifier for all EX_TABLE and ALTERNATIVE inline assemblies 2025-03-18 17:13:51 +01:00
compat_audit.c
compat_linux.c
compat_linux.h
compat_ptrace.h
compat_signal.c s390/vdso: Move vdso symbol handling to separate header file 2024-09-13 17:28:36 +02:00
cpacf.c s390/crypto/cpacf: Constify 'struct bin_attribute' 2025-01-07 10:05:35 +01:00
cpcmd.c s390/cpcmd: Convert to use flag output macros 2024-11-13 14:31:32 +01:00
cpufeature.c
crash_dump.c s390/crash: Use note name macros 2025-02-10 16:56:58 -08:00
ctlreg.c
debug.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
dis.c
dumpstack.c s390/asm-offsets: Remove ASM_OFFSETS_C 2025-03-31 12:20:39 +02:00
early.c s390/asm-offsets: Remove ASM_OFFSETS_C 2025-03-31 12:20:39 +02:00
early_printk.c
ebcdic.c
entry.h s390/traps: Change stack overflow message 2025-03-04 17:34:03 +01:00
entry.S s390/entry: Fix setting _CIF_MCCK_GUEST with lowcore relocation 2025-03-31 12:20:39 +02:00
facility.c
fpu.c
ftrace.c s390 updates for 6.15 merge window 2025-03-29 11:59:43 -07:00
ftrace.h
guarded_storage.c s390/cpufeature: Convert MACHINE_HAS_GS to cpu_has_gs() 2025-03-04 17:18:04 +01:00
head64.S s390/time: Convert MACHINE_HAS_SCC to machine_has_scc() 2025-03-04 17:18:06 +01:00
hiperdispatch.c s390/cpufeature: Convert MACHINE_HAS_TOPOLOGY to cpu_has_topology() 2025-03-04 17:18:05 +01:00
idle.c
ima_arch.c
ipl.c s390: Use inline qualifier for all EX_TABLE and ALTERNATIVE inline assemblies 2025-03-18 17:13:51 +01:00
ipl_vmparm.c
irq.c s390 updates for 6.15 merge window 2025-03-29 11:59:43 -07:00
jump_label.c
kdebugfs.c
kexec_elf.c
kexec_image.c
kprobes.c s390/cpufeature: Convert MACHINE_HAS_SEQ_INSN to cpu_has_seq_insn() 2025-03-04 17:18:04 +01:00
lgr.c s390: kernel: convert timeouts to use secs_to_jiffies() 2025-01-12 20:21:01 -08:00
machine_kexec.c s390: Convert MACHINE_IS_[LPAR|VM|KVM], etc, machine_is_[lpar|vm|kvm]() 2025-03-04 17:18:07 +01:00
machine_kexec_file.c
machine_kexec_reloc.c
Makefile s390/diag: Move diag.c to diag specific folder 2024-12-17 12:46:14 +01:00
mcount.S s390/tracing: Enable HAVE_FTRACE_GRAPH_FUNC 2024-12-26 10:50:05 -05:00
module.c
nmi.c s390/cpufeature: Convert MACHINE_HAS_GS to cpu_has_gs() 2025-03-04 17:18:04 +01:00
nospec-branch.c
nospec-sysfs.c s390/nospec: Switch over to sysfs_emit() 2024-10-25 16:03:24 +02:00
numa.c mm/memblock: add memblock_alloc_or_panic interface 2025-01-25 20:22:38 -08:00
os_info.c s390: Remove __bootdata annotations from declarations 2024-12-15 16:19:04 +01:00
perf_cpum_cf.c s390/cpumf: Fix double free on error in cpumf_pmu_event_init() 2025-04-09 12:12:42 +02:00
perf_cpum_cf_events.c s390/cpumf: Update CPU Measurement facility extended counter set support 2025-04-09 12:12:41 +02:00
perf_cpum_sf.c s390/cpumf: Fix double free on error in cpumf_pmu_event_init() 2025-04-09 12:12:42 +02:00
perf_event.c Performance events changes for v6.13: 2024-11-19 13:34:06 -08:00
perf_pai_crypto.c perf: Supply task information to sched_task() 2025-03-17 11:23:37 +01:00
perf_pai_ext.c perf: Supply task information to sched_task() 2025-03-17 11:23:37 +01:00
perf_regs.c
process.c
processor.c s390: Add z17 elf platform 2025-04-09 12:12:41 +02:00
ptrace.c s390/ptrace: Avoid KASAN false positives in regs_get_kernel_stack_nth() 2025-03-18 17:13:05 +01:00
reipl.S
relocate_kernel.S
rethook.c
rethook.h
runtime_instr.c
setup.c s390/lowcore: Remove unused machine_flags 2025-03-31 12:20:39 +02:00
signal.c s390/vdso: Move vdso symbol handling to separate header file 2024-09-13 17:28:36 +02:00
smp.c s390/smp: Add support for HOTPLUG_SMT 2025-03-31 12:20:39 +02:00
stacktrace.c s390/asm-offsets: Remove ASM_OFFSETS_C 2025-03-31 12:20:39 +02:00
sthyi.c s390/sthyi: Convert to use flag output macros 2024-11-13 14:31:31 +01:00
syscall.c s390: Remove 2k vs 4k page table leftovers 2025-03-18 17:13:05 +01:00
sysinfo.c s390: Convert MACHINE_IS_[LPAR|VM|KVM], etc, machine_is_[lpar|vm|kvm]() 2025-03-04 17:18:07 +01:00
text_amode31.S s390/amode31: Use exrl instead of ex 2025-01-13 09:50:17 +01:00
time.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
topology.c s390/cpufeature: Convert MACHINE_HAS_TOPOLOGY to cpu_has_topology() 2025-03-04 17:18:05 +01:00
trace.c
traps.c s390 updates for 6.15 merge window 2025-03-29 11:59:43 -07:00
unwind_bc.c
uprobes.c
uv.c s390/uv: Don't return 0 from make_hva_secure() if the operation was not successful 2025-05-28 14:13:20 +02:00
vdso.c mseal sysmap: enable s390 2025-04-01 15:17:16 -07:00
vmcore_info.c s390: Remove __bootdata annotations from declarations 2024-12-15 16:19:04 +01:00
vmlinux.lds.S s390/fpu: Add fpc exception handler / remove fixup section again 2025-01-26 17:24:04 +01:00
vtime.c
wti.c