linux/arch/riscv
Anup Patel 7c8de080d4 RISC-V: KVM: Fix GPA passed to __kvm_riscv_hfence_gvma_xyz() functions
The parameter passed to HFENCE.GVMA instruction in rs1 register
is guest physical address right shifted by 2 (i.e. divided by 4).

Unfortunately, we overlooked the semantics of rs1 registers for
HFENCE.GVMA instruction and never right shifted guest physical
address by 2. This issue did not manifest for hypervisors till
now because:
  1) Currently, only __kvm_riscv_hfence_gvma_all() and SBI
     HFENCE calls are used to invalidate TLB.
  2) All H-extension implementations (such as QEMU, Spike,
     Rocket Core FPGA, etc) that we tried till now were
     conservatively flushing everything upon any HFENCE.GVMA
     instruction.

This patch fixes GPA passed to __kvm_riscv_hfence_gvma_vmid_gpa()
and __kvm_riscv_hfence_gvma_gpa() functions.

Fixes: fd7bb4a251 ("RISC-V: KVM: Implement VMID allocator")
Reported-by: Ian Huang <ihuang@ventanamicro.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Message-Id: <20211026170136.2147619-4-anup.patel@wdc.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-10-31 02:45:43 -04:00
..
boot riscv: dts: microchip: mpfs-icicle: Fix serial console 2021-09-10 23:58:19 -07:00
configs riscv: defconfig: enable NLS_CODEPAGE_437, NLS_ISO8859_1 2021-09-10 21:31:12 -07:00
errata riscv: skip errata_cip_453.o if CONFIG_ERRATA_SIFIVE_CIP_453 is disabled 2021-06-01 21:16:41 -07:00
include RISC-V: KVM: Fix GPA passed to __kvm_riscv_hfence_gvma_xyz() functions 2021-10-31 02:45:43 -04:00
kernel RISC-V: KVM: FP lazy save/restore 2021-10-04 16:08:23 +05:30
kvm RISC-V: KVM: Fix GPA passed to __kvm_riscv_hfence_gvma_xyz() functions 2021-10-31 02:45:43 -04:00
lib riscv: __asm_copy_to-from_user: Fix: Typos in comments 2021-07-23 17:49:12 -07:00
mm RISC-V Patches for the 5.15 Merge Window, Part 1 2021-09-05 11:31:23 -07:00
net bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-07-29 00:20:56 +02:00
Kbuild riscv: Allow device trees to be built into the kernel 2020-05-18 11:38:05 -07:00
Kconfig RISC-V: Add initial skeletal KVM support 2021-10-04 15:40:08 +05:30
Kconfig.debug RISC-V: Remove EARLY_PRINTK support 2018-12-17 10:23:46 -08:00
Kconfig.erratas riscv: enable SiFive errata CIP-453 and CIP-1200 Kconfig only if CONFIG_64BIT=y 2021-05-06 09:40:13 -07:00
Kconfig.socs riscv: sifive: fix Kconfig errata warning 2021-06-12 17:20:50 -07:00
Makefile RISC-V: Add initial skeletal KVM support 2021-10-04 15:40:08 +05:30