On 08.02.2022 19:00, Oleksii Moisieiev wrote:
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -512,7 +512,7 @@ static int sanitise_domain_config(struct 
> xen_domctl_createdomain *config)
>  
>      if ( iommu )
>      {
> -        if ( config->iommu_opts & ~XEN_DOMCTL_IOMMU_no_sharept )
> +        if ( config->iommu_opts >> XEN_DOMCTL_IOMMU_MAX )
>          {
>              dprintk(XENLOG_INFO, "Unknown IOMMU options %#x\n",
>                      config->iommu_opts);

While in common code this is perhaps okay, the new bit wants rejecting
(or also implementing) for x86.

> @@ -534,6 +536,7 @@ int iommu_do_domctl(
>  {
>      int ret = -ENODEV;
>  
> +
>      if ( !is_iommu_enabled(d) )
>          return -EOPNOTSUPP;

Please don't.

> @@ -542,7 +545,7 @@ int iommu_do_domctl(
>  #endif
>  
>  #ifdef CONFIG_HAS_DEVICE_TREE
> -    if ( ret == -ENODEV )
> +    if ( ret == -ENOSYS )
>          ret = iommu_do_dt_domctl(domctl, d, u_domctl);
>  #endif

Why?

Jan


Reply via email to