Commit e3c511da authored by Min Fanlei's avatar Min Fanlei Committed by guzitao
Browse files

sw64: kvm: remove unused argument 'addr' of apt_dissolve_pud/pmd()

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IB73UR



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

Signed-off-by: default avatarMin Fanlei <minfanlei@wxiat.com>
Reviewed-by: default avatarHe Sheng <hesheng@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent fa830439
Loading
Loading
Loading
Loading
+39 −15
Original line number Diff line number Diff line
@@ -70,21 +70,35 @@ enum {
 *
 * Function clears a PMD entry, flushes TLBs.
 */
static void apt_dissolve_pmd(struct kvm *kvm, phys_addr_t addr, pmd_t *pmd)
static void apt_dissolve_pmd(struct kvm *kvm, pmd_t *pmd)
{
	int i;

	if (!pmd_trans_huge(*pmd))
		return;

	if (pmd_cont(*pmd)) {
		for (i = 0; i < CONT_PMDS; i++, pmd++)
	pmd_clear(pmd);
	} else
	kvm_flush_remote_tlbs(kvm);
	put_page(virt_to_page(pmd));
}

/**
 * apt_dissolve_cont_pmd() - clear and flush huge cont PMD entry
 * @kvm:	pointer to kvm structure.
 * @addr:	IPA
 * @pmd:	pmd pointer for IPA
 *
 * Function clears a cont PMD entry, flushes TLBs.
 */
static void apt_dissolve_cont_pmd(struct kvm *kvm, pmd_t *pmd)
{
	int i;
	pmd_t *start_pmd;

	start_pmd = pmd;
	for (i = 0; i < CONT_PMDS; i++, pmd++)
		pmd_clear(pmd);

	kvm_flush_remote_tlbs(kvm);
	put_page(virt_to_page(pmd));
	put_page(virt_to_page(start_pmd));
}

/**
@@ -95,7 +109,7 @@ static void apt_dissolve_pmd(struct kvm *kvm, phys_addr_t addr, pmd_t *pmd)
 *
 * Function clears a PUD entry, flushes TLBs.
 */
static void apt_dissolve_pud(struct kvm *kvm, phys_addr_t addr, pud_t *pudp)
static void apt_dissolve_pud(struct kvm *kvm, pud_t *pudp)
{
	if (!pud_huge(*pudp))
		return;
@@ -804,7 +818,7 @@ static int apt_set_pte_fast(struct kvm_vcpu *vcpu,
	 * on to allocate page.
	 */
	if (logging_active)
		apt_dissolve_pud(kvm, addr, pud);
		apt_dissolve_pud(kvm, pud);

find_pud:
	if (pud_none(*pud)) {
@@ -828,8 +842,13 @@ static int apt_set_pte_fast(struct kvm_vcpu *vcpu,
	 * While dirty page logging - dissolve huge PMD, then continue on to
	 * allocate page.
	 */
	if (logging_active)
		apt_dissolve_pmd(kvm, addr, pmd);
	if (logging_active) {
		if (pmd_cont(*pmd))
			apt_dissolve_cont_pmd(kvm,
					pmd_offset(pud, addr & CONT_PMD_MASK));
		else
			apt_dissolve_pmd(kvm, pmd);
	}

find_pmd:
	/* Create stage-2 page mappings - Level 2 */
@@ -893,7 +912,7 @@ static int apt_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
	 * on to allocate page.
	 */
	if (logging_active)
		apt_dissolve_pud(kvm, addr, pud);
		apt_dissolve_pud(kvm, pud);

	if (pud_none(*pud)) {
		if (!cache)
@@ -916,8 +935,13 @@ static int apt_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
	 * While dirty page logging - dissolve huge PMD, then continue on to
	 * allocate page.
	 */
	if (logging_active)
		apt_dissolve_pmd(kvm, addr, pmd);
	if (logging_active) {
		if (pmd_cont(*pmd))
			apt_dissolve_cont_pmd(kvm,
					pmd_offset(pud, addr & CONT_PMD_MASK));
		else
			apt_dissolve_pmd(kvm, pmd);
	}

	/* Create stage-2 page mappings - Level 2 */
	if (pmd_none(*pmd)) {