OSDN Git Service

KVM: x86: compile out TDP MMU on 32-bit systems
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 6 Feb 2021 14:53:33 +0000 (09:53 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Feb 2021 19:49:01 +0000 (14:49 -0500)
commit897218ff7cf19290ec2d69652ce673d8ed6fedeb
treee2901b8ab7865dc22205fdd57c173f72279aad19
parente36b250e502a6145fa95a3d93af83ba66fc6ae1b
KVM: x86: compile out TDP MMU on 32-bit systems

The TDP MMU assumes that it can do atomic accesses to 64-bit PTEs.
Rather than just disabling it, compile it out completely so that it
is possible to use for example 64-bit xchg.

To limit the number of stubs, wrap all accesses to tdp_mmu_enabled
or tdp_mmu_page with a function.  Calls to all other functions in
tdp_mmu.c are eliminated and do not even reach the linker.

Reviewed-by: Sean Christopherson <seanjc@google.com>
Tested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/Makefile
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/mmu_internal.h
arch/x86/kvm/mmu/tdp_mmu.c
arch/x86/kvm/mmu/tdp_mmu.h