Unverified Commit ed398fe1 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13240 virtcca feature: support transfer smmu_vmid to tmm

Merge Pull Request from: @bob_1211 
 
virtcca feature: support transfer smmu_vmid to tmm 
 
Link:https://gitee.com/openeuler/kernel/pulls/13240

 

Reviewed-by: default avatarZhang Jianhua <chris.zjh@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents d69967a0 299534d0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,9 +67,9 @@ struct tmi_tec_params {
};

struct tmi_smmu_ste_params {
	uint64_t ns_src;     /* non-secure STE source address */
	uint64_t sid;        /* stream id */
	uint64_t smmu_id;    /* smmu id */
	uint16_t smmu_vmid;  /* smmu vmid */
};

struct tmi_smmu_cfg_params {
+1 −3
Original line number Diff line number Diff line
@@ -327,17 +327,15 @@ static int virtcca_secure_dev_ste_create(struct arm_smmu_device *smmu,
	struct arm_smmu_master *master, u32 sid)
{
	struct tmi_smmu_ste_params *params_ptr;
	struct arm_smmu_strtab_cfg *cfg = &smmu->strtab_cfg;
	struct arm_smmu_strtab_l1_desc *desc = &cfg->l1_desc[sid >> STRTAB_SPLIT];

	params_ptr = kzalloc(sizeof(*params_ptr), GFP_KERNEL);
	if (!params_ptr)
		return -ENOMEM;

	/* Sync Level 2 STE to TMM */
	params_ptr->ns_src = desc->l2ptr_dma + ((sid & ((1 << STRTAB_SPLIT) - 1)) * STE_ENTRY_SIZE);
	params_ptr->sid = sid;
	params_ptr->smmu_id = smmu->s_smmu_id;
	params_ptr->smmu_vmid = master->domain->s2_cfg.vmid;

	if (tmi_smmu_ste_create(__pa(params_ptr)) != 0) {
		kfree(params_ptr);
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ bool virtcca_pci_write_msg_msi(struct msi_desc *desc, struct msi_msg *msg)

	if (unmasked)
		pci_msix_write_vector_ctrl(desc, ctrl);
	tmi_mmio_read(mmio_va_to_pa((void *)pbase + PCI_MSIX_ENTRY_DATA),
	tmi_mmio_read(pbase + PCI_MSIX_ENTRY_DATA,
		CVM_RW_32_BIT, pci_dev_id(pdev));

	return true;