diff options
| author | Bibo Mao <maobibo@loongson.cn> | 2025-11-09 16:02:09 +0800 |
|---|---|---|
| committer | Huacai Chen <chenhuacai@loongson.cn> | 2025-11-10 08:37:07 +0800 |
| commit | 37e9d1a91382661c2d1f656b54c5d22dfe7a8606 (patch) | |
| tree | 62e8003a9d2c6bcad53dd7bc8cbc46503b6cbbc3 /arch | |
| parent | 62cda5e54f7c5e773911b458dd4d10ee8c91b60b (diff) | |
| download | linux-37e9d1a91382661c2d1f656b54c5d22dfe7a8606.tar.gz | |
LoongArch: KVM: Set page with write attribute if dirty track disabled
With secondary MMU page table, if there is a read page fault, the page's
write attribute will not set even if it is writable from master MMU page
table. This logic only works if dirty tracking is enabled, so page table
should be set with _PAGE_WRITE if dirty tracking is disabled.
It reduces extra page fault on secondary MMU page table if a VM finishes
migration, when the master MMU page table is ready and the secondary MMU
page is fresh.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/loongarch/kvm/mmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c index 7c8143e79c1279..a7fa458e33605e 100644 --- a/arch/loongarch/kvm/mmu.c +++ b/arch/loongarch/kvm/mmu.c @@ -857,7 +857,7 @@ retry: if (writeable) { prot_bits = kvm_pte_mkwriteable(prot_bits); - if (write) + if (write || !kvm_slot_dirty_track_enabled(memslot)) prot_bits = kvm_pte_mkdirty(prot_bits); } |
