Commit 9d1da280 authored by David Matlack's avatar David Matlack Committed by Yu Zhang
Browse files

KVM: x86/mmu: Rename cr2_or_gpa to gpa in fast_page_fault

mainline inclusion
from mainline-v5.15-rc1
commit 76cd325e
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I7S3VQ
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=76cd325ea75bb2a84c329782d7b8015b6a970c34



----------------------------------------------------------------------

fast_page_fault is only called from direct_page_fault where we know the
address is a gpa.

Fixes: 736c291c ("KVM: x86: Use gpa_t for cr2/gpa to fix TDP support on 32-bit KVM")
Reviewed-by: default avatarBen Gardon <bgardon@google.com>
Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarDavid Matlack <dmatlack@google.com>
Message-Id: <20210713220957.3493520-2-dmatlack@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarYu Zhang <yu.c.zhang@linux.intel.com>
parent c7324f64
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -3022,8 +3022,7 @@ 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_vcpu *vcpu, gpa_t gpa, u32 error_code)
{
	struct kvm_shadow_walk_iterator iterator;
	struct kvm_mmu_page *sp;
@@ -3039,7 +3038,7 @@ static int fast_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
	do {
		u64 new_spte;

		for_each_shadow_entry_lockless(vcpu, cr2_or_gpa, iterator, spte)
		for_each_shadow_entry_lockless(vcpu, gpa, iterator, spte)
			if (!is_shadow_present_pte(spte))
				break;

@@ -3118,8 +3117,7 @@ static int fast_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,

	} while (true);

	trace_fast_page_fault(vcpu, cr2_or_gpa, error_code, iterator.sptep,
			      spte, ret);
	trace_fast_page_fault(vcpu, gpa, error_code, iterator.sptep, spte, ret);
	walk_shadow_page_lockless_end(vcpu);

	return ret;