OSDN Git Service

KVM: x86/mmu: Move "huge page disallowed" calculation into mapping helpers
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 23 Sep 2020 18:37:30 +0000 (11:37 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 28 Sep 2020 11:57:40 +0000 (07:57 -0400)
commit6c2fd34f5c7970915f040b502563cf339fb661cd
tree503c4bdfcd12204edf5084ad4c4918a606ad5ea0
parent7d919c7a38fb2e34d4d27e535f19979e1b415f68
KVM: x86/mmu: Move "huge page disallowed" calculation into mapping helpers

Calculate huge_page_disallowed in __direct_map() and FNAME(fetch) in
preparation for reworking the calculation so that it preserves the
requested map level and eventually to avoid flagging a shadow page as
being disallowed for being used as a large/huge page when it couldn't
have been huge in the first place, e.g. because the backing page in the
host is not large.

Pass the error code into the helpers and use it to recalcuate exec and
write_fault instead adding yet more booleans to the parameters.

Opportunistically use huge_page_disallowed instead of lpage_disallowed
to match the nomenclature used within the mapping helpers (though even
they have existing inconsistencies).

No functional change intended.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200923183735.584-4-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/paging_tmpl.h