KVM: RISC-V: Fix wrong usage of PGDIR_SIZE to check page sizes
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Mon, 23 Jan 2023 09:29:28 +0000 (10:29 +0100)
committerAnup Patel <anup@brainfault.org>
Tue, 7 Feb 2023 15:05:24 +0000 (20:35 +0530)
commitc25a6dddc62c84f50e57094bd44e7f9d84907f49
tree63f77263a83bb0c2a8000ad9f28420aab0fb6a20
parent4ec5183ec48656cec489c49f989c508b68b518e3
KVM: RISC-V: Fix wrong usage of PGDIR_SIZE to check page sizes

At the moment, riscv only supports PMD and PUD hugepages. For sv39,
PGDIR_SIZE == PUD_SIZE but not for sv48 and sv57. So fix this by changing
PGDIR_SIZE into PUD_SIZE.

Fixes: 9d05c1fee837 ("RISC-V: KVM: Implement stage2 page table programming")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/kvm/mmu.c