qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 6/6] intel_iommu: Block migration if cap is updated


From: Prasad Pandit
Subject: Re: [PATCH v1 6/6] intel_iommu: Block migration if cap is updated
Date: Mon, 4 Mar 2024 12:05:31 +0530

On Wed, 28 Feb 2024 at 15:17, Zhenzhong Duan <zhenzhong.duan@intel.com> wrote:
> When there is VFIO device and vIOMMU cap/ecap is updated based on host

* cap/ecap -> capability/extended capability registers are updated ...

> IOMMU cap/ecap, migration should be blocked.

* It'll help to mention why migration should be blocked in this case?

> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
>  hw/i386/intel_iommu.c | 16 ++++++++++++++--
> +static Error *vtd_mig_blocker;
> +
>  static int vtd_check_iommufd_hdev(IntelIOMMUState *s,
>                                    IOMMUFDDevice *idev,
>                                    Error **errp)
> @@ -3861,8 +3864,17 @@ static int vtd_check_iommufd_hdev(IntelIOMMUState *s,
>          tmp_cap |= VTD_CAP_MGAW(host_mgaw + 1);
>      }
>
> -    s->cap = tmp_cap;
> -    return 0;
> +    if (s->cap != tmp_cap) {
> +        if (vtd_mig_blocker == NULL) {
> +            error_setg(&vtd_mig_blocker,
> +                       "cap/ecap update from host IOMMU block migration");
> +            ret = migrate_add_blocker(&vtd_mig_blocker, errp);
> +        }
> +        if (!ret) {
> +            s->cap = tmp_cap;
> +        }
> +    }
> +    return ret;

* I couldn't find vtd_check_* function in the tree, but what happens
if vtd_mig_blocker != NULL? What will be 'ret' then?

Thank you.
---
  - Prasad




reply via email to

[Prev in Thread] Current Thread [Next in Thread]