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

Re: [RFC 2/6] roles: provide abstraction for the possible domain roles


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 2 Aug 2023 09:51:46 +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=Bo1KwlTLRh23X2gWkgL4nTGICIXqpMUpvj9JprEOskg=; b=XXh2kJGWpegQPtfnVVoY2kLgzwHhAIxDc4iBOIZhT1KWzDhoxZXQEwHmRC8Ws4feVCBhH42dFxiZ+35ATPUZnXGYLEeemxcYpdunq0kghEdCKg+/d8+bKOcEqHm75oux+JpPu8RGKj0IojCUTzsDzvVZLEqr89nME2Q1DE2D5fMp/yYaR008FsHiPJ0wSmLryikNmRV9/SX9b20buasWi0suJxc8Y1IEop11LwDU14qOKtmeFasgGbsIryguKRrP0tZO/UomsbEktPg56KzjSGIqpbkfBIgvs2LWeCgMZnycHuoidhMRQjAV9YUIbASliUVMvZHU86oFQch6wLHFcA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O3+wVmf6SfmAmmR3fI0jrPiCZbuj0jdtvIkTNMMDjm8mUE52/8wQIeJhTk5bLuqXa1SSEkStE7K7mo+7G5KfHQWCLEETQAUCuYiUXWXtyym9iXqx/acGJAEOmmtDElXIpld9KjK/ue33vUyo00Hmk9WMcXTPxjRKLzrrouMNvI1P4NbLdu3GdxsE1QRoSICUYZygXcU3PzmX7JPfSVV+I4siTMIWiDgx0VjcEK94Mfwv+liJ7fFkIk7zRdFka+wW+Y2xVVmUemGJf6poFZKKFuxM23PGfS2AJxl/XBx9w+PCZpiSKwXc2NXS844nFws1o9r0aSzaMpHtUiUJmXFUbg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 02 Aug 2023 07:51:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 01.08.2023 22:20, Daniel P. Smith wrote:
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -340,6 +340,14 @@ static int late_hwdom_init(struct domain *d)
>      setup_io_bitmap(dom0);
>  #endif
>  
> +    /*
> +     * "dom0" may have been created under the unbounded role, demote it from
> +     * that role, reducing it to the control domain role and any other roles 
> it
> +     * may have been given.
> +     */
> +    dom0->role &= ~(ROLE_UNBOUNDED_DOMAIN & ROLE_HARDWARE_DOMAIN);

This doesn't look to remove anything, when taking into account ...

> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -467,8 +467,10 @@ struct domain
>  #endif
>      /* is node-affinity automatically computed? */
>      bool             auto_node_affinity;
> -    /* Is this guest fully privileged (aka dom0)? */
> -    bool             is_privileged;
> +#define ROLE_UNBOUNDED_DOMAIN  (1U<<0)
> +#define ROLE_CONTROL_DOMAIN    (1U<<1)
> +#define ROLE_HARDWARE_DOMAIN   (1U<<2)

... that each of the constants has just a single bit set. Seeing the
& there I was expecting something like

#define ROLE_UNBOUNDED_DOMAIN  (ROLE_CONTROL_DOMAIN | ROLE_HARDWARE_DOMAIN)

instead.

Jan



 


Rackspace

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