RISC-V: KVM: Don't flush TLB when PTE is unchanged
authorAnup Patel <apatel@ventanamicro.com>
Wed, 18 Jun 2025 11:35:25 +0000 (17:05 +0530)
committerAnup Patel <anup@brainfault.org>
Mon, 28 Jul 2025 16:57:16 +0000 (22:27 +0530)
commiteaa98ba20be088eeb252061f216c299442ba5a69
tree8ef12f5820e59d840ef3ba400483b4bb1009b594
parent7584eb611e8ef22aca3b801f7fd8529892b70901
RISC-V: KVM: Don't flush TLB when PTE is unchanged

The gstage_set_pte() and gstage_op_pte() should flush TLB only when
a leaf PTE changes so that unnecessary TLB flushes can be avoided.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Tested-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com>
Link: https://lore.kernel.org/r/20250618113532.471448-6-apatel@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/kvm/mmu.c