linux/arch
Andrew Jones db2556e538 RISC-V: KVM: Fix sbiret init before forwarding to userspace
[ Upstream commit 6b7b282e6b ]

When forwarding SBI calls to userspace ensure sbiret.error is
initialized to SBI_ERR_NOT_SUPPORTED first, in case userspace
neglects to set it to anything. If userspace neglects it then we
can't be sure it did anything else either, so we just report it
didn't do or try anything. Just init sbiret.value to zero, which is
the preferred value to return when nothing special is specified.

KVM was already initializing both sbiret.error and sbiret.value, but
the values used appear to come from a copy+paste of the __sbi_ecall()
implementation, i.e. a0 and a1, which don't apply prior to the call
being executed, nor at all when forwarding to userspace.

Fixes: dea8ee31a0 ("RISC-V: KVM: Add SBI v0.1 support")
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20240807154943.150540-2-ajones@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-10-17 15:20:37 +02:00
..
alpha rtc: Add support for configuring the UIP timeout for RTC reads 2024-01-31 16:17:01 -08:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:29:23 +02:00
arm ARM: spitz: fix GPIO assignment for backlight 2024-08-03 08:49:02 +02:00
arm64 arm64: dts: rockchip: fix PMIC interrupt pin in pinctrl for ROCK Pi E 2024-09-18 19:23:04 +02:00
csky csky, hexagon: fix broken sys_sync_file_range 2024-07-05 09:31:57 +02:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-07-05 09:31:57 +02:00
ia64 ia64/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:46 +02:00
loongarch LoongArch: Define ARCH_IRQ_INIT_FLAGS as IRQ_NOPROBE 2024-09-30 16:23:47 +02:00
m68k m68k: amiga: Turn off Warp1260 interrupts during boot 2024-08-03 08:49:34 +02:00
microblaze microblaze: don't treat zero reserved memory regions as error 2024-09-30 16:23:47 +02:00
mips MIPS: cevt-r4k: Don't call get_c0_compare_int if timer irq is installed 2024-09-12 11:10:25 +02:00
nios2 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
openrisc openrisc: Call setup_memory() earlier in the init sequence 2024-08-29 17:30:39 +02:00
parisc parisc: Use irq_enter_rcu() to fix warning at kernel/context_tracking.c:367 2024-08-29 17:30:36 +02:00
powerpc powerpc/mm: Fix boot warning with hugepages and CONFIG_DEBUG_VIRTUAL 2024-09-18 19:23:02 +02:00
riscv RISC-V: KVM: Fix sbiret init before forwarding to userspace 2024-10-17 15:20:37 +02:00
s390 s390/vmlinux.lds.S: Move ro_after_init section behind rodata section 2024-09-12 11:10:24 +02:00
sh sh: rework sync_file_range ABI 2024-07-05 09:31:57 +02:00
sparc sparc64: Fix incorrect function signature and add prototype for prom_cif_init 2024-08-03 08:49:16 +02:00
um um: line: always fill *error_out in setup_one_line() 2024-09-12 11:10:23 +02:00
x86 x86/mm: Switch to new Intel CPU model defines 2024-09-30 16:23:56 +02:00
xtensa xtensa: fix MAKE_PC_FROM_RA second argument 2024-06-21 14:35:39 +02:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-27 13:46:24 +02:00