]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Let guest use GBPAGES if supported in hardware and TDP is on
authorSean Christopherson <seanjc@google.com>
Tue, 22 Jun 2021 17:57:39 +0000 (10:57 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Jun 2021 22:00:48 +0000 (18:00 -0400)
commitda737cf6440a281723b3fb95e3d203ed37eeadbf
treec5f6b318f32e050f16948d6d210229e0cf178666
parentdd0a45e2de83f24aaa7b92f4ede8077161930476
KVM: x86/mmu: Let guest use GBPAGES if supported in hardware and TDP is on

Let the guest use 1g hugepages if TDP is enabled and the host supports
GBPAGES, KVM can't actively prevent the guest from using 1g pages in this
case since they can't be disabled in the hardware page walker.  While
injecting a page fault if a bogus 1g page is encountered during a
software page walk is perfectly reasonable since KVM is simply honoring
userspace's vCPU model, doing so arguably doesn't provide any meaningful
value, and at worst will be horribly confusing as the guest will see
inconsistent behavior and seemingly spurious page faults.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210622175739.3610207-55-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c