• Bibo Mao's avatar
    LoongArch: KVM: Select huge page only if secondary mmu supports it · 2f56f9ea
    Bibo Mao authored
    Currently page level selection about secondary mmu depends on memory
    slot and page level about host mmu. There will be problems if page level
    of secondary mmu is zero already. Huge page cannot be selected if there is
    normal page mapped in secondary mmu already, since it is not supported to
    merge normal pages into huge pages now.
    
    So page level selection should depend on the following three conditions.
     1. Memslot is aligned for huge page and vm is not migrating.
     2. Page level of host mmu is also huge page.
     3. Page level of secondary mmu is suituable for huge page.
    Signed-off-by: default avatarBibo Mao <maobibo@loongson.cn>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    2f56f9ea
mmu.c 24.8 KB