]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Extend make_huge_page_split_spte() for the shadow MMU
authorDavid Matlack <dmatlack@google.com>
Wed, 22 Jun 2022 19:27:05 +0000 (15:27 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Jun 2022 08:51:59 +0000 (04:51 -0400)
commit04b7929b10150e517710044e2358fda992f76b63
treeb3e79dc925606452e3087fdf82cdc433c7e4ff8a
parentd8f054f5f023e4135450b2ddbd0d34139d5072d6
KVM: x86/mmu: Extend make_huge_page_split_spte() for the shadow MMU

Currently make_huge_page_split_spte() assumes execute permissions can be
granted to any 4K SPTE when splitting huge pages. This is true for the
TDP MMU but is not necessarily true for the shadow MMU, since KVM may be
shadowing a non-executable huge page.

To fix this, pass in the role of the child shadow page where the huge
page will be split and derive the execution permission from that.  This
is correct because huge pages are always split with direct shadow page
and thus the shadow page role contains the correct access permissions.

No functional change intended.

Signed-off-by: David Matlack <dmatlack@google.com>
Message-Id: <20220516232138.1783324-19-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/spte.c
arch/x86/kvm/mmu/spte.h
arch/x86/kvm/mmu/tdp_mmu.c