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

Re: [PATCH v2 3/3] xen: Expose the PMU to the guests


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 7 Oct 2021 10:03:23 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; 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=PPvXMUt1yXPsruUB6mUTf5wWpPPb1iAQDcQabh6jiJ8=; b=oHKe6IIq1eVNWtqUELfkSlQzjLwy9GyHKCNdhZRY+bQ4GjX7s+sVCxvlRLUdhmCwQW1qE/d9xuDcxkPtv560dac/g3819CzYWLk1VUUh02/oz+xzKb80ABJ3xTtyY7QIyofFHVmSgt6x/cjTZE1gEnmmnmQGt04Zx2wfPdNas8YRb4Q/Jcl1xhBxC4AA1Z3PdiKRqq4T/5Z6eBrlIW1llTFEUIPTQSDF0bOT/jqTYB4LQzFcF0ycBBxxUkwQ4EYvbNkmHcuSDjanz2IBYa9frAnjhIs1qIanz9QxFOq6SFfhvtJH2uq9nyU0o15KMQKBbEf96CIL/WZfnGiMu5Y7xg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OFuJVeALfFFxIW4k3Jz0KiYgglgwwZ1x3ya8lcLINj9lVUACo4zeEeTOZLnqV6N+zXu1o+RieEqYdxWC+8wtHz1DXedGUdT43RM01ZF8lJjelBc5wnUfagv7ovLO+fniS5wQVr6umsWRvl1S/y1zIY7/FWbBunfLg0Y8l4x/YulNBDSTJDY/GmetJfbCmqB1EjZmkLlG34/rftTNEEsGZsMx3IEmY/ZlvD9NPuFzYDtTxHHnQgP3HskjJAR3ilyEDqprYdMlD/gbs6wLaxWvrnQAQa4v9sOTMz8XRh1fTiRwNTks/wLxMh1maTvxTnOQLe0RmnVgxrGz5qvach5cwg==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Nick Rosbrook <rosbrookn@xxxxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, bertrand.marquis@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 07 Oct 2021 08:03:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.10.2021 12:58, Michal Orzel wrote:
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -692,6 +692,12 @@ int arch_sanitise_domain_config(struct 
> xen_domctl_createdomain *config)
>          return -EINVAL;
>      }
>  
> +    if ( config->flags & XEN_DOMCTL_CDF_vpmu )
> +    {
> +        dprintk(XENLOG_INFO, "vpmu support not ready yet\n");
> +        return -EINVAL;
> +    }

I consider this message potentially misleading (as x86 does have vPMU
support, it merely doesn't get enabled this way). But isn't this redundant
with ...

> @@ -534,6 +535,12 @@ static int sanitise_domain_config(struct 
> xen_domctl_createdomain *config)
>          return -EINVAL;
>      }
>  
> +    if ( vpmu && !vpmu_is_available )
> +    {
> +        dprintk(XENLOG_INFO, "vpmu requested but not available\n");
> +        return -EINVAL;
> +    }

... this? (This message is again potentially misleading.)

> --- a/xen/include/public/domctl.h
> +++ b/xen/include/public/domctl.h
> @@ -70,9 +70,12 @@ struct xen_domctl_createdomain {
>  #define XEN_DOMCTL_CDF_iommu          (1U<<_XEN_DOMCTL_CDF_iommu)
>  #define _XEN_DOMCTL_CDF_nested_virt   6
>  #define XEN_DOMCTL_CDF_nested_virt    (1U << _XEN_DOMCTL_CDF_nested_virt)
> +/* Should we expose the vPMU to the guest? */
> +#define _XEN_DOMCTL_CDF_vpmu           7
> +#define XEN_DOMCTL_CDF_vpmu            (1U << _XEN_DOMCTL_CDF_vpmu)

Like for the earlier patch, I think we should stop with the bad habit of
defining both the bit position and the mask separately.

Jan




 


Rackspace

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