From: Nikhil Devshatwar <[email protected]> arm_smmuv3_cell_init and arm_smmuv3_cell_exit calls iterate over all iommu_units to process the ones with SMMUV3 type.
After the loop, it unconditionally issues commands with first element of smmu. This causes Unhandled HYP exception while enabling jailhouse. Also, it fails to issue commands on the subsequent SMMU units. Fix this by issuing the sync command only if the iommu is SMMUV3 type. Signed-off-by: Nikhil Devshatwar <[email protected]> --- Notes: Changes from v1: * Update commit description to describe failure to issue cmds on 2nd SMMU unit hypervisor/arch/arm64/smmu-v3.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hypervisor/arch/arm64/smmu-v3.c b/hypervisor/arch/arm64/smmu-v3.c index dd33bda2..3889d32b 100644 --- a/hypervisor/arch/arm64/smmu-v3.c +++ b/hypervisor/arch/arm64/smmu-v3.c @@ -1057,12 +1057,12 @@ static int arm_smmuv3_cell_init(struct cell *cell) if (ret) return ret; } - } - cmd.opcode = CMDQ_OP_TLBI_S12_VMALL; - cmd.tlbi.vmid = cell->config->id; - arm_smmu_cmdq_issue_cmd(smmu, &cmd); - arm_smmu_cmdq_issue_sync(smmu); + cmd.opcode = CMDQ_OP_TLBI_S12_VMALL; + cmd.tlbi.vmid = cell->config->id; + arm_smmu_cmdq_issue_cmd(&smmu[i], &cmd); + arm_smmu_cmdq_issue_sync(&smmu[i]); + } return 0; } @@ -1084,12 +1084,12 @@ static void arm_smmuv3_cell_exit(struct cell *cell) for_each_stream_id(sid, cell->config, j) { arm_smmu_uninit_ste(&smmu[i], sid, cell->config->id); } - } - cmd.opcode = CMDQ_OP_TLBI_S12_VMALL; - cmd.tlbi.vmid = cell->config->id; - arm_smmu_cmdq_issue_cmd(smmu, &cmd); - arm_smmu_cmdq_issue_sync(smmu); + cmd.opcode = CMDQ_OP_TLBI_S12_VMALL; + cmd.tlbi.vmid = cell->config->id; + arm_smmu_cmdq_issue_cmd(&smmu[i], &cmd); + arm_smmu_cmdq_issue_sync(&smmu[i]); + } } static int arm_smmuv3_init(void) -- 2.17.1 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/20200108111512.9844-2-nikhil.nd%40ti.com.
