Subject: Re: [PATCH v2 6/9] iommu/arm-smmu-v3: Directly encode simple commands

From: Nicolin Chen <[email-masked]>
Date: Sun, 17 May 2026 20:15:25 -0700

On Wed, May 13, 2026 at 08:57:45PM -0300, Jason Gunthorpe wrote:
> Add make functions to build commands for
> 
>  CMDQ_OP_TLBI_EL2_ALL
>  CMDQ_OP_TLBI_NSNH_ALL
>  CMDQ_OP_CFGI_ALL
>  CMDQ_OP_PREFETCH_CFG
>  CMDQ_OP_CFGI_STE
>  CMDQ_OP_CFGI_CD
>  CMDQ_OP_RESUME
>  CMDQ_OP_PRI_RESP
> 
> Convert all of these call sites to use the make function instead of
> going through arm_smmu_cmdq_build_cmd(). Use a #define so the general
> pattern is always:
> 
>    arm_smmu_cmdq_issue_cmd(smmu, arm_smmu_make_cmd_XX(..));
> 
> Add arm_smmu_cmdq_batch_add_cmd() which takes struct arm_smmu_cmd
> directly to match the new flow.
> 
> Reviewed-by: Pranjal Shrivastava <[email-masked]>
> Reviewed-by: Mostafa Saleh <[email-masked]>
> Tested-by: Pranjal Shrivastava <[email-masked]>
> Tested-by: Mostafa Saleh <[email-masked]>
> Signed-off-by: Jason Gunthorpe <[email-masked]>
  
Reviewed-by: Nicolin Chen <[email-masked]>

> +static inline struct arm_smmu_cmd arm_smmu_make_cmd_cfgi_all(void)
> +{
> +	struct arm_smmu_cmd cmd = arm_smmu_make_cmd_op(CMDQ_OP_CFGI_ALL);
> +
> +	cmd.data[1] |= FIELD_PREP(CMDQ_CFGI_1_RANGE, 31);

Optional, might retain the note:
	/* Cover the entire SID range */