]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MMU: record maximum physical address width in kvm_mmu_extended_role
authorYu Zhang <yu.c.zhang@linux.intel.com>
Thu, 31 Jan 2019 16:09:23 +0000 (00:09 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 22 Feb 2019 18:25:10 +0000 (19:25 +0100)
commit139d0239ec8b918879aaf730ec46f76e306bebc4
tree0a8d3d19ab24b7accfe02d160445688224fa238d
parent2301ca4dccb1714edb1b30de68bbe9a66c8a398b
KVM: MMU: record maximum physical address width in kvm_mmu_extended_role

Previously, commit 22e08c018391 ("x86/kvm/mmu: check if tdp/shadow
MMU reconfiguration is needed") offered some optimization to avoid
the unnecessary reconfiguration. Yet one scenario is broken - when
cpuid changes VM's maximum physical address width, reconfiguration
is needed to reset the reserved bits.  Also, the TDP may need to
reset its shadow_root_level when this value is changed.

To fix this, a new field, maxphyaddr, is introduced in the extended
role structure to keep track of the configured guest physical address
width.

Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu.c