[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v10 06/25] x86: refactor psr: L3 CAT: implement Domain init/free and schedule flows.
>>> On 06.04.17 at 08:01, <yi.y.sun@xxxxxxxxxxxxxxx> wrote: > On 17-04-05 09:23:50, Jan Beulich wrote: >> >>> On 01.04.17 at 15:53, <yi.y.sun@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |