Commit 9ed8587a authored by Kunkun Jiang's avatar Kunkun Jiang Committed by Zheng Zengkai
Browse files

iommu/arm-smmu-v3: Change the TLBI CMD in arm_smmu_cache_invalidate()

virt inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I401IF


CVE: NA

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

According to the SMMUv3 spec, CMD_TLBI_NSNH_ALL invalidates all
Non-secure, non-NS-EL2, non-NS-EL2-E2H TLB entries at all
implemented stages. Obviously, it is inappropriate to use it here.
We replace it with CMD_TLBI_NH_ALL.

Signed-off-by: default avatarKunkun Jiang <jiangkunkun@huawei.com>
Reviewed-by: default avatarKeqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 21d56f9c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -289,6 +289,7 @@ static int arm_smmu_cmdq_build_cmd(u64 *cmd, struct arm_smmu_cmdq_ent *ent)
	case CMDQ_OP_TLBI_NH_ASID:
		cmd[0] |= FIELD_PREP(CMDQ_TLBI_0_ASID, ent->tlbi.asid);
		fallthrough;
	case CMDQ_OP_TLBI_NH_ALL:
	case CMDQ_OP_TLBI_S12_VMALL:
		cmd[0] |= FIELD_PREP(CMDQ_TLBI_0_VMID, ent->tlbi.vmid);
		break;
@@ -3547,7 +3548,7 @@ static int
arm_smmu_cache_invalidate(struct iommu_domain *domain, struct device *dev,
			  struct iommu_cache_invalidate_info *inv_info)
{
	struct arm_smmu_cmdq_ent cmd = {.opcode = CMDQ_OP_TLBI_NSNH_ALL};
	struct arm_smmu_cmdq_ent cmd = {.opcode = CMDQ_OP_TLBI_NH_ALL};
	struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
	struct arm_smmu_device *smmu = smmu_domain->smmu;

+1 −0
Original line number Diff line number Diff line
@@ -469,6 +469,7 @@ struct arm_smmu_cmdq_ent {
			};
		} cfgi;

		#define CMDQ_OP_TLBI_NH_ALL	0x10
		#define CMDQ_OP_TLBI_NH_ASID	0x11
		#define CMDQ_OP_TLBI_NH_VA	0x12
		#define CMDQ_OP_TLBI_EL2_ALL	0x20