Commit 4d9bd8a6 authored by jiaqingtong's avatar jiaqingtong Committed by Jia Qingtong
Browse files

iommu/io-pgtable-arm: Add __arm_lpae_set_pte

virt inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8UZSP


CVE: NA

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

Add __arm_lpae_set_pte perpare for realize dirty log

Signed-off-by: default avatarJia Qingtong <jiaqingtong@huawei.com>
parent af9c5ba6
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -242,15 +242,21 @@ static void __arm_lpae_sync_pte(arm_lpae_iopte *ptep, int num_entries,
				   sizeof(*ptep) * num_entries, DMA_TO_DEVICE);
}

static void __arm_lpae_clear_pte(arm_lpae_iopte *ptep, struct io_pgtable_cfg *cfg)
static void __arm_lpae_set_pte(arm_lpae_iopte *ptep, arm_lpae_iopte pte,
			       struct io_pgtable_cfg *cfg)
{

	*ptep = 0;
	*ptep = pte;

	if (!cfg->coherent_walk)
		__arm_lpae_sync_pte(ptep, 1, cfg);
}

static void __arm_lpae_clear_pte(arm_lpae_iopte *ptep, struct io_pgtable_cfg *cfg)
{

	__arm_lpae_set_pte(ptep, 0, cfg);
}

static size_t __arm_lpae_unmap(struct arm_lpae_io_pgtable *data,
			       struct iommu_iotlb_gather *gather,
			       unsigned long iova, size_t size, size_t pgcount,