[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: Tue, 8 Aug 2023 17:15:59 +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=rPLem2qXu3qEoFuK1xBkTuhqviQq9n7waaPtSwXl7MA=; b=EwdcnfCH5by8vN4kWcBsIRbk8mSUQhQ++Cv5bYRnXxg/eNpHvIjBEhiWyyRSvACA3wArNp+FWIu9RnAkDZQgmJ7RLgbCiccGSQ2XpA4o6OAX4ruRZlK+ULorERyCCF2zBbGF28oEhEZ6tKcgz1XwvVsUNQTRso+OwfFn8dIIAjMTiUGeBfOm43bNU+5rXS0BLK2+LCMWJpZQr5w2aasB4agZLvoJwMefXKKDsWUYmuFHY8+2pm+Vqv9fwmvvBxpeVRseMd2x0K6P7yTeueZtT9urukoFx5/WQXNTNAfgN3WPrW7FvOTJulgS/MIMFlnqDkTg4poQbxJLJ5paL9tQOw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SQBjC7vEu6+GuCAPhOicdNPM3044slf9Xl/DN5Rw1KSRodK/NKZygtsmOC2K4Zs0maJK4iI/Uf5oSTGlOqBwci0Z3tL13Q2BvtxkbHITKZrUuPL4Ya1351LRIQ88vw0XS4R4OnX7VPycEgkJtQdgSfvnYr4W4l9FPdDvt6f76qxFwQRDKsvBgA5vo9KdCA3j0bhZb1Az0bIL9600iOlMTHbG2t/kyJ+swILEv2EBwmwKTPoE9fUYb82WHgLXIaWgo417ZLbdQD0pmxrBZykxqnT4KaTQdobmeh2RK6UlO0LdJ3BpxlP+ULOW+t0lSIENE/0BPhhFtqrQaKZcsLfJww==
  • 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: Tue, 08 Aug 2023 15:16:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 01.08.2023 22:20, Daniel P. Smith wrote:
> @@ -1076,7 +1076,8 @@ static always_inline bool is_hardware_domain(const 
> struct domain *d)
>      if ( IS_ENABLED(CONFIG_PV_SHIM_EXCLUSIVE) )
>          return false;
>  
> -    return evaluate_nospec(d == hardware_domain);
> +    return evaluate_nospec(((d->role & ROLE_HARDWARE_DOMAIN) ||
> +        is_initial_domain(d)) && (d == hardware_domain));
>  }
>  
>  /* This check is for functionality specific to a control domain */
> @@ -1085,7 +1086,8 @@ static always_inline bool is_control_domain(const 
> struct domain *d)
>      if ( IS_ENABLED(CONFIG_PV_SHIM_EXCLUSIVE) )
>          return false;
>  
> -    return evaluate_nospec(d->is_privileged);
> +    return evaluate_nospec((d->role & ROLE_CONTROL_DOMAIN) ||
> +        is_initial_domain(d));
>  }

Why these complicated conditions, and not just the check of the single
relevant role bit? (Also note that indentation used here doesn't really
match our expectations, but there are other style issues in the patch
as well, which I assume is okay for an RFC.)

Jan



 


Rackspace

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