KVM: x86/mmu: Initialize fault.{gfn,slot} earlier for direct MMUs
authorDavid Matlack <dmatlack@google.com>
Wed, 21 Sep 2022 17:35:43 +0000 (10:35 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 29 Dec 2022 20:33:21 +0000 (15:33 -0500)
commite5e6f8d254a285e97b02180fdc75d02ffdf9f0ed
tree77a043f89d5b067c491cc3711256735d1633effc
parent354c908c068ec0a21850aef5dbf6b8331434a2e9
KVM: x86/mmu: Initialize fault.{gfn,slot} earlier for direct MMUs

Move the initialization of fault.{gfn,slot} earlier in the page fault
handling code for fully direct MMUs. This will enable a future commit to
split out TDP MMU page fault handling without needing to duplicate the
initialization of these 2 fields.

Opportunistically take advantage of the fact that fault.gfn is
initialized in kvm_tdp_page_fault() rather than recomputing it from
fault->addr.

No functional change intended.

Signed-off-by: David Matlack <dmatlack@google.com>
Reviewed-by: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220921173546.2674386-8-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/mmu_internal.h