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

Ping: [PATCH v3 2/2] x86/mm: tidy XENMEM_{get,set}_pod_target handling


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 27 Jan 2022 16:03:15 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tAsZ1INTzuG72sYTQK15mT+SFnZ9SnW+BPZRRBe+xys=; b=HeKMnRQpRYnPU3/qEFHF5UqM9er4I8SDgG80rti3Tc8PFD9/kOO72wo4Ti1QZVvgaBW7w7o9OEhgAzSEIgazh3Bpm2qQtgIxginnWos0CB1e+raOEQrtLvVRGbFrXcDBLSrRDZO0HtQpLvU/xAKiGX4gFwDpIevqGQptgNS42wfvnba+CxUO3ZhDPhyqjySCf9x1jrD+w8zCz3YgMuYbR2nZDqRPO6xnjosZZuNzvxFVRyjHWlYQFB1CElDlOvYTHwg1oTVM6xLrZyRecxsIZV7HUggkNx1RR3tuYcPnaDyC+RQc5Bf5c1dF/XtKqkkFjmUdHmsd5dHpvnhi32cT5A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H7erZQjzedGN+JaOrPrSkxKyekOrWP8Zz8X90u0Gn3+++Lit4q3v434GSXZ0uCp54NeR0Z4qECAEW7JaQz8PI2ZCcFPaKAc9+OZog5LPMlCY7jHrv9+umUtbYE+WZle2kmXzrKndmf+hqmGNUQy/Nl6ZkCix7pFbk2rUc+xJw9ArOmFbBHpZQ9rM/ynDq2NIdyX6erOSYnUZjbuGrBsQr02fx94kh52Mb8aJFqbKKVRdOA/RbO0BCkvLMIOyizw5/7MQscRfkb4k/+09aHoDsXsMkjofZeGbdx2mNG+7ljPjyRnK5gSzIc2zzbHRFcUMGZTXCxl9RenOQBsegnSQtA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 27 Jan 2022 15:03:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.01.2022 10:41, Jan Beulich wrote:
> Do away with the "pod_target_out_unlock" label. In particular by folding
> if()-s, the logic can be expressed with less code (and no goto-s) this
> way.
> 
> Limit scope of "p2m", constifying it at the same time.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Ping?

Jan

> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -4789,23 +4789,17 @@ long arch_memory_op(unsigned long cmd, X
>          if ( !is_hvm_domain(d) )
>              rc = -EINVAL;
>          else if ( cmd == XENMEM_set_pod_target )
> -            rc = xsm_set_pod_target(XSM_PRIV, d);
> -        else
> -            rc = xsm_get_pod_target(XSM_PRIV, d);
> -
> -        if ( rc != 0 )
> -            goto pod_target_out_unlock;
> -
> -        if ( cmd == XENMEM_set_pod_target )
>          {
> -            if ( target.target_pages > d->max_pages )
> -            {
> +            rc = xsm_set_pod_target(XSM_PRIV, d);
> +            if ( rc )
> +                ASSERT(rc < 0);
> +            else if ( target.target_pages > d->max_pages )
>                  rc = -EINVAL;
> -                goto pod_target_out_unlock;
> -            }
> -
> -            rc = p2m_pod_set_mem_target(d, target.target_pages);
> +            else
> +                rc = p2m_pod_set_mem_target(d, target.target_pages);
>          }
> +        else
> +            rc = xsm_get_pod_target(XSM_PRIV, d);
>  
>          if ( rc == -ERESTART )
>          {
> @@ -4817,13 +4811,9 @@ long arch_memory_op(unsigned long cmd, X
>              p2m_pod_get_mem_target(d, &target);
>  
>              if ( __copy_to_guest(arg, &target, 1) )
> -            {
> -                rc= -EFAULT;
> -                goto pod_target_out_unlock;
> -            }
> +                rc = -EFAULT;
>          }
>  
> -    pod_target_out_unlock:
>          rcu_unlock_domain(d);
>          return rc;
>      }
> 
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.