]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RISC-V: KVM: Fix APLIC in_clrip[x] read emulation
authorAnup Patel <apatel@ventanamicro.com>
Thu, 21 Mar 2024 08:50:41 +0000 (14:20 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:35:48 +0000 (16:35 +0200)
commit651bf5b1d0708d277e5f2cf2887ec27d3b04f500
treea11fa75a87ad373475a8830c43c04eabb1802e61
parent200cc2c7184138383ceb3249925c06a3e7c653db
RISC-V: KVM: Fix APLIC in_clrip[x] read emulation

commit 8e936e98718f005c986be0bfa1ee6b355acf96be upstream.

The reads to APLIC in_clrip[x] registers returns rectified input values
of the interrupt sources.

A rectified input value of an interrupt source is defined by the section
"4.5.2 Source configurations (sourcecfg[1]–sourcecfg[1023])" of the
RISC-V AIA specification as:

    rectified input value = (incoming wire value) XOR (source is inverted)

Update the riscv_aplic_input() implementation to match the above.

Cc: stable@vger.kernel.org
Fixes: 74967aa208e2 ("RISC-V: KVM: Add in-kernel emulation of AIA APLIC")
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20240321085041.1955293-3-apatel@ventanamicro.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/riscv/kvm/aia_aplic.c