[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Tue, 8 Aug 2023 18:21:29 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691533294; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=88j7gu/5pbiHC2iyQK4RrtMPtJazFeuz6Ak0rV88tXc=; b=m2WjCTUlCpe0wKwFNb1dHj+o/l1R+gSpfaU7PWZU0GVoxE/2pk4e1hpV+bXRAW/2fx5fHMIfMKwaOUi0o6KREiHG56vSXRlRQv4PKuMpcTKp7JAGr2FJxi/W/mXDDEBMpRYm4tpH752+c7yN/RzctsqxZmkZVGS8k0ECBKhWRgc=
  • Arc-seal: i=1; a=rsa-sha256; t=1691533294; cv=none; d=zohomail.com; s=zohoarc; b=S5UbPESoyGc4fJ9i3MzznzVVl8DXErgTlpt56beSU85PhS55JSwlsYOUH+AMkWx3ADoSoE9U9pi2pxYvTT4kty3a05N93HYqrSbhXcbqTvBFYSDX7tKcgI3qmp8xTkZOnp99BZ4jJy1R8Y2jGsH840LXglaCYh/O2gZyBEoWF9Q=
  • 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 22:21:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 8/8/23 11:15, Jan Beulich wrote:
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.)

They go away with suggestion to move ROLE_UNBOUNDED a concatenation of all the other roles.

Ack on the style.

v/r,
dps




 


Rackspace

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