Skip to content

Commit b342166

Browse files
yechao-wavpatel
authored andcommitted
RISC-V: KVM: Skip THP support check during dirty logging
When dirty logging is enabled, guest stage mappings are forced to PAGE_SIZE granularity. Changing the mapping page size at this point is incorrect. Fixes: ed7ae7a ("RISC-V: KVM: Transparent huge page support") Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260226191231140_X1Juus7s2kgVlc0ZyW_K@zte.com.cn Signed-off-by: Anup Patel <anup@brainfault.org>
1 parent 7120a9d commit b342166

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/riscv/kvm/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ int kvm_riscv_mmu_map(struct kvm_vcpu *vcpu, struct kvm_memory_slot *memslot,
539539
goto out_unlock;
540540

541541
/* Check if we are backed by a THP and thus use block mapping if possible */
542-
if (vma_pagesize == PAGE_SIZE)
542+
if (!logging && (vma_pagesize == PAGE_SIZE))
543543
vma_pagesize = transparent_hugepage_adjust(kvm, memslot, hva, &hfn, &gpa);
544544

545545
if (writable) {

0 commit comments

Comments
 (0)