]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: split cpu_role from mmu_role
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 11 Feb 2022 11:50:11 +0000 (06:50 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 29 Apr 2022 16:49:53 +0000 (12:49 -0400)
commit5dcd1fffbc5585333bd2b648917432b2b2226611
treefd59eecd3558d9126ae32361880eb8900946031c
parentce681bc700bdf4c3d239d6d39d6b9b66f57fbd70
KVM: x86/mmu: split cpu_role from mmu_role

Snapshot the state of the processor registers that govern page walk into
a new field of struct kvm_mmu.  This is a more natural representation
than having it *mostly* in mmu_role but not exclusively; the delta
right now is represented in other fields, such as root_level.

The nested MMU now has only the CPU role; and in fact the new function
kvm_calc_cpu_role is analogous to the previous kvm_calc_nested_mmu_role,
except that it has role.base.direct equal to !CR0.PG.  For a walk-only
MMU, "direct" has no meaning, but we set it to !CR0.PG so that
role.ext.cr0_pg can go away in a future patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/paging_tmpl.h