On 22.07.19 11:51, Lokesh Vutla wrote:
>>> +static int arm_smmu_init_strtab_2lvl(struct arm_smmu_device *smmu)
>>> +{
>>> +   struct arm_smmu_strtab_cfg *cfg = &smmu->strtab_cfg;
>>> +   u32 size, l1size;
>>> +   void *strtab;
>>> +   u64 reg;
>>> +   int ret;
>>> +
>>> +   /* Calculate the L1 size, capped to the SIDSIZE. */
>>> +   size = STRTAB_L1_SZ_SHIFT - 3;
>>> +   size = MIN(size, smmu->sid_bits - STRTAB_SPLIT);
>>> +   cfg->num_l1_ents = 1 << size;
>>> +
>>> +   size += STRTAB_SPLIT;
>>> +   if (size < smmu->sid_bits)
>>> +           printk("WARN: SMMU 2-level strtab only covers %u/%u bits of 
>>> SID\n",
>>> +                  size, smmu->sid_bits);
>>
>> What does that mean for the user? Or the guest?
> 
> This specfies that the driver does not support all the stream ids that 
> hardware
> specifies that are supported. Driver supports for 25 sid bits(with 128K L1
> entries and 256L2 entries). I don't think there would be any realistic use 
> case
> using a stream id with  >  25 bits.
> 

OK. Maybe worth clarify this in form of a comment.

[...]

>>> +
>>> +static int arm_smmuv3_cell_init(struct cell *cell)
>>> +{
>>> +   struct jailhouse_iommu *iommu;
>>> +   struct arm_smmu_cmdq_ent cmd;
>>> +   int ret, i, j, sid;
>>> +
>>> +   for (i = 0; i < JAILHOUSE_MAX_IOMMU_UNITS; i++) {
>>> +           iommu = &system_config->platform_info.arm.iommu_units[i];
>>> +           if (iommu->type != JAILHOUSE_IOMMU_SMMUV3)
>>> +                   continue;
>>> +
>>> +           for_each_stream_id(sid, cell->config, j) {
>>> +                   ret = arm_smmu_init_ste(&smmu[i], sid, 
>>> cell->config->id);
>>> +                   if (ret) {
>>> +                           printk("ERROR: SMMU INIT ste failed: sid = 
>>> %d\n",
>>> +                                  sid);
>>> +                           return ret;
>>
>> Do we need any rollback in case only one of many calls fails?
> 
> I don't think so, as that specific stream id will not be supported and rest 
> can
> work as is. Do you see other reason for roll back?

I didn't look into details, if arm_smmu_init_ste leaves anything rollback-worthy
behind, was just asking this question openly to make you check that again.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

-- 
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/2b98c35d-923b-3d81-b6a0-86f63e8b8377%40siemens.com.

Reply via email to