diff mbox series

[RFC,07/10] KVM: x86/mmu: make fast_page_fault() receive single argument

Message ID e74afe360a85d41e7ab4bad115210771d2a600ce.1618914692.git.isaku.yamahata@intel.com (mailing list archive)
State New
Headers show
Series KVM: x86/mmu: simplify argument to kvm page fault handler | expand

Commit Message

Isaku Yamahata April 20, 2021, 10:39 a.m. UTC
Convert fast_page_fault() to receive single argument, struct kvm_page_fault
instead of many arguments.

No functional change is intended.

Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
 arch/x86/kvm/mmu/mmu.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index a16e1b228ac2..ce48416380c3 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -3043,9 +3043,11 @@  static bool is_access_allowed(u32 fault_err_code, u64 spte)
 /*
  * Returns one of RET_PF_INVALID, RET_PF_FIXED or RET_PF_SPURIOUS.
  */
-static int fast_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
-			   u32 error_code)
+static int fast_page_fault(struct kvm_page_fault *kpf)
 {
+	struct kvm_vcpu *vcpu = kpf->vcpu;
+	gpa_t cr2_or_gpa = kpf->cr2_or_gpa;
+	u32 error_code = kpf->error_code;
 	struct kvm_shadow_walk_iterator iterator;
 	struct kvm_mmu_page *sp;
 	int ret = RET_PF_INVALID;
@@ -3704,7 +3706,7 @@  static int direct_page_fault(struct kvm_page_fault *kpf)
 		return RET_PF_EMULATE;
 
 	if (!is_tdp_mmu_root(vcpu->kvm, vcpu->arch.mmu->root_hpa)) {
-		r = fast_page_fault(vcpu, gpa, error_code);
+		r = fast_page_fault(kpf);
 		if (r != RET_PF_INVALID)
 			return r;
 	}