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