On 30.12.19 14:24, 'Nikhil Devshatwar' via Jailhouse wrote:
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.
Even worse, it would fail to issue those commands on the second and
following units, no? This should be reflected in the subject and commit
message as it seems to fix that case as well.
Fix this by issuing the sync command only if the iommu is SMMUV3 type.
Looks like this should come before patch 1 then.
Signed-off-by: Nikhil Devshatwar <[email protected]>
---
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)
Jan
--
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/206d0597-b45b-617a-019a-e80e06b18d2d%40web.de.