I do not know whether KVM_DIRTY_LOG_INITIALLY_SET should be enabled on LoongArch. If it is set, write protection for second MMU will start one by one in function kvm_arch_mmu_enable_log_dirty_pt_masked() when dirty log is cleared if it is set, else write protection will start in function kvm_arch_commit_memory_region() when flag of memslot is changed.
I do not see the obvious benefits between these two write protect stages. Can anyone give me any hints?