KVM: x86: MMU: Make force_pt_level bool
This will be passed to a function later. Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6092d3d3e6
commit
cd1872f028
|
@ -2962,7 +2962,7 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, u32 error_code,
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
int level;
|
int level;
|
||||||
int force_pt_level;
|
bool force_pt_level;
|
||||||
pfn_t pfn;
|
pfn_t pfn;
|
||||||
unsigned long mmu_seq;
|
unsigned long mmu_seq;
|
||||||
bool map_writable, write = error_code & PFERR_WRITE_MASK;
|
bool map_writable, write = error_code & PFERR_WRITE_MASK;
|
||||||
|
@ -3476,7 +3476,7 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t gpa, u32 error_code,
|
||||||
pfn_t pfn;
|
pfn_t pfn;
|
||||||
int r;
|
int r;
|
||||||
int level;
|
int level;
|
||||||
int force_pt_level;
|
bool force_pt_level;
|
||||||
gfn_t gfn = gpa >> PAGE_SHIFT;
|
gfn_t gfn = gpa >> PAGE_SHIFT;
|
||||||
unsigned long mmu_seq;
|
unsigned long mmu_seq;
|
||||||
int write = error_code & PFERR_WRITE_MASK;
|
int write = error_code & PFERR_WRITE_MASK;
|
||||||
|
@ -3497,9 +3497,9 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t gpa, u32 error_code,
|
||||||
|
|
||||||
if (mapping_level_dirty_bitmap(vcpu, gfn) ||
|
if (mapping_level_dirty_bitmap(vcpu, gfn) ||
|
||||||
!check_hugepage_cache_consistency(vcpu, gfn, PT_DIRECTORY_LEVEL))
|
!check_hugepage_cache_consistency(vcpu, gfn, PT_DIRECTORY_LEVEL))
|
||||||
force_pt_level = 1;
|
force_pt_level = true;
|
||||||
else
|
else
|
||||||
force_pt_level = 0;
|
force_pt_level = false;
|
||||||
|
|
||||||
if (likely(!force_pt_level)) {
|
if (likely(!force_pt_level)) {
|
||||||
level = mapping_level(vcpu, gfn);
|
level = mapping_level(vcpu, gfn);
|
||||||
|
|
|
@ -698,7 +698,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, u32 error_code,
|
||||||
int r;
|
int r;
|
||||||
pfn_t pfn;
|
pfn_t pfn;
|
||||||
int level = PT_PAGE_TABLE_LEVEL;
|
int level = PT_PAGE_TABLE_LEVEL;
|
||||||
int force_pt_level;
|
bool force_pt_level;
|
||||||
unsigned long mmu_seq;
|
unsigned long mmu_seq;
|
||||||
bool map_writable, is_self_change_mapping;
|
bool map_writable, is_self_change_mapping;
|
||||||
|
|
||||||
|
@ -747,7 +747,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, u32 error_code,
|
||||||
force_pt_level = mapping_level_dirty_bitmap(vcpu, walker.gfn)
|
force_pt_level = mapping_level_dirty_bitmap(vcpu, walker.gfn)
|
||||||
|| is_self_change_mapping;
|
|| is_self_change_mapping;
|
||||||
else
|
else
|
||||||
force_pt_level = 1;
|
force_pt_level = true;
|
||||||
if (!force_pt_level) {
|
if (!force_pt_level) {
|
||||||
level = min(walker.level, mapping_level(vcpu, walker.gfn));
|
level = min(walker.level, mapping_level(vcpu, walker.gfn));
|
||||||
walker.gfn = walker.gfn & ~(KVM_PAGES_PER_HPAGE(level) - 1);
|
walker.gfn = walker.gfn & ~(KVM_PAGES_PER_HPAGE(level) - 1);
|
||||||
|
|
Loading…
Reference in New Issue