>>> On 06.04.17 at 08:01, <yi.y....@linux.intel.com> wrote: > On 17-04-05 09:23:50, Jan Beulich wrote: >> >>> On 01.04.17 at 15:53, <yi.y....@linux.intel.com> wrote: >> > @@ -397,6 +434,11 @@ void psr_ctxt_switch_to(struct domain *d) >> > if ( psr_cmt_enabled() ) >> > psr_assoc_rmid(®, d->arch.psr_rmid); >> > >> > + if ( psra->cos_mask ) >> > + psr_assoc_cos(®, d->arch.psr_cos_ids ? >> > + >> > d->arch.psr_cos_ids[cpu_to_socket(smp_processor_id())] : >> > + 0, psra->cos_mask); >> >> I may have asked this question before, but if so you can see that >> the code above continues puzzling me: Under what conditions >> would psra->cos_mask be non-zero, but d->arch.psr_cos_ids be >> NULL? And why is zero the right value in that case? >> > 'cos_mask' is initialized in 'psr_assoc_init' during cpu starting. The > 'psr_cos_ids' is allocated during domain init. Here is soft a protection > to handle abnormal case. Of course, we can use ASSERT to check it.
Obviously a domain failing initialization won't ever make it here, so an ASSERT() is the maximum I'd consider reasonable here. We should try to not go overboard with assertions - I appreciate useful ones, but there is a line beyond which they end up being clutter. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel