[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABQgh9E1rfA8i+x+6VRgyFb41n+n_F6-gqnT-TfqLqVeYaYmew@mail.gmail.com>
Date: Sat, 12 Oct 2024 11:12:09 +0800
From: Zhangfei Gao <zhangfei.gao@...aro.org>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: jgg@...dia.com, kevin.tian@...el.com, will@...nel.org, joro@...tes.org,
suravee.suthikulpanit@....com, robin.murphy@....com, dwmw2@...radead.org,
baolu.lu@...ux.intel.com, shuah@...nel.org, linux-kernel@...r.kernel.org,
iommu@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-kselftest@...r.kernel.org, eric.auger@...hat.com,
jean-philippe@...aro.org, mdf@...nel.org, mshavit@...gle.com,
shameerali.kolothum.thodi@...wei.com, smostafa@...gle.com, yi.l.liu@...el.com,
aik@....com, patches@...ts.linux.dev
Subject: Re: [PATCH v3 14/16] iommu/arm-smmu-v3: Add arm_vsmmu_cache_invalidate
On Thu, 10 Oct 2024 at 00:44, Nicolin Chen <nicolinc@...dia.com> wrote:
>
> Implement the vIOMMU's cache_invalidate op for user space to invalidate the
> IOTLB entries, Device ATS and CD entries that are still cached by hardware.
>
> Add struct iommu_viommu_arm_smmuv3_invalidate defining invalidation entries
> that are simply in the native format of a 128-bit TLBI command. Scan those
> commands against the permitted command list and fix their VMID/SID fields.
>
> Co-developed-by: Eric Auger <eric.auger@...hat.com>
> Signed-off-by: Eric Auger <eric.auger@...hat.com>
> Co-developed-by: Jason Gunthorpe <jgg@...dia.com>
> Signed-off-by: Jason Gunthorpe <jgg@...dia.com>
> Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 5 +
> include/uapi/linux/iommufd.h | 24 ++++
> .../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 131 +++++++++++++++++-
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 6 +-
> 4 files changed, 162 insertions(+), 4 deletions(-)
>
> +static int
> +arm_vsmmu_convert_user_cmd(struct arm_vsmmu *vsmmu,
> + struct iommu_viommu_arm_smmuv3_invalidate *cmd)
> +{
> + cmd->cmd[0] = le64_to_cpu(cmd->cmd[0]);
> + cmd->cmd[1] = le64_to_cpu(cmd->cmd[1]);
> +
> + switch (cmd->cmd[0] & CMDQ_0_OP) {
> + case CMDQ_OP_TLBI_NSNH_ALL:
> + /* Convert to NH_ALL */
> + cmd->cmd[0] = CMDQ_OP_TLBI_NH_ALL |
> + FIELD_PREP(CMDQ_TLBI_0_VMID, vsmmu->vmid);
> + cmd->cmd[1] = 0;
> + break;
> + case CMDQ_OP_TLBI_NH_VA:
> + case CMDQ_OP_TLBI_NH_VAA:
> + case CMDQ_OP_TLBI_NH_ALL:
> + case CMDQ_OP_TLBI_NH_ASID:
> + cmd->cmd[0] &= ~CMDQ_TLBI_0_VMID;
> + cmd->cmd[0] |= FIELD_PREP(CMDQ_TLBI_0_VMID, vsmmu->vmid);
> + break;
> + case CMDQ_OP_ATC_INV:
> + case CMDQ_OP_CFGI_CD:
> + case CMDQ_OP_CFGI_CD_ALL:
> + u32 sid, vsid = FIELD_GET(CMDQ_CFGI_0_SID, cmd->cmd[0]);
Here got build error
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c:302:3: error: a
label can only be part of a statement and a declaration is not a
statement
302 | u32 sid, vsid = FIELD_GET(CMDQ_CFGI_0_SID, cmd->cmd[0]);
| ^~~
Need {} to include.
case CMDQ_OP_CFGI_CD_ALL: {
...
}
Thanks
Powered by blists - more mailing lists